title: Wireless is not working on Lenovo ThinkPad X201 with CentOs 6.5

text: I am having trouble with wireless connection on my `Thinkpad X201` laptop. I installed `CentOs 6.5 Minimal`. The Wired (cable) internet works perfect. But wireless is not detected. I looked at following links but doesn't help me. http://wiki.centos.org/HowTos/Laptops/Wireless http://wiki.centos.org/HowTos/Laptops/Lenovo/Thinkpad-X200s http://www.lapwik.com/lenovo_thinkpad_x201 by running `ifconfig -a` I cannot see the `wlan0`, although I setup wireless via `NetWork Manager` in `Gnome`. Oh by the way, my laptop came with Windows7 on it which I completely wiped it out and installed Linux. **-- UPDATE --** Here is the output of `lspci -v`:               00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 02)         Subsystem: Lenovo Device 2193         Flags: bus master, fast devsel, latency 0         Capabilities: [e0] Vendor Specific Information: Len=0c <?>         Kernel driver in use: agpgart-intel          00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02) (prog-if 00 [VGA controller])         Subsystem: Lenovo Device 215a         Flags: bus master, fast devsel, latency 0, IRQ 28         Memory at f2000000 (64-bit, non-prefetchable) [size=4M]         Memory at d0000000 (64-bit, prefetchable) [size=256M]         I/O ports at 1800 [size=8]         Expansion ROM at <unassigned> [disabled]         Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-         Capabilities: [d0] Power Management version 2         Capabilities: [a4] PCI Advanced Features         Kernel driver in use: i915         Kernel modules: i915          00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06)         Subsystem: Lenovo Device 215f         Flags: bus master, fast devsel, latency 0, IRQ 11         Memory at f2727800 (64-bit, non-prefetchable) [size=16]         Capabilities: [50] Power Management version 3         Capabilities: [8c] MSI: Enable- Count=1/1 Maskable- 64bit+          00:19.0 Ethernet controller: Intel Corporation 82577LM Gigabit Network Connection (rev 06)         Subsystem: Lenovo Device 2153         Flags: bus master, fast devsel, latency 0, IRQ 30         Memory at f2500000 (32-bit, non-prefetchable) [size=128K]         Memory at f2525000 (32-bit, non-prefetchable) [size=4K]         I/O ports at 1820 [size=32]         Capabilities: [c8] Power Management version 2         Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+         Capabilities: [e0] PCI Advanced Features         Kernel driver in use: e1000e         Kernel modules: e1000e          00:1a.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06) (prog-if 20 [EHCI])         Subsystem: Lenovo Device 2163         Flags: bus master, medium devsel, latency 0, IRQ 23         Memory at f2728000 (32-bit, non-prefetchable) [size=1K]         Capabilities: [50] Power Management version 2         Capabilities: [58] Debug port: BAR=1 offset=00a0         Capabilities: [98] PCI Advanced Features         Kernel driver in use: ehci_hcd          00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06)         Subsystem: Lenovo Device 215e         Flags: bus master, fast devsel, latency 0, IRQ 31         Memory at f2520000 (64-bit, non-prefetchable) [size=16K]         Capabilities: [50] Power Management version 2         Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+         Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00         Capabilities: [100] Virtual Channel         Capabilities: [130] Root Complex Link         Kernel driver in use: snd_hda_intel         Kernel modules: snd-hda-intel          00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 06) (prog-if 00 [Normal decode])         Flags: bus master, fast devsel, latency 0         Bus: primary=00, secondary=0d, subordinate=0d, sec-latency=0         Capabilities: [40] Express Root Port (Slot+), MSI 00         Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-         Capabilities: [90] Subsystem: Lenovo Device 2164         Capabilities: [a0] Power Management version 2         Kernel modules: shpchp          00:1c.3 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 4 (rev 06) (prog-if 00 [Normal decode])         Flags: bus master, fast devsel, latency 0         Bus: primary=00, secondary=05, subordinate=0c, sec-latency=0         I/O behind bridge: 00002000-00002fff         Memory behind bridge: f0000000-f1ffffff         Prefetchable memory behind bridge: 00000000f2800000-00000000f28fffff         Capabilities: [40] Express Root Port (Slot+), MSI 00         Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-         Capabilities: [90] Subsystem: Lenovo Device 2164         Capabilities: [a0] Power Management version 2         Kernel modules: shpchp          00:1c.4 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 5 (rev 06) (prog-if 00 [Normal decode])         Flags: bus master, fast devsel, latency 0         Bus: primary=00, secondary=02, subordinate=02, sec-latency=0         Memory behind bridge: f2400000-f24fffff         Capabilities: [40] Express Root Port (Slot+), MSI 00         Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-         Capabilities: [90] Subsystem: Lenovo Device 2164         Capabilities: [a0] Power Management version 2         Kernel modules: shpchp          00:1d.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06) (prog-if 20 [EHCI])         Subsystem: Lenovo Device 2163         Flags: bus master, medium devsel, latency 0, IRQ 19         Memory at f2728400 (32-bit, non-prefetchable) [size=1K]         Capabilities: [50] Power Management version 2         Capabilities: [58] Debug port: BAR=1 offset=00a0         Capabilities: [98] PCI Advanced Features         Kernel driver in use: ehci_hcd          00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev a6) (prog-if 01 [Subtractive decode])         Flags: bus master, fast devsel, latency 0         Bus: primary=00, secondary=0e, subordinate=0e, sec-latency=0         Capabilities: [50] Subsystem: Lenovo Device 2165          00:1f.0 ISA bridge: Intel Corporation Mobile 5 Series Chipset LPC Interface Controller (rev 06)         Subsystem: Lenovo Device 2166         Flags: bus master, medium devsel, latency 0         Capabilities: [e0] Vendor Specific Information: Len=10 <?>         Kernel driver in use: lpc_ich         Kernel modules: lpc_ich          00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 6 port SATA AHCI Controller (rev 06) (prog-if 01 [AHCI 1.0])         Subsystem: Lenovo Device 2168         Flags: bus master, 66MHz, medium devsel, latency 0, IRQ 29         I/O ports at 1860 [size=8]         I/O ports at 1814 [size=4]         I/O ports at 1818 [size=8]         I/O ports at 1810 [size=4]         I/O ports at 1840 [size=32]         Memory at f2727000 (32-bit, non-prefetchable) [size=2K]         Capabilities: [80] MSI: Enable+ Count=1/1 Maskable- 64bit-         Capabilities: [70] Power Management version 3         Capabilities: [a8] SATA HBA v1.0         Capabilities: [b0] PCI Advanced Features         Kernel driver in use: ahci         Kernel modules: ahci          00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller (rev 06)         Subsystem: Lenovo Device 2167         Flags: medium devsel, IRQ 23         Memory at f2728800 (64-bit, non-prefetchable) [size=256]         I/O ports at 1880 [size=32]         Kernel driver in use: i801_smbus         Kernel modules: i2c-i801          00:1f.6 Signal processing controller: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem (rev 06)         Subsystem: Lenovo Device 2190         Flags: fast devsel, IRQ 19         Memory at f2526000 (64-bit, non-prefetchable) [size=4K]         Capabilities: [50] Power Management version 3         Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit-         Kernel driver in use: intel ips         Kernel modules: intel_ips          02:00.0 Network controller: Intel Corporation Centrino Wireless-N 1000 [Condor Peak]         Subsystem: Intel Corporation Centrino Wireless-N 1000 BGN         Flags: fast devsel, IRQ 16         Memory at f2400000 (64-bit, non-prefetchable) [size=8K]         Capabilities: [c8] Power Management version 3         Capabilities: [d0] MSI: Enable- Count=1/1 Maskable- 64bit+         Capabilities: [e0] Express Endpoint, MSI 00         Capabilities: [100] Advanced Error Reporting         Capabilities: [140] Device Serial Number 00-26-c7-ff-ff-eb-a7-56         Kernel modules: iwlwifi          ff:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers (rev 02)         Subsystem: Lenovo Device 2196         Flags: bus master, fast devsel, latency 0          ff:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture System Address Decoder (rev 02)         Subsystem: Lenovo Device 2196         Flags: bus master, fast devsel, latency 0          ff:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 02)         Subsystem: Lenovo Device 2196         Flags: bus master, fast devsel, latency 0          ff:02.1 Host bridge: Intel Corporation Core Processor QPI Physical 0 (rev 02)         Subsystem: Lenovo Device 2196         Flags: bus master, fast devsel, latency 0          ff:02.2 Host bridge: Intel Corporation Core Processor Reserved (rev 02)         Subsystem: Lenovo Device 2196         Flags: bus master, fast devsel, latency 0          ff:02.3 Host bridge: Intel Corporation Core Processor Reserved (rev 02)         Subsystem: Lenovo Device 2196         Flags: bus master, fast devsel, latency 0      -- **UPDATE** -- Here is the output of `lsmod`:               Module                  Size  Used by     fuse                   73530  2      rfcomm                 74119  0      sco                    18005  0      bridge                 83689  0      bnep                   16690  0      l2cap                  55714  4 rfcomm,bnep     8021q                  25349  0      garp                    7152  1 8021q     stp                     2218  2 bridge,garp     llc                     5546  3 bridge,garp,stp     ipt_REJECT              2351  2      nf_conntrack_ipv4       9506  2      nf_defrag_ipv4          1483  1 nf_conntrack_ipv4     iptable_filter          2793  1      ip_tables              17831  1 iptable_filter     ip6t_REJECT             4628  2      nf_conntrack_ipv6       8337  2      nf_defrag_ipv6         11156  1 nf_conntrack_ipv6     xt_state                1492  4      nf_conntrack           79758  3 nf_conntrack_ipv4,nf_conntrack_ipv6,xt_state     ip6table_filter         2889  1      ip6_tables             18732  1 ip6table_filter     ipv6                  318183  21 ip6t_REJECT,nf_conntrack_ipv6,nf_defrag_ipv6     uinput                  7992  0      btusb                  16851  0      bluetooth              99271  5 rfcomm,sco,bnep,l2cap,btusb     iTCO_wdt                7115  0      iTCO_vendor_support     3056  1 iTCO_wdt     thinkpad_acpi          68622  0      iwlwifi                92090  0      cfg80211              619515  1 iwlwifi     rfkill                 19255  4 bluetooth,thinkpad_acpi,cfg80211     sg                     29350  0      uvcvideo               62688  0      videodev               75708  1 uvcvideo     v4l2_compat_ioctl32     7110  1 videodev     intel_ips              14598  0      i2c_i801               11359  0      snd_hda_codec_hdmi     28922  1      snd_hda_codec_conexant    39925  1      snd_hda_intel          40562  2      snd_hda_codec         179208  3 snd_hda_codec_hdmi,snd_hda_codec_conexant,snd_hda_intel     snd_hwdep               6780  1 snd_hda_codec     snd_seq                55727  0      snd_seq_device          6500  1 snd_seq     snd_pcm                87409  3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec     snd_timer              22443  2 snd_seq,snd_pcm     snd                    70569  13 snd_hda_codec_hdmi,snd_hda_codec_conexant,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_seq,snd_seq_device,snd_pcm,snd_timer     soundcore               7958  1 snd     snd_page_alloc          8856  2 snd_hda_intel,snd_pcm     lpc_ich                12803  0      mfd_core                1895  1 lpc_ich     shpchp                 32778  0      e1000e                267701  0      ptp                     9614  1 e1000e     pps_core               11458  1 ptp     ext4                  374405  3      jbd2                   93427  1 ext4     mbcache                 8193  1 ext4     sd_mod                 39069  3      crc_t10dif              1541  1 sd_mod     ahci                   42247  2      wmi                     6287  0      i915                  624511  7      drm_kms_helper         44321  1 i915     drm                   280012  3 i915,drm_kms_helper     i2c_algo_bit            5935  1 i915     i2c_core               31084  6 videodev,i2c_i801,i915,drm_kms_helper,drm,i2c_algo_bit     video                  20674  1 i915     output                  2409  1 video     dm_mirror              14384  0      dm_region_hash         12085  1 dm_mirror     dm_log                  9930  2 dm_mirror,dm_region_hash     dm_mod                 84337  11 dm_mirror,dm_log


title: What log files to include when reporting a bug report for my wlan card?

text: I'd like to report a bug with my wireless card cutting out (seemingly) randomly, but I don't know what log files to include. I know a `tail -F` of a particular log file when the card cuts out would be invaluable. I just don't want to submit a bug report with no log files that will get lost in the shuffle. Right now, I'd attach the following:   1. `lspci | grep -i ethernet`   2. `lshw -C network` But I still need some sort of log file.


title: How to Provide login delay in ssh

text: I wanted to provide login delay while login through ssh .I tried couple of ways of doing same but couldn't find desired result. I tried steps provided by given link. http://hostingfu.com/article/ssh-dictionary-attack-prevention-with-iptables               iptables -N SSH_CHECK     iptables -A INPUT -p tcp --dport 22 -m state --state NEW -j SSH_CHECK     iptables -A SSH_CHECK -m recent --set --name SSH     iptables -A SSH_CHECK -m recent --update --seconds 60 --hitcount 4 --name SSH -j DROP      I don't have pam module installed on my machine,so can't make any modification related to pam files So any body let me suggest some other way to do the same? I have bare linux kernel running on embedded platform.


title: How to force Gnome's WM (metacity) to open a program window on a specific monitor?

text: I need to configure a dual-head machine using Debian 6 (and, hence, Gnome 2.30.2 and xrandr 1.3.3) so that it opens applications reliably on a certain screen. While it is trivial to move normal windows from one monitor to the other by just dragging their title bars, we need to run Stellarium, which opens an undecorated fullscreen window that doesn't even respond to ALT-dragging it. It also does not seem to use the standard X command line switches -geometry, -display and so on. Since this is a machine that will be shared by many users, I am especially interested in simple, intuitive and documentable solutions.


title: -d shell script doesn't work

text: > **Possible Duplicate:**   >  Change directory with -d in shell script I am trying to give the option to the users to run the script in a different directory. However when the script changes the directory, the `mkdir` does not work. I change the directory like this:               case $1 in      "-d")        PWD=$2;;        *)          ;;     esac      but when I run the script I get this error:               sasha@ubuntu:~/Desktop$ ./shellsc.sh -d /home/sasha/Downloads/     trigger took place in /home/sasha/Desktop     processing "1.sh.save.1" ...     ./shellsc.sh: line 22: mkdir: command not found      here is the complete code:               #!/bin/bash     #File sorter     set -e    # Abort in case of error     START=$(date +"%T")     SAVEIFS=$IFS     case $1 in         "-d")           PWD=$2;;         *)           ;;     esac     echo "trigger took place in $PWD"     for i in *; do       echo "processing \"$i\" ..."       case $i in         *.zip)           [ -d archive ] || mkdir archive           mkdir "archive/${i%.*}"           unzip -d "archive/${i%.*}" "./$i"           echo -e "\"$i\" extracted in $PWD/archive/${i%.*}" >> report.txt;;         *.*)           mkdir -p "${i##*.}"           mv -- "$i" "${i##*.}/"           echo -e "\"$i\" moved to $PWD/${i##*.}" >> report.txt;;         *)           tmp=$(TMPDIR=. mktemp -d)           mv -- "$i" "$tmp/"           mv -- "$tmp" "$i";;       esac     done     echo "Done in $SECONDS seconds!"     END=$(date +"%T")     echo "Start time: $START" >> report.txt     echo "End time: $END" >> report.txt


title: Launching Gentoo from external hard drive

text: I have an external hard drive (Transcend TS500GSJ25M - not sure M1, M2 or M3, but guess it's M1) and I'd like to install Gentoo on it. It's pretty easy, using genkernel, though it compile a lot of useless garbage and don't compile drivers necessary for my hardware. Using menuconfig I turned off almost all modules and turned on ones I need.   However, today I had to recompile kernel to add FUSE support and decided to turn off all unnecessary features like huge heap of special SCSI drivers. After building kernel system wouldn't mount root. Yes, I encountered such problems before I used genkernel. Yes, I mounting root by "root=LABEL=" and of course pass "--disklabel" to genkernel. The question is which modules do I need built-in in kernel to successfully mount external USB hard drive as root? I guess it's some of SCSI, USB and maybe EFI, but there is a lot of them, and it's not possible to get one by turning on, compile and trying to boot.


title: What should I do before dual-booting Windows 7 and Debian on EFI?

text: I'm about to purchase an Asus motherboard with EFI firmware and wanted to prepare myself for installing Windows and Debian once the hardware arrives. I was hoping that someone who has gone down this road could give me a few pointers. What preparations should I make before attempting to install Windows 7 and Debian on a new UEFI based system?


title: Is crontab related to server performance?

text: I am using Solaris 10, and I am adding many cronjobs to my server's crontab. Currently I have 30 cronjobs in my crontab. one cronjob takes **8 hours** to complete ,one other cron job takes **5 hours** to complete it and rest of them are ordinary cronjobs (max 30 mins they take) As it is a production server, I am worried about server's performance.   1. How are they related to the performance of my server?   2. Is there any upper limit for number of cronjobs?


title: ssh root@localhost error; help me hack this box :)

text: I need to gain a root shell on a linux vm for a security class. I have a user account on the system and a means to write to any file (i.e. /etc...) and want to escalate my privileges with:               ssh root@localhost      I used ssh-keygen to make rsa keys and added them to /root/.ssh/authorized_keys, and modified /etc/ssh/sshd_config to allow root connections. However, I cannot connect to the box as root. This is the output:               Last login: Fri Jan 27 00:43:01 2012 from localhost     Connection to localhost closed.      It seems to me that the authentication succeded, however the connection is closed immediately. I have no idea why this isn't working. Does anybody have any suggestions? Thanks, The verbose output is:               OpenSSH_4.6p1 Debian-7, OpenSSL 0.9.8g 19 Oct 2007     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: Applying options for *     debug1: Connecting to localhost [127.0.0.1] port 22.     debug1: Connection established.     debug1: identity file /home/user/.ssh/identity type -1     debug1: identity file /home/user/.ssh/id_rsa type 1     debug1: identity file /home/user/.ssh/id_dsa type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_4.6p1 Debian-7     debug1: match: OpenSSH_4.6p1 Debian-7 pat OpenSSH*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_4.6p1 Debian-7     debug1: SSH2_MSG_KEXINIT sent     debug1: SSH2_MSG_KEXINIT received     debug1: kex: server->client aes128-cbc hmac-md5 none     debug1: kex: client->server aes128-cbc hmac-md5 none     debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP     debug1: SSH2_MSG_KEX_DH_GEX_INIT sent     debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY     debug1: Host 'localhost' is known and matches the RSA host key.     debug1: Found key in /etc/ssh/ssh_known_hosts:2     debug1: ssh_rsa_verify: signature correct     debug1: SSH2_MSG_NEWKEYS sent     debug1: expecting SSH2_MSG_NEWKEYS     debug1: SSH2_MSG_NEWKEYS received     debug1: SSH2_MSG_SERVICE_REQUEST sent     debug1: SSH2_MSG_SERVICE_ACCEPT received     debug1: Authentications that can continue: publickey,password,hostbased     debug1: Next authentication method: publickey     debug1: Trying private key: /home/user/.ssh/identity     debug1: Offering public key: /home/user/.ssh/id_rsa     debug1: Server accepts key: pkalg ssh-rsa blen 277     debug1: read PEM private key done: type RSA     debug1: Authentication succeeded (publickey).     debug1: channel 0: new [client-session]     debug1: Entering interactive session.     debug1: Sending environment.     debug1: Sending command: /bin/bash     debug1: client_input_channel_req: channel 0 rtype exit-status reply 0     debug1: channel 0: free: client-session, nchannels 1     debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.0 seconds     debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0     debug1: Exit status 255


title: Cant update ICEauthority/unable to resolve debian host

text: I got a problem installing whonix gateway. It starts up fine but when I get to login it I get an error `Could not update ICEauthority file /home/user/ICEauthority`. When I run `whonixcheck -v` I get > Whonixcheck script could not determine if this is whonix_gateway or > whonix_workstation. Please report this bug. Looking for a solution for this I also found this error               sudo: unable to resolve host debian      Any ideas?


title: How to disable root user on OpenBSD?

text: So there is a desktop and root permission isn't needed on it (or if it's needed, then reboot to single mode/whateverlivecd fix a config file-> get root, do the stuff with it and at the end, disable again the root). There is no service on this machine (ex.: `sshd`), since it is a desktop. **My question: Does it bring more security if I disable the root user on a system?** (If yes, how to do it? Disable password for it? Modifying the default shell for root to `/sbin/nologin` in the `/etc/passwd` and `/etc/master.passwd` file doesn't helps, since after reboot the shell will be `ksh` for it. Nevertheless the ex.: passwd file still contains `/sbin/nologin`)


title: Change xscreensaver lock option command

text: How could I change the lock option for the `xscreensaver` from the command line?   Been looking around and couldn't find anything about it.   `xscreensaver-command -lock` will lock it right away, which is not what I'm looking for.   I'm using Fedora 14.


title: How to check if I can log in to server via ssh?

text: I have a list of servers:               cat list.txt     10.10.10.10 servera     10.11.10.10 serverb      How can I check that I can log in via ssh to them or not? I mean by default I should be able to log in via ssh key auth.., so in short, I need a solution that sorts the lines (servers) in the list.txt like this:   * servers that I can log in via ssh key   * servers that prompts for password (of course password is unknown..)   * servers that are unreachable


title: WD MyBook 3TB - Gparted failed & HDD partitions recovery?

text: I have this new WD MyBook external HDD (USB 3.0/2.0); I created 3 partitions all of them ext3 type (~1 TB | ~1 TB | ~750 GB) I loaded lots of files all the partitions were like ~30% full on each, and on all my systems had problems with the HDD (same problem) the disk was recognized, mounted and I can work with it for several minutes/hours but then the HDD got disconnected and sometimes reconnected automatically. So I grow tired of the above, but found no solution on the net nor my peers... so I figured out that one possibility was that the partitions were too large for my machines (all my systems are Linux and HW is 5 or more years old) thus I borrowed a new System 76 laptop and test the drive on it, this machine had no problems loading the disk's partitions, none at all, that was when I realize that the problem were the huge partitions I've created and that my systems were unable to handle so I pick `gparted` using this laptop and resize the first partition of 1 TB to half its size. The process took more than expected but finally `gparted` was on the last stage of the process,the last step was to ran `fsck` on both the new and the old partition, I wait two days but this process never completed, so I regretfully manually stop the process and this is where hell started. Now the disk is still recognized as an USB device:               kamino ~ # lsusb     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 001 Device 003: ID 0c45:63f1 Microdia Integrated Webcam     Bus 005 Device 019: ID 0a5c:5800 Broadcom Corp. BCM5880 Secure Applications Processor     Bus 002 Device 048: ID 1058:1130 Western Digital Technologies, Inc.      Bus 006 Device 009: ID 046d:c526 Logitech, Inc. Nano Receiver     kamino ~ #       But `fdisk` does not see anything connected nor `testdisk`... other than the machine's HDD. When the drive is connected, the following chunk of log is generated on `/var/log/messages`:               Jan 26 23:30:02 kamino kernel: [328391.764238] usb 2-2: new high speed USB device number 47 using ehci_hcd     Jan 26 23:30:02 kamino kernel: [328392.027254] hub 2-0:1.0: unable to enumerate USB device on port 2     Jan 26 23:30:04 kamino kernel: [328393.120042] usb 2-2: new high speed USB device number 48 using ehci_hcd     Jan 26 23:30:04 kamino kernel: [328393.823141] scsi85 : usb-storage 2-2:1.0     Jan 26 23:30:04 kamino mtp-probe: checking bus 2, device 48: "/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-2"     Jan 26 23:30:04 kamino mtp-probe: bus: 2, device: 48 was not an MTP device     Jan 26 23:30:07 kamino kernel: [328396.981177] scsi 85:0:0:0: Direct-Access     WD       My Book 1130     1012 PQ: 0 ANSI: 6     Jan 26 23:30:07 kamino kernel: [328396.981906] scsi 85:0:0:1: Enclosure         WD       SES Device       1012 PQ: 0 ANSI: 6     Jan 26 23:30:07 kamino kernel: [328396.982646] sd 85:0:0:0: Attached scsi generic sg2 type 0     Jan 26 23:30:07 kamino kernel: [328396.982726] ses 85:0:0:1: Attached Enclosure device     Jan 26 23:30:07 kamino kernel: [328396.982775] ses 85:0:0:1: Attached scsi generic sg3 type 13     Jan 26 23:30:07 kamino kernel: [328396.985520] ses 85:0:0:1: Failed to get diagnostic page 0x8000002     Jan 26 23:30:07 kamino kernel: [328396.985523] ses 85:0:0:1: Failed to bind enclosure -19     Jan 26 23:30:07 kamino kernel: [328396.988270] sd 85:0:0:0: [sdb] Test WP failed, assume Write Enabled     Jan 26 23:30:07 kamino kernel: [328396.989270] sd 85:0:0:0: [sdb] Asking for cache data failed     Jan 26 23:30:07 kamino kernel: [328396.989274] sd 85:0:0:0: [sdb] Assuming drive cache: write through     Jan 26 23:30:07 kamino kernel: [328396.993635] sd 85:0:0:0: [sdb] Test WP failed, assume Write Enabled     Jan 26 23:30:07 kamino kernel: [328396.995637] sd 85:0:0:0: [sdb] Asking for cache data failed     Jan 26 23:30:07 kamino kernel: [328396.995641] sd 85:0:0:0: [sdb] Assuming drive cache: write through     Jan 26 23:30:07 kamino kernel: [328396.995644] sd 85:0:0:0: [sdb] Attached SCSI disk     Jan 26 23:30:07 kamino ata_id[20922]: HDIO_GET_IDENTITY failed for '/dev/sdb'      And the information showed by `dmesg` is:               [328391.764238] usb 2-2: new high speed USB device number 47 using ehci_hcd     [328392.027254] hub 2-0:1.0: unable to enumerate USB device on port 2     [328393.120042] usb 2-2: new high speed USB device number 48 using ehci_hcd     [328393.823141] scsi85 : usb-storage 2-2:1.0     [328396.981177] scsi 85:0:0:0: Direct-Access     WD       My Book 1130     1012 PQ: 0 ANSI: 6     [328396.981906] scsi 85:0:0:1: Enclosure         WD       SES Device       1012 PQ: 0 ANSI: 6     [328396.982646] sd 85:0:0:0: Attached scsi generic sg2 type 0     [328396.982726] ses 85:0:0:1: Attached Enclosure device     [328396.982775] ses 85:0:0:1: Attached scsi generic sg3 type 13     [328396.985520] ses 85:0:0:1: Failed to get diagnostic page 0x8000002     [328396.985523] ses 85:0:0:1: Failed to bind enclosure -19     [328396.988270] sd 85:0:0:0: [sdb] Test WP failed, assume Write Enabled     [328396.989270] sd 85:0:0:0: [sdb] Asking for cache data failed     [328396.989274] sd 85:0:0:0: [sdb] Assuming drive cache: write through     [328396.993635] sd 85:0:0:0: [sdb] Test WP failed, assume Write Enabled     [328396.995637] sd 85:0:0:0: [sdb] Asking for cache data failed     [328396.995641] sd 85:0:0:0: [sdb] Assuming drive cache: write through     [328396.995644] sd 85:0:0:0: [sdb] Attached SCSI disk      I been looking information using all the keyword combinations on many search engines, forums, etc. without luck. If I fire up `gparted` it only sees the HDD of the system, when I fire up `Gnome Disk Utility` the disk is showed as an USB device and it seems that I can format it from there. An screenshoot of the `Gnome Disk Utility` can be found here: http://i.stack.imgur.com/n0HoR.png I would like to recover the information at least the information in the partitions that were not resized, is this possible? What are my options? Any help is much apreciated, thank you!


title: Unable to override the JAVA home in opensuse 13.1

text: What i did : made an entry in both ~/.bash_profile ~/.profile export JAVA_HOME=/usr/java/jdk1.7.0_51 export PATH=$PATH:/usr/java/jdk1.7.0_51/bin still system points to some openJDK installed by default Found by issuing **java-version** So what can be done in this case ?


title: Can I get "Permission denied" when running out of space?

text: I am running smrtanalysis software which is very demanding in terms of cpu, RAM and storage. After running for couple of hours, I got following error message:               IOError: [Errno 13] Permission denied: '/afs/bx.psu.edu/user/s/szr/smrtanalysis/tmpdir/tmpqNMh9s'      However, when I check the files, it seems that permissions are set OK (I am starting program as biomonika):               [biomonika@brubeck tmpdir]$ ls -l tmpqNMh9s     -rw-------  1 biomonika biomonika  639 Feb  6 01:13 tmpqNMh9s      Actually, tmpdir is full of similarly named folders and files created at very similar times. At the time of error, there were only 131 GB of free space left. I am wondering if "Permission denied" can mean something other than actually incorrectly set permissions, e.g. running out of space. However, the disk is "afs" which I don't have experience with - I am experienced only with use of chmod, hence the question.


title: ssh says: You don't exist, go away!

text: Sometimes when I try to ssh to a server I get the following message:               You don't exist, go away!      I haven't seen this before using `ssh`. What does this mean? Is there a problem with ssh or something else? Additional info:               ssh -q -i private_key root@192.168.0.11 "command"       The server is a SUSE Linux. I run the ssh command in a loop for 10 times and only 1 or 2 of the tries result in the Go away message.


title: Update manager returns error [Mint 15 Cinnamon]

text: Every time I try to install updates from the manager I get the following error:               dpkg: unrecoverable fatal error, aborting:     files list file for package 'libjpeg8:i386' is missing final newline     W: Waited for dpkg --assert-multi-arch but it wasn't there - dpkgGo (10: No child processes)     E: Sub-process /usr/bin/dpkg returned an error code (2)     A package failed to install. Trying to recover:      Don't know if it matters but installing new software and sudo apt-get update works fine.


title: Why does a user get prompted for password under AIX?

text: Users get prompted for password, and according to the `lsuser -f username` output:               expires=0     maxexpired=-1     maxage=13      users shouldn't be prompted for changing password. Why does he has a change password prompt when logging in? P.S.:   1. According to maxage+last password update, his password expired at:               Mon Sep 27 16:26:32 CEST 2010      but the `maxexpired=-1` should take care of this, and the user shouldn't be prompted to change the pasaword.   2.     oslevel -s     6100-02-02-0849


title: Does elementary OS use the standard AppIndicators?

text: I think about switching from Ubuntu, but I don't want to miss the AppIndicators.


title: How to copy an installed application to another computer that lacks the build tools?

text: On one computer I installed an application from source using `configure` `make` and `make install`. Now I want to install the same application on another computer that lacks gcc, make and all the other build tools. Both computers are running Kubuntu 12.04. How can I locate all the files to copy to the second computer? What other installation steps are needed? This is a command line app. I don't want to install build essentials on the 2nd computer. (It's a small laptop.)


title: Allowing an entire subnet on Ubuntu server 11.10

text: I am trying to allow all hosts in my subnet to connect to a server I have running in VirtualBox with ssh. I have tried several different methods so far, none of which have made any progress. What I want is to allow all hosts on my subnet to attempt to login without being blocked after an arbitrary number of failed attempts. (As of right now it takes 6 attempts for me to be blocked.) Every method I have found online so far has not worked. Many of them are very similar but I tried them anyway. None of them worked. I am using a NAT network setting. I have port forwarding already set up. What i need to be able to do is allow a user, whether valid or not, to attempt to login as many times as they wish without blocking the IP they are attempting to login from. When I attempt to login to my virtual system from my host system the IP that gets blocked is 10.0.2.2 When I run ifconfig the ip address that shows is 10.0.2.15/24 I have tried these different methods: For the /etc/hosts.allow file I have tried               sshd: 10.0.2.     ALL: 10.0.2.     sshd:10.0.2.2     sshd: ALL: 10.0.2.15/24     sshd: 10.0.2.15/24 :ALLOW      For the /etc/hosts.deny file I have tried               ALL: ALL     sshd: ALL      Can anyone explain to me how to get this to work? Every method I have tried above still blocks me after 6 failed attempts Any help, tips, or suggestions will be greatly appreciated!


title: How to close (kill) ssh ControlMaster connections manually

text: With the following `.ssh/config` configuration:               ControlMaster auto     ControlPath /tmp/ssh_mux_%h_%p_%r     ControlPersist 4h      How to close the persisting connection before the 4 hours? I know you can make new connections, but how to close them (all)? Maybe there is a way to show all the persisted connections and handle them individually but I can not find it.


title: `Pacman` rollback or fixing a disappeared KDE taskbar?

text: I upgraded my ArchLinux installation yesterday and one of the packages affected was KDE. After restarting, the taskbar has disappeared and I have found no way to make it reappear. Is there a mirror with older packages (to rollback) or a way to fix the problem?


title: Understanding the output of apt-cache depends and apt-cache showpkg

text: I'm using `Lubuntu 13.10` which doesn't include `gedit` by default. But I have installed it using               sudo apt-get install --no-install-recommends gedit      Now, when I run `apt-cache depends gedit`, `zenity` and `yelp` are among `recommends`. But when I run `apt-cache showpkg gedit`, `zenity` and `yelp` are under `Dependencies` (third line from bottom in the code below).               Dependencies:      3.8.3-0ubuntu3 - libatk1.0-0 (2 1.12.4) libc6 (2 2.14)     libcairo2 (2 1.2.4) libenchant1c2a (2 1.6.0)     libgdk-pixbuf2.0-0 (2 2.22.0) libgirepository-1.0-1 (2 0.9.3)      libglib2.0-0 (2 2.37.3) libgtk-3-0 (2 3.7.10)     libgtksourceview-3.0-1 (2 3.2.0) libpango-1.0-0 (2 1.14.0)     libpeas-1.0-0 (2 1.1.0) libx11-6 (0 (null)) libxml2 (2 2.7.4)     libzeitgeist-2.0-0 (2 0.9.9) gedit-common (2 3.8)     gedit-common (3 3.9) gsettings-desktop-schemas (0 (null))     python3-gi (2 3.0) python-gi-cairo (2 3.0)      gir1.2-peas-1.0 (0 (null)) iso-codes (0 (null))      gedit-plugins (0 (null)) zenity (0 (null)) yelp (0 (null))      gedit-plugins (3 2.91) gedit-plugins:i386 (3 2.91)      gedit:i386 (0 (null))       Why is that? Is the output of `apt-cache depends` and `apt-cache showpkg` influenced by software already present on my system and by whether I use `\--no-install recommends`? And what does `(0 (null))` mean? What I'm seeing is with a fully updated system. In other words, I have run `sudo apt-get update && sudo apt-get dist-upgrade` and then tried the `apt- cache` commands.


title: Can't get tc to limit network traffic

text: Based on this section of the Linux Advanced Routing & Traffic Control HOWTO, I can't get `tc` to limit the network speed in my computer. Basically, I have 13 machines in the network, and this particular machine sometimes steals all traffic available. The router is a Motorola SurfBoard modem with a few routing capabilities and firewall. The machine I want to limit the traffic is _192.168.0.5_ , and also the script is being run from _192.168.0.5_. Here is my adaption of the commands on the link above for `/etc/NetworkManager/dispatcher.d/`:               #!/bin/sh -eu          # clear any previous queuing disciplines (qdisc)     tc qdisc del dev wlan0 root 2>/dev/null ||:          # add a cbq qdisc; see `man tc-cbq' for details     if [ $2 = up ]; then         # set to a 3mbit interface for more precise calculations         tc qdisc add dev wlan0 root handle 1: cbq avpkt 1000  \             bandwidth 3mbit              # leave 30KB (240kbps) to other machines in the network         tc class add dev wlan0 parent 1: classid 1:1 cbq      \             rate 2832kbit allot 1500 prio 5 bounded isolated              # redirect all traffic on 192.168.0.5 to the previous class         tc filter add dev wlan0 parent 1: protocol ip prio 16 \             u32 match ip dst 192.168.0.5 flowid 1:1              # change the hashing algorithm every 10s to avoid collisions         tc qdisc add dev wlan0 parent 1:1 sfq perturb 10     fi      The problem is that I have tried setting _2832kbit_ to very small values for testing (like _16kbit_ ), but I still can browse the web at high speed. The problem is not in `NetworkManager`, because I'm testing the script manually. **EDIT:** I have found that by changing `dst 192.168.0.5` to `src 192.168.0.5`, the upload speed is reliably limited, but I still haven't figured how to get the download speed to work, which is the most important for me.


title: Combining sed statements

text: Let's say my input file looks like:               ID1     1    5     6    8     ID2     1    4     5    7      I'm trying to formulate a loop that can combine these actions:   * If the line begins with a letter: keep the '\ n' after the field   * If the line begins with a number: replace every '\ t' and '\ n' with a comma ( `sed 's / \ t /, / g; s / \ n /, / g '` ) EXCEPT if the next line begins with a letter ( `sed 's / \ t /, / g'` ) Expected output:               ID1          1, 5, 6, 8     ID2          1, 4, 5, 7


title: Webmin setup on CentOS 6.3

text: I installed Webmin (based on Installing the RPM) for CentOS 6.3 running on virtual box. The package was installed successfully but when I open home.centos:10000 it doesn't open up. My internet is fine. I have opened ports of `iptables` but not working. Also tried as given on Webmin website and did `iptables` file entries for firewall but still not opening up via my web browser.


title: How do I use an If-Else query based on the day of the week?

text: Problem: I need to check if today is Thursday and perform different actions based on the result of this condition. I tried two different approaches: ### Getting the Day Name:               DAYOFWEEK=$(date +"%a")     echo DAYOFWEEK: $DAYOFWEEK     if ["$DAYOFWEEK" == "Thu"];      then           echo YES     else         echo NO     fi      ### Getting the Day Num:               DAYOFWEEK=$(date +"%u")     echo DAYOFWEEK: $DAYOFWEEK          if ["$DAYOFWEEK" == 4];      then        echo YES     else        echo NO     fi      In both cases, the output is NO, even though it should be YES. What is wrong?


title: Which packages contain IPsec implementations and algorithms that use it for encryption?

text: Which package contains the implementation of IPsec and which package contains the implementation of encryption algorithms that IPsec uses for encryption? I need to use custom crytographic algorithms in IPsec, so I need to edit the implementations of these packages.


title: Where does Cinnamon store its Desktop Art settings?

text: Running Linux Mint 16 right now, Cinnamon 64-bit. I'm trying to find out where Cinnamon stores my desktop settings. Precisely looking for where the desktop image settings are stored and want to figure out how to manipulate it via the command line for a bash script I've written. tl;dr: can I change cinnamon's desktop image from the command line? Any clues or tips?


title: MySQL: Tab-completion not working

text: Tab completion in mysql is not working. I tried to start mysql with               mysql --auto-rehash      but it didn't work either. I also tried               mysql> \#      but autocompletion refuses to complete my commands. Does anyone know the reason?


title: Script to su -c into a screen is not working as intended

text: I'm working on a script that will allow me to load up a screen from a user via sudo and su -c. However, when I use it, it will just show the shell of the user:               sudo su -c "script /dev/null; screen -r $2" $1      Forgive me if this is something relatively stupid, I am new to batch scripting. As it stands, it executes /dev/null (used to make accessing the screen in su possible).. but doesn't connect to the screen. I'm sure that the screen name is accurate and so is the user I am logging in as.


title: Extracting n characters from a test line

text: How can I extract the 6 characters after Z in the following text line and put it into a file using grep, egrep, sed or awk? B1_Site4_5aT4ZNHN691AQSB6B65_KYEC_SLT_2013-11-24-00-30_935985e7_100m_PASS1.tar


title: How can I create an encrypted, file-system–agnostic, mountable volume?

text: At work, we have an iMac (running OS X) that shares a partitioned hard drive over the network. I'd like to back up to my partition from my Linux machine. I've attempted connecting via cifs, then attempted to back up using backintime onto an encfs-encrypted volume. This throws up a whole lot of errors, and I assume that it is because cifs is unhappy with hard-links and other unix wizardry. I seem to remember on OS X that you can create monolithic, encrypted disk images that you could then mount as a "local" (and hence file-system–agnostic) volume. This seems ideal. Hence, I'd connect to the remote volume via cifs, then "locally" mount the encrypted volume as ext4. Is there an equivalent in Linux?


title: Udev rules involving X11 don't run on startup

text: I have some udev rules written to run when I connect certain usb devices. For example, I change pointer velocity for certain mice, and change xmodmaps for particular keyboards. The scripts work well when connecting the devices when the computer is on, and also work while connecting them while the computer is suspended. However, these udev rules appear not to fire if the device is plugged in _before_ I boot up or log in. Is there a way to make them run on startup? I'm using (K)ubuntu 13.04. Here are some examples of my udev rules and scripts. `/etc/udev/rules.d/00-teck.rules`:               ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0e6a", ATTR{idProduct}=="030c", RUN+="/usr/local/bin/TECK_connect"     ACTION=="remove", SUBSYSTEM=="usb", RUN+="/usr/local/bin/TECK_disconnect"      `/usr/local/bin/TECK_connect`:               #!/usr/bin/env bash          export DISPLAY=:0.0     cp -f /home/sparhawk/HDD/Computer/Xmodmaps/Xmodmap_for_TECK /home/sparhawk/.Xmodmap     sudo -u sparhawk setxkbmap -layout us -variant altgr-intl     sudo -u sparhawk xmodmap /home/sparhawk/.Xmodmap     sudo -u sparhawk pkill xcape     sudo -u sparhawk xcape -e 'Alt_L=Return' && sudo -u sparhawk notify-send "xmodmap" "TECK connected." -i /usr/share/icons/oxygen/48x48/devices/input-keyboard.png --hint=int:transient:1      `/etc/udev/rules.d/90-razerwakeup-slowdown.rules`:               ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="1532", ATTRS{idProduct}=="0016" RUN+="/bin/sh -c 'echo $env{DEVPATH} | grep -q usb./[^/]*/[^/]*/[^/]*$ && echo enabled > /sys$env{DEVPATH}/../power/wakeup; razer_slowdown'"      `/usr/local/bin/razer_slowdown`:               #!/usr/bin/env bash     # slow down the tracking speed of a razer mouse.     # to check, $ xinput --list-props "Razer Razer DeathAdder"| grep 'Constant Deceleration'     # which was originally 1          scriptproper () {             sleep 0.5 # perhaps not necessary, but putting it in background is.             export DISPLAY=:0.0             sudo -u sparhawk xinput --set-prop "Razer Razer DeathAdder" "Device Accel Constant Deceleration" 3     }          scriptproper &


title: Convert ps to pdf by ps2pdf, but the pdf file is not well-behaved

text: I have a ps file,and converted it to a pdf file using ps2pdf. > ps2pdf elden.ps elden.pdf When I open the pdf file in evince, and try to select some text in it using my mouse, the selected content is not the text but some incomprehensible symbols, and also it cost a lot of memory for opening the ps and pdf files and a lot of CPU time for selecting. I was wondering how to convert the ps to a pdf file whose text can be selected and copied, and without much memory and cpu time?


title: How can I set device rw permissions permanetnly on raspbian?

text: Im using Raspbian (distribution made for Raspberry Pi based on Debian). I have some scripts that use i2c. Normally only root has read and write permissions for i2c. Im using this command to add i2c r/w permissions for normal user:               # chmod a+rw /dev/i2c-*      however after reboot devices have default permissions. What is **best way** to make my i2c available for r/w for normal user permanently? Is there more "elegant" way than adding to init.d custom script that runs command below after my Raspberry Pi boot?


title: How can I load Debian onto a USB stick on Windows

text: I have read the Debian documentation, specifically http://wiki.debian.org/BootUsb and http://www.debian.org/CD/faq/#write-usb but they do not provide info on how to do it on Windows. So, how can I write a Debian image to a USD stick on Windows? Thanks in advance!


title: Having an rsync job complete after closing SSH connection

text: I am transferring a large amount of files from one computer to another using `rsync`. I am doing this by SSHing into the source computer and executing a command like this: `sudo rsync ssh --rsync-path="sudo rsync" source_dir user@host.com:dest_dir`. Even if I add `nohup` before this command, whenever I close out the terminal window from which I SSHed, the connection closes. How can I have it so that my file transfer still continues when I close my SSH connection?


title: LXDE customize main menu add SEARCH BOX like in KDE Kickoff or Windows 7/Vista

text: When you open the main menu in say MS Windows (7/Vista) you can quickly search for any item (apps/docs etc.) the same in Ubuntu (Dash), Kubuntu (Kickoff menu). Is there any easy way to add such a search input which can filter apps (at least just apps no need for docs) in LXDE's main menu? I Google'd a lot with no success, that's why I'm here. I am a technical person so if you can give even more low level guide's would help (may be I should create some widget custom panel etc.)


title: Grub won't boot Arch Linux

text: **Notice:** This is not about dual booting, I can setup GRUB to dual boot with Windows 7 later. I just need to be able to get into Arch Linux. Last night I installed Arch onto my computer via netinstall and it all went smoothly, but when I went to reboot... it loaded up the GRUB menu and it listed Arch Linux, but when I select it, I get "Error 15: File not found." I've been googling and trying various way to fix this problem but I always get the same error. Some info about my partitions:   * `/dev/sda`:     1. Windows 7 System Reserved     2. Windows 7   * `/dev/sdb`:     1. Data (Movies, Music, etc..)   * `/dev/sdc`:     1. Separate Boot Partition     2. Swap     3. Separate Home Partition     4. Root   * `/dev/sdd`:     1. Pendrive The followings are outputs of various programs and contents of various files.               ubuntu@ubuntu:~$ sudo blkid     /dev/loop0: TYPE="squashfs"      /dev/sdb1: LABEL="Stuff" UUID="72D6355E32F06BD5" TYPE="ntfs"      /dev/sda1: LABEL="System Reserved" UUID="A8F8AC7FF8AC4CFE" TYPE="ntfs"      /dev/sda2: UUID="2A20B02620AFF6CB" TYPE="ntfs"      /dev/sdc1: UUID="2a23abcf-b29f-4119-b406-0b1817e5c8e1" TYPE="ext2"      /dev/sdc2: UUID="f3d9ce0d-5953-4f4e-885a-4cd2ebf6b6e9" TYPE="swap"      /dev/sdc3: UUID="2a53bdc8-7a9a-4dd2-9aef-5b7b4c3e74a4" TYPE="ext4"      /dev/sdc4: UUID="7b4faa93-98db-49e3-ad41-92e9dc60deda" TYPE="ext4"      /dev/sdd1: LABEL="PENDRIVE" UUID="0290-E580" TYPE="vfat"       `menu.lst`               timeout   5     default   0     color     light-blue/black light-cyan/blue          #===--- Arch Linux     title  Arch Linux     root   (hd2,0)     kernel /vmlinuz26 root=/dev/disk/by-uuid/2a53bdc8-7a9a-4dd2-9aef-5b7b4c3e74a4 ro vga=775     initrd /kernel26.img          #===--- Arch Linux Fallback     title  Arch Linux Fallback     root   (hd2,0)     kernel /vmlinuz26 root=/dev/disk/by-uuid/2a53bdc8-7a9a-4dd2-9aef-5b7b4c3e74a4 ro vga=775     initrd /kernel26-fallback.img          #===--- Windows 7     title         Windows 7     rootnoverify  (hd0,0)     chainloader   +1      `fstab`               #      # /etc/fstab: static file system information     #     # <file system>        <dir>         <type>    <options>          <dump> <pass>     devpts                 /dev/pts      devpts    defaults            0      0     shm                    /dev/shm      tmpfs     nodev,nosuid        0      0     /dev/sdc1              /boot         ext2      defaults            0      1     /dev/sdc2              /             ext4      defaults            0      1     /dev/sdc3              /home         ext4      defaults            0      1     /dev/sdc4              swap          swap      defaults            0      1


title: Extracting nested zip files

text: I have numerous zip archives, each of which contains a number of zip archives. What is the best way to recursively extract all files contained within this zip archive and its child zip archives, that aren't zip archives themselves?


title: Find bootloader

text: Out of curiosity, Is it possible to find out which bootloader was used to start a given system? Was the system booted by GRUB, Lilo or any other boot loader? I'm guessing there must exist some `/sys` or `/proc` variable for the same? EDIT: > Boot Info Summary: => Lilo is installed in the MBR of /dev/sda > > sda1: **_______________________________________________________________** >   >   >     File system:   >     Boot sector type:  Unknown >     Boot sector info: >     Mounting failed: mount: unknown filesystem type '' >   `/dev/sda` is the only device I have to boot with. I wonder, if there is no known file system on only available single partition then how it manage to boot ?


title: Boot resolution change in initramfs on laptop monitor and HDMI monitor

text: I have Linux Mint 17 on my laptop. Also I have 22'' monitor connected to laptop using HDMI cable. My disk if fully encrypted with LUKS and LVM. On boot I get graphical prompt to enter password for encrypted partitions. Screen resolution on on both laptop and external monitor is wrong when asking for password. Graphical prompt and linux mint logo is moved to top left corner on both monitors and rest of space is black. Resolution is correct only after I log in to my profile. This is what `xrandr` shows when I'm logged in:               Screen 0: minimum 320 x 200, current 3286 x 1080, maximum 32767 x 32767     LVDS1 connected 1366x768+1920+312 (normal left inverted right x axis y axis) 344mm x 194mm        1366x768       60.1*+   40.1        1360x768       59.8     60.0        1024x768       60.0        800x600        60.3     56.2        640x480        59.9     VGA1 disconnected (normal left inverted right x axis y axis)     HDMI1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 531mm x 298mm        1920x1080      60.0*+        1680x1050      59.9        1600x900       60.0        1280x1024      75.0     60.0        1280x800       59.9        1152x864       75.0        1280x720       60.0        1024x768       75.1     60.0        832x624        74.6        800x600        75.0     60.3        640x480        75.0     60.0        720x400        70.1     DP1 disconnected (normal left inverted right x axis y axis)     VIRTUAL1 disconnected (normal left inverted right x axis y axis)      After mounting encrypted disk I can change resolution on monitors using `xrandr` command. But this command is unavailable with `initramfs`. I was recently fixing another laptop screen brightness on boot using `initramfs` script and it worked. This script was setting brightness by echoing correct value to to `/sys/class/backlight/acpi_video0/brightness`. Can I also use something similar to change screen resolution somehow? **UPDATE** I've tried @mikeserv solution:   1. EDID files from monitors (not sure if they are correct):              # cat /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/edid > /lib/firmware/edid/1366x768.bin     # cat /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-1/edid > /lib/firmware/edid/1920x1080.bin          # hexdump /lib/firmware/edid/1366x768.bin     0000000 ff00 ffff ffff 00ff e430 033b 0000 0000     0000010 1600 0401 2290 7813 610a 9ed5 5b5e 269a     0000020 501a 0054 0000 0101 0101 0101 0101 0101     0000030 0101 0101 0101 1de2 b456 0050 3038 3024     0000040 0035 c258 0010 1900 13ec c656 0050 302e     0000050 3024 0035 c258 0010 1900 0000 fe00 3500     0000060 4833 3935 3180 3635 4857 0a34 0000 0000     0000070 0000 3141 0096 0000 0100 0a01 2020 ac00     0000080          # hexdump /lib/firmware/edid/1920x1080.bin      0000000 ff00 ffff ffff 00ff d109 78a5 5445 0000     0000010 1626 0301 3580 781e b72e a4d5 5456 279f     0000020 500c a554 806b 0081 c081 8081 c0a9 00b3     0000030 c0d1 0101 0101 3a02 1880 3871 402d 2c58     0000040 0045 2a13 0021 1e00 0000 ff00 4c00 4339     0000050 3030 3537 3039 3931 200a 0000 fd00 3200     0000060 1e4c 1153 0a00 2020 2020 2020 0000 fc00     0000070 4200 6e65 2051 4c47 3432 3035 200a d900     0000080        2. Hook script for initramfs, loads `i915` module and include `EDID` files into `/lib/firmware/edid/` directory inside `initramfs` (I've checked and `EDID` files are inside initramfs)              # cat /etc/initramfs-tools/hooks/include-edid-data      #!/bin/sh          PREREQ="udev"     prereqs()     {        echo "$PREREQ"     }          case $1 in     prereqs)        prereqs        exit 0        ;;     esac          . /usr/share/initramfs-tools/hook-functions     # Begin real processing below this line          if [ ! -e "${DESTDIR}/lib/firmware/edid" ]; then         mkdir -p "${DESTDIR}/lib/firmware/edid"     fi          if [ -r "/lib/firmware/edid/1366x768.bin" ]; then        cp "/lib/firmware/edid/1366x768.bin" "${DESTDIR}/lib/firmware/edid/"     fi          if [ -r "/lib/firmware/edid/1920x1080.bin" ]; then        cp "/lib/firmware/edid/1920x1080.bin" "${DESTDIR}/lib/firmware/edid/"     fi          manual_add_modules i915          exit 0          # chmod a+rx /etc/initramfs-tools/hooks/include-edid-data     # update-initramfs -u        3. On reboot I've added boot parameter (not sure if it should be HDMI-1 or HDMI1 or something else)              drm_kms_helper.edid_firmware=HDMI1:/lib/firmware/edid/1920x1080.bin        4. It didn't change anything. So I also tried:              drm_kms_helper.edid_firmware=HDMI-1:/lib/firmware/edid/1920x1080.bin     drm_kms_helper.edid_firmware=HDMI1:edid/1920x1080.bin     drm_kms_helper.edid_firmware=HDMI-1:edid/1920x1080.bin      No luck at all. Everything is like it was before I took steps from above. I also want to add that when HDMI monitor id disconnected resolution on laptop monitor is correct. What am I doing wrong? **UPDATE 2** Still not working. Steps I took:   1. Found out correct names for my monitors:              $ for p in /sys/class/drm/*/status; do if [ "$(cat "$p")" == "connected" ]; then echo -n "$p" | awk -F '/' '{print $5}'; fi; done     card0-HDMI-A-1     card0-LVDS-1        2. Install `linux-doc` (to get docs describing creation of custom `EDID`), `dos2unix`, `make` (for compiling `EDID` files) packages              $ sudo apt-get install linux-doc dos2unix make        3. Create temporary directory for compilation and copy source files for `EDID`              $ mkdir ~/Tmp/edid     $ cd ~/Tmp/edid     $ cp /usr/share/doc/linux-doc/EDID/* .     $ rm *.S     $ cp /usr/share/doc/linux-doc/EDID/1920x1080.S .     $ cp /usr/share/doc/linux-doc/EDID/1920x1080.S 1366x768.S        4. Edit file `1366x768.S` with correct values, compile, copy to `/lib/firmware/edid`:     * Obtain current working modeline for my laptop screen                          $ xvidtune -show         "1366x768"     76.50   1366 1402 1450 1546    768  771  776  824 -hsync -vsync          They are in turn: `resolution`, `clock MHz`, `hdisp`, `hsyncstart`, `hsyncend`, `htotal`, `vdisp`, `vsyncstart`, `vsyncend`, `vtotal`     * Calculate values:                          CLOCK = 76500         XPIX    = hdisp                               = 1366         XBLANK  = htotal - hdisp        = 1546 - 1366 = 180         XOFFSET = hsyncstart - hdisp    = 1402 - 1366 = 36         XPULSE  = hsyncend - hsyncstart = 1450 - 1402 = 48                  YPIX    = vdisp = 768         YBLANK  = vtotal - vdisp             = 824 - 768      = 56         YOFFSET = 63 + vsyncstart - vdisp    = 63 + 771 - 768 = 66         YPULSE  = 63 + vsyncend - vsyncstart = 63 + 776 - 771 = 68                  TIMING_NAME "Linux HDR"         CRC 0xcd              * Final version `1366x768.S`:                           $ cat 1366x768.S         /* EDID */         #define VERSION 1         #define REVISION 3                  /* Display */         #define CLOCK 76500 /* kHz */         #define XPIX 1366         #define YPIX 768         #define XY_RATIO XY_RATIO_16_9         #define XBLANK 180         #define YBLANK 56         #define XOFFSET 36         #define XPULSE 48         #define YOFFSET 66         #define YPULSE 68         #define DPI 96         #define VFREQ 60 /* Hz */         #define TIMING_NAME "Linux HDR"         #define ESTABLISHED_TIMINGS_BITS 0x00 /* none */         #define HSYNC_POL 1         #define VSYNC_POL 1         #define CRC 0xcd                  #include "edid.S"              * Compile files and check if no errors using `edid-decode` (`sudo apt-get install edid-decode`):                          $ make clean && make         rm 1920x1080.o 1366x768.o                  $ ls -1 *.bin         1366x768.bin         1920x1080.bin                  $ edid-decode 1366x768.bin         Extracted contents:         header:          00 ff ff ff ff ff ff 00         serial number:   31 d8 00 00 00 00 00 00 05 16         version:         01 03         basic params:    6d 23 14 78 ea         chroma info:     5e c0 a4 59 4a 98 25 20 50 54         established:     00 00 00         standard:        8b c0 01 01 01 01 01 01 01 01 01 01 01 01 01 01         descriptor 1:    e2 1d 56 b4 50 00 38 30 24 30 35 00 63 c8 10 00 00 1e         descriptor 2:    00 00 00 ff 00 4c 69 6e 75 78 20 23 30 0a 20 20 20 20         descriptor 3:    00 00 00 fd 00 3b 3d 30 32 08 00 0a 20 20 20 20 20 20         descriptor 4:    00 00 00 fc 00 4c 69 6e 75 78 20 48 44 52 0a 20 20 20         extensions:      00         checksum:        cd                  Manufacturer: LNX Model 0 Serial Number 0         Made week 5 of 2012         EDID version: 1.3         Analog display, Input voltage level: 0.7/0.7 V         Sync: Separate Composite Serration          Maximum image size: 35 cm x 20 cm         Gamma: 2.20         DPMS levels: Standby Suspend Off         RGB color display         First detailed timing is preferred timing         Established timings supported:         Standard timings supported:           1360x816@60Hz         Detailed mode: Clock 76.500 MHz, 355 mm x 200 mm                        1366 1402 1450 1546 hborder 0                         768  771  776  824 vborder 0                        +hsync +vsync         Serial number: Linux #0             Monitor ranges: 59-61HZ vertical, 48-50kHz horizontal, max dotclock 80MHz         Monitor name: Linux HDR            Checksum: 0xcd                  $ edid-decode 1920x1080.bin         Extracted contents:         header:          00 ff ff ff ff ff ff 00         serial number:   31 d8 00 00 00 00 00 00 05 16         version:         01 03         basic params:    6d 32 1c 78 ea         chroma info:     5e c0 a4 59 4a 98 25 20 50 54         established:     00 00 00         standard:        d1 c0 01 01 01 01 01 01 01 01 01 01 01 01 01 01         descriptor 1:    02 3a 80 18 71 38 2d 40 58 2c 45 00 f4 19 11 00 00 1e         descriptor 2:    00 00 00 ff 00 4c 69 6e 75 78 20 23 30 0a 20 20 20 20         descriptor 3:    00 00 00 fd 00 3b 3d 42 44 0f 00 0a 20 20 20 20 20 20         descriptor 4:    00 00 00 fc 00 4c 69 6e 75 78 20 46 48 44 0a 20 20 20         extensions:      00         checksum:        05                  Manufacturer: LNX Model 0 Serial Number 0         Made week 5 of 2012         EDID version: 1.3         Analog display, Input voltage level: 0.7/0.7 V         Sync: Separate Composite Serration          Maximum image size: 50 cm x 28 cm         Gamma: 2.20         DPMS levels: Standby Suspend Off         RGB color display         First detailed timing is preferred timing         Established timings supported:         Standard timings supported:           1920x1152@60Hz         Detailed mode: Clock 148.500 MHz, 500 mm x 281 mm                        1920 2008 2052 2200 hborder 0                        1080 1084 1089 1125 vborder 0                        +hsync +vsync         Serial number: Linux #0             Monitor ranges: 59-61HZ vertical, 66-68kHz horizontal, max dotclock 150MHz         Monitor name: Linux FHD            Checksum: 0x5              * Copy files to `/lib/firmware/edid`                          $ sudo cp *.bin /lib/firmware/edid            5. Update `initramfs`, hook script should add edid files (they are there, I've checked)              $ sudo update-initramfs -u        6. On boot, edit grub command line (pressed shift on boot to show grub menu and after press `e`) from:              linux   /vmlinuz-3.13.0-24-generic root=/dev/mapper/mint--vg-root ro   quiet splash $vt_handoff      to              linux   /vmlinuz-3.13.0-24-generic root=/dev/mapper/mint--vg-root ro   quiet splash $vt_handoff drm_kms_helper.edid_firmware=card0-LVDS-1:/lib/firmware/edid/1366x768.bin drm_kms_helper.edid_firmware=card0-HDMI-A-1:/lib/firmware/edid/1920x1080.bin      Also I've tried setting it just for one monitor. But no luck at all. I'm starting to think that it is not a problem with resolution but with plymouth image itself. When I see boot image it is not blurred, stretched or anything and Linux mint logo is sharp and clear. It's just smaller than my screen and placed in left top part of my laptop and HDMI screen. I've found this bug that is really similar to my problem. So I think I must wait for them to fix this.


title: Recursively compare directory contents by name, ignoring file extensions

text: I have a directory containing about 7,000 music files. I used lame to recursively re-encode all files in it to a separate directory, outputting all files with the same relative path and file name. The output files have a .mp3 extension, but some of the input files had different extensions (.wma, .aac, etc). I can see that there is a file count difference of ~100 files missing in the output directory. What I want to do is run a compare of the two directories and obtain a list of the files that exist in the source, but not in the destination. This would be simple enough except I need to ignore differences in file extension. I've tried using rsync with dry-run turned on but I couldn't figure out a way to ignore file extensions. I've also tried diff but was unable to find an option to only check by name but ignore file extensions. I started thinking I could just do a recursive ls on both directories, remove the file extensions, and then compare the outputs, but I really have no idea on where to start with modifying the ls output using sed or awk since I'm a compete noob with those.


title: Log4j File Location

text: I have a Webapp running on an Amazon EC2 Linux AMI. I've been trying to configure my Log4J file for logging but haven't been able to figure out where the logs are getting created. This is my log4j config:               log4j.rootCategory=DEBUG, FILE     log4j.rootLogger=DEBUG, FILE          # Configure a rolling file appender     log4j.appender.FILE=org.apache.log4j.RollingFileAppender     log4j.appender.FILE.File=/home/ec2-user/trelta/logs/trelta.log     log4j.appender.FILE.MaxFileSize=5MB     log4j.appender.FILE.MaxBackupIndex=10     log4j.appender.FILE.layout=org.apache.log4j.PatternLayout     log4j.appender.FILE.layout.ConversionPattern=%p %d %t %c - %m%n          #log4j.appender.FILE.org.hibernate=DEBUG     log4j.appender.FILE.org.hibernate.SQL=DEBUG     log4j.appender.FILE.org.hibernate.type=DEBUG     log4j.appender.FILE.org.hibernate.tool.hbm2ddl=warn     log4j.appender.FILE.org.hibernate.jdbc=debug          ### log JDBC resource acquisition     #log4j.appender.FILE.org.hibernate.jdbc=debug          ### enable the following line if you want to track down connection ###     ### leakages when using DriverManagerConnectionProvider ###     #log4j.appender.FILE.org.hibernate.connection.DriverManagerConnectionProvider=trace          #Logging for spring framework     log4j.appender.FILE.org.springframework=DEBUG          #Logging for jackson library     log4j.appender.FILE.org.codehaus.jackson = INFO      My user is ec2-user. Tomcat is running as a service and shows the user who started tomcat is tomcat. So, where is my log file?


title: GNU Screen: Strange TERMCAP when using -d -m

text: Depending on how I run `screen`, it either does or does not have the right TERMCAP info. The symptom of this is that colors don't always show up in my terminal correctly (eg: ls, vim syntax highlighting, etc). This works fine:               $ echo $TERMCAP       <empty output>     $ screen -S foo     $ screen -r foo       <now I'm inside a screen session>     $ echo $TERMCAP       <long output>     $ ls       <nice pretty colors>      This has problems:               $ echo $TERMCAP       <empty output>     $ screen -d -m -S foo     $ screen -r foo       <now I'm inside a screen session>     $ echo $TERMCAP       <long output, but different than before>     $ ls       <no colors ):>      Now, I can work around this. I can fiddle with my TERMCAP manually, etc. But I'd really like to understand what's going on. I'd like to find a 'clean' solution, if possible. Does anybody know what's going on here? What difference should it make if I use `-d -m` when running `screen`? This is on FreeBSD, if that matters.


title: How do I set an environment variable for sudo in MacOS?

text: I have installed ServiceMix on my machine, and am trying to start it. The startup script is called start.sh. When I did `./start.sh`, it gave me a Permission Denied message. So I used `sudo ./start.sh`, which starts the server fine. However, it seems to be using Java 7, when I would like to use Java 6 (for various reasons). I looked through the start.sh script and found that it uses the `JAVA_HOME` variable. So I set my JAVA_HOME to the JDK 6 directory. However, ServiceMix still uses Java 7. A Google search revealed that when a command is run with sudo, sudo removes certain environment variables. So I did `sudo -E ./start.sh`. Again, it used JDK 7. I opened the start.sh and added a line, `echo $JAVA_HOME` to see whether the variable is set properly or not. The output of `echo` was an empty line. I tried modifying the /etc/sudoers file to include `Defaults env_keep += "JAVA_HOME"`. Executing start.sh now tells me that my echo statement is again an empty line. ServiceMix still uses JDK 7. I tried setting JAVA_HOME in `/etc/profile`. Executing start.sh now tells me that my echo statement is again an empty line. Again, ServiceMix uses JDK 7. What mistake am I doing here? FWIW, am on Mac OS X 10.8.2. `echo $SHELL` on my terminal returns /bin/bash. When I use `sudo su` and fire `echo $SHELL`, it returns /bin/sh.


title: Change Google Chrome Flash Plugin

text: I just installed Google Chrome, on Linux Mint 14 64-bit, and the Flash plugin's sound doesn't work. I navigated to **chrome://flash** and received the following info:               Google Chrome   25.0.1364.160 ()     OS  Linux     Flash plugin    11.6.602.171     /opt/google/chrome/PepperFlash/libpepflashplayer.so     Flash plugin    11.2 r202        /opt/mint-flashplugin-11/libflashplayer.so (not used)      I have Mozilla Firefox as well, which is using the Linux Mint provided flash plugin and there are no problems. As you can see the plugin provided by mint isn't being used, how do I switch to that one?


title: Why does Linux have a C compiler by default?

text: Why does a Linux distribution have gcc installed in advance? Is it because most of the applications in linux are written in C? What would happen if the gcc directory is deleted?


title: Crontab change MAILTO for only one specific job in Root's crontab

text: Can I do the following to change where mail goes for one specific crontab job in root's crontab (don't sent to root for Do Something job, just send to porklover):               # Make a hambone appear     * * * * * /scripts/hambone.pl          # Eat Ham     * * * * * /scripts/manga_ham.py          OLDMAILTO=$MAILTO          MAILTO=porklover.cramble.edu          #Do something     * * * * * /scripts/chown_abrahams_niece.sh          MAILTO=$OLDMAILTO


title: No syntax coloring in vim for me, but ok for my students

text: My students get syntax coloring in vim, but I don't! Even when I "syntax on" as a command `syntax on` or put it in my `.vimrc` and/or `.exrc`. The terminal is xterm. I am missing something in vim or is there something in my .profile -- it has been growing for 30 years... And I've been hacking at this problem for a year. Thanks for listening


title: How to solve "building the main Guest Additions module Failed"

text: I tried to install the VirtualBox Guest Additions module in a VM guest running CentOS but I get this error message when everything else was okay: > building the main Guest Additions module Failed Since I'm very new to CentOS and VirtualBox, I have no idea about to solve this and wasnt able to find any solution searching the internet (the only post I found didnt help me). Here is the log : > /usr/src/vboxguest-4.1.14/vboxguest/build_in_tmp: line 55: make : command > not found Creating user for the Guest additions. Creating udev rule for the > Guest additions kernel module Any ideas? Thanks


title: SSH into Ubuntu VM remotely

text: I don't have much Linux or networking experience, but I'm trying to SSH into an Ubuntu virtual machine from outside of my home network. The Ubuntu virtual machine (running inside VirtualBox) is running a Debian desktop. I did some research and found I had to forward port 22 from the router to the virtual machine. -I changed the network setting on the VM to bridge. -I'm forwarding the port to the VM. -I checked (http://www.yougetsignal.com/) to show the port as open. But when I try to connect it is still not working.               ssh username@<public-ip-address>     -- connection refused      Is there anything I have to do inside the virtual machine to allow incoming connections? Or forward any port? If there is anything I'm doing wrong, any help would be greatly appreciated!!


title: Permission denied NetApp export share

text: We have NetApp NFS file server. I have shared /example filesystem on NFS and give two Linux host permission of `ROOT` level access. Interesting thing is ServerA can mount /example share and has full access on it read/write. But serverB has only Read-Only access. I gave both A/B full Root access then why only A has r/w but not B?               NetApp*> qtree status     Volume   Tree     Style Oplocks  Status     -------- -------- ----- -------- ---------     example unix  enabled  normal      Export details               NetApp> exportfs     /example      -sec=sys,rw,root=serverA:serverB      Mount share               [root@serverB /]# mount -o rw,hard,nointr,proto=tcp,nfsvers=3,bg,nolock netapp:/example /mnt     [root@serverB /]# cd /mnt/     [root@serverB mnt]# touch foo     touch: cannot touch `foo': Permission denied      NFS client debug logs               Jan  7 13:03:02 serverB kernel: NFS call  create foo     Jan  7 13:03:02 serverB kernel: NFS: nfs_update_inode(0:15/64 ct=1 info=0x7)     Jan  7 13:03:02 serverB kernel: NFS reply create: -13     Jan  7 13:03:02 serverB kernel: NFS: dentry_delete(/foo, 10)     Jan  7 13:03:02 serverB kernel: NFS: permission(0:15/64), mask=0x1, res=0     Jan  7 13:03:02 serverB kernel: NFS: lookup(/foo)     Jan  7 13:03:02 serverB kernel: NFS call  lookup foo     Jan  7 13:03:02 serverB kernel: NFS reply lookup: -2     Jan  7 13:03:02 serverB kernel: NFS: dentry_delete(/foo, 0)


title: timestamp of newly created file is in the future

text: On my machine at work I experience weird timestamps of files. This is bothering me, because it messes with `make`. To reproduce the issue, this suffices:               $ touch foo     $ stat -c %y foo     2014-01-31 16:38:51.000000000 +0100     $ date     Fr 31. Jan 16:14:59 CET 2014      As you can see, the file, although just created, has a timestamp that is roughly 24 minutes in the future. To be precise, it is fairly stable at 24 minutes and 8 seconds, which is 1448 seconds, to me a seemingly arbitrary number. The same holds for directories freshly created with `mkdir` or simply any kind of file saving / creating stuff. Our administrator is fairly unresponsive and didn't gave root permissions either. What might be the cause of this issue and how to deal with it, if possible without root?


title: Static DNS setup on client of shared internet connection

text: I've 2 linux computers, one redhat (client), and one ubuntu (set up with shared internet connection as described here) At the moment, on the wired connection between the computers, I can ping the other computer from both sides; IP addresses are setup statically. The ubuntu computer has access to the internet through wireless. I want to setup the redhat client to be able to access the same DNS server as the ubuntu one uses. In the article above, it is assumed that the client is another ubuntu box, and they advise to do the following:               prepend domain-name-servers 208.67.222.222,208.67.220.220;      However, the redhat client doesn't have the file **/etc/dhcp3/dhclient.conf**. Is there another way of achieving the above in redhat? (I've tried to setup the ubuntu box as a dhcp server using **dnsmasq** , but it didn't work) (BTW, I thought I needed a crossover cable for this type of setup, but that didn't work - an ordinary ethernet cable was fine)


title: How do I find out which processes are preventing unmounting of a device?

text: Sometimes, I would like to umount a **usb device** , but I get a `drive is busy` error. How do I find out which processes or programs are accessing the device?


title: How can I set desktop defaults for new users?

text: How can I set up desktop defaults, much like most distributions do, for every new user? (ex. default wallpaper, apps, etc)


title: Strategies for maintaining a reference to a file after it was moved or renamed?

text: I've had a mac at work lately, and was amazed to see that Xcode would still find my latest project after I renamed its folder and moved it someplace else. Now I understand that this is the result of a heavy infrastructure at work, but I was wondering if it would be possible to somehow come up with similar functionality for the rest of the Unix world ?


title: How would I build a linux based router?

text: I am looking into building a Linux based router out of a home-built Linux server. I don't have much experience with the software required however. I would like the server to run the following applications               router     firewall     kerberos auth server      Optionally, I would like to compliment with an email server. Can you suggest a good combination of software to fulfill my needs? I would prefer that the router and firewall be web configurable. As a bonus question. I tripped over ClearOS while googling my way thorough the problem. But I haven't been able to figure out if it is a closed web- configurable router or if it is a fully fledged OS underneath. Does anyone know if you can get access to a terminal and install extra packages on it? I would have to have a need to install some extra component and be unable to because I installed a closed system.


title: Configuring SELINUX to allow logging to a file that's outside /var/log

text: I have a daemon that uses syslog(3) to log to a file that is not a descendant of /var/log. Currently, this requires that SELINUX be disabled. How can I configure an enabled SELINUX to allow this logging? I am an SELINUX novice. Any guidance or advice would be appreciated.


title: Expect script within bash & exit codes

text: I have a `bash` script that calls an `expect` script. The expect script has several conditions. It ssh's into a box and executes a command, and there are different possible errors that could happen which I have given exit codes like so:               expect {         "passwd: password updated successfully" {         exit 0         }         "Password unchanged" {         exit 1         }         "Bad: new and old password are too similar" {         exit 2         }         "You must choose a longer password" {         exit 3         }     }      I had planned to take those exit codes and use them in the bash script that called the expect script, like so:                           if [ $? -eq 0 ]; then                 echo -e "\n"                 echo "Password successfully changed on $host by $user"                      elif [ $? -eq 1 ]; then                     echo "Failure, password unchanged"                 elif [ $? -eq 2 ]; then                     echo "Failure, new and old passwords are too similar"                 elif [ $? -eq 3 ]; then                     echo "Failure, password must be longer"                 else                     echo "Password failed to change on $host"             fi      But that doesn't work. It seems that the expect script only returns 0 if it succeeds or 1 if it fails, regardless of where it fails. Is it possible to retrieve the exit codes I assign and use them in the bash script? Or would it be better to use "send_user" in the expect script to describe the error? If so, how would I be able to have the bash script use the output of the "send_user" command in expect?


title: When to use redirection to stderr in shell scripts

text: I know that well-behaved utilities like _grep_ output "normal" messages to stdout, and error messages to stderr.               $ grep '^foo' file1 file2     file1:foo     grep: file2: No such file or directory      When I'm writing shell scripts myself I often find it hard to decide what output and which messages I should present on stderr, or if I should bother at all. I'd like to know about good practice: When is redirecting some message to stderr called for and reasonable, and when not? "It depends", sure, but do you have some insights that would help me make these decisions? In order to make this subjective question fit the format, I would like to encourage answers that address the "why", and are informed by experience and if possible backed by facts.


title: How to escape spaces while using command's output in command line

text: I want to perform the following command in command line :               $ md5sum $(find . -type f)      But this would cause problems when it encounter files with spaces in filenames :               md5sum: Kaufmann: No such file or directory     md5sum: Mobile: No such file or directory     md5sum: 3D: No such file or directory     md5sum: Graphics: No such file or directory


title: Problem installing packages on my Redhat machine

text: This is what I get               $ sudo yum install git-core     file://localhost/tmp/common1/x86_64/redhat/50/base/ga/Server/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: '/tmp/common1/x86_64/redhat/50/base/ga/Server/repodata/repomd.xml'     Trying other mirror.     Setting up Install Process     No package git-core available.     Nothing to do     $      What is wrong here? * * * Update: Current State of the configuration files:               $ cat /etc/yum.conf     [main]     cachedir=/var/cache/yum     debuglevel=2     logfile=/var/log/yum.log     pkgpolicy=newest     distroverpkg=redhat-release     tolerant=1     exactarch=1     metadata_expire=0               [base]     name=Red Hat Linux - Base     baseurl=file://localhost/tmp/common1/x86_64/redhat/50/base/ga/Server          $ ls /etc/yum.repos.d/     $


title: What are the benefits of running Gnome 3 + awesome compared with awesome alone?

text: What are the benefits to running awesome as my window manager in Gnome 3? I am interested in identifying what features/functionality gnome3+awesome provides that can not be easily (if not identical) replicated running awesome all by itself.


title: Change terminal prompt Ubuntu

text: I have cloned a git repository to a folder in my workspace: /home/jose/workspace/very-very-very-long-repository-name/ so when i browse to it in my terminal it looks like               jose@jose-Vostro-1500:~/workspace/very-very-very-long-repository-name$      Is there a way of changing/editing/abbreviating the terminal prompt so that it doesn't fill the terminal!?? e.g               ~/abbreviated/prompt$      Thanks, W


title: Search a string between two timestamps starting from bottom of file

text: I was trying to find a string `Cannot proceed: the cube has no data` in huge test.txt file only between timestamps yesterday 22:30 pm to today 00:30 am. **Script:**               tac test.txt | awk -v today=$(date "+%d") -v yesterday=$(date "+%d" -d yesterday) '/Cannot proceed: the cube has no data/ {f=$0; next} f{if (($3==yesterday && $4>"22:30:00") || ($4==today && $4<="00:30:00")) {print; print f} f=""}'      **test.txt:**               [Thu Jun  8 07:56:17 2014]Local/data///47480280486528/Info(1019022)     Writing Database Mapping For [data]          [Thu Jun  8 12:56:38 2014]Local/data///47480280486528/Info(1250008)     Setting Outline Paging Cachesize To [8192KB]          [Thu Jun  8 22:56:20 2014]Local/data///47480280486528/Info(1013202)     Cannot proceed: the cube has no data           [Thu Jun  8 23:26:18 2014]Local/data///47480280486528/Info(1013205)     Received Command [Load Database]          [Thu Jun  9 00:16:23 2014]Local/data///47480280486528/Info(1019018)     Writing Parameters For Database           [Thu Jun  9 00:21:20 2014]Local/data///47480280486528/Info(1013205)     Writing Parameters For Database           [Thu Jun  9 00:29:00 2014]Local/data///47480280486528/Info(1013205)     Cannot proceed: the cube has no data          [Thu Jun  9 01:25:21 2014]Local/data///47480280486528/Info(1019018)     Cannot proceed: the cube has no data       **output:**               [Thu Jun  8 22:56:20 2014]Local/data///47480280486528/Info(1013202)     Cannot proceed: the cube has no data      Why not all strings matching the requiremnts are coming in output ? what I'm missing here ?


title: Viewing info pages in a browser

text: Is there any way I can use a browser to view `info` pages? I know that it can be done with man pages based on the man page for `man`, but I couldn't find any such option for info.


title: IPTables rule to allow incoming SSH connections

text: The aim of this script is to only allow traffic over the VPN, except for localhost<->localhost and incoming SSH traffic. But when I run the script over SSH I am disconnected and forced to restart the vm. What is wrong with my script?               #!/bin/bash     iptables -F          #Allow over VPN     iptables -A INPUT -i tun+ -j ACCEPT     iptables -A OUTPUT -o tun+ -j ACCEPT          #Localhost     iptables -A INPUT -s 127.0.0.1/8 -j ACCEPT     iptables -A OUTPUT -d 127.0.0.1/8 -j ACCEPT          #VPN     iptables -A INPUT -s 123.123.123.123 -j ACCEPT     iptables -A OUTPUT -d 123.123.123.123 -j ACCEPT          #SSH     iptables -A INPUT -p tcp --dport ssh -j ACCEPT          #Default Deny     iptables -A INPUT -j DROP     iptables -A OUTPUT -j DROP


title: How to correctly set up fonts?

text: I installed Arch Linux few weeks ago, but I've been using it before for about a year. I set up mostly everything, but I have problems with fonts. First problem appears in Firefox's pdf viewer. ![screenshot 1](http://i.stack.imgur.com/wacsy.png) Second problem looks like the fonts aren't anti-aliased. It appears even in system fonts, like on the taskbar and window title bars. ![screenshot 2](http://i.stack.imgur.com/TysK8.png) Anything I can do make it better? I'm running i3 tiling WM, so most of my configs are done through editing files. I'm up for installing some packages that provide a better GUI for that, though.


title: copy mount from one server to another

text: I'm trying to copy the mount point from `server1` to `server2`. So I copy the file, which I found in `/etc/fstab`, and did `mount -a`. It gives me the following error:               mount: special device /dev/dX/dY does not exist      So I look at `/dev/dX/dY` in `server1` and it has a link to `../d1`. When I did `ll` in `../` in server1, I found the next statement:               brw-rw---- 1 root disk    num,   0  May 06 06:22 d1      What should I do in order to complete the mount process?


title: Why is MAIL unset in graphical environments?

text: I get new-mail notifications when running `bash` interactively on Linux console but I don't get them on `xterm` or `konsole`. The environment variable `MAIL` is set to `/var/mail/USER` upon logging in on the console but it's empty on `xterm` and `konsole`. Also, `MAIL` is not mentioned in any of `.bashrc`, `.profile`, `/etc/bash.bashrc`, `/etc/profile`, `/etc/profile.d/*`, nor is it printed by `grep -r MAIL= /etc`. Why is it unset in the graphical environment? (Debian 7.0)


title: Cannot execute binary - No such file or directory

text: I tried to install the current oracle jre on a VM running NixOS. Now the following happens:               [michas@cc:~]$ tar xvzf jre-7u40-linux-x64.tar.gz |grep bin/java     jre1.7.0_40/bin/javaws     jre1.7.0_40/bin/java_vm     jre1.7.0_40/bin/java          [michas@cc:~]$ ls -l ./jre1.7.0_40/bin/java     -rwxr-xr-x 1 michas nogroup 7750 Aug 27 09:17 ./jre1.7.0_40/bin/java          [michas@cc:~]$ ./jre1.7.0_40/bin/java     bash: ./jre1.7.0_40/bin/java: No such file or directory      WTF? The named file is obviously there. What is going on? Trying to analyse further:               [michas@cc:~]$ strace ./jre1.7.0_40/bin/java     execve("./jre1.7.0_40/bin/java", ["./jre1.7.0_40/bin/java"], [/* 53 vars */]) = -1 ENOENT (No such file or directory)     write(2, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory     ) = 40     exit_group(1)                           = ?     +++ exited with 1 +++          [michas@cc:~]$ strace ./jre1.7.0_40/bin/jav     strace: Can't stat './jre1.7.0_40/bin/jav': No such file or directory      Ok, the output of a really missing file looks different.               [michas@cc:~]$ file ./jre1.7.0_40/bin/java     ./jre1.7.0_40/bin/java: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, BuildID[sha1]=a558f547fe0b95fdc6a109cb7d9692d6d7969794, not stripped          [michas@cc:~]$ file ~/t     /home/michas/t: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, not stripped      The latter is a tiny self compiled binary running without problems. Both look very similar. Hence format the binary itself seems to be fine.               [michas@cc:~]$ ldd ./jre1.7.0_40/bin/java     /run/current-system/sw/bin/ldd: line 116: ./jre1.7.0_40/bin/java: No such file or directory      Seems like there is a problem regarding the needed shared libraries. What is going on and how can I fix it?


title: How to set up local mail retrieval and delivery?

text: $ mail     No mail for lazer     $        * I am able to send mails using `mail`.   * I have unread mails in my inbox as I can see in Outlook. Why doesn't mail show me my mails? How can I make `mail` fetch them?


title: Aptitude installing jre

text: I am trying to install jre on my debian 7 kali box, but I keep getting these faulty errors. I tried installing it through aptitude and it fails at the end. The result is:               dpkg: error processing default-jre-headless (--configure):     dependency problems - leaving unconfigured     Errors were encountered while processing:     openjdk-7-jre-headless:amd64     openjdk-7-jre:amd64     icedtea-7-jre-jamvm:amd64     openjdk-7-jdk:amd64     openjdk-6-jre-headless:amd64     openjdk-6-jre:amd64     openjdk-6-jre-lib     default-jre     icedtea-6-jre-cacao:amd64     icedtea-netx:amd64     icedtea-6-jre-jamvm:amd64     default-jre-headless      I have no idea what the problem is. Can anyone help me with this issue, please?


title: Linux adding wordlist for spell checking

text: We have a small linux cluster (12 machines). Before we populate our database (then create a report from database contents) we would like to spell check a few files. The problem I have is some fields in the text file will contain lists of drugs and other medical terms and other acronyms that the spell checker will automatically think is a spelling error. Eg the line `DRUGS:=ASPIRIN;BISOPROLOL;RAMIPRIL;GTN;TAMSULOSIN;PIZOTIFEN;CO-CODAMOL` When I issue the command `aspell --lang en_GB check filename` It doesn't recognise most of these drugs? Is it possible to create a wordlist (i.e a text file containing a list of accepted drugs and acronyms) that aspell can use so that: (a) it ignores incorrectly spelled drugs (b) If a drug is mis-spelled it suggests the correctly spelled version


title: convert pdf to png with resize and adding black border

text: I try to convert the first page of a book to a png, scale the png to a certain size and add a black border. This is what I tried:               convert tmp.pdf\[0\] -background white -alpha remove -border 8 -bordercolor black cover.png      This is the document, I want to convert. For some reason I have to specify `-background white -alpha remove` since otherwise my white border does not appear or is grey. My problem is that the border that is added is grey not black. Is there anything I can do?


title: Write output of wget or curl to a custom filename based on the url

text: For example I have a link `http://www.abc.com/123/def/ghi/jkl.mno`. I want to download it using `wget` or `curl` and get the name of output file as `def_ghi_jkl.mno`, where the part `def_ghi` is taken from the link. I will put this `wget` command in a script to download multiple files so it can't be giving the output file name explicitly.


title: Do not lock screen command

text: I am running Lubuntu with LXDE and xfce power manager. I have set lock screen when going to sleep (suspend/hibernate) and I like it this way. However, I'd like that the screen does not get locked when I, for example, am running `play whatever mp3s` or have set an alarm (which won't be audible with a locked screen). This "do not lock screen" works fine when I am watching films (with SMPlayer), so I know it's possible. However, I'd like a command for that.


title: Why can't I execute shutdown when the permission is rwxr-xr-x?

text: I'm in `/sbin` and I see that `shutdown` has permissions `rwxr-xr-x`. Doesn't this mean that anyone can execute it?


title: Adding custom Compose key sequences

text: How can one add custom Compose-key sequences? I have googled quite a bit, but could not find an explanation. In particular, I would like to have:               <Compose> + <Z> + <Z> = ℤ # Blackboard bold Z (set of integers)      In particular, I tried copying the file `/usr/share/X11/locale/en_US.UTF-8/Compose` to `~/.XCompose`, and mimicked its syntax. However, this did not seem to work.


title: How to keep record of previous operation results in awk?

text: I ran into another challenge that I am completely stumped on. I have a file filled with data in the following format. There are 3 lines that need to stay together and they have a predictable pattern:               dn: uid=N-NAME-02, ou=data01, dc=data02, dc=data03     uidNumber: 3423     sambaSID: S-1-1-11-1111111-111111111-11111111-12342     <blank line>     dn: uid=N-NAME-03, ou=data01, dc=data02, dc=data03     uidNumber: 3245     sambaSID: S-1-1-11-1111111-111111111-11111111-32212      I need to do some math based the second string of data in the group of 3 and then place the resulting calculation into the third string of the group:               dn: uid=NAME02, ou=data01, dc=data02, dc=data03     uidNumber: (3423 + 2 * 100)     sambaSID: S-1-1-11-1111111-111111111-11111111-342500     <blank line>     dn: uid=NAME03, ou=data01, dc=data02, dc=data03     uidNumber: (3245 + 2 * 100)     sambaSID: S-1-1-11-1111111-111111111-11111111-324700      I figured I could again use AWK for this since AWK can do the math and correct placement of the resulting value. I got the math part on it's own and stored it in a variable               variable1=`awk -F ': ' '/uidNumber:/ { new = $2 * 2 + 1000; print new }' infile`      I was then able to use this variable in another command on the same file to do the replace               awk -F '-' -v variable2=$variable1 '/pattern of string 3 / { print $1"-"$2"-"$3"-"$4"-"$5"-"$6"-"$7"-"variable2 }'      I should mention that the string 3 data is a long string separated by dashes '-'. After the very last dash is where the calculated value needs to be placed. This all works but has one major flaw... it only works if there is one record in the file. So I don't really have it figured out. I am trying to wrap my head around the most efficient way to do this. I would prefer to stick with bash as I am most familiar with it. Can someone maybe give me a hint as to a way to accomplish this?


title: Canon MF4550d refuses to print from Linux server

text: We have several Canon mf4550d printers at the office directly connected to Windows 7 machines. I need to print from a Linux server to those printers. I have installed the latest drivers for my model of printer. I've added the printer to CUPS through the web interface on `http://localhost:631`. All printer jobs are sending without any problems (no errors in log files), but the printer doesn't print. Other printers, for example HP LaserJet 3055, work fine. I guess it'd be connected with the port settings on the local machine, because canon has port settings as `usb001` but HP has `DOT4_0001`. I tried to plug both printers into one computer and in the port settings of the Canon I changed `usb001` to `DOT4_001`. And then when I send printer jobs to the Canon my HP prints the following error: > unable to open the initial device, quitting. How can I resolve my problem? My Linux server uses AltLinux 7.0.4 Centaurus.


title: Different ways of using expr command

text: I'm trying to learn the bash expr command inside and out. What are some of the most basic to the most creative/tricky/unexpected ways to use the expr command? Small, manageable examples are great.


title: Can one ping a NIC by MAC

text: I have an NIC card on a Debian machine somewhere. The machine is turned off, but I need to know whether the NIC card is turned on so that I can send a wake-on-lan magic packet later (from another Debian machine) to wake it up. I have the MAC address of the card. Is there any way I can ping the ethernet card by MAC to see whether it is on? I tried creating an ARP entry:               arp -s 192.168.2.2 00-0c-0d-ef-02-03     ping 192.168.2.2      That didn't work, since the NIC card does not have this ip address. So the NIC card would receive the ping request but would not reply to it. Is there any way around this? I am using the etherwake package to send a wake-on-lan message.