Changing sound chip with ALSA

I have a laptop with Intel audio card that `lspci` reports as               00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)      It is responsible for both Analog Audio (speakers, 3.5 mm jack) and HDMI sound (since my laptop has HDMI output) as reported by `aplay --list-devices`                   **** List of PLAYBACK Hardware Devices ****         card 0: PCH [HDA Intel PCH], device 0: ALC269VB Analog [ALC269VB Analog]           Subdevices: 1/1           Subdevice #0: subdevice #0         card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]           Subdevices: 1/1           Subdevice #0: subdevice #0      Obviously the audio card is configured and drivers are loaded. Media players, however, don't produce any sound. `pavucontrol` shows that there is output from the player - under playback tab, the slider which acts as a visual feedback is "bouncing". But under "Output devices" tab, the very same slider doesn't react at all. Under Configuration tab "Profile" is set to "Analog Stereo Duplex", which it should be. If I change the profile to "Digital Stereo (HDMI) Output" the aferomentioned slider suddenly begins to bounce. It is now obvious to me that either ALSA or PulseAdio (I don't know which is to be blamed) recognize the HDMI chip as the default one. `alsamixer` gives me option to change sound card, but not it's chip.![alsamixer interface](http://i.stack.imgur.com/T2omG.png) `pactl list` output               Module #0         Name: module-device-restore         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Automatically restore the volume/mute state of devices"             module.version = "5.0"          Module #1         Name: module-stream-restore         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Automatically restore the volume/mute/device state of streams"             module.version = "5.0"          Module #2         Name: module-card-restore         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Automatically restore profile of cards"             module.version = "5.0"          Module #3         Name: module-augment-properties         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Augment the property sets of streams with additional static information"             module.version = "5.0"          Module #4         Name: module-switch-on-port-available         Argument:          Usage counter: n/a         Properties:               Module #5         Name: module-udev-detect         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Detect available audio hardware and load matching drivers"             module.version = "5.0"          Module #6         Name: module-alsa-card         Argument: device_id="0" name="pci-0000_00_1b.0" card_name="alsa_card.pci-0000_00_1b.0" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1"         Usage counter: 0         Properties:             module.author = "Lennart Poettering"             module.description = "ALSA Card"             module.version = "5.0"          Module #7         Name: module-jackdbus-detect         Argument: channels=2         Usage counter: n/a         Properties:             module.author = "David Henningsson"             module.description = "Adds JACK sink/source ports when JACK is started"             module.version = "5.0"          Module #8         Name: module-bluetooth-policy         Argument:          Usage counter: n/a         Properties:             module.author = "Frédéric Dalleau"             module.description = "When a bluetooth sink or source is added, load module-loopback"             module.version = "5.0"          Module #9         Name: module-bluetooth-discover         Argument:          Usage counter: n/a         Properties:             module.author = "João Paulo Rechi Vita"             module.description = "Detect available Bluetooth daemon and load the corresponding discovery module"             module.version = "5.0"          Module #10         Name: module-bluez5-discover         Argument:          Usage counter: n/a         Properties:             module.author = "João Paulo Rechi Vita"             module.description = "Detect available BlueZ 5 Bluetooth audio devices and load BlueZ 5 Bluetooth audio drivers"             module.version = "5.0"          Module #11         Name: module-esound-protocol-unix         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "ESOUND protocol (UNIX sockets)"             module.version = "5.0"          Module #12         Name: module-native-protocol-unix         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Native protocol (UNIX sockets)"             module.version = "5.0"          Module #13         Name: module-gconf         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "GConf Adapter"             module.version = "5.0"          Module #14         Name: module-default-device-restore         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Automatically restore the default sink and source"             module.version = "5.0"          Module #15         Name: module-rescue-streams         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "When a sink/source is removed, try to move its streams to the default sink/source"             module.version = "5.0"          Module #16         Name: module-always-sink         Argument:          Usage counter: n/a         Properties:             module.author = "Colin Guthrie"             module.description = "Always keeps at least one sink loaded even if it's a null one"             module.version = "5.0"          Module #17         Name: module-intended-roles         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Automatically set device of streams based on intended roles of devices"             module.version = "5.0"          Module #18         Name: module-suspend-on-idle         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "When a sink/source is idle for too long, suspend it"             module.version = "5.0"          Module #19         Name: module-console-kit         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Create a client for each ConsoleKit session of this user"             module.version = "5.0"          Module #20         Name: module-systemd-login         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Create a client for each login session of this user"             module.version = "5.0"          Module #21         Name: module-position-event-sounds         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Position event sounds between L and R depending on the position on screen of the widget triggering them."             module.version = "5.0"          Module #22         Name: module-role-cork         Argument:          Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "Mute & cork streams with certain roles while others exist"             module.version = "5.0"          Module #23         Name: module-filter-heuristics         Argument:          Usage counter: n/a         Properties:             module.author = "Colin Guthrie"             module.description = "Detect when various filters are desirable"             module.version = "5.0"          Module #24         Name: module-filter-apply         Argument:          Usage counter: n/a         Properties:             module.author = "Colin Guthrie"             module.description = "Load filter sinks automatically when needed"             module.version = "5.0"          Module #25         Name: module-x11-publish         Argument: display=:0.0         Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "X11 credential publisher"             module.version = "5.0"          Module #26         Name: module-x11-xsmp         Argument: display=:0.0 session_manager=local/localhost:@/tmp/.ICE-unix/281,unix/localhost:/tmp/.ICE-unix/281         Usage counter: n/a         Properties:             module.author = "Lennart Poettering"             module.description = "X11 session management"             module.version = "5.0"          Sink #0         State: SUSPENDED         Name: alsa_output.pci-0000_00_1b.0.analog-stereo         Description: Built-in Audio Analog Stereo         Driver: module-alsa-card.c         Sample Specification: s16le 2ch 44100Hz         Channel Map: front-left,front-right         Owner Module: 6         Mute: no         Volume: front-left: 49145 /  75% / -7.50 dB,   front-right: 49145 /  75% / -7.50 dB                 balance 0.00         Base Volume: 65536 / 100% / 0.00 dB         Monitor Source: alsa_output.pci-0000_00_1b.0.analog-stereo.monitor         Latency: 0 usec, configured 0 usec         Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY          Properties:             alsa.resolution_bits = "16"             device.api = "alsa"             device.class = "sound"             alsa.class = "generic"             alsa.subclass = "generic-mix"             alsa.name = "ALC269VB Analog"             alsa.id = "ALC269VB Analog"             alsa.subdevice = "0"             alsa.subdevice_name = "subdevice #0"             alsa.device = "0"             alsa.card = "0"             alsa.card_name = "HDA Intel PCH"             alsa.long_card_name = "HDA Intel PCH at 0xd1b00000 irq 49"             alsa.driver_name = "snd_hda_intel"             device.bus_path = "pci-0000:00:1b.0"             sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"             device.bus = "pci"             device.vendor.id = "8086"             device.vendor.name = "Intel Corporation"             device.product.id = "1c20"             device.product.name = "6 Series/C200 Series Chipset Family High Definition Audio Controller"             device.form_factor = "internal"             device.string = "front:0"             device.buffering.buffer_size = "352800"             device.buffering.fragment_size = "176400"             device.access_mode = "mmap+timer"             device.profile.name = "analog-stereo"             device.profile.description = "Analog Stereo"             device.description = "Built-in Audio Analog Stereo"             alsa.mixer_name = "Intel CougarPoint HDMI"             alsa.components = "HDA:10ec0269,10250504,00100100 HDA:80862805,80860101,00100000"             module-udev-detect.discovered = "1"             device.icon_name = "audio-card-pci"         Ports:             analog-output: Analog Output (priority: 9900)             analog-output-speaker: Speakers (priority: 10000)             analog-output-headphones: Headphones (priority: 9000, not available)         Active Port: analog-output         Formats:             pcm          Source #0         State: SUSPENDED         Name: alsa_output.pci-0000_00_1b.0.analog-stereo.monitor         Description: Monitor of Built-in Audio Analog Stereo         Driver: module-alsa-card.c         Sample Specification: s16le 2ch 44100Hz         Channel Map: front-left,front-right         Owner Module: 6         Mute: no         Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB                 balance 0.00         Base Volume: 65536 / 100% / 0.00 dB         Monitor of Sink: alsa_output.pci-0000_00_1b.0.analog-stereo         Latency: 0 usec, configured 0 usec         Flags: DECIBEL_VOLUME LATENCY          Properties:             device.description = "Monitor of Built-in Audio Analog Stereo"             device.class = "monitor"             alsa.card = "0"             alsa.card_name = "HDA Intel PCH"             alsa.long_card_name = "HDA Intel PCH at 0xd1b00000 irq 49"             alsa.driver_name = "snd_hda_intel"             device.bus_path = "pci-0000:00:1b.0"             sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"             device.bus = "pci"             device.vendor.id = "8086"             device.vendor.name = "Intel Corporation"             device.product.id = "1c20"             device.product.name = "6 Series/C200 Series Chipset Family High Definition Audio Controller"             device.form_factor = "internal"             device.string = "0"             module-udev-detect.discovered = "1"             device.icon_name = "audio-card-pci"         Formats:             pcm          Source #1         State: SUSPENDED         Name: alsa_input.pci-0000_00_1b.0.analog-stereo         Description: Built-in Audio Analog Stereo         Driver: module-alsa-card.c         Sample Specification: s16le 2ch 44100Hz         Channel Map: front-left,front-right         Owner Module: 6         Mute: no         Volume: front-left: 8251 /  13% / -54.00 dB,   front-right: 8251 /  13% / -54.00 dB                 balance 0.00         Base Volume: 5206 /   8% / -66.00 dB         Monitor of Sink: n/a         Latency: 0 usec, configured 0 usec         Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY          Properties:             alsa.resolution_bits = "16"             device.api = "alsa"             device.class = "sound"             alsa.class = "generic"             alsa.subclass = "generic-mix"             alsa.name = "ALC269VB Analog"             alsa.id = "ALC269VB Analog"             alsa.subdevice = "0"             alsa.subdevice_name = "subdevice #0"             alsa.device = "0"             alsa.card = "0"             alsa.card_name = "HDA Intel PCH"             alsa.long_card_name = "HDA Intel PCH at 0xd1b00000 irq 49"             alsa.driver_name = "snd_hda_intel"             device.bus_path = "pci-0000:00:1b.0"             sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"             device.bus = "pci"             device.vendor.id = "8086"             device.vendor.name = "Intel Corporation"             device.product.id = "1c20"             device.product.name = "6 Series/C200 Series Chipset Family High Definition Audio Controller"             device.form_factor = "internal"             device.string = "front:0"             device.buffering.buffer_size = "352800"             device.buffering.fragment_size = "176400"             device.access_mode = "mmap+timer"             device.profile.name = "analog-stereo"             device.profile.description = "Analog Stereo"             device.description = "Built-in Audio Analog Stereo"             alsa.mixer_name = "Intel CougarPoint HDMI"             alsa.components = "HDA:10ec0269,10250504,00100100 HDA:80862805,80860101,00100000"             module-udev-detect.discovered = "1"             device.icon_name = "audio-card-pci"         Ports:             analog-input-internal-mic: Internal Microphone (priority: 8900)             analog-input-mic: Microphone (priority: 8700, not available)         Active Port: analog-input-internal-mic         Formats:             pcm          Client #0         Driver: module-systemd-login.c         Owner Module: 20         Properties:             application.name = "Login Session c1"             systemd-login.session = "c1"          Client #3         Driver: module-x11-xsmp.c         Owner Module: 26         Properties:             application.name = "XSMP Session on xfce4-session as 2c7bf982c-3f0a-4235-93e5-780d27ff15f0"             xsmp.vendor = "xfce4-session"             xsmp.client.id = "2c7bf982c-3f0a-4235-93e5-780d27ff15f0"          Client #10         Driver: protocol-native.c         Owner Module: 12         Properties:             application.name = "pactl"             native-protocol.peer = "UNIX socket client"             native-protocol.version = "29"             application.process.id = "1707"             application.process.user = "tichomir"             application.process.host = "localhost"             application.process.binary = "pactl"             application.language = "C"             window.x11.display = ":0.0"             application.process.machine_id = "98bf0358e390486598b6233568214778"             application.process.session_id = "c1"          Card #0         Name: alsa_card.pci-0000_00_1b.0         Driver: module-alsa-card.c         Owner Module: 6         Properties:             alsa.card = "0"             alsa.card_name = "HDA Intel PCH"             alsa.long_card_name = "HDA Intel PCH at 0xd1b00000 irq 49"             alsa.driver_name = "snd_hda_intel"             device.bus_path = "pci-0000:00:1b.0"             sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"             device.bus = "pci"             device.vendor.id = "8086"             device.vendor.name = "Intel Corporation"             device.product.id = "1c20"             device.product.name = "6 Series/C200 Series Chipset Family High Definition Audio Controller"             device.form_factor = "internal"             device.string = "0"             device.description = "Built-in Audio"             module-udev-detect.discovered = "1"             device.icon_name = "audio-card-pci"         Profiles:             input:analog-stereo: Analog Stereo Input (sinks: 0, sources: 1, priority: 60, available: yes)             output:analog-stereo: Analog Stereo Output (sinks: 1, sources: 0, priority: 6000, available: yes)             output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (sinks: 1, sources: 1, priority: 6060, available: yes)             output:hdmi-stereo: Digital Stereo (HDMI) Output (sinks: 1, sources: 0, priority: 5400, available: yes)             output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 5460, available: yes)             output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (sinks: 1, sources: 0, priority: 300, available: yes)             output:hdmi-surround+input:analog-stereo: Digital Surround 5.1 (HDMI) Output + Analog Stereo Input (sinks: 1, sources: 1, priority: 360, available: yes)             off: Off (sinks: 0, sources: 0, priority: 0, available: yes)         Active Profile: output:analog-stereo+input:analog-stereo         Ports:             analog-input-internal-mic: Internal Microphone (priority: 8900, latency offset: 0 usec)                 Properties:                     device.icon_name = "audio-input-microphone"                 Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround+input:analog-stereo             analog-input-mic: Microphone (priority: 8700, latency offset: 0 usec, not available)                 Properties:                     device.icon_name = "audio-input-microphone"                 Part of profile(s): input:analog-stereo, output:analog-stereo+input:analog-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround+input:analog-stereo             analog-output: Analog Output (priority: 9900, latency offset: 0 usec)                 Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo             analog-output-speaker: Speakers (priority: 10000, latency offset: 0 usec)                 Properties:                     device.icon_name = "audio-speakers"                 Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo             analog-output-headphones: Headphones (priority: 9000, latency offset: 0 usec, not available)                 Properties:                     device.icon_name = "audio-headphones"                 Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo             hdmi-output-0: HDMI / DisplayPort (priority: 5900, latency offset: 0 usec, not available)                 Properties:                     device.icon_name = "video-display"                 Part of profile(s): output:hdmi-stereo, output:hdmi-stereo+input:analog-stereo, output:hdmi-surround, output:hdmi-surround+input:analog-stereo


noexec on /tmp and /var/tmp directory

Our client servers are running old version of jboss (Jboss 4.0) which has lots of known vulnerabilities. Result is that the server is hacked and we are seeing some unknown executables running from `/tmp`, `/var/tmp` and `/dev/shm` directories. The server is being used as a zombie machine from which other machines are targeted. We modified jboss configuration to remove the flaw with Nessus confirming that the vulnerability is no more there. Apart from that, I executed the following               Mounted /tmp with noexec option     Mounted /dev/shm with noexec,nosuid option       I had no issue in executing the above two steps as `/tmp` is on a separate partition for me. I am facing issues with `/var/tmp` location as I cannot use noexec on `/var` partition. So, planning to mount `/var/tmp` on the same partition that I am using for `/tmp` location. I hoped that will help resolve the issue for me but after executing the changes I noticed that files and dirs in `/tmp` are also available in `/var/tmp`.               # ls -l /var/tmp/     total 32     drwx------ 2 ssdg  ssdg   4096 Dec 17 12:10 gconfd-ssdg     drwxr-xr-x 3 root  root   4096 Feb 21  2013 hp_sum     drwxr-xr-x 2 jboss jboss  4096 Dec 18 11:56 hsperfdata_jboss     drwx------ 2 root  root  16384 May 18  2011 lost+found     srwxr-xr-x 1 root  root      0 Aug 29  2011 mapping-root          # ls -l /tmp/     total 32     drwx------ 2 ssdg  ssdg   4096 Dec 17 12:10 gconfd-ssdg     drwxr-xr-x 3 root  root   4096 Feb 21  2013 hp_sum     drwxr-xr-x 2 jboss jboss  4096 Dec 18 11:56 hsperfdata_jboss     drwx------ 2 root  root  16384 May 18  2011 lost+found     srwxr-xr-x 1 root  root      0 Aug 29  2011 mapping-root      So , proably the idea of using the same partition for `/tmp` and `/var/tmp` is not going to work. Need suggestions how can I implement noexec for `/var/tmp` directory.


Why does my squid cache never get any hits?

I have set up a squid cache on a portable 3G/wifi router I've built. The proxy works, but I only ever see TCP_MISS, with a very rare TCP_MEM_HIT I've never tried this before, and this is the config file I came up with:               acl manager proto cache_object     acl localhost src 127.0.0.1/32 ::1     acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1     acl localnet src 192.168.99.0/24         acl SSL_ports port 443     acl Safe_ports port 80           acl Safe_ports port 21           acl Safe_ports port 443          acl Safe_ports port 70           acl Safe_ports port 210          acl Safe_ports port 1025-65535       acl Safe_ports port 280          acl Safe_ports port 488          acl Safe_ports port 591          acl Safe_ports port 777          acl CONNECT method CONNECT     http_access allow manager     http_access deny !Safe_ports     http_access deny CONNECT !SSL_ports     http_access allow localnet     http_access allow localhost     http_access deny all     http_port 3128     cache_dir aufs /var/spool/squid3 8192 16 256     maximum_object_size 512 MB     coredump_dir /var/spool/squid3     refresh_pattern ^ftp:       1440    20% 10080     refresh_pattern ^gopher:    1440    0%  1440     refresh_pattern -i (/cgi-bin/|\?) 0 0%  0     refresh_pattern .       0   20% 4320     cache_mgr *******@*****.com      Even the files coming from the 3G stick's built in http pages don't cache. Have I made any mistakes in config file?   Is there any special way to set up /var/spool/squid3? I just used sudo mkdir /var/spool/squid3 and it created all the bits inside. Here's the output from cache.log:               2013/09/04 19:13:47| Starting Squid Cache version 3.1.20 for arm-unknown-linux-gnueabihf...     2013/09/04 19:13:47| Process ID 2606     2013/09/04 19:13:47| With 65535 file descriptors available     2013/09/04 19:13:47| Initializing IP Cache...     2013/09/04 19:13:47| DNS Socket created at 0.0.0.0, FD 7     2013/09/04 19:13:47| Adding nameserver 127.0.0.1 from /etc/resolv.conf     2013/09/04 19:13:47| Adding nameserver 192.168.1.1 from /etc/resolv.conf     2013/09/04 19:13:47| Adding nameserver 192.168.1.1 from /etc/resolv.conf     2013/09/04 19:13:47| Unlinkd pipe opened on FD 12     2013/09/04 19:13:47| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec     2013/09/04 19:13:47| Store logging disabled     2013/09/04 19:13:47| Swap maxSize 8388608 + 262144 KB, estimated 665442 objects     2013/09/04 19:13:47| Target number of buckets: 33272     2013/09/04 19:13:47| Using 65536 Store buckets     2013/09/04 19:13:47| Max Mem  size: 262144 KB     2013/09/04 19:13:47| Max Swap size: 8388608 KB     2013/09/04 19:13:47| Version 1 of swap file with LFS support detected...      2013/09/04 19:13:47| Rebuilding storage in /var/spool/squid3 (CLEAN)     2013/09/04 19:13:47| Using Least Load store dir selection     2013/09/04 19:13:47| Set Current Directory to /var/spool/squid3     2013/09/04 19:13:48| Loaded Icons.     2013/09/04 19:13:48| Accepting  HTTP connections at 0.0.0.0:3128, FD 15.     2013/09/04 19:13:48| HTCP Disabled.     2013/09/04 19:13:48| Squid plugin modules loaded: 0     2013/09/04 19:13:48| Adaptation support is off.     2013/09/04 19:13:48| Ready to serve requests.     2013/09/04 19:13:48| Done reading /var/spool/squid3 swaplog (1664 entries)     2013/09/04 19:13:48| Finished rebuilding storage from disk.     2013/09/04 19:13:48|      1664 Entries scanned     2013/09/04 19:13:48|         0 Invalid entries.     2013/09/04 19:13:48|         0 With invalid flags.     2013/09/04 19:13:48|      1664 Objects loaded.     2013/09/04 19:13:48|         0 Objects expired.     2013/09/04 19:13:48|         0 Objects cancelled.     2013/09/04 19:13:48|         0 Duplicate URLs purged.     2013/09/04 19:13:48|         0 Swapfile clashes avoided.     2013/09/04 19:13:48|   Took 0.85 seconds (1953.12 objects/sec).     2013/09/04 19:13:48| Beginning Validation Procedure     2013/09/04 19:13:48|   Completed Validation Procedure     2013/09/04 19:13:48|   Validated 3353 Entries     2013/09/04 19:13:48|   store_swap_size = 19920     2013/09/04 19:13:49| storeLateRelease: released 0 objects     2013/09/04 19:50:17| Preparing for shutdown after 90 requests     2013/09/04 19:50:17| Waiting 30 seconds for active connections to finish     2013/09/04 19:50:17| FD 15 Closing HTTP connection     2013/09/04 19:50:48| Shutting down...     2013/09/04 19:50:48| basic/auth_basic.cc(97) done: Basic authentication Shutdown.     2013/09/04 19:50:48| Closing unlinkd pipe on FD 12     2013/09/04 19:50:48| storeDirWriteCleanLogs: Starting...     2013/09/04 19:50:48|   Finished.  Wrote 1693 entries.     2013/09/04 19:50:48|   Took 0.02 seconds (102861.66 entries/sec).     CPU Usage: 3.420 seconds = 1.690 user + 1.730 sys     Maximum Resident Size: 56784 KB     Page faults with physical i/o: 404     Memory usage for squid via mallinfo():         total space in arena:    4212 KB         Ordinary blocks:         3197 KB     96 blks         Small blocks:               0 KB      1 blks         Holding blocks:         27936 KB     10 blks         Free Small blocks:          0 KB         Free Ordinary blocks:    1014 KB         Total in use:           31133 KB 739%         Total free:              1014 KB 24%     2013/09/04 19:50:48| Open FD READ/WRITE    7 DNS Socket IPv4     2013/09/04 19:50:48| Squid Cache (Version 3.1.20): Exiting normally.      Here's a pair of lines from access.log               pi@junior ~ $ sudo cat /var/log/squid3/access.log | grep 32px-Portal-puzzle     1378324277.327    203 192.168.99.74 TCP_MISS/304 263 GET http://upload.wikimedia.org/wikipedia/en/thumb/f/fd/Portal-puzzle.svg/32px-Portal-puzzle.svg.png - DIRECT/91.198.174.234 text/html     1378324296.260     68 192.168.99.74 TCP_MISS/304 263 GET http://upload.wikimedia.org/wikipedia/en/thumb/f/fd/Portal-puzzle.svg/32px-Portal-puzzle.svg.png - DIRECT/91.198.174.234 text/html      Two different machines, same file, two misses Two more lines, these are weird:               pi@junior ~ $ sudo cat /var/log/squid3/access.log | grep 16px-Portal-puzzle     1378324276.132    130 192.168.99.74 TCP_MISS/304 263 GET http://1.2.3.9/bmi/upload.wikimedia.org/wikipedia/en/thumb/f/fd/Portal-puzzle.svg/16px-Portal-puzzle.svg.png - DIRECT/1.2.3.9 text/html     1378324320.926    290 192.168.99.254 TCP_MISS/200 1373 GET http://1.2.3.9/bmi/upload.wikimedia.org/wikipedia/en/thumb/f/fd/Portal-puzzle.svg/16px-Portal-puzzle.svg.png - DIRECT/1.2.3.9 image/png      What is 1.2.3.9? how can upload.wikimedia.org be in the middle of that url? Is that some sort of other cache maintained by T-Mobile in between us and the rest of the 'net?


Why am I not able to login directly using SSH

Suppose, the server address is **abcd.com**. On my local machine at my workplace, I have to login to that server, using               ssh <my employeeid>@abcd.com      Then, to login to user **myname** , I have to use               su - myname      This way I login, but why can't I directly login to that server using               ssh myname@abcd.com


NFS different uig/gid on hosts

Scenario: There are different mappings of UIDs and GIDs between hosts that would like to have NFS share. Is there workaround without changing number mapping on hosts ? **Example:** Is there a way to "hardcode" mapping of username/groupname <-> uid/gid. (for example on client side to map local uid 3333 top remote uid 2222 and local gid 999 to remote gid 888 ? ) I know about trick with mapping everyone to "nobody" or making `chown uog+rw -R ...`. I am interested in solution where user UX in group GX creates files and directories as GX and UX and other GY, UY creates as GY UY... maybe some idmapd might be helpful ? If there is no other option, how to securely change number UID and GID on all those hosts to make them consistent ?


in bash, read after a pipe is not setting values

Edit : original title was "read fails in bash" With ksh I'm using read as a convenient way to separate values:                 $ echo 1 2 3 4 5 | read a b dump       $ echo $b $a        2 1       $      But it fails in bash :                 $ echo 1 2 3 4 5 | read a b dump       $ echo $b $a             $      I didn't find a reason in the man page why it fails, any idea ?


Installing Ubuntu/Debian on 16 GB SD Card

Is it possible to install Ubuntu/Debian on my 16 GB SD Card ? Do I just during installation process chose my SD Card partition and install it (that doesn't work if we have USB) or do I need to install persistance ISO on my SD Card ? The last question how it's with the speed of such demon as this ? I will use that SD Card in laptop slot where I can insert it so I think it should be faster than using USB Adapter.


Unable to connect to wifi on Linux Mint

I installed Linux Mint and am trying to connect to wifi, but this does not work. On the system tray it shows the “connecting” icon for a while, then the “not connected” icon. How can I investigate what's going wrong and make the wifi work? Model is Intel(R) WiFi Link 1000BGN on a Dell Inspiron 14r laptop. `dmesg` says:               wlan0: authenticate with 20:4e:7f:13:e1:58 (try 1)     [  152.358450] wlan0: authenticated     [  152.371768] wlan0: associate with 20:4e:7f:13:e1:58 (try 1)     [  152.377936] wlan0: RX AssocResp from 20:4e:7f:13:e1:58 (capab=0x411 status=0 aid=1)     [  152.377939] wlan0: associated     [  152.385284] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready     [  153.041670] wlan0: deauthenticating from 20:4e:7f:13:e1:58 by local choice (reason=3)


How do I prevent GNOME suspending while I finish a compilation job

I am trying to build a custom kernel for my machine which is taking a long time to build (as expected). Is it possible to stop my GNOME desktop from suspending the machine until the compilation has completed and then have it suspend (assuming I'm away from the machine for the 30 minutes it would normally take). I don't want to permanently disable suspend (which is easy to do via the system settings control panel but wastes power) but rather be able to specify (via PID?) my compile job and have the computer suspend when it finishes.


router latency measured by tcpdump increases

I am using tcpdump to measure latency on a linux router, i.e. the delay experienced by packets as they pass through the router (made of Ubuntu 10). For this purpose, I captured packets in the IN and Out interfaces and subtracted their log timestamp to know the latency inside the router. I was expecting some sort of flat latency; but, in constrast, the latency increased linearly with time. I used iperf to send about 800,000 packets (of size 1500Byte) through the router (having two Gibabit links). The surprising point is that although the latency on the router was increasing from about 20 microseconds to 7 milliseconds, the average throughput measured every second was almost flat. Would you please let me know why the latency has increased? There might be some problem in properly recording the time of capturing OUT interface packets. Thank you in advance.


Why does the read command not take interactive options when run by sh?

I want to download a provisioning script that reads some configuration parameters via `read`, and execute it:               curl http://example.com/provisioning.sh | sh      The problem is, that the `read` command in the script is call with the `-i` parameter to provide a default:               read -p "Name: " -i joe name     echo $name      If I download the script, set the `+x` permission and run it, everything's fine. If I run it with `cat provisioning.sh | sh` or `sh provisioning.sh`, it fails with:               read: Illegal option -i      Why wouldn't read support providing a default if it's run via sh? But whatever, I'll remove the `-i`, being left with               read -p "Name: " name     echo $name      Now if I run the script via `cat provisioning.sh | sh`, it won't do anything. Why is that? Ubuntu 14.04.


fastest way of doing a tar.gz from a tree of directories?

I've got a tree of directories with files like this:               .     |-- 00     |   |-- 00     |   |   |-- 00     |   |   |-- 01     |   |   |-- 02     |   |   |-- 03     |   |   |-- 04     |   |   |-- 05     [..]     |   |   |-- 97     |   |   |-- 98     |   |   `-- 99     |   |-- 01     |   |   |-- 00     |   |   |-- 01     [...]      There is about 200 files at the end of each directory, so a lot of files. What would be the fastest way of making a tar.gz of the whole thing? Can I parallelize the task for many CPUs?


Mislocated bootloader is needed removed

I used to have Windows XP on my computers smaller partition but it seems the bootloader is located on the bigger one. After replacing my OS with Linux Mint, I kept being asked as to choose whether XP or Mint. I tried deleting `boot.ini`, didn't work. I cannot afford to delete all my backup files. How can I get rid of the Windows bootloader? Especially manually.


sed to search for multiple words and remove those lines

I have a master file with more than 50000 lines and my requirement is to remove around 20000 lines from actual file, for this I used `grep -vE` command which is showing an error as too many arguments. I'm using `sed` command to remove those using for loop. But it is taking so much time to remove as 20000 `sed` commands are going to initialize. I need help in doing it as fast as possible.               for i in `cat 20000-words.txt`; do          sed -i -e "/$i/ d" 50000-lines.txt     done


GRUB on MBR of Windows-only internal drive, with distros on external drive

I think what I want to do is long and convoluted; then again, it might be somewhat easy, and I'm just overthinking it. Here's the setup I want to achieve:   * The internal drive (sda) is one giant WinXP partition (sda2), a tiny one for a boot partition (sda1), and the MBR.   * On an external drive (sdb), I will create multiple partitions for several distros. This drive will be either an HDD in an enclosure or something like a WD passport. This will be attached via USB 2.0. I know it is possible to install grub to the MBR of `sda` and boot an `sdb` partition from there. I also know I'll need to edit grub to chainload Windows and list all the distros. However, I have the following questions:   1. If I disconnect sdb and want to select + boot into Windows, is grub going to get upset? In other words, does the grub menu just display what you tell it to, or does it go hunting for those other options immediately and will have problems because some have disappeared?    2. If I disconnect sdb, I'd love for it to still be bootable on another computer. If I have a boot partition on sdb as well as sda, but have my BIOS set to use the internal MBR first, can this be achieved?    3. What if I want to use something pretty like burg or plymouth? How will this change things? I'm sure the answers are out there somewhere, but I'm finding it hard to Google for!


IPtables reset on reboot, how do I tell what is causing this

Using RHEL, and I have had some "Cyber Security" people work on my server. I'm now using this server in a completely closed environment with no outward network connection, and would like my iptables set to completely off. I have used these commands:               chkconfig iptables off     service iptables save     service iptables stop          chkconfig ip6tables off     service ip6tables save     service ip6tables stop      **The Issue** Every time I restart the server the iptables are back on their incredibly restrictive settings. Am I not doing something correctly, or do they have a script that could be running and resetting the iptables settings. If there is a script, how could I figure out where this is coming from to disable it.


Find files that have words in common

What would be the best way to create a list of files that have common words with a given file. For example, if I had:               $ ls       mainFile  file1  file2  file file4     $ cat mainFile       exquisite malicious sentient pulsating       perspicacious one       tawdry fumigate Baryshnikov O'connor      and I wanted to list any of the files in the `cwd` that contained any one of the words in `mainFile`. What would be the best way to go about this? Since the number of words per line in `mainFile` is not constant, I was finding solutions using `cut` a little tricky. I was trying to create a string out of the words and then place them separated by `|` in a `grep -l "exquisite|malicious|etc" *` command. I'm open to any method though that might be better.


How can I configure postfix smtp per user?

I have previously used msmtp as my MDA. msmtp has a configuration file with username and password of the outgoing smtp server (eg gmail) stored in my home directory. I've recently changed distributions to CentOS 6.3 for reasons of support (only supported distribution for third party software). I tried to install msmtp but it wasn't available in any of the repositories. I finally got an rpm from fedora and installed that but it still doesn't work (can't find ca-certificates). So I decided I'd try with Postfix as it's the default on RHEL. What I'm trying to do is set up sendmail (git and mutt) to send mail via my gmail account. I can't find where to set this up using Postfix. Everything I read suggests editing /etc/postfix/main.cf. But I don't want every user of my computer to be able to send email via _my_ gmail account. So my question is: how can I configure postfix per user (or can this not be done)? update: I've got msmtp working now (had to edit the config due to distribution changing), but I'm still curious if this can be done (easily) in postfix


How do I get started with linux?

I am a programmer but have only used Windows as the development environment till now. I work on Java. I wanted to start developing on Linux and would like to know where to start. More specifically:   * Which Linux to install on my machine?   * What are the basic requirements that I would need to know before I insert the Linux CD in my PC?   * Which packages do I need to install so that I don't have to wait for it to install while first access? I mean like JDK/ MP3 Player/ Open Office/ GCC, etc


Is there a way to execute the second-to-last command that started with a given string?

In a project with different makefiles:               $ make -f foo1.make     ... ...     $ testing testing     ... ...     $ !ma     make -f foo1.make       Good! But then if I by accident do:               $ make -f foo1.make     ... ...     $ testing testing     ... ...     $ make     make: *** No targets specified and no makefile found.  Stop.      And now I am sad:               $ !!ma     makema     No command 'makema' found, did you mean:       ... ...      Now I have to pick through all my testing commands with the up arrow like an animal. Unacceptable*! Is there any way to re-run that full `make -f foo1.make` command using `!` or some variant thereof? *: I will not even dignify the suggestion that I just retype the entire command with a response!


simplest way to get an ubuntu virtual machine w/ ssh server on my network

I have an OSX box and I'd like to just get a fresh install of Ubuntu to use remotely over SSH. That's all. But I'd like to get that on the same box without in anyway altering my existing OSX environment (i.e. I want to just run an Ubuntu VM or Docker). What's the simplest (fewest steps) way for me to do this?


Are unix[-like] programs capable of determing where their output is going?

Up until recently I was under the impression that Unix-y programs were unaware of where their output went, be it to standard out, redirected to a file, or into a pipe. However, an unrelated U&L question on this site brought to my attention the following example:               % echo "hello world" > file          % grep --color=auto lo file     hello world          % grep --color=auto lo file | cat     hello world      Obviously you can't see it here, but the first command shows 'lo' highlighted, as expected. However, the second call, which goes through a pipe, shows no colour. This suggests that `grep` was aware of its output being directed to a pipe and avoided outputting colour. How is this done?


How do I change the font size when using lp on Linux?

I used to send files in Unix to a printer with `lp`, and used `-ofp16.16` or `-ofp12` to change the size of the fonts. This does not work on Linux; what should I use instead?


Exploring RAM contents

I am using a redis Database and would like to explore the contents of the RAM the application is using. I feel the explanation of why I want to do this will make more sense then the question I would ask. Redis is a simple key value store that stores binary data. I think it would be a good place to explore things like encoding and it would be interesting to me to do things like skimming over the RAM looking for binary sets of data, doing things like looking for simple patterns; maybe explore the idea of writing a baby query language that searched in RAM. I had gotten this idea after reading the chapter in SICP about query languages. Any thoughts on where to start? Initially, I want to ask "Give me the address space this application is running in, please" to the system.


proc/sys/vm/flush_mmap_pages missing in 3.9 kernel, how to get it?

There was an option in redHat 5.2 called `flush_mmap_pages`, I could set this to zero and that would turn of writing dirty pages from a mapped memory file (so I can do it myself when I want to). However it is missing in newer kernels, I am using fedora 17 on Linux 3.9 kernel ATM and it is not there. Is there anyway to apply a kernel patch to get it back, does anybody know the last kernel version to support this kernel parameter?


chowning each home user to itself recursively

Okay so I have about 100 directories in my home folder each owned by the home user itself. Sometimes I have to manually replace some files as root so the permissions are disturbed and some files are no longer owned by that user. To fix this, I always have to use the following command within the home directory:               chown -R user:user user/      Now I'm looking at some shortcut because I can't do this for all the 100 users out there. I'm wondering what would be done by:               chown -R *:* *


SVN repository - user premissions issue

I have created the repository long time ago when I was the only user. Now I need to add another user, so I created a usergroup where I added the both users and did the following:               chmod -R user1:usergroup svnrepo/*     chown -R 0770 svnrepo/*      Now we all have the ability to update and commit but the problem is that when one of us commits, it aparently changes the owner of `svnrepo/db/current` (to the user who committed) and the other person loses access to the repo, until I manually set the proper owner again. Do you have an idea how to fix that? It is extremely annoying...


Replace $ with £ using sed command

I have text file `DollarToPound.txt` with some Dollar signs (`$`). Please provide a shell script to replace dollar symbol with Pound (`£`) with sed command. I am getting:               batch@BATCH:[~/output]$ ./del.sh     sed: command garbled: s/\$/£/g      Content of DollarToPound.txt:               $$$$$$$$$$$      Contents of del.sh:               #!/bin/sh      #!/bin/expect     #!/bin/bash          sed 's/[$]/£/g' DollarToPound.txt     #sed 's/\$/£/g' DollarToPound.txt      Executing command `:LC_ALL=C sed -n l < del.sh`               batch@BATCH:[~/output]$ LC_ALL=C sed -n l < del.sh     #!/bin/sh     #!/bin/expect     #!/bin/bash               sed 's/[$]/\243/g' Dollar.txt               #sed 's/\$/\243/g' Dollar.svd > Dollar.txt     #sed 's/\\243/\$/g' Dollar.svd >     #sed 's/\$/\243/g' Dollar.txt      Operating system used: Solaris 10


How to specify where files are transferred to using ssh

I know how I can send files to a specific directory on a remote server using ssh, but I don't know how to specify it.


How to find information about the RAM using the Terminal?

> **Possible Duplicate:**   >  Can I identify my RAM without shutting down linux? I need to know it to check the compatibility... **I wanna know the type/size/model, etc.** Can someone help? Thanks.


Reccommendations for a wireless print server supported on Linux?

I have found it difficult to research a **wireless print server** which will be supported on Linux. I use Debian 6 and Ubuntu 10.04 (also Windows 7 64 bit, Vista, and MACOS Snow Leopard). Everyone in my household using uses a different OS, so it is all the more difficult to ensure interoperability across so many OSs. Where can I find a definitive, authoritative and complete list of supported print servers? Also, I want to keep things simple as possible. This is an important criterion for my choice of wireless print server. GUI mediated setup/install is much preferred over complex configuration files and command line. I know of CUPs, but I don't know if CUPs will regulate the wireless print server and what's involved. The print server is to enable sharing of Brother HL-4050CDN printer. Edit: I'm seriously considering the Belkin F5L049au. But the customer support people tell me it does not support Linux. But this is true of the majority of the print server market... Anybody, help? Edit2: Must support N network standard, the printer above, be wireless, and be Linux compatible.


Comparing files in unix columnwise

I want to compare two files with same number of rows and columns with records in same order. Just want to highlight the differences in the column values if any. `file A`:               1,kolkata,19,ab          2,delhi,89,cd          3,bangalore,56,ef      `file B`:               1,kolkata,21,ab          2,mumbai,89,gh          3,bangalore,11,kl      Considering column `1` as primary key, we have differences in other columns. I want to highlight those differences. Output format may be (not sure):               record_number,  columns_with_diff     1               3          2               2,4          3               3,4      Can `diff` or `comm` solve my problem? If yes then what would be the exact command?


How to specify -? option with GNU getopt

When parsing command line arguments with GNU `getopt` command, how do I (if possible) do recognize `-?` as another option? Is there a way to escape it in the opstring?


browsers don't work(chrome err 137:name resolution failed), but everything is ok in gnome terminal

My system is debian 6.0. Both debian default brower and chrome don't work. The error is `name resolution failed(code:137)`. I can ping and update software in gnome terminal. Yesterday I installed pptp-linux, and pptp did work, I also could surf internet by chrome. Today I can't surf internet by browsers. after I remove pptp-linux, it still exist. Have you encountered it?


Best way to remove bytes from the start of a file?

Today I had to remove the first 1131 bytes from an 800MB mixed text / binary file, a filtered subversion dump I'm hacking for a new repository. What's the best way to do this? To start with I tried               dd bs=1 skip=1131 if=filtered.dump of=trimmed.dump      but after the skip this copies the remainder of the file a byte at a time, i.e. very slowly. In the end I worked out I needed 405 bytes to round this up to three blocks of 512 which I could skip               dd if=/dev/zero of=405zeros bs=1 count=405     cat 405zeros filtered.dump | dd bs=512 skip=3 of=trimmed.dump      which completed fairly quickly but there must have been a simpler / better way? Is there another tool I've forgotten about? Thanks!


A page documenting usage of various package managers

I'm looking for a reasonably up-to-date and comprehensive web page that documents differences in how to use different package managers.


FVWM 's Windows buttons (Maximize Minimize ...), Themes

I'm using the F Virtual Window Manager (FVWM). I'm wondering how to customize the window appearance (the theme) to   1. Add a minimize, maximize, and close button, so I have four buttons, arranged like this: > >      --------------------------------------- >     |=         (Window Titlebar)       N M X| >     |---------------------------------------| >     |                                       | >     |                                       | >     |                                       | >     |                                       | >      --------------------------------------- > > = is an `-` button; when clicked on it shows a menu containing `move` > `resize` `raise` `lower` `(De)Iconify` `Delete` `Close` `Destroy` `Identify`   >  N is minimize   >  M is maximize   >  X is close   2. How could I set the height of the window title bar?  > >       Answer: The height is govern by the `(Window Titlebar)` **Font size**.   >               Or; >               TitleStyle Centered Height 24  #for example >


The zip format's external file attribute

This is a slightly exotic question, but there doesn't seem to be much information on the net about this. I just added an answer to a question about the zip format's external file attribute. As you can see from my answer, I conclude that only the second byte (of 4 bytes) is actually used for Unix. Apparently this contains enough information when unzipping to deduce whether the object is a file or a directory, and also has space for other permission and attribute information. My question is, how does this map to the usual Unix permissions? Do the usual Unix permissions (e.g. below) that `ls` gives fit into exactly one byte, and if so, can someone describe the layout or give a reference, please?               $ ls -la     total 36     drwxr-xr-x   3 faheem faheem  4096 Jun 10 01:11 .     drwxrwxrwt 136 root   root   28672 Jun 10 01:07 ..     -rw-r--r--   1 faheem faheem     0 Jun 10 01:07 a     drwxr-xr-x   2 faheem faheem  4096 Jun 10 01:07 b     lrwxrwxrwx   1 faheem faheem     1 Jun 10 01:11 c -> b      Let me make this more concrete by asking a specific question. Per the Trac patch quoted in my answer above, you can create a zip file with the snippet of Python below. The `040755 << 16L` value corresponds to the creation of an empty directory with the permissions `drwxr-xr-x`. (I tested it). I recognize `0755` corresponds to the `rwxr-xr-x` pattern, but what about the `04`, and how does the whole value correspond to a byte? I also recognize `<< 16L` corresponds to a bitwise left shift of 16 places, which would make it end up as the second from top byte.               def makezip1():         import zipfile         z = zipfile.ZipFile("foo.zip", mode = 'w')         zfi = zipfile.ZipInfo("foo/empty/")         zfi.external_attr = 040755 << 16L # permissions drwxr-xr-x         z.writestr(zfi, "")         print z.namelist()         z.close()      EDIT: On rereading this, I think that my conclusion that the Unix permissions only correspond to one byte may be incorrect, but I'll let the above stand for the present, since I'm not sure what the correct answer is. EDIT2: I was indeed incorrect about the Unix values only corresponding to 1 byte. As @Random832 explained, it uses both of the top two bytes. Per @Random832's answer, we can construct the desired `040755` value from the tables he gives below. Namely:               __S_IFDIR + S_IRUSR + S_IWUSR + S_IXUSR + S_IRGRP + S_IXGRP + S_IROTH + S_IXOTH     0040000   + 0400    + 0200    + 0100    + 0040    + 0010    + 0004    + 0001     = 40755       The addition here is in base 8.


need assistanse with dhcpd.conf understanding

How can i interpret following:               class "blade-1-01-1" {                 match if substring (option dhcp-client-identifier, 9, 1) = 01 and                          substring (option dhcp-client-identifier, 5, 1) = 01 and                          substring (option dhcp-client-identifier, 6, 1) = 00;             }      BR


How can I add an x509 certificates bundle (ca-bundle.crt) to NSS database (~./pki/nssdb)

I'm currently using RedHat Enterprise 6. Git had issues cloning Github repos using HTTPS. After some investigation (e.g. enabling GIT_CURL_VERBOSE and GIT_TRACE) the problem was narrowed to a certificate validation issue, which was solved updating the certificate DB, i.e.:               curl http://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/certs/ca-bundle.crt      Things worked fine for a while. However, after a system upgrade now I'm getting a different error:               Couldn't find host github.com in the .netrc file; using defaults     * About to connect() to github.com port 443 (#0)     *   Trying 192.30.252.128... * Connected to github.com (192.30.252.128) port 443 (#0)     * Initializing NSS with certpath: sql:/etc/pki/nssdb     * NSS error -5978     * Expire cleared      Unfortunately I can't find that error code description on the documentation. It seems that the updated CURL system lib defaults to NSS and relies exclusively on the certificates on /etc/pki/nssdb I've been trying to solve this issue trying different commands to add the certificates to NSS, but failed. **Can you recommend a solution? Is it possible to force Git and/or CURL to use the ca-bundle DB, or even disable certificate validation?** _Any solution that could allow Git commands to be run using Github's repos wil be welcome._ **Notes:** _Curl version_ curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2


Why does the Skype incoming call window disappear in Awesome WM?

Skype used to work OK on Awesome WM for some months, but recently incoming call windows do not show up at all. I've checked all the tabs and tried to minimise all the other windows, and there is no status bar entry, so it looks like it's not floated behind any of them. Removing the Awesome WM configuration file and restarting doesn't work.


How can I Allocate More Space to a Filesystem Mounted on /?

I am new to Linux so please forgive the incorrect use of vocabulary. My company has a private cloud that provisions VM's in a KVM. I received a RHEL 6.4. When I provisioned it, I asked for 50GB of additional storage. Here is the results of `df -h`: ![enter image description here](http://i.stack.imgur.com/4Qeap.png) The filesystem /dev/mapper/VolGroup-lv_root mounted on `/` is full. After consulting my companies FAQ, I found one called "Where is my extra storage that I ordered with my VM?" and was directed to a PDF that showed me how to create a new filesystem mounted on a new directory called `/data`. I was unable to determine how to simply extend the fileysystem mounted on `/`. I did that on a different VM as a test. On the VM which I wish to extend the filesystem mounted on `/`, here are the results of `fdisk -l`: ![enter image description here](http://i.stack.imgur.com/C9OD4.png) Here are the results for `pvdisplay`: ![enter image description here](http://i.stack.imgur.com/jGMOH.png) On a test VM I issued the following commands as specified by my companies FAQ:               pvcreate /dev/vdb     vgcreate DATAVG /dev/sdb     lvcreate -L 10G -n lvdata1 DATAVG     mkfs -t ext4 /dev/DATAVG/lvdata1     tune2fs -c0 -i0 /dev/DATAAVG/lvdata1      I appended the following to `/etc/fstab`               /dev/DATAVG/lvdata1    /data    ext4    defaults    1 2      and then mounted `/data`:               mount /data      After this, a `df -h` results in: ![enter image description here](http://i.stack.imgur.com/TPnz7.png) This shows that I can successfully add storage, but I wish to add the storage to the filesystem mounted on `/` instead.


How to measure an operation's duration in terminal, not in code

For example, I need to do "make " for some software. I want to measurement how long this is going take. Is there easy and accurate way to do so?


How do I install LXDE and the X Window System on Debian Squeeze

I recently did a netinstall of Debian Squeeze and during the install I unticked Desktop Environment because I didn't want to install Gnome as the default DE. So I end up with a command line during boot. Now I want to install LXDE and I was wondering which to install: xorg or xserver-xorg (or both) before installing LXDE? And yes, I realized later that I could have chosen LXDE as an alternative DE during install but I don't want to reinstall again.


Manually copying MBR from one drive to the other GPT drive and configuring GRUB results in booting failure

I run _CentOS 6.4_. I have **SSD** 300GB for system files and **RAID10 8TB** for storage + _backup_. **SSD system drive is partitioned as follows:** `fdisk -l /dev/sdb`               Disk /dev/sdb: 300.1 GB, 300069052416 bytes     255 heads, 63 sectors/track, 36481 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0xc95ec64f             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1   *           1          66      524288   83  Linux       (/boot)     /dev/sdb2              66        8421    67108864   83  Linux       (/)     /dev/sdb3            8421       12598    33554432   83  Linux       (/usr)     /dev/sdb4           12598       36482   191847576    5  Extended     /dev/sdb5           12598       16775    33554432   83  Linux       (/var)     /dev/sdb6           16775       18864    16777216   83  Linux       (/tmp)     /dev/sdb7           18864       35574   134217728   82  Linux swap / Solaris      **RAID10 8TB _(GPT)_ is partitioned as follows:** `parted /dev/sda print`               Model: ASR7805 RAID 10 (scsi)     Disk /dev/sda: 7999GB     Sector size (logical/physical): 512B/512B     Partition Table: gpt          Number  Start   End     Size    File system     Name     Flags      1      8389kB  7399GB  7399GB                  primary             (LUKS)      2      7399GB  7400GB  510MB   ext4            primary  boot       (/boot)      3      7400GB  7468GB  68.7GB  ext4            /                   (/)      4      7468GB  7503GB  34.4GB  ext4            /usr                (/usr)      5      7503GB  7537GB  34.4GB  ext4            /var                (/var)      6      7537GB  7554GB  17.2GB  ext3            /tmp                (/tmp)      7      7554GB  7692GB  137GB   linux-swap(v1)  primary             (swap)      8      7692GB  7992GB  300GB                   primary             (LUKS)         All I wanted is just to use _300GB_ of space on my _/dev/sda (RAID10)_ for creating an identical image (backup) of my _SSD_ in case of sudden failure. As you could see above, I have partitioned my _RAID10_ is just absolutely identical way as my current system _SSD_. Afterwards, I have created exact images of each partition that I have on my current _SSD_ and extracted them to my _RAID10_ using `dump/restore` commands. All is fully copied and set on my _RAID10_ just the same way as on my current _SSD_. I have obviously edited my backed up `fstab` (on _RAID10 /etc/fstab_ ) using proper UUID for mounting on load. **BUT** Whatever I do I cannot properly load the system, as I restart and choose to load from _RAID10_. The system just doesn't boot (underscore is continually blinking)!? I have tried to copy first `446` bite of boot sector `(dd if=/tmp/mbrsdb.bak of=/dev/sda bs=446 count=1)` from my _SSD's MBR_ to my _RAID10's MBR_ but it didn't work? Now, as I'm all out of any other options, I would like to ask for your help?


Console font - how to show accents?

Arch linux on VirtualBox. My problem is the console (not X) does not show accents like "á ã ç". The problem is showing, not typing. I have a text file with these accents and when I use "cat" the don't show correctly. I _was_ able to make it work with "setfont cp850-8x16", however, I do want to use Terminus (or some other font) and in any case, I want to understand why other fonts that should be capable of showing these characters (supposedly, Lat2-Terminus16 should handle them, but does not work) don't do that. I already spent some hours on research and testing, and tried a bunch of setfont/loadunimap, and none helped except the one mentioned above. My guess is I have to do something about UNICODE before using the other fonts, but I do not know what. It's surprising the low amount of resources on how to make stuff like this work. The end result is that I should be able to type accents (pt_BR) with a beautiful font on the Console (text-mode).


GRUB can't find an existing file?

I'm trying to install GRUB, but when I try to boot, I get this:               error: file '/boot/grub/i386-pc/normal.mod' not found.      But that file exists on the drive I'm booting to. Why is it saying "not found" if the file is very clearly there? I'm using BIOS, and installing everything to sdb1. Here's my GRUB output:               GRUB loading.     Welcome to GRUB!          error: file '/boot/grub/i386-pc/normal.mod' not found.     Entering rescue mode...     grub rescue> ls     (hd0) (hd0,msdos1) (hd1) (hd1,msdos3) (hd1,msdos2) (hd1,msdos1) (hd2) (hd2,msdo     s1)     grub rescue> set     prefix=(hd0,msdos1)/boot/grub     root=hd0,msdos1     grub rescue> ls (hd0,msdos1)/     ./ ../ lost+found/ var/ dev/ run/ etc/ tmp/ sys/ proc/ usr/ boot/ home/ lib lib     64 mnt/ opt/ root/ srv/ sbin/ bin/


cmake question on RedHat Linux 64

I am new with building software using cmake. I want to install VTK using cmake. I downloaded the .tar file and un-tared it. This leaves me with a directory that contains some cmake files and some other stuff. Suppose I have un-tared all files in the directory `/HOME/USER/SETUP_FILES/` and created a directory `/HOME/USER/SETUP_FILES/BUILD` When I cd into `/HOME/USER/SETUP_FILES/BUILD` and execute `cmake ../.` I am able to configure the build. In the configuration file, I can choose to define `CMAKE_INSTALL_PREFIX` My first question is: 1) What should I enter there? When I enter for example `/HOME/USER/VTK_PROGRAM` this folder is created (after `make` and `make install`) that contains a `bin/` folder (along with some other folders). However, in the `/HOME/USER/SETUP_FILES/BUILD` there is also a `bin/` folder created. My second question is: 2) I now have three folders with files. Which one(s) should I keep in order to have a working program: a) `/HOME/USER/SETUP_FILES` b) `/HOME/USER/SETUP_FILES/BUILD` c) `/HOME/USER/VTK_PROGRAM` Is it possible to merge the b) and c) folders?


No /proc in a Busybox-based embedded Linux distribution

I am making an embedded Linux distribution and my board is a Raspberry Pi. My kernel version is 3.2.27 without initramfs and my root file system as follows:               /lib                          /* contains kernel modules */     /bin /sbin /usr/bin /usr/sbin /* contains busybox utils binaries */     /usr/lib                      /* contains cross-compiler tool chain libs */     linuxrc                       /* generated by busybox, kept in / */     /dev                          /* I have created console and ttyAM0 manually but added mode devices by udev */     /etc/init.d/rcS               /* required by busybox init */      after kernel booted I am getting a console (I don't know whether it is busybox console or not). I have few problems below   * No process information available (no files/folder created under `/proc`).   * When I am using `ps -e` it shows nothing. Why this unexpected behavior happens?


Why is GNU screen / byobu leaving garbage text in the shell during a reverse search?

I recently starting using GNU screen via Byobu but I think the problem is related to screen. I first SSH into a server and then do a reverse search to run a commonly run command (dump a the database). I've redacted some of the text, but because usually outputs `(reverse-i-search)`':` before the search, it pushed the line across the width of the terminal. ![screenshot1](http://i.stack.imgur.com/Ggjj6.png) If I am happy with the search and accept the command, the rightmost text stays put. See below: ![screenshot2](http://i.stack.imgur.com/lCMus.png) So, why is this "garbage text" staying in the window? It only happens in screen and only seems to happen for certain hosts that use my custom .bashrc formatting and don't have their own.


What's the right way to execute a script before system shutdown (systemd)?

I wrote a script that suspends all my VirtualBox machines, and put a line in `/etc/rc.local.shutdown`, but it doesn't seem to work, `su - XX -c /XX` When I'm booting the next time, VirtualBox tells me the machine was `Aborted`, so the script wasn't executed. (Launching that script manually works for me) P.S I already enabled `shutdown.target` **EDIT** The problem seems more complicated than I thought, in my `.bashrc`, if it's running on `tty3`, it executes `startx`, so when systemd decide to shutdown/reboot, it whould kill `VBoxSVC` process and other stuff when X Session dies. I also tried to hack the source code of `xfsm-shutdown-helper`, make a fake `systemctl` that execute my script first, none of the above works.


Where is the setting that disallows duplicate command history?

Let's say I type the following sequence of commands:               $ cd     $ ls     $ ls      When I go back in history by pressing `up` twice, I end up with `cd`, instead of `ls`. I've noticed this isn't always the case, so it likely is some bash setting somewhere. Which is it?


How do I port-forward 169.254.169.254-bound packets from libvirt/KVM guests to localhost?

This is a followup to What's the best way to have a 169.254.169.254 address local to my laptop?. Short story: 169.254.169.254 is the "well known" address of cloud metadata services for EC2 and for OpenStack, and I want to emulate it on my laptop for devel work. Having given up on the `lo:0` approach, I decided to just set up NAT/port forwarding. My guests are configured by libvirt, using a default libvirt network which NATs through my wireless nic, which libvirt has configured like so:               Chain POSTROUTING (policy ACCEPT)     target     prot opt source               destination              MASQUERADE  tcp  --  192.168.77.0/24     !192.168.77.0/24      masq ports: 1024-65535     MASQUERADE  udp  --  192.168.77.0/24     !192.168.77.0/24      masq ports: 1024-65535     MASQUERADE  all  --  192.168.77.0/24     !192.168.77.0/24          This rule:               sudo iptables -t nat -I OUTPUT -p tcp -d 169.254.169.254 --dport 80 -j DNAT --to-destination 127.0.0.1:80      does a lovely job of forwarding from Firefox running on the laptop (host OS) itself. But from within the guest, I get `No route to host`. Clearly I need something else to make this work. What? * * * As requested, some more networking information. I removed the down interfaces from `ip addr` for brevity.               $ ip addr     1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN         link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00         inet 127.0.0.1/8 scope host lo            valid_lft forever preferred_lft forever         inet6 ::1/128 scope host            valid_lft forever preferred_lft forever     2: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000         link/ether 60:67:20:44:8d:48 brd ff:ff:ff:ff:ff:ff         inet 192.168.1.5/24 brd 192.168.1.255 scope global wlp3s0            valid_lft forever preferred_lft forever         inet6 fe80::6267:20ff:fe44:8d48/64 scope link            valid_lft forever preferred_lft forever     4: virbr1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP         link/ether 52:54:00:84:3d:aa brd ff:ff:ff:ff:ff:ff         inet 192.168.77.1/24 brd 192.168.77.255 scope global virbr1            valid_lft forever preferred_lft forever      * * *               $ ip route     default via 192.168.1.1 dev wlp3s0  proto static     192.168.1.0/24 dev wlp3s0  proto kernel  scope link  src 192.168.1.5     192.168.77.0/24 dev virbr1  proto kernel  scope link  src 192.168.77.1      * * *               $ ip rule     0:      from all lookup local     32766:  from all lookup main     32767:  from all lookup default      * * *               $ iptables -t nat -L -n     Chain PREROUTING (policy ACCEPT)     target     prot opt source               destination                  Chain INPUT (policy ACCEPT)     target     prot opt source               destination                  Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination                  Chain POSTROUTING (policy ACCEPT)     target     prot opt source               destination             MASQUERADE  tcp  --  192.168.77.0/24     !192.168.77.0/24      masq ports: 1024-65535     MASQUERADE  udp  --  192.168.77.0/24     !192.168.77.0/24      masq ports: 1024-65535     MASQUERADE  all  --  192.168.77.0/24     !192.168.77.0/24          * * *               $ iptables -L -n     Chain INPUT (policy ACCEPT)     target     prot opt source               destination                  Chain FORWARD (policy ACCEPT)     target     prot opt source               destination             ACCEPT     all  --  0.0.0.0/0            192.168.77.0/24      ctstate RELATED,ESTABLISHED     ACCEPT     all  --  192.168.77.0/24      0.0.0.0/0                    Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination


building/compiling kernel headers

I am compiling kernel 3.4 and 3.8 for different target devices. I would like to install compat wireless driver which requires kernel header. Could anyone tell me how I can compile/build the kernel header from the kernel source? I would appreciate if someone could suggest me a clear document to read or explain clearly how I can accomplish it. Secondly, the target devices run Debian. would it work if I install the kernel header by `apt-get install linux-headers-$(uname -r)` for the device that would have `3.4` kernel? Or there might be conflict or problem?


ssh will sporadically hang temporarily on fast connection

I am using Ubuntu 13.04 on my laptop, connected to my router at home. When working from home, I will ssh into the servers on campus, through a vpn, with X11 forwarding.               ssh -X server.address.on.campus      I have a connection that is usually about 40 Mb/s and I only live a few miles away so the terminal is just as responsive as if I was using ssh on the campus network. However, the difference is that the connection from home has a tendency to "hang" for about 10-15 seconds every few minutes before resuming (all keystrokes I made during the hang are clearly sent because my screen is updated with them after the hang). There is no discernible pattern to the hangs. It usually happens (or is most noticeable) when I am typing something out. Does anyone have any ideas how I could mitigate this issue or what might be causing it? Reading around the internet, there are various issues with ssh hanging (usually permanently) but no solutions for my specific issue. UPDATE: I still have this issue. As suggested by @Anthon, I left `ping` running until ssh hung again. I've plotted the results below, and it is quite clear where the temporary hang happens. No packets are received for serval seconds and then ~6 are sent back in quick succession. ![enter image description here](http://i.stack.imgur.com/6iSaA.png) Also: I have never noticed the issue occurring when I use PuTTY on a windows partition on the same machine.


GDM hangs when home directory is inaccessible

I have setup a OpenSUSE 12.3 workstation with SSO through KRB5 and LDAP. This works pretty smoothly up to the point where GDM isn't very happy about that fact that it cannot access user's home directories that are actually nfs mounts with krb5p. If no home directory is mounted GDM works fine. If at least one home directory is mounted then GDM will crash when attempting to open the greeter / login screen. If I remove LDAP (sss) from `/etc/nsswitch.conf` then GDM will work fine even if the home directories are mounted. At first I used to have the nfs mount in fstab for `/home/users`. There GDM would crash every time. Then I have tried to switch to autofs to mount `/home/users/*` individually. There GDM would work at first but crash thereafter (when the user logs out). Now I have configured it to use pam_mount so that the home directories would get unmounted after a user logs out. Now GDM works as long as there is no other user logged on to the system. So the problem must be somehow related to the fact that if the user `gdm` that the GDM greeter uses tries to access any of the mounted home directories, its permission will be denied by the nfs server due to a missing kerberos ticket. Even root cannot access these directories. Any attempt to give GDM access to these directories before the respective user logs in, would be a security issue. Interestingly though if the home directory doesn't exist then GDM has absolutely no problem with it. So GDM does tolerate `file does not exist`, but doesn't tolerate `permission denied`. So this makes me conclude that whatever GDM is trying to access from the home directories is not required at all. So what is it that GDM is trying to get from the home directories? And more importantly, how can I disable it from trying to do so? How can I prevent it from hanging? Any ideas for some extra troubleshooting? Or how can I make the mounted home directories invisible to GDM so that it won't trip over them?


Problems setting up own Cloud Lab

I'm trying to set up an own Cloud Lab on a self-built server. Server details:   * Board: Gigabyte Z77MX-D3H TH   * CPU: Xeon E3-1245 v2   * 16GB Crucial Ballistix CL8 1600Mhz   * NETWORK: ALFA AWUS036H   * additional crap (like crap-hdd, cooler, etc). I can only use (at this moment) a wireless connection because the box is far away from the router. I tried with Cloudstack and wanted to try with Openstack but I have read a lot of about (people who work with in production) that it is not a good solution and it will be more useful for me to try out with ProxMox. Now I have ProxMox up, but I can not establish any wireless-connections. At the PVE-Forum I got that they don't support or have not provided any wireless- network setup because PVE has some problems because of bridging. **My question is now:** I have my metal here (see hardware description above).   I have almost no experience with virtualization on Unix/Linux.   (I'm using VMware WS on my Ubuntu and I worked some weeks with OpenNebula (setting up and s.o.).   -> What should I use for my Cloud Lab / virtualisation environment, and if ProxMox is a good point to go on, how to solve the wireless problem? **EDIT:** I will definitely need kvm as hypervisor.


Half screen appears to have film on it. Acer C7 Chromebook running 13.04

Right side of the screen is not processing colors properly. Does not show up in white space but when colors deep colors occur the right side is lighter and it seems to be a bit blurry as well. I toggled back to chrome but it doesn't seem to be an issue there. I from 12.04 to 12.10 to 13.04 and all of them have the exact problem. I tried re- installing the intel drivers in all three but nothing changed. I also hooked it up to a HDTV which worked fine. I looked into calibrating the colors of the monitor but couldn't quite figure it out. Does anyone know of a good color profile online with good instructions? I believe the C7 runs the Intel HD graphics 4000, which I have seen some problems occurring. Any help would be great.


ufw in laptop running Ubuntu

I installed ufw and enabled it. The status is:                Status: active      Logging: on (low)      Default: deny (incoming), deny (outgoing)      New profiles: skip      But, I am able to navigate the web, get emails and even download and upload torrents. What does it mean the "deny (incoming), deny (outgoing)" part then? I expected a firewall to block traffic. What rules could I add so it blocks traffic?


tmux new pane has home directory as default instead of previous directory

When I press `Ctrl`+`"` (create a new pane) while in a pane, which has the `PWD` `/tmp` for example, the new pane starts as my home folder `~`. I looked at http://unix.stackexchange.com/a/109255/72471 and it helped me with the same issue concerning windows. However, I couldn't fix the `split-window` issue by inserting               bind " split-window -c "#{pane_current_path}"      into my `~/.tmux.conf`. I am using tmux 1.9a and therefor don't want a rather messy solution for older versions stated here (it doesn't work in my case, anyway):               bind '"' set default-path "" \; split-window -v \; set -u default-path      How can I tell `tmux` to set the default directory as the current path of a pane, when creating a new pane?


What is the difference between "find" and "till" in vim?

I see I can use `t` `c` or `T``c` to move to the next / previous character `c` I can also use `f``c` or `F``c` to move to the next / previous character `c` Is the only difference between them that `t``c` places the cursor before the character, `T``c` (going backwards) places the cursor _after_ the character and `f``c` / `F``c` both place it on the character itself?


What are the positions in `free` called?

I am trying to compare the output of `free` with the output of `sar -r`:               # sar -r     12:00:01 AM kbmemfree kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit     12:10:01 AM    629756  65293976     99.04    586536  60321636   5094176      7.49          # free                  total       used       free     shared    buffers     cached     Mem:      65923732    9120348   56803384          0     403628    5789524     -/+ buffers/cache:    2927196   62996536     Swap:      2097144          0    2097144      On the `free` line that begins `Mem:` it is obvious that we have what would be called in `sar`: _kbmemtotal_ , _kbmemused_ , _kbmemfree_ , **???** , _kbbuffers_ , _kbcached_.   On the line that begins `-/+`: **???** , **???** **What are the names of the values that I've marked as _???_?** Is this the `kbcommit` value? I have read Linux ate my ram which does explain what the numbers mean, but not their names. Also, the free manpage does not give the names either.


Why does debian and ubuntu default to runlevel 2?

I never thought about this before, but I was wondering why they chose runlevel 2. Every other distro and OS I've used default to runlevel 3 (with the exception of AIX which also defaults to runlevel 2).


How to disable floppy seek at linux startup?

It is annoying enough that my BIOS has no switch that allows me to disable the floppy-seek at boot. But when I boot CentOS 5 the floppy seeks again - I suspect `hald` to do this. How can I disable that seek (/dev/fd0)?


Can renaming a network device cause race conditions?

Arch uses predictable network interface names. MATLAB licenses are linked to the MAC address of eth0, so I need to rename one of my devices eth0. In a machines with only one NIC I can just turn off consistent naming, but in machines with multiple NICs it seems like it is desirable to keep consistent naming and just rename the device I care about to eth0 (it is still consistent after all). The Arch Wiki suggests creating a file `/etc/udev/rules.d/10-network.rules` with               SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="aa:bb:cc:dd:ee:ff", NAME="net1"      but the wiki includes the disclaimer: > When choosing the static names it should be avoided to use names in the > format of "ethX" and "wlanX", because this may lead to race conditions > between the kernel and udev during boot. For ethX with X greater than 0, I can see how this might be a problem, but for eth0 it seems like the kernel would have already used eth0 by the time the rename happens. So on a system with multiple NICs, do I have to worry about renaming a device to eth0? Alternatively, can I rename the device once I am fully booted and the network is online?


How can I install M4 on Linux, avoiding the dependency loop with Automake and Autoconf?

I am trying to install GNU M4 on my Chromebook using the 1.4.17 tarball, but when I run `./configure` and then`make` I get an error related to `aclocal`, which is apparently part of the GNU Automake package. The exact error I get is               WARNING: 'aclocal-1.14' is missing on your system.              You should only need it if you modified 'acinclude.m4' or              'configure.ac' or m4 files included by 'configure.ac'.              The 'aclocal' program is part of the GNU Automake package:              <http://www.gnu.org/software/automake>              It also requires GNU Autoconf, GNU m4 and Perl in order to run:              <http://www.gnu.org/software/autoconf>              <http://www.gnu.org/software/m4/>              <http://www.perl.org/>     make: *** [aclocal.m4] Error 127      I know the first part is only a warning, but the name indicates that the error is related. I also tried to create an empty file for `aclocal.m4`, and I get a different message: a warning about `automake-1.14` missing and `make: *** [Makefile.in] Error 1` Unfortunately, according to the official page, Automake requires Autoconf, which in turn requires M4. What can I do to install M4 and avoid this problem?


Bash $PROMPT_COMMAND messing up scroll history display

I set up a `PROMPT_COMMAND` to display the current branch while I'm in a git repo. The relevant part of my .bashrc is:               export PS1=" \[\033[34m\]\$\[\033[0m\] "     export PROMPT_COMMAND="$HOME/bin/myprompt"      where ~/bin/myprompt is:               #!/usr/bin/env ruby     green = "\033[32m"     bold = "\033[1m"     underline = "\033[4m"     reset = "\033[0m"          home_regex = Regexp.new "^#{ENV["HOME"]}"     Dir.chdir ENV["PWD"]          out =        underline + bold + green +       `pwd`.gsub(home_regex, "~").chomp +       reset          if `git log 2>&1 | grep ^fatal`.chomp == ""       out += "#{underline}#{green} (#{`git branch | grep ^\* | sed s/^..//g`.chomp})#{reset}"     end          print out      It works fine for the most part, the only problem is that when I use the arrow keys to scroll through command history, sometimes the command gets written over my prompt. Suppose the following session:               ~ $ pwd     /Users/Adrian     ~ $ cd sibilant     ~/sibilant (master) $ pwd     /Users/Adrian/sibilant     ~/sibilant (master) $      Then I press the up arrow to scroll through command history. each line shows the result of one press of the arrow:               ~/sibilant (master) $ pwd     ~/sibilant (master) $ cd sibilant     ~/spwd      as you can see, the last time I pressed the arrow the command was written over my prompt. Has anyone experienced this and/or know how to fix it?


Matterhorn dead but PID file exists

Installed opencast-matterhorn14 in a Centos 6.5 Machine and after Installation steps while I try to run the Matterhorn using `service matterhorn start` I keep on getting the same error:               [root@matterhorn log]# /etc/init.d/matterhorn status     matterhorn dead but pid file exists      While looking in `/var/run` I saw there is a PIDFILE:               -rw-r--r--  1 root  root     5 Jun 13 12:11 matterhorn.pid      So I removed the pidfile and tried to restart matterhorn, and I get the same error. Whith Google search I found an `init` script for Matterhorn from Github, so I have replaced my `init` script and still get the same error:               Matterhorn dead but pid file exists      If anyone have faced this issue please suggest a solution.


Command to change Konsole title

I would like to have the Konsole's title to change every time I run a loop, like this:               while read line; do       echo $line $i/$numline       echo -ne "\033]0;$line $i/$numline\007"       commands       let i=i+1     done<text      I've found that the `echo -ne "\033]0;text\007"`command doesn't work.


How to login from remote server to my own PC?

For the experiment purpose I need to login to my own PC from the remote PCs which are under the same domain, i.e: university network. How can I do remote login in this case using SSH? As an example, I have accounts in two machines in University X which are `me@machine_a.cs.x.ca` and `me@machine_b.cs.x.ca`, my personal laptop account is `nawshad@ubuntu`. What extra info do I need to provide?


command line method or programtically add ssh key to github.com user account

Is there a way to identify with a username and password to github.com servers for the purpose of adding an ssh key to the github user account? So far everything I've read suggests that a users ssh key must be added via the web GUI. I'm looking for the method or process of adding a key via a command line interface or bash/ansible/something script.


NTP with networks isolated

I have a computer (CentOS) with 2 network cards. I want to use one network card (A) to retrieve time from NTP server (internet). This would then set [this] local computer's time. I then want to point all other clients, (computers, and other devices) to the second network (B) card, using it as a LOCAL NTP. The B network must remain unto itself. This is all this computer will be used for. No other programs or functions. Can this be achieved? nutshell:   * network A gets time via NTP Ethernet.   * network B then provides time for incoming queries from local clients.   * No cross network communication can occur.  I'm obviously new to networking, and any help is appreciated.


Timeout `idql` command in ksh

I probably read all the threads in almost all the forums for a solution to my need. I am a beginner in shell scripting and I dont have a perfect solution yet. Below is my code snippet.               idql -n $REPOSITORY_NAME.$cs -Udmadmin -P"" -R$DM_SCRIPTS/test.api > /dev/null 2>&1         if [ $? != 0 ]; then           echo "   \c"           echo "ERROR: Cannot connect to: $REPOSITORY_NAME.$cs on $HOST"         else           echo "   Successfully connected to: $REPOSITORY_NAME.$cs"         fi      This is from the main logic that we use for monitoring our service. But we often see our service getting hung and so the first line of the above snippet gets hung and it doesnt proceed after that. Due to this we are not able to catch this 'service hung' condition. Most importantly we have to retain the checks for the existing conditions (specified in the if-else conditional statements) and additionally we have to be checking for the 'hung' state. If the `idql` command takes more than 5 seconds, we can assume that it is hung.


How to script a database migration using SSH?

I am trying to create a `sync.sh` script that coordinates with our less-than- ideal version control for our website. This script will migrate a copy of the live database to our local development environment and a couple other things. I'm having trouble with the mysql migration portion. This script is run on a development machine. `remote` is the live host.               # --------------     # database          # ssh tunnel     ssh -L 3307:remote:3306 user@remote          # mysql dump     mysqldump -u someuser -h remote -P 3307 -p"p4ssw0rd" db > localfile.sql          # somehow close ssh tunnel ???          # populate local db with sql dump file     mysql -ulocal db < localfile.sql          # -----------------     # other sync stuff     # ...      When I just run the mysql portion of the script, I'm getting this output:               Pseudo-terminal will not be allocated because stdin is not a terminal.     Enter password:       We have ssh keys setup and I can ssh to the remote properly. However, when run in the script context, things are going wrong. I think I'm just a total bash noob. I'm guessing that if I simply change the structure of my approach, I should have no problem. I'm just not sure how to do that...


Browse Bash files for a distribution

With my current OS, my `LANG` value is set by               /etc/profile.d/lang.sh      I am curious of the code for another distribution, Linux Mint for example. How could I browse this code online, or perhaps download the code without actually installing that OS? I would prefer not to download an ISO if possible.


Compress a directory using tar/gz over SSH to local computer?

I'd like to essentially tar/gz a directory on a remote machine and save the file to my local computer without having to connect back into my local machine from the remote one. Is there a way to do this over SSH? The tar file doesn't need to be stored on the remote machine, only on the local machine. Is this possible?


Adding XFCE to Linux Mint 15 Cinnamon?

I installed _mint-meta-xfce_ package on an existing Cinnamon installation but it doesn't look anything like a standalone installation of Linux Mint 15 Xfce. It appears to be using the default Xfce settings. Is there a better procedure to install xfce to get the Mint eye-candy? * * * Linux Mint 15 Xfce installation: ![Linux Mint 15 Xfce](http://i.stack.imgur.com/vqDkd.png) Linux Mint 15 Cinnamon installation after adding mint-meta-xfce: ![Linux Mint 15 Cinnamon plus mint-meta- xfce](http://i.stack.imgur.com/o09Ug.png) * * *               $ cat /etc/apt/sources.list     # deb http://archive.getdeb.net/ubuntu raring-getdeb apps games                    $ ls /etc/apt/sources.list.d     local-repository.list official-package-repositories.list                    $ cat /etc/apt/sources.list.d/local-repository.list     #deb file:///usr/share/local-repository binary/                    $ cat /etc/apt/sources.list.d/official-package-repositories.list     # Do not edit this file manually, use Software Sources instead.          deb http://packages.linuxmint.com olivia main upstream import  #id:linuxmint_main          deb http://archive.ubuntu.com/ubuntu raring main restricted universe multiverse     deb http://archive.ubuntu.com/ubuntu raring-updates main restricted universe multiverse          deb http://security.ubuntu.com/ubuntu/ raring-security main restricted universe multiverse     deb http://archive.canonical.com/ubuntu/ raring partner


What is the difference between system-call, vm-call and hypervisor-call in a virtualized environment?


How can I investigate what other users are currently logged in?

Since the last few days I get an error message when I try to shut my laptop down: > System policy prevents stopping the system when other users are logged in This error message includes a prompt for administrator password. I don't think that there should be other users logged in. How can I find out what the problem is? ## What I've tried               $ w      08:00:47 up  1:50,  2 users,  load average: 0,74, 0,95, 0,70     USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT     moose    tty8     :0               07:57    1:49m  4.88s  0.11s x-session-manager     moose    pts/0    :0.0             08:00    2.00s  0.11s  0.00s w               $ loginctl        SESSION        UID USER             SEAT                         c1        117 couchdb                                       c2       1000 moose            seat0                 2 sessions listed. I'm not sure: is that already the problem? `$ sudo shutdown -h now` worked as expected. ## How I shut the computer down By clicking on `System > Shut Down... > Shut Down`: ![enter image description here](http://i.stack.imgur.com/47knu.png) ## System information I have Linux Mint MATE:               $ uname -a     Linux pc08 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux     $ cat /etc/issue     Linux Mint 16 Petra \n \l


Bash syntax error when "else" follows an empty "then" clause

Why would following script not execute, but give a syntax error of `else`:               LOGS3_DIR=~/logs     if [ -d "$LOGS3_DIR" ]; then      cd      cd "$LOGS3_DIR"      echo "$LOGS3_DIR"      for filename in `find "." -mtime 1 -type f`       do       if lsof "$filename" > /dev/null       then         # file is open       else         echo "deleting $filename"         rm "$filename"       fi      done     fi


Why do I have to disconnect and connect for internet all the time?

Currently, I have to disconnect and connect again to use the internet for my Linux computer. It works fine for my tablet. Do you know what could be the reason for that? When I use the internet for more than a minute or so it simply doesn't work any more. I am connected without a wire.               $ cat /etc/issue     Linux Mint 16 Petra \n \l     $ uname -a     Linux pc08 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux     $ ifconfig     eth0      Link encap:Ethernet  HWaddr e8:40:f2:93:ff:ab                 UP BROADCAST MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)               Interrupt:17           lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:65536  Metric:1               RX packets:6760 errors:0 dropped:0 overruns:0 frame:0               TX packets:6760 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:534518 (534.5 KB)  TX bytes:534518 (534.5 KB)          wlan0     Link encap:Ethernet  HWaddr 9c:b7:0d:f1:35:65                 inet addr:192.168.1.4  Bcast:192.168.1.255  Mask:255.255.255.0               inet6 addr: fe80::9eb7:dff:fef1:3565/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:58102 errors:0 dropped:0 overruns:0 frame:0               TX packets:40615 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:63722853 (63.7 MB)  TX bytes:6852895 (6.8 MB)     $ traceroute 4.2.2.2     traceroute to 4.2.2.2 (4.2.2.2), 30 hops max, 60 byte packets      1  192.168.1.1 (192.168.1.1)  13.115 ms  13.090 ms  13.069 ms      2  * * *      3  te-0-1-0-5-sur01.pittsburgh.pa.pitt.comcast.net (68.85.234.9)  180.382 ms  180.372 ms  180.356 ms      4  162-151-21-129-static.hfc.comcastbusiness.net (162.151.21.129)  179.660 ms te-0-10-0-13-ar03.pittsburgh.pa.pitt.comcast.net (69.139.168.57)  174.513 ms te-0-8-0-12-ar03.pittsburgh.pa.pitt.comcast.net (68.85.75.189)  179.609 ms      5  he-4-14-0-0-cr01.newyork.ny.ibone.comcast.net (68.86.94.185)  186.009 ms  186.002 ms  185.987 ms      6  ae12.edge1.NewYork2.level3.net (4.68.127.1)  185.288 ms  54.871 ms  81.634 ms      7  vlan51.ebr1.NewYork2.Level3.net (4.69.138.222)  103.096 ms  173.070 ms vlan52.ebr2.NewYork2.Level3.net (4.69.138.254)  173.044 ms      8  ae-48-48.ebr2.NewYork1.Level3.net (4.69.201.37)  173.010 ms ae-47-47.ebr1.NewYork1.Level3.net (4.69.201.45)  172.915 ms  172.908 ms      9  ae-62-62.csw1.NewYork1.Level3.net (4.69.148.34)  172.821 ms ae-92-92.csw4.NewYork1.Level3.net (4.69.148.46)  172.947 ms ae-91-91.csw4.NewYork1.Level3.net (4.69.134.78)  171.584 ms     10  ae-2-70.edge2.NewYork1.Level3.net (4.69.155.80)  172.802 ms  172.808 ms ae-1-60.edge2.NewYork1.Level3.net (4.69.155.16)  172.732 ms     11  b.resolvers.Level3.net (4.2.2.2)  172.808 ms  172.760 ms  47.988 ms     $ lspci | grep -i ethernet     03:00.0 Ethernet controller: Broadcom Corporation NetLink BCM57780 Gigabit Ethernet PCIe (rev 01)


Sourcing scripts with a for loop for different variables

I have several shell scripts that I summarised within a global script. I am using some variables that are the same across all scripts, and I wrote a separate script for this, which I am sourcing in each sub-script. This is what my variables script looks like:               variables.sh     NUMBER="6"     TYPE="${NUMBER}_xyz"     STATE="S05"     DIR="path/file_${NUMBER}_blabla"     FILE="file.txt"      My global script, global.sh, looks like this:               source variables.sh     bash script1.sh     bash script2.sh     ...      Now, I need to change the NUMBER variable in my variables script, run the global script, change the number, run the global script again etc. for each number from 6-15. At the moment I am doing this manually every time the global script has finished, but it's taking up a lot of time. Has someone got an easy to implement tip for a newbie? Thanks in advance!