Silent booting Linux from u-boot

For security reasons I have to boot Linux from u-boot with all output hidden (silently) until a password is entered. I've configured uBoot to do this correctly using the `CONFIG_AUTOBOOT_KEYED` macro and can successfully boot silently. The issue I am having is that when uBoot boots the Linux kernel and silent mode is enabled, it passes `console=` as part of the bootargs to Linux kernel. This is fine for silent booting, but I can't seem to find a way to re-enable the console again after bootup. I've also tried to boot normally and append `loglevel=0` to the kernal bootargs which works for silent bootup, but again I cannot re-enable the console. I've tried:               dmesg -n 4      and               klogd -c 4      to try to set the Kernel loglevel back to KERN_WARNING (4) without luck. These commands work properly when I boot the Kernel normally. The best guide I've found on the matter is Silencing the boot process on blackfin.uclinux.org. Ideally I'd like to use uBoot's silent mode where it passes `console=` as part of the bootargs but still take input on the console and re-enable output when the password is entered, but I am open to other ideas if anyone can help guide me I would greatly appreciate it.


Make gvim scroll to the center after opening a file with line numbers?

When I open a file with gvim with the following command line option, `gvim file +5` I would like the current line (the 5th line) be scrolled to the center of gVIM's window, Is that possible?               --=--=----=--=----=--=----=--=--     |                            |     |                            |     |                            |     |                            |     |  this line was selected    |     |                            |     --=--=----=--=----=--=----=--=--      By default, it wasn't centered


Accidentally included special characters in username when adding user

I was trying to add a user called `joebloggs` and accidentally hit other keys as I pressed enter:               useradd -u 12345 joebloggs$*      (on French keyboards the `$` and `*` keys are next to Enter) doing a cat of /etc/passwd doesn't show anything nasty:               joebloggs:x:12345:12345::/home/joebloggs:/bin/bash      Is there anything else I should be aware of or checking for?


Logitech G110 Multimedia Keys in Linux Mint 14

I know that plenty of questions have been asked about multimedia keys, but I'm having trouble finding a solution for my specific problem. I have a Logitech G110 keyboard, which (besides the macro keys) works fine in Linux; however, the multimedia keys aren't working at all in any media program. The keys are being detected by the _Keyboard Shortcuts_ window but aren't doing anything in any other program. The volume wheel, mute button, mute headphones/microphone buttons, and backlighting all work fine. Only the multimedia keys are malfunctioning. Is there anything I can do, a tool I can download, some configuration file I can change, to get these working?


How to uncompress zlib data in UNIX?

I have created zlib-compressed data in Python, like this:               import zlib     s = '...'     z = zlib.compress(s)     with open('/tmp/data', 'w') as f:         f.write(z)      (or one-liner in shell: `echo -n '...' | python2 -c 'import sys,zlib; sys.stdout.write(zlib.compress(sys.stdin.read()))' > /tmp/data`) Now, I want to uncompress the data in shell. Neither `zcat` nor `uncompress` work:               $ cat /tmp/data | gzip -d -     gzip: stdin: not in gzip format          $ zcat /tmp/data      gzip: /tmp/data.gz: not in gzip format          $ cat /tmp/data | uncompress -     gzip: stdin: not in gzip format      It seems that i have created gzip-like file, but without any headers.. unfortunately i don's see any option to uncompress such raw data in gzip man page.. and zlib package does not contain any executable utility.. Is there an utility to uncompress raw zlib data?


Traffic-shaping Application with GUI

is there any free traffic shaping software for internet gateways with GUI for managing per user/computer bandwidth? At least it should able to manage per source IP (or MAC), or if possible with user authentication before they can access the internet (captive portal)


Redis-like temporary filesystem

Is there temporary file system (or ramdisk) that behaves like redis/memcache? so if there is not enough memory, i will dump to disk, when the computer restarted, it could read back from disk


Debian driver needed for Intel ICH7M SouthBridge I/O controller

I am using a motherboard based on this architecture. http://www.intel.com/content/www/us/en/intelligent-systems/navy-pier/embedded- intel-atom-n270-with-mobile-intel-945gse-express-chipset.html I need the linux driver for Intel® 82801GB I/O Controller Hub (Intel® ICH7). I find only windows drivers for this chipset. Any pointers would be useful. The actual issue I am facing is as described below. **Issue:** Secondary hard disk failure leads to OS Stall.. **Motherboard :** Quanmax KEMX 2030 **Operating System:** Debian 2.6.32-31 **Our Setup and Application Description:** On the KEMX 2030 motherboard, we connect two HDDs each at SATA 0 and SATA 1. SATA 0 is connected to a HDD(primary) which is loaded with Debian Linux OS. SATA 1 is connected to a HDD(secondary) which does not have any OS but has data storage partitions. Our application runs on the primary HDD and we copy certain critical files from primary to secondary HDD periodically for backup purposes. **Problem Description:** A faulty secondary HDD results in primary HDD Operating system stalling and freezing. There are two cases that we have witnessed in our field deployments   1. When the secondary HDD has developed bad sectors, whenever a file copy operation is performed from primary to secondary, the primary OS will start throwing DRDY UNC errors in its kernel log. UNC means uncorrectable sectors. The OS is not able to recover from this scenario and the whole system freezes and every application running on the primary HDD will become dead slow because the sata bus is choked.   2. When the sata data cable to the secondary HDD is faulty or of low quality, the primary OS will start throwing DRDY ICRC errors in its kernel log. ICRC means CRC errors in the data transmission. Even in this case, the primary OS freezes. Question is that why should the primary OS freeze when the secondary HDD goes bad. Is it because the SATA bus is getting choked? We want the primary HDD not to be affected because of secondary HDD failures. In order to isolate the problem and we did the following test. With a regular PC motherboard, we connected the same primary and secondary(faulty) drive to simulate the case. On simulating, we found that the linux kernel detects the same DRDY UNC/ICRC errors and in a matter of about 2 minutes, it is able to make the secondary HDD as read only and prevents further damage. The primary OS does not get choked at all. This PC motherboard also had a similar SATA 0 and SATA 1 to which we connected the same HDDs. We could not understand how the PC motherboard handled the scenario better. This test proved that the OS is doing it job on the PC motherboard, but on the KEMX motherboard it does not. Quanmax architecture is as shown in the picture below ![Arch Diagram](http://i.stack.imgur.com/R8iwm.png). Do I need a specific I/O controller driver to address this issue? Further debugging it, we found that irrespective of we connecting the secondary hard disk on SATA 0 or SATA 1 port, linux is able to scan for the secondary hard disk only on SCSI /HOST 0 port. If we do a scan on SCSI/HOST 1, the secondary HDD is not getting detected. Does this mean, the SATA bus is multiplexed into SCSI HOST 0? On the contrary, in the case of regular PC motherboards, we noticed that the scan has to be performed on the respective SCSI/HOST port for the secondary HDD to be detected. Following is the lspci output on the Quanmax KEMX board.               debian:~# lspci     00:00.0 Host bridge: Intel Corporation Mobile 945GME Express Memory Controller Hub (rev 03)     00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03)     00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)     00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio Controller (rev 02)     00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 02)     00:1d.0 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #1 (rev 02)     00:1d.1 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #2 (rev 02)     00:1d.2 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #3 (rev 02)     00:1d.3 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #4 (rev 02)     00:1d.7 USB Controller: Intel Corporation N10/ICH 7 Family USB2 EHCI Controller (rev 02)     00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)     00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)     00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 02)     00:1f.3 SMBus: Intel Corporation N10/ICH 7 Family SMBus Controller (rev 02)     01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)          debian:~#      Following is the lspci output on the regular PC motherboard.               debian:~# lspci     00:00.0 Host bridge: Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller (rev 02)     00:01.0 PCI bridge: Intel Corporation 82G33/G31/P35/P31 Express PCI Express Root Port (rev 02)     00:02.0 VGA compatible controller: Intel Corporation 82G33/G31 Express Integrated Graphics Controller (rev 02)     00:19.0 Ethernet controller: Intel Corporation 82562V-2 10/100 Network Connection (rev 02)     00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 02)     00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 02)     00:1a.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #6 (rev 02)     00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 02)     00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 02)     00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 02)     00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 02)     00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 02)     00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 02)     00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 92)     00:1f.0 ISA bridge: Intel Corporation 82801IR (ICH9R) LPC Interface Controller (rev 02)     00:1f.2 IDE interface: Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 4 port SATA IDE Controller (rev 02)     00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 02)     00:1f.5 IDE interface: Intel Corporation 82801I (ICH9 Family) 2 port SATA IDE Controller (rev 02)      The difference is that regular PC motherboard has ICH9 family and Quanmax KEMX has ICH7 family. Following is the kernel log which shows ata_piix version 2.13 is the driver which is being used. Does this version of the driver have a bug?               2013 Nov 21 17:14:19::kernel::[    1.569271] ata_piix 0000:00:1f.2: version 2.13     2013 Nov 21 17:14:19::kernel::[    1.569315] ata_piix 0000:00:1f.2: PCI INT B -> GSI 19 (level, low) -> IRQ 19     2013 Nov 21 17:14:19::kernel::[    1.569405] ata_piix 0000:00:1f.2: MAP [ P0 P2 IDE IDE ]     2013 Nov 21 17:14:19::kernel::[    1.569697] ata_piix 0000:00:1f.2: setting latency timer to 64     2013 Nov 21 17:14:19::kernel::[    1.576892] scsi0 : ata_piix     2013 Nov 21 17:14:19::kernel::[    1.581480] scsi1 : ata_piix     2013 Nov 21 17:14:19::kernel::[    1.584880] ata1: SATA max UDMA/133 cmd 0x1f0 ctl 0x3f6 bmdma 0xffa0 irq 14     2013 Nov 21 17:14:19::kernel::[    1.584952] ata2: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0xffa8 irq 15     2013 Nov 21 17:14:19::kernel::[    1.756783] ata1.00: ATA-8: ST320LT012-9WS14C, 0001SDM1, max UDMA/133     2013 Nov 21 17:14:19::kernel::[    1.756860] ata1.00: 625142448 sectors, multi 16: LBA48 NCQ (depth 0/32)     2013 Nov 21 17:14:19::kernel::[    1.757445] ata1.01: ATA-8: ST320LT012-9WS14C, 0001SDM1, max UDMA/133     2013 Nov 21 17:14:19::kernel::[    1.757517] ata1.01: 625142448 sectors, multi 16: LBA48 NCQ (depth 0/32)     2013 Nov 21 17:14:19::kernel::[    1.772546] ata1.00: configured for UDMA/133     2013 Nov 21 17:14:19::kernel::[    1.789555] ata1.01: configured for UDMA/133     2013 Nov 21 17:14:19::kernel::[    1.789846] scsi 0:0:0:0: Direct-Access     ATA      ST320LT012-9WS14 0001 PQ: 0 ANSI: 5     2013 Nov 21 17:14:19::kernel::[    1.790422] scsi 0:0:1:0: Direct-Access     ATA      ST320LT012-9WS14 0001 PQ: 0 ANSI: 5     2013 Nov 21 17:14:19::kernel::[    1.814269] sd 0:0:0:0: [sda] 625142448 512-byte logical blocks: (320 GB/298 GiB)     2013 Nov 21 17:14:19::kernel::[    1.814370] sd 0:0:0:0: [sda] 4096-byte physical blocks     2013 Nov 21 17:14:19::kernel::[    1.814658] sd 0:0:1:0: [sdb] 625142448 512-byte logical blocks: (320 GB/298 GiB)     2013 Nov 21 17:14:19::kernel::[    1.814755] sd 0:0:1:0: [sdb] 4096-byte physical blocks     2013 Nov 21 17:14:19::kernel::[    1.814998] sd 0:0:0:0: [sda] Write Protect is off     2013 Nov 21 17:14:19::kernel::[    1.815068] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00     2013 Nov 21 17:14:19::kernel::[    1.815165] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA     2013 Nov 21 17:14:19::kernel::[    1.815268] sd 0:0:1:0: [sdb] Write Protect is off     2013 Nov 21 17:14:19::kernel::[    1.815339] sd 0:0:1:0: [sdb] Mode Sense: 00 3a 00 00     2013 Nov 21 17:14:19::kernel::[    1.815452] sd 0:0:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA     2013 Nov 21 17:14:19::kernel::[    1.816076]  sda:     2013 Nov 21 17:14:19::kernel::[    1.828670]  sdb: sda1 sda2 sda3 < sdb1 sdb2 < sda5 sdb5 sda6 >     2013 Nov 21 17:14:19::kernel::[    1.921110]  sdb6 >     2013 Nov 21 17:14:19::kernel::[    1.922236] sd 0:0:1:0: [sdb] Attached SCSI disk     2013 Nov 21 17:14:19::kernel::[    1.922571] sd 0:0:0:0: [sda] Attached SCSI disk


How can I prevent SSH connection be closed by server for a user with nologin shell?

Basic info: Server OS: CentOS 6.3 Client tool: PuTTY I SSH to my server using PuTTY. I added an account with /sbin/nologin shell. When I log on to that account (selecting "never" close window on exit), console says "This account is currently not available" and PuTTY prompts "Connection closed by remote host". But I expect the server should only say "account not available" without closing the connection, so that I can still tunneling through this connection. I also noticed that for normal /bin/bash users, when typing exit, sometimes the connection is closed, sometimes the server says "LOGOUT" but still connected (I can still tunneling through it). So how can I ensure a connection not to be closed for a nologin shell account?


CentOS connected to Internet but not updates

I have installed CentOS 6.3, OpenSUSE 12.1 and Ubuntu 12.04 on VMware Workstation 9. On any of these when I use `ping` to check network connectivity, I receive a proper answer, but when try to update them using `yum`, `yast` and `apt-get`, they all return error message like "can't reach repository". I changed network setting in OSs and also in VMware over and over, but nothing happened. Also from CentOS (and probably other OSs) I cannot use firefox to access internet also cannot use wget to fetch a page such as yahoo.com, it says: "Connecting to yahoo.com (yahoo.com)|98.138.253.109|:80... failed: Connection refused. " on Ubuntu I do/see this:               root@ubuntu:~# apt-get update     Err http://packages.mate-desktop.org precise InRelease     Err http://packages.mate-desktop.org precise Release.gpg       Unable to connect to packages.mate-desktop.org:http:     Err http://extras.ubuntu.com precise InRelease     Err http://extras.ubuntu.com precise Release.gpg       Unable to connect to extras.ubuntu.com:http:     Err http://ppa.launchpad.net precise InRelease     Err http://ppa.launchpad.net precise Release.gpg       Unable to connect to ppa.launchpad.net:http:     Err http://security.ubuntu.com precise-security InRelease           Err http://security.ubuntu.com precise-security Release.gpg       Unable to connect to security.ubuntu.com:http:     Err http://us.archive.ubuntu.com precise InRelease     Err http://us.archive.ubuntu.com precise-backports InRelease     Err http://us.archive.ubuntu.com precise-updates InRelease     Err http://us.archive.ubuntu.com precise Release.gpg       Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.14 80]     Err http://us.archive.ubuntu.com precise-backports Release.gpg       Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.14 80]     Err http://us.archive.ubuntu.com precise-updates Release.gpg       Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.14 80]     Reading package lists... Done     W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/InRelease     W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-backports/InRelease     W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/InRelease     W: Failed to fetch http://packages.mate-desktop.org/repo/ubuntu/dists/precise/InRelease     W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/InRelease         W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-updates/InRelease         W: Failed to fetch http://ppa.launchpad.net/xubuntu-dev/xfce-4.10/ubuntu/dists/precise/InRelease         W: Failed to fetch http://packages.mate-desktop.org/repo/ubuntu/dists/precise/Release.gpg  Unable to connect to packages.mate-desktop.org:http:         W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/Release.gpg  Unable to connect to extras.ubuntu.com:http:         W: Failed to fetch http://ppa.launchpad.net/xubuntu-dev/xfce-4.10/ubuntu/dists/precise/Release.gpg  Unable to connect to ppa.launchpad.net:http:         W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/Release.gpg  Unable to connect to security.ubuntu.com:http:         W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/Release.gpg  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.14 80]     W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-backports/Release.gpg  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.14 80]         W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-updates/Release.gpg  Unable to connect to us.archive.ubuntu.com:http: [IP: 91.189.91.14 80]     W: Some index files failed to download. They have been ignored, or old ones used instead.


The keys work from config but not from ssh-add

Ssh keys work fine, if indicated in `./ssh/config` but if i try   `$ssh-add mykey   Could not open a connection to your authentication agent` even with `ssh-add -l` give the same result


error running raidctl on Solaris 10

I am trying set up a disk mirror on a Solaris 10 system. The two disks are identically formatted and not mounted. Neither is a boot disk. I ran the following:               # raidctl -c c1t2d0 c1t3d0      RAID_CREATE: Error 0      The error does not indicate anything about what the problem is. I have not been able to find anything about what the problem could be.


GNU "install" -d flag -- how's it work?

I'm trying to write a makefile rule to copy a directory, maintaining its structure, and since all the other rules in our makefiles use `install`, I wanted to be consistent. In the manpage, it says: > SYNOPSIS >   >   >        install [OPTION]... [-T] SOURCE DEST >        install [OPTION]... SOURCE... DIRECTORY >        install [OPTION]... -t DIRECTORY SOURCE... >        install [OPTION]... -d DIRECTORY... >   >        -d, --directory >               treat all arguments as directory names; create all components > of >               the specified directories >   OK, that sounds like what I need... but the flags don't make sense. How do you specify the destination directory to install to? I tried doing a basic test by making an arbitrary directory structure on my local hard disk:               ~>tree test     test     ├── a     │   └── b     │       └── c     │           └── e.txt     └── d          4 directories, 1 file      And then running `install -d` and looking at what was created:               ~>install -d test test2     ~>tree test2     test2          0 directories, 0 files      Nothing happened! Can anyone point me in the right direction? Googling "gnu install -d flag" isn't bringing me much.


Unable to run 'sudo chmod +w /etc/hosts'

I am logged into my remote VM (running out of `ESXi`) as user xyz. I wanted to change my `/etc/hosts` to add some network names that were not visible by default. I first tried to run               sudo vi /etc/hosts      but when I got into `vi`, it was still telling me the file was read-only. Here are the privileges:               >ls -l /etc/hosts     -rw-r--r-- 1 root root 416 2013-06-19 08:08 /etc/hosts      I also noticed that almost every other file in `/etc` has a `lsattr` of `-----------------e-`, only `hosts` has `----i------------e-`. E.g.:               >lsattr /etc     ...     -----------------e- ./python     ----i------------e- ./hosts     ...      Then I tried to `chmod` and here is what I got:               >sudo chmod +w /etc/hosts     chmod: changing permissions of `/etc/hosts': Operation not permitted      I thought that was weird because root (to which I am switched when I `sudo`) should be able to do anything. My `sudoers` file looks quite ordinary:                 1 # /etc/sudoers       2 #       3 # This file MUST be edited with the 'visudo' command as root.       4 #       5 # See the man page for details on how to write a sudoers file.       6 #       7        8 Defaults        env_reset       9       10 # Host alias specification      11       12 # User alias specification      13       14 # Cmnd alias specification      15       16 # User privilege specification      17 root    ALL=(ALL) ALL      18       19 # Allow members of group sudo to execute any command after they have      20 # provided their password      21 # (Note that later entries override this, so you might need to move      22 # it further down)      23 %sudo ALL=(ALL) ALL      24 #      25 #includedir /etc/sudoers.d      26       27 # Members of the admin group may gain root privileges      28 %admin ALL=(ALL) ALL      I am looking for an explanation why this is happening and how to work around it.


Send first line of the HTTP Header

A normal HTTP request may look something like this:               GET / HTTP/1.1     Host: example.com           I would like to change the first line of this request, with a custom one, e.g.:               FOOBAR NOT REALLY HTTP     Host: example.com           Is it possible to do this using `curl` or this there another tool, capable of doing this?


how to find out namespace of a particular process?

I already asked a question about how to list all namespaces in Linux, but there wasn't any correct and exact answers, so I want to find out a method which can help me to find out the namespace of PID of some process or group of processes. How can it be done in Linux?


Best practices for writing Blu-Ray discs on Linux

I recently bought a Blu-Ray writer and am wondering how to best write the discs. The scenario is: I have a directory full of files and want to put them on the disc, read them back once to verify, and then put the disc on a shelf (i.e., the main purpose is for backup). Some of the files are bigger than 4.4GB or whatever the limit is for ISO filesystems. For writing to DVDs, I currently use `growisofs`, with `split` to break the files into bite-size chunks. growisofs doesn't seem to have good UDF support and splitting the files is lame, which is the motivation for my question. What is the current best practice for writing files onto a BD-R disc? I am on Debian Wheezy (Testing).


What files in /var need to have specific owners?

I accidentally wreaked unknown amounts of havoc on my web server by running               sudo chown -R myuser:mygroup * .*      in `/var/www`, not remembering that `.*` would include the parent directory (as `..`). I realized what was happening after a second or so, but by then it was too late, half the directories in `/var` had been "re-owned". I know I can reset most of it with               sudo chown -R root:root /var      but what files are there that need to be owned by specific non-root users (or groups) that I would have to change manually? This is on Gentoo, and here's a directory listing:               $ ls -l /var     drwxr-xr-x  9 root root 4096 May 12  2009 cache     drwxr-xr-x  4 root root 4096 Aug 20 22:49 db     drwxr-xr-x  3 root root 4096 Aug 20 22:42 dist     drwxr-xr-x  4 root root 4096 Nov  1  2009 edata     drwxr-xr-x  2 root root 4096 Jun 17  2008 empty     drwxr-xr-x  5 git  git  4096 Feb 13  2010 git     drwxr-xr-x 23 root root 4096 Jul 19 03:22 lib     drwxrwxr-x  3 root uucp 4096 Aug 12 00:14 lock     drwxr-xr-x 10 root root 4096 Aug 20 03:10 log     lrwxrwxrwx  1 root root   15 Nov  7  2008 mail -> /var/spool/mail     drwxr-xr-x 10 root root 4096 Aug 21 00:22 run     drwxr-xr-x  8 root root 4096 Feb 13  2010 spool     drwxr-xr-x  2 root root 4096 Jun 17  2008 state     drwxr-xr-x 13 root root 4096 Dec 23  2009 svn     drwxrwxrwt  5 root root 4096 Aug 14 01:53 tmp     drwxr-xr-x 13 root root 4096 Aug 11 20:21 www     drwxr-xr-x  2 root root 4096 Dec 14  2008 www-cache      I can provide listings of subdirectories if it would help but that gets pretty long pretty fast. (`dist`, `edata`, `git`, `svn`, and `www` are things I manage myself so ownership in those won't be an issue)


Is there a Debian security APT repository that allows access via ftp?

If I want security updates for Debian, I add the following line to **/etc/apt/sources.list** :               deb http://security.debian.org <codename>/updates main      Is there a repository that allows the `http` to be `ftp`? I say this because other normal Debian APT mirrors allows that, and doing the same here doesn't work. That is, using the following line results in errors:               deb ftp://security.debian.org <codename>/updates main      One advantage of ftp is that it's often (or rather, in my limited experience) not put behind a proxy.


Where can I find information on Linux device driver parameters?

I want to work on Linux module programming (Device Drivers). And as a my college project I have to do profiling or benchmarking of a kernel modules based on various parameters. Everywhere I looked, I found info on how to write device drivers, whereas I want info on what parameters affect the performance of any specific driver/module. I also want to know how can I change them to test their various values.


rsync include-from exlcude-from with including subdir but excluding dirs above

I try to use rsync with `--include-from` and `--exclude-from` options. I have a directory structure like: `/docs/domain-[a-z]/templates` Now I want to sync `templates` only if something is in there. Further do not want to sync anything like `/docs/domain-a` and `/docs/domain-b` if `templates` is empty. I thougt it would work if I exclude `/docs/domain*` and include `**/templates` but this is not working. Should this work at all? Or is this just a problem of my rsync version 3.0.4 on SLES 11SP3 To clarify it Source Dir               /docs/     /docs/anydomain/templates     /docs/anydomain/other     /docs/domain_blah/     /docs/domain_blah/tmp/     /docs/domain_blub/     /docs/domain_blub/tmp/     /docs/domain_blub/templates/anyfiles     /docs/domain_blob     /docs/ohter     /other      So I just want to sync the `/domain_blub/templates` if there is something inside `templates` and leave all the `/docs/domain_blub/tmp` and other files away But I too want to sync contents from `/docs/anydomain/` or `/docs/other` and even `/other` The target structure looks the same but there might be more domains set up which shouldn't be deleted or changed. It could look like this               /docs/     /docs/anydomain/templates     /docs/anydomain/other     /docs/domain_balah/     /docs/domain_balah/tmp/     /docs/domain_aaaa/     /docs/domain_aaaa/tmp/     /docs/domain_blah/     /docs/domain_blah/tmp/     /docs/domain_blub/     /docs/domain_blub/tmp/     /docs/domain_blub/templates/anyfiles     /docs/domain_blob     /docs/ohter     /other


Avoiding pasting with the mouse wheel

I'm tired of having to copy and paste text using the the wheel of my mouse; the amount of dexterity needed is legendary. Anybody know of any kind of frankenmouse which has four buttons (one that simulates the third button right below the wheel would be nice)? Or have any other solution? * * * **Edit** : A nice solution could be some integration of the two cut and paste schemes (`Ctrl`+`c`, `Ctrl`+`x`, `Ctrl`+`v`) and the mouse highlight and paste with wheel, so I could actually use the `Ctrl` keys while in a terminal.


Which users are allowed to log in via SSH by default?

1. When I set up my Debian 6, I was wondering, which users apart from root whose password I know can log into my system via SSH?   2. When I install Apache 2 a user called www-data gets created. Does this user have the right to log into my system via SSH? But if there was some default password for www-data everyone could log in, seems unlikely to me.   3. Where do I have a list which users are allowed to log into my system via SSH? Can't find anything in the ssh config files.


How do major package managers differ?

It appears that the major package managers are (in no particular order) apt, yum, and pacman. But when it comes down to it, what is the difference? My understanding is that you can use any of them on any distribution, although every distribution appears to favor one over the other. So, my questions are: What are the core differences between the major package managers? Why should I consider one over the other?


"find" output relative to directory

I'd like to use `find` to list all files and directories recursively in a given root for a `cpio` operation. However, I don't want the root directory itself to appear in the paths. For example, I currently get:               $ find diskimg     diskimg     diskimg/file1     diskimg/dir1     diskimg/dir1/file2      But, I'd like to get               file1     dir1     dir1/file2      (note the root is also not in my desired output, but that's easy to get rid of with `tail`). I'm on OS X, and I'd prefer not to install any extra tools (e.g. GNU find) if possible, since I'd like to share the script I'm writing with other OS X users. I'm aware this can be done with `cut` to cut the root listing off, but that seems like a suboptimal solution. Is there a better solution available?


Limit CPU cycles inside of Xen

I'd like to run some minimum-expectation benchmarks on EC2, but I'm having an issue of high variability in my output data. Specifically, they keep giving me more CPU than I'm minimally entitled to, which is killing my ability to evaluate minimum performance when I'm only receiving my minimal CPU allocation. So the question is...does anyone know a way to limit the CPU cycles available to the entire OS? I'm looking at Debian-based systems, so primarily Ubuntu. I've tried modifying the governor (no luck) and there's no access to Xen config (not that it would help) or the BIOS. All other solutions are either percentage (cpulimit, cgroups) or time (ulimit) based and therefore won't work.


How to get back on track of your Linux PC fails and your USB drives with Linux O.S. are lost

Assumption is you take your netbook or nettop and fly   to another country where you have no friends, etc. You can not create a bootable usb drive with a linux iso file   unless you purchase a windows pc and then learn how to do it   using windows. does this mean, it would only be logical to ask windows questions   on here as well in terms of how to create a bootable usb drive   with linux os via windows ? this happened to me previously, all i could do was use unetbootin   to install linux mint on a usb drive. and then i had to install linux   mint to the blank pc, and from linux mint i had to create a centos   linux usb using the ISO file and linux mint's terminal. creating a bootable centos usb using windows machine is not possible.   even newest fedora versions do not work. unetbootin does not work , it only works by luck.


How to use Wireless Network in Virtualbox?

I'm trying to enable Wireless on VirtualBox in my Ubuntu 14.04. I use a Kali Linux as the guest OS, but this OS not show the wi-fi when I connect it. ![here](http://i.stack.imgur.com/OFSBD.png) After starting the guest OS, it still does not show the wi-fi ![here](http://i.stack.imgur.com/fUoy3.png) I already tried the suggestions from this link and this link, but my virtualbox does not enable my wireless.


Accidentally overwrote boot sector of encrypted drive: any way to recover data?

I had one external drive on which I was storing a large quantity of data; the drive is/was encrypted using gnome disk utility. I got a second drive for redundancy and I was preparing to encrypt it. Unfortunately, I overwrote the device book partition for the original external drive:               ~$ sudo dd if=/dev/urandom of=/dev/sdb1     15585+0 records in     15584+0 records out     7979008 bytes (8.0 MB) copied, 1.30506 s, 6.1 MB/s So that is a disaster. Curse my fat fingers. Is there anything I can do to restore access to the drive? Some output from fdisk below. Device mounted as `sdb` was the original drive, the device at sdc the new drive.               Disk /dev/sdb: 2000.4 GB, 2000398839808 bytes     255 heads, 63 sectors/track, 30400 cylinders, total 488378623 sectors     Units = sectors of 1 * 4096 = 4096 bytes     Sector size (logical/physical): 4096 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1               1   488378622  1953514488   ee  GPT          ...          Disk /dev/sdc: 1000.2 GB, 1000204138496 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953523708 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x7e3058f0             Device Boot      Start         End      Blocks   Id  System     /dev/sdc1            2048  1953519615   976758784    7  HPFS/NTFS/exFAT


rpm temp file question (rpm-tmp)

When installing an RPM on CentOS, I receive the following error message:               /var/tmp/rpm-tmp.44492: line 578: [: too many arguments      The trouble I'm having is that `/var/tmp/rpm-tmp.xxxxx` file is always deleted after a RPM install and I want to see the line number it's having trouble with. What is the best way to preserve this file when installing so that debugging problems with the rpm are easier? So far, I placed this in the `%pre` section of my rpm spec file to deal with this issue:               cp -vf /var/tmp/rpm-tmp* /tmp/%module_name-rpm-tmp-copy      By copying `/var/tmp/rpm-tmp*` to `/tmp`, I was able to look at look at line 578 and fix the syntax error in my code easily. Is there a way to reference the `rpm-tmp` file that RPM is using during the install? Something from `env` that I can use in my spec file to copy the correct `rpm-tmp` instead of a blanket `cp` (copy `/var/tmp/rpm-tmp*` files) statement?


Merging preexisting source folders in mksquashfs

In this answer on a previous question, I found out how to modify files in a squashfs filesystem:               # unsquash the filesystem to a local directory     sudo cp /media/clonezilla/live/filesystem.squashfs ./     sudo unsquashfs filesystem.squashfs     # now, insert my own script which I want as part of the distribution     sudo cp ~/autobackup squashfs-root/usr/sbin/     # now, resquash the filesystem to be able to use it     sudo mksquashfs squashfs-root filesystem.squashfs -b 1024k -comp xz -Xbcj x86 -e boot      However, on that last line, I run into some problems making the filesystem:               Source directory entry bin already used! - trying bin_1     Source directory entry dev already used! - trying dev_1     Source directory entry etc already used! - trying etc_1     Source directory entry home already used! - trying home_1     Source directory entry initrd.img already used! - trying initrd.img_1     Source directory entry lib already used! - trying lib_1     Source directory entry lib64 already used! - trying lib64_1     Source directory entry media already used! - trying media_1     Source directory entry mnt already used! - trying mnt_1     Source directory entry opt already used! - trying opt_1     Source directory entry proc already used! - trying proc_1     Source directory entry root already used! - trying root_1     Source directory entry run already used! - trying run_1     Source directory entry sbin already used! - trying sbin_1     Source directory entry selinux already used! - trying selinux_1     Source directory entry srv already used! - trying srv_1     Source directory entry sys already used! - trying sys_1     Source directory entry tmp already used! - trying tmp_1     Source directory entry usr already used! - trying usr_1     Source directory entry var already used! - trying var_1     Source directory entry vmlinuz already used! - trying vmlinuz_1      Essentially, since it's overwriting an existing squashfs filesystem, instead of merging duplicate files, it creates new folders and files in the root of the filesystem named `bin_1`, `etc_1`, `var_1`, `tmp_1`, etc. Obviously, this is not desired. Is there a way that I can force it to merge the directories? I have attempted to run it with `-noappend`, but that breaks the Clonezilla install and I can't get into the Clonezilla wizard. Any ideas?


Ubuntu styled notifications in Linux Mint

I recently installed Linux Mint 15 with Cinnamon. It ran smoothly after forcing a kernel update by activating visibility of "Level 5" "dangerous packages". Later, after a post-update reboot, my notifications look like those seen in Ubuntu's Unity (Notify OSD). I have only installed things through Mint's software center or apt-get. It doesn't seem like the notifications stack up in the taskbar applet either. I do get the ubuntu styled notifications by triggering them with notify-send. The ubuntu styled notifications also replaces the volume up/down as well as brightness up/down notifications. How can I debug this?


Caps lock delay problem

With using caps lock for word capitalization, when I type _fast_ using my Linux distro, I get the following:               CAps LOck NOt WOrking PRoperly.      I tried the same keyboard on a windows machine, it works properly. So, the main reason of the problem seems to be my Linux distro. PS1: Same problem is also mentioned here: http://ubuntuforums.org/showthread.php?t=1462333 PS2: I use Ubuntu 13.04   PS3: Please do not give the advice to use shift instead of caps lock for capitalization purposes.


Ubuntu 13.10 x64 - slow and acting strangely gvfs+NTFS

I have updated Ubuntu 13.10 x64 to latest stable releases of all packages. I'm running GNOME and using SSD disks on USB 3.0 ports in lenovo Y500 notebook. I'm using Midnight Commander (as root) in GNOME to make operations on files (copy). What I observe is that when copying file (whole question - large files - few GBs) using `mc` from system drive (external SSD) to SSD or HDD (inside=SATA3 or outside=USB 3.0) there are some problems:   1. I start copying file and there is no progress bar starting, as the file is copied (LEDs are blinking), then after some time the progress bar moves from the beginning fast through whole file and ends the copy process (but not write?).   2. As the file is copied (progress bar ends) there is sometimes very long or endless hang after `sync` command issued right after copying. Then the LEDs are blinking again (second write? first wasn't complete?).   3. The overall speed of the copy process is terrible! As SSD under Windows on USB 3.0 gives about 200MB/s constant write speed, on Ubuntu there are few MB/s... Also, to write on external HDD on Windows - about 80MB/s, on Ubuntu - few MB/s. In `Disks` there is write cache enabled for all tested drives. Also hdparm is configured to use write_cache (on). As I try to not to use GNOME, gvfs and fuse - booting directly into shell and mounting partitions as ntfs-3g gives full performance and no problems at all (as I can remember). I've updated gvfs to latest stable version for today (build it), but it didn't solved the problem (nearly no change). The same with ntfs-3g. On previous versions of Ubuntu, without gvfs, there were no such problems. What is the problem and what can be done to speed up the disk operations and make them more stable? The are nearly no problems with ext3/ext4 filesystems.


tar delete progress question

I was trying to use **tar** command , `--delete` option and met some problems. There are two things I don't understand:   1. when using `--verbose` option with combination of --delete option, nothing shows as `--verbose` usually do, i.e. no show of deleted files.   2. when using `--totals` option, the deleted size is always 0, it doesn't make sense and I can't figure out the meaning of these output.  Can anyone help me with these? The following code shows the procedure.               x@x:~/bin$ tar --list --file=pomo.tar     pomodoro     pomodoro_2     pomodoro_3     x@x:~/bin$ tar --append --file=pomo.tar quitpomo --verbose     quitpomo     x@x:~/bin$ tar --list --file=pomo.tar     pomodoro     pomodoro_2     pomodoro_3     quitpomo     x@x:~/bin$ tar --list --file=pomo.tar --totals     pomodoro     pomodoro_2     pomodoro_3     quitpomo     Total bytes read: 10240 (10KiB, 12MiB/s)     x@x:~/bin$ tar --delete --file=pomo.tar quitpomo --total --verbose     Total bytes read: 10240 (10KiB, 86MiB/s)     Total bytes written: 10240 (10KiB, 86MiB/s)     Total bytes deleted: 0


Can't create a bootable (live) usb flash for arch linux

I created a bootable usb from which I was going to install Arch. I did this the following way:               sudo dd if=/path_to_arch_.iso of=/dev/sdX      But when I tried to boot from this usb flash, I failed. There was no error, it just couldn't boot from it. I downloaded iso file from the official arch linux website recently so it should be up to date. Previously I was able to install mint, elementary and ubuntu from usb flash successfully. **It preventing me booting the following way:** After selecting "boot from usb" I was shown a black screen for 1 second and brought back to the menu where I must choose a temporary boot device. When I did it again the story repeated. What might be the cause?


Save multiple URL targets to text files

I have a list of URLs and I want to save each of their targets in a separate text file. Here's an example of the input file containing the URLs:               ~$: head -3 url.txt      http://www.uniprot.org/uniprot/P32234.txt     http://www.uniprot.org/uniprot/P05552.txt      http://www.uniprot.org/uniprot/P07701.txt      I'm currently using a Python custom function to accomplish this task. It works, but the main inconvenient are: user has to copy-paste URLs manually (there's no direct file input) and the output contains some 'b' characters at the beginning of each line (?binary).               ~$: head -3 P32234.txt     b' ID   128UP_DROME             Reviewed;         368 AA.     'b' AC   P32234; Q9V648;     'b' DT   01-OCT-1993, integrated into UniProtKB/Swiss-Prot.      Here's the Python code:               def html_to_txt():          import urllib.request          url = str(input('Enter URL: '))          page = urllib.request.urlopen(url)          with open(str(input('Enter filename: ')), "w") as f:              for x in page:                  f.write(str(x).replace('\\n','\n'))          s= 'Done'          return s      Is there a cleaner way of doing this using some Unix utilities?


Transfer 2 drive raid0 / lvm2 system to new drive pair

I have a multi-boot, multi-drive system that I want to transfer onto 2 bigger drives. Currently pc has 2x1TB drives with Fedora 19 running, using RAID0 drive mirroring, with LVM2 on top of the md. I want to transfer the entire md/lvm set of filesystems to a new pair of 2TB drives configured in the same raid0/lvm2 arrangement. In addition to Fedora, there are Windows 7 partitions, and other misc partitions to copy. To make matters harder, the Fedora root filesystem exists in the md/lvm2 partition, so I need to bring up all this infrastructure. /boot is in a real primary partition. So I'm able to install the 2 new drives at the same time the old drives are still installed, so it is basically a big copy task, but the details are the tricky part. Using a GParted Live boot disk, I can go in and configure the new drives in a new raid0 and lvm2 vg called "pool2". The original vg is called "pool". I partition & mount up the new filesystems and tar/copy all the files from old to new. But now the two hard parts are biting me.   1. Getting grub2 to install/boot the new copy of the Fedora partition.   2. Getting Windows to boot on its new copy.  Actually never to go trying #2, so for #1, Here's details of what I tried, and where I got stuck. After the copy, I disconnect the old drives and change new drives to sda and sdb. Booting back again with the boot iso, Then I have to manually start the raid0 with the commands:               mdadm -E --scan     mdadm -A /dev/md0      No errors, /proc/mdstat shows the raid active with RAID0. Then I have to manually start the vg with:               vgchange -a y pool2 Now to reinstall grub2 on the new partitions:               mount /dev/mapper/pool2-root /mnt/fedora     mount /dev/sda1 /mnt/fedora/boot          cd /mnt/fedora     mount -o bind /dev dev     mount -o bind /proc proc     mount -o bind /sys sys     mount -t tmpfs tmpfs tmp     chroot /mnt/fedora     grub2-install /dev/sda      Everything appears to go fine. But when I try to reboot from the new disk drives, I either get nothing as if grub2 isn't found, or I get the grub menu and it then fails during the boot very early, because it can't find the root filesystem. What I think is happening is all the grub.cfg file is still full of the old references such as:               root=/dev/mapper/pool-root     rd.lvm.lv=pool/root     and probably UUIDs wrong.      (remember the new drives are on pool2). I also suspect maybe the initrd settings are incorrect for the new locations. Manually changing these values in grub.cfg don't seem to help, so how can I get this working? I think I'm really close, but having to do a lot of manual md/lvm2/grub2 commands I'm no expert in, and am missing something.


missing files after reassemble of RAID-5

I had to open my file-server's housing today to replace a faulty fan. What I didn't see was that one of the sata-cables was not properly connected. The 1st thing I did after a reboot was a check of the RAID status and it showed immediately that one drive is missing. Till this moment the device was not used (however it was mounted, so I'm not 100% sure that system did nothing). I stopped md0 and re-plugged in the cable:               mdadm --stop /dev/md0     poweroff      After another reboot I checked the removed drive:                mdadm --examine /dev/sdd1      ...            Checksum : 3276bc1d - correct              Events : 315782                   Layout : left-symmetric          Chunk Size : 32K                Number   Major   Minor   RaidDevice State     this     0       8       49        0      active sync   /dev/sdd1             0     0       8       49        0      active sync   /dev/sdd1        1     1       8       65        1      active sync   /dev/sde1        2     2       8       33        2      active sync   /dev/sdc1        3     3       8       17        3      active sync   /dev/sdb1      I was a bit surprised that it was shown as active (even if earlier `mdadm` said that this device was removed from array) and the checksum was OK. I recreated RAID with:               mdadm --assemble /dev/md0 --scan      The command `mdadm --detail /dev/md0` showed that all drives were running and system was in "clean" state. I mounted the device md0 and then came hic-cup. I wanted to work on one of the last files that I had been using before all the situation and it was not there. In another place I missed actually all files from the directory where I was working. As far as I can see most of the files that are older than a few days are intact but some newer ones are missing. Now the big question: what would be your advice? Is there a way to get this data? I thought about removing the drive that was earlier labeled by `mdadm` and rebuild array with another HDD. **UPDATE** I started to back-up the drives today. After mounting md0 as read-only I run `rsync` to another server. Now curious thing. I moved a week ago some directories to other array. `rsyns` has shown following info on these removed dirs:               file has vanished: "/MD0/Data/_NMR_"


libcurl.so.4 undefined reference error

Even after installation of curl and all concerned libcurl packages such as curl libcurl3 libcurl3-gnutls   libcurl4-doc   libcurl4-nss-dev   libcurl-ocaml   libcurl3-dbg   libcurl3-nss   libcurl4-gnutls-dev   libcurl4-openssl-dev   libcurl-ocaml-dev I get errors such as ,               /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_use_certificate_chain_file@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_set_verify@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ASN1_STRING_type@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `CRYPTO_free@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_get_shutdown@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_get_verify_result@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `d2i_PKCS12_fp@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `EVP_cleanup@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_write@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_peek@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `BIO_new@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_set_fd@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_get_privatekey@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `BN_num_bits@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_connect@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `DES_set_odd_parity@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `RAND_egd@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_set_srp_password@OPENSSL_1.0.1'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_get_pubkey@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_init@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_set_connect_state@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_get_cert_store@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_NAME_get_entry@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ERR_free_strings@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `RAND_add@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_ctrl@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `sk_pop_free@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_free@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `BIO_free@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `GENERAL_NAMES_free@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_get_id@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_library_init@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_ctrl@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ASN1_STRING_print@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_NAME_ENTRY_get_data@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_get_next@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ERR_get_error@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `RAND_file_name@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `CRYPTO_cleanup_all_ex_data@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_set_default_passwd_cb_userdata@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_use_certificate_file@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `BN_bn2bin@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_get_peer_cert_chain@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_check_issued@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ERR_clear_error@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_pending@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_free@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `BIO_s_mem@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `EVP_PKEY_copy_parameters@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSLv23_client_method@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_add_client_CA@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_use_PrivateKey@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_get_serialNumber@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_callback_ctrl@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `MD4_Update@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `MD4_Final@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `PEM_read_X509@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSLeay@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_get_first@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_get_subject_name@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `MD5_Final@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_load_builtin_engines@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_ctrl@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509V3_EXT_print@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_load_error_strings@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_set_session@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_NAME_get_index_by_NID@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_ctrl_cmd@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `TLSv1_client_method@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_check_private_key@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_by_id@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_get_certificate@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSLv3_client_method@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_verify_cert_error_string@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_get_peer_certificate@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_new@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `OPENSSL_add_all_algorithms_noconf@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `sk_value@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_use_PrivateKey_file@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_EXTENSION_get_object@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ASN1_INTEGER_get@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_get_ext_d2i@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_load_crl_file@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_set_cipher_list@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `DES_set_key@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_get1_session@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ERR_peek_error@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_STORE_add_lookup@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_get_current_cipher@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ASN1_STRING_to_UTF8@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_load_private_key@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `PEM_write_bio_X509@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_finish@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `MD4_Init@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_free@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `CRYPTO_malloc@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `PKCS12_PBE_add@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_cleanup@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `MD5_Init@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `PKCS12_parse@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `UI_OpenSSL@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_get_issuer_name@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `EVP_PKEY_free@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_free@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_get_error@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_set_default_passwd_cb@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ERR_error_string_n@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `BIO_ctrl@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_new@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_shutdown@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_STORE_CTX_get_current_cert@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_SESSION_free@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ASN1_STRING_length@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `sk_pop@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `DES_ecb_encrypt@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `RAND_status@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_LOOKUP_file@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_use_certificate@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_STORE_set_flags@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_read@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ENGINE_set_default@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ASN1_STRING_data@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_set_srp_username@OPENSSL_1.0.1'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `RAND_load_file@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CTX_load_verify_locations@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `i2t_ASN1_OBJECT@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ERR_remove_thread_state@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `RAND_bytes@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `MD5_Update@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `SSL_CIPHER_get_name@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_EXTENSION_get_critical@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `PKCS12_free@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `sk_num@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `ERR_error_string@OPENSSL_1.0.0'     /usr/lib/x86_64-linux-gnu/libcurl.so.4: undefined reference to `X509_NAME_print_ex@OPENSSL_1.0.0'     collect2: error: ld returned 1 exit status      Any help appreciated


FATAL: Module hello.ko not found

I'm using `CentOS-6.5` and default kernel is `2.6.32-431.11.2.el6.x86_64`. I downloaded `2.6.32` and built that kernel (under `/lib/modules/2.6.32`). I wrote a module for simple `hello world` program. This program is working under below case: Makefile: `/lib/modules/$(shell uname -r)/build` (default kernel)               $ sudo insmod hello.ko          $ dmesg     module inserted..     hello world..      My program is not working for below case: Makefile: `/lib/modules/3.2.32/build` (newly built kernel)               $ sudo insmod hello.ko     insmod: error inserting 'hello.ko': -1 Invalid module format          dmesg:      hello: disagrees about version of symbol module_layout      I tried `modprobe` for both cases it is showing below error `FATAL: Module hello not found.` How compile my module with `2.6.32` kernel?


How can I write ftp command for a file transfer from one server to other?

How can I write ftp command for a file transfer from one server to other with a simple script?


How to retrieve sysfs devpath of a USB flash drive given its corresponding partition sysfs path?

I have a USB flash drive connected to a hub. Its storage device partition devpath in sysfs is `/devices/pci0000:00/0000:00:12.2/usb6/6-1/6-1.2/6-1.2:1.0/host10/target10:0:0/10:0:0:0/block/sdb/sdb1`. I would like to retrieve the corresponding USB device path (i.e. `/devices/pci0000:00/0000:00:12.2/usb6/6-1/6-1.2`, or even better `/sys/bus/usb/devices/6-1.2`). I'm going to do it in some scripting language (shell, python, whatever) for any device inserted into the PC. **EDIT** : I get the original partition's devpath from udev, and I need to trace it back to the USB device entry. The most simple&stupid approach is to navigate the path upwards, up to the 6-1.2 entry. It has a few serious and obvious drawbacks, though. First, the device may or may not be connected to a hub, and thus its devpath may change. Second, the device may or may not have partitions, which also changes the devpath. I also need a generic solution, not just for the 6-1.2 device. Apparently, there are no symlinks leading to the actual device entry from the `.../block/sdb/sdb1` directory. Is there any elegant way to do what I want at all?


Can the same ext4 disk be mounted from two hosts, one readonly?

I know that mounting the same disk with an ext4 filesystem from two different servers (it's an iSCSI vloume) will likely corrupt data on the disk. My question is **will it make any difference if one of the servers mounts the disk read-only while the other mounts it read-write?** I know OCFS2 or the likes could be used for this and that I could export the disk with NFS to be accesible to the other server, but I would like to know if the setup I propose will work.


Where to find the VBR on the /dev/sda1 partition?

I have one built-in hard disk `/dev/sda` which looks like this:               Disk /dev/sda: 160.0 GB, 160041885696 bytes     255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00042134             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048   293048319   146523136   83  Linux     /dev/sda2       293050366   312580095     9764865    5  Extended     /dev/sda5       293050368   312580095     9764864   82  Linux swap / Solaris      Now I can easily find the MBR with `xxd /dev/sda | less`, it's located in the first sector. According to Wikipedia the VBR must be in the first sector within the first bootable partition, in my case `/dev/sda1`. But in the first sector of `/dev/sda1` I only see zeroes when I do a `xxd /dev/sda1 | less`. I actually thought to find binary code of GRUB in there, where could it be then?


bind9: client update denied

I've a bind9.7.3 running on Debian squeeze. I've configured a zone to accept dynamic update using a key: (I've replaced the key and the actual domain names ...)               key "yme" {             algorithm hmac-md5;             secret "topsecret";     };          zone "some-domain.de" in {       type master;       file "/etc/bind/zones/some-domain.de";       allow-update {         key yme;       };     };          zone "some-other-domain.net" in {       type master;       file "/etc/bind/zones/some-other-domain.net";       allow-update {         key yme;       };     };      Now, I send updates from a pfSense installation and I always get               22-Mar-2013 13:08:15.969 update-security: client 1.2.3.4#30949: update 'some-other-domain.net/IN' denied      The key is configured correctly on both sides, there is no clock skew between the both sides. What else could be the problem, what might I have overlooked?


Mint 16 - Won't boot to USB

I am attempting to completely remove my Linux Mint 16 MATE OS and reinstall Windows 8. At which point, I'll decide if I want to reinstall a Linux OS (most likely will). **The issue I'm having is that my computer won't boot to USB,** even though I've set USB as the very first option in the BIOS UI. I'm wondering if the fact that I've got a UEFI bootloader has anything to do with it... **I've disabled fast-boot and secure-boot options.** Any idea what might be the issue?


Shell script to replace string in multiple files within selected directories

I created the script below which takes the path of a single directory and replaces search string in all the files within that directory. I would like to enhance this script in such a way that it can search and replace the string in multiple directories which are listed in an external input file. External input file content:               /var/start/system1/dir1     /var/start/system2/dir2     /var/start/system3/dir3     /var/start/system4/dir4      Script with one directory:               filepath="/var/start/system/dir1"     searchstring="test"     replacestring="test01"          i=0;           for file in $(grep -l -R $searchstring $filepath)     do       cp $file $file.bak       sed -e "s/$searchstring/$replacestring/ig" $file > tempfile.tmp       mv tempfile.tmp $file            let i++;            echo "Modified: " $file     done


Sublime doesn't show on the GNOME Shell sidebar

I have a problem in GNOME Shell. I have Sublime Text installed via AUR but it's not shown in the sidebar. Here is the screenshot: ![the icon shown in applications list but not in dash, and i cant add it to favorite](http://i.stack.imgur.com/NSYeU.png) The icon shows in the applications grid but not in the sidebar, and I can't add it to my favorites. How can I fix this?


xscreensaver and keyboard layouts

xscreensaver doesn't show which is the current keyboard layout, so sometimes I can't enter my password, because I've switched to Cyrillic without knowing it. I found a discussion about the same problem at http://forum.xfce.org/viewtopic.php?id=6877, for example. Is there a way to make it show the current keyboard layout, or always switch to English? My system is Debian Wheezy.


Change the PS1 color based on the background color?

I learned that I can change the format of PS1, especially the color of the string. Then, is it possible to change the color based on the background color of the shell? Or, how can I detect the background color of the shell?


Keep tracking of symbolic links?

I use symbolic links quite often, but after moving the original file, I lose track of the symbolic link. I also use symbolic links for keeping track of some files in the same directory, but again, I lose track.   * Is there any way (tool/method) to keep track of the symbolic link no matter what change I make? Is the hard link the only way for this?   * Is there any way to make the symbolic link in a relative way so that when I move the directory that contains both the original and link, the link should work.


How does xrandr identify/choose which resolutions to offer?

My monitor has a maximum resolution of 2560x1440 (16:9). On one machine I run, (VMWare VM), xrandr identifies the highest resolution as 2560x1600 (16:10), and no other resolution suggested by xrandr is 16:9 either. I'm trying to track down the source of this, so I get it fixed. So what layers below xrandr affect the reported resolutions?               $ xrandr -q     Screen 0: minimum 1 x 1, current 1680 x 1050, maximum 8192 x 8192     Virtual1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 0mm x 0mm        800x600        60.0 +   60.3  (1.33)        2560x1600      60.0  (1.6)        1920x1440      60.0  (1.33)        1856x1392      60.0  (1.33)        1792x1344      60.0  (1.33)        1920x1200      59.9  (1.6)        1600x1200      60.0  (1.33)        1680x1050      60.0* (1.6)        1400x1050      60.0  (1.33)        1280x1024      60.0  (1.25)        1440x900       59.9  (1.6)        1280x960       60.0  (1.33)        1360x768       60.0  (1.77)        1280x800       59.8  (1.6)        1152x864       75.0  (1.33)        1280x768       59.9  (1.66)        1024x768       60.0  (1.33)        640x480        59.9  (1.33)      Cut out all the "VirtualX disconnected" lines following the above info. I also took the liberty of calculating and adding the aspect ratio for each of the resolutions within parenthesis, so that's not my xrandr being special and outputing that.


Running programs as root with my own password in Scientific Linux

In Debian-derived Linux distros, if you are not `root` but are authorized in `/etc/sudoers`, GNOME will ask you for your own password to allow privileged operations. However, Scientific Linux asks you for the real `root` password, even if you can run programs with `sudo`. A Google search suggests this is true for all Red Hat or Fedora-derived distros, but the suggested solutions are all very old, complex, and not very complete. How should I configure GNOME, or `gksu`, or kernel PAM, or what-have-you to let me use `sudo` properly within the GNOME GUI?


Upgrading php on a Linux server

I am running a Redhat on a webserver. The current version of php on the server is 5.1.6. I want to upgrade it to 5.3.8 so I downloaded php and compiled it and replaced the older php binary with the newer one. I then restarted the httpd daemon. When I type php -v on the command line it gives me 5.3.8 but when I look at php on the browser using I get 5.1.6. How can I resolve this? Thanks.


Command to Download Source Files in FreeBSD

In most Linux distros there is a command sometimes the same one used to install or build (compile) packages with extra switch; which just download the source files instead of building or installing them. I am trying to find the same command in FreeBSD. In FreeBSD we have `portmaster` but I couldn't infer anything like that from its man page.


Creating mounting point

1. I am mounting an image, and just realized that I have to create the directory for mounting point first. The command `mount` won't mount to a non-existing directory. But I seem to remember in some cases, when I insert some external device, such as external HDD and CD, I don't have to create mounting point myself. So I wonder when mounting points are required to be created by myself and when not?   2. Is it correct that mounting point directories can be created anywhere?  Then what is the purposes of the directories `/mnt` and `/media`? Aren't they for hosting mounting points of devices? PS: I am under Ubuntu 12.04. Thanks!


How to delete commands in history matching a given string?

I need to delete all commands in my history matching a string. I've tried:               $ history | grep searchstring | cut -d" " -f2 | history -d     -bash: history: -d: option requires an argument          $ history | grep searchstring | cut -d" " -f2 | xargs history -d     xargs: history: No such file or directory          $ temparg() { while read i; do "$@" "$i"; done }     $ history | grep searchstring | cut -d" " -f2 | temparg history -d     (no error, but nothing is deleted)      What is the right way to do this?


How do I know which processors are physical cores?

I've got an Intel i7 2700k here, and I'd like to know how I can tell which processors are physical and which are virtual (ie: hyperthreading). I'm currently running a Conky script to display my CPU temps, frequencies, and loads, but I'm not sure that I've done it right: ![awesome](http://i.imgur.com/nBlaH.png) I've written my own script to get temperatures and frequencies from `i7z`, but these only correspond to physical cores. I'm currently displaying each core like this:               ${cpu cpu1} ${lua display_temp 0} ${lua display_load 0}     ${cpu cpu2}     ${cpu cpu3} ${lua display_temp 1} ${lua display_load 1}     ${cpu cpu4}     # ...      I'm not sure that this is right, because of the loads and temperatures I see sometimes. In `/proc/cpuinfo`, how are cores sorted? First all physical then all virtual? Each physical core then its virtual core(s)? How are they sorted?


samba: files written to public share belong to nobody

I have setup a samba share like this:                   [shared]         path = /home/shared/         comment = shared         public = yes         writable = yes         printable = no      I can access it from windows, but when I upload files to it, the files I uploaded have the following permission:               -rwxr--r-- 1 nobody nobody 899381 Mar  7 11:59 letter17.rtf      What I would like to see is that, when a user accesses this share, the user acts as if he was a particular user of the samba server(say dave). So that he has access to files that 'dave' has access to, and the files he uploaded belongs to 'dave'.   which option do I use to achieve this?


Where is the frame.h located in modern Linux implementations? (ubuntu specifically)

A book I am reading refers to an include file that **shows how a stack frame looks** on one's UNIX system. In particular: `/usr/include/sys/frame.h` I am having trouble finding the modern equivalent. Anyone have an idea? I'm on Ubuntu 12.10.


We are using redhat linux ver5.4.I kept printing job and how to stop it.The job was given from another remote system.I am unable to stop it. I have given cancel -a 4 times , but it was not stopped.Please guide me.-HARI


Reset Nautilus "Computer" folder list

In my setup I tend to symlink major user folders in Linux to their Windows equivalents, IE Downloads, Documents, Pictures, Videos, etc. Usually I make sure nautilus isn't running before I do it and the default list of folders under "Computer" stays the same However my last change I forgot to do this and now the 4 folders above are filed under Bookmarks. Deleting the nautilus settings folder at `~/.conf/nautilus` doesn't fix it. Reinstalling nautilus with `yum reinstall nautilus nautilus-extensions` doesn't fix it. I'm not sure where else to go as I don't know how nautilus is loading these folders Does anyone have any suggestions on what to do to put the folders back under Computer?


Get the keycode of a key, from a custom made keyboard

I'm trying to transform a Minitel to a computer with a Raspberry Pi. This is a minitel: ![enter image description here](http://i.stack.imgur.com/bQAct.jpg) So I soldered the matrix of the minitel keyboard to a usb keyboard pcb, like this: ![enter image description here](http://i.stack.imgur.com/tgTjb.jpg) Everything is working ok, I recieve some keys from my custom keyboard. I just need to remap the keys appropriately. So I'm trying to create a program that will ask me to press `a` and trap the corresponding keycode, and then with all keys of my custom keyboard, to finaly produce a xmodmap file. The only problem I have is that I can't figure out on how can I get that keycode (and only that!). I tried `xev` but there's too much data displayed to filter it out. I know I could track all the keycodes by hand, but I'll transform 10 Minitels, so I would prefer a quicker way!


What changed between kernels 3.7 and 3.9 that affects LVM/RAID root file systems?

I'm trying to fix a (very messy) system that the user hosed by running a kernel upgrade from 3.7.10 to 3.9.6. the root file system is on an LVM volume on top of a software RAID array. The boot manager is grub2. The 3.9 kernel is unable to mount the root file system. It spits out the usual not-very-helpful bit about the device node not existing. This happens whether I use the UUID, the `/dev/{vg}/{lv}` or `/dev/mapper/{vg}-{lv}` notation for the root file system in the grub config file. The 3.7 kernel on the other hand is still on the machine and actually mounts the root file system and boots up just fine. Unfortunatly the modules got removed so even the keyboard doesn't work. I can book it up to a rescue cd, in which case the RAID arrays and LVM volumns come up just fine. Both kernels have matching `initrd` files that include the same set of modules. The initrd file is created by `genintrd` as part of the post-install process of the package manager1. LVM is built in and MD modules are present in the initrd. Further inspection2 of the init file shows they have identical root fs paths, the same one grub is passing in. I have tried searching around for the net for related issues but none of the cases out there seem to quite match this. I was unable to find anything about changes in the 3.9 kernel that would necesssitate a configuration change on the system from 3.7. What changed to the handling of LVM root file systems in 3.9? 1\. The distro is PLD-Linux, an RPM based distro. Kernel packages are stock rpm's from the TH tree.   2\. Inspected each one by extracting it using `gunzip | cpio -i` and observing module and script files.


How to properly setup web server directory permissions

I'm lost with this, hopefully I can find some help here: I have Ubuntu 12.04 LTS webserver. For example I have user "myuser". There is a public directory which is my web root. I chowned it and all files in it as www-data:www-data. This enabled me proper work of PHP which can create/write files as PHP and web server run under www-data.               /home/myuser/public/      My problem is that when I transfer files with rsync through ssh my permissions, user and group for the files are changed. This mean after every transfer I have to do my chown again.               rsync -azv . -e ssh myuser@server.com/public/      I'm not sure if chown-ing the files is the "right" way, but I followed this tutorial at DigitalOcean: https://www.digitalocean.com/community/articles/how- to-install-wordpress-with-nginx-on-ubuntu-12-04 and they do the following:               sudo chown www-data:www-data * -R      sudo usermod -a -G www-data username      As well as in other tutorials. I need some way when I will be not need to chown/chmod or whatever my files after each transfer (same as it works on shared hostings) Any ideas how to achieve that?


How does libusb access kernel stuff?

From what I understand:   * Generally speaking, a driver runs in kernel space and can be called from user space.   * Only code in kernel space can call usb low level things / `ioctl`   * `libusb` is a library, so it will compile and run in user space So how does `libusb` achieve low level USB?


Why can't I ping Google?

I can't ping google.com _(unknown host)_. But I can ping IP addresses. I tried to ping the IP address of Google but it doesn't work.   * ## `resolv.conf`              nameserver 8.8.8.8 nameserver 209.139.209.33         * ## `ifconfig -a`              eth0      Link encap:Ethernet  HWaddr 00:50:56:xx:xx:xx               inet addr:10.2.0.63  Bcast:10.2.15.255  Mask:255.255.240.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:638762803 errors:0 dropped:0 overruns:0 frame:0               TX packets:231307131 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:55502371533 (51.6 GiB)  TX bytes:23436883491 (21.8 GiB)          lo        Link encap:Local Loopback               inet addr:127.0.0.1  Mask:255.0.0.0               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:56011078 errors:0 dropped:0 overruns:0 frame:0               TX packets:56011078 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:4792283266 (4.4 GiB)  TX bytes:4792283266 (4.4 GiB)        * ## `route -n`              Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     10.2.0.0        0.0.0.0         255.255.240.0   U     0      0        0 eth0     169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0     0.0.0.0         10.2.15.1       0.0.0.0         UG    0      0        0 eth0        * ## `ping -c 4 -n 8.8.8.8`              4 packets transmitted, 0 received, 100% packet loss, time 13000ms


How to restore the /etc/init.d/pure-ftpd-mysql?

By a mistake... this is my new /etc/init.d/pure-ftpd-mysql:                   /etc/init.d/pure-ftpd-mysql restart      How to install or recover the file? The standard `apt-get remove`, `apt-get install` or `apt-get install --reinstall pure-ftpd-common pure-ftpd-mysql` doesn’t give me that file back. Kind regards.


External drive not being recognized

I am currently running elementary OS (a Linux OS based on Ubuntu so everything in Ubuntu works in it) - dual booting it with Windows 8. I have a 3TB external hard drive (USB 3.0) that does not seem to be recognized when I plug it in. It works fine under Windows (both 7 and 8). It is using a GPT partition table and is formatted as NTFS. When I plug it in, the light flashes on the drive but it doesn't show up under devices, if I run fdisk or gdisk they just seem to freeze. Using dmesg I can see this: > [ 1511.173737] usb 4-2: new SuperSpeed USB device number 6 using xhci_hcd   >  [ 1511.198057] scsi11 : usb-storage 4-2:1.0   >  [ 1512.198085] scsi 11:0:0:0: Direct-Access ST3000DM 001-9YN166 CC4C PQ: 0 > ANSI: 0   >  [ 1512.199618] sd 11:0:0:0: Attached scsi generic sg3 type 0   >  [ 1512.199836] sd 11:0:0:0: [sdc] Very big device. Trying to use READ > CAPACITY(16).   >  [ 1512.200003] sd 11:0:0:0: [sdc] 5860533168 512-byte logical blocks: (3.00 > TB/2.72 TiB)   >  [ 1512.200904] sd 11:0:0:0: [sdc] Write Protect is off   >  [ 1512.200915] sd 11:0:0:0: [sdc] Mode Sense: 23 00 00 00   >  [ 1512.201913] sd 11:0:0:0: [sdc] No Caching mode page present   >  [ 1512.201926] sd 11:0:0:0: [sdc] Assuming drive cache: write through   >  [ 1512.202655] sd 11:0:0:0: [sdc] Very big device. Trying to use READ > CAPACITY(16).   >  [ 1512.204294] sd 11:0:0:0: [sdc] No Caching mode page present   >  [ 1512.204306] sd 11:0:0:0: [sdc] Assuming drive cache: write through   >  [ 1543.300083] usb 4-2: reset SuperSpeed USB device number 6 using xhci_hcd   >  [ 1543.318785] xhci_hcd 0000:04:00.0: xHCI xhci_drop_endpoint called with > disabled ep ffff8801cb1ec480   >  [ 1543.318797] xhci_hcd 0000:04:00.0: xHCI xhci_drop_endpoint called with > disabled ep ffff8801cb1ec4c0   >  [ 1574.366771] usb 4-2: reset SuperSpeed USB device number 6 using xhci_hcd   >  [ 1574.385450] xhci_hcd 0000:04:00.0: xHCI xhci_drop_endpoint called with > disabled ep ffff8801cb1ec480   >  [ 1574.385454] xhci_hcd 0000:04:00.0: xHCI xhci_drop_endpoint called with > disabled ep ffff8801cb1ec4c0 and a bit later on: > [ 1698.142961] sd 11:0:0:0: [sdc] Unhandled error code   >  [ 1698.142972] sd 11:0:0:0: [sdc] Result: hostbyte=DID_ABORT > driverbyte=DRIVER_OK   >  [ 1698.142980] sd 11:0:0:0: [sdc] CDB: Read(10): 28 00 00 00 00 00 00 00 08 > 00   >  [ 1698.143000] end_request: I/O error, dev sdc, sector 0   >  [ 1698.143009] Buffer I/O error on device sdc, logical block 0 I have tried the drive in USB 2 ports as well but have the same issue and I can't really seem to find any relevant answers researching the output of dmesg so any help is greatly appreciated. Anyone have any ideas as to why it won't show up or what to try?


(IP Telephony, VoIP and Video Conferencing) Ekiga configuration for LAN with same subnet

I am looking for a Open Source Voice Chat Application, like Skype, but within an isolated intranet (no internet is available). Is there any application which can run on Scientific Linux or CentOS? Client-Server will be OK, but our need is Client Based. **Update:** As per Anonymous answer I have installed Ekiga. In two of Scientific Linux Terminal. These machines are in one network (same subnet), having 192.168.3.51 and 192.168.3.56.   When I open ekiga, both users are visible online to each other in neighbours section. But when I am trying to make a call, message appears "user is not available" ![](http://i.stack.imgur.com/JabAD.png)   and when I try to send a message ,in message box, after sending a message "NOTICE: Could not send message" error appears.   ![enter image description here](http://i.stack.imgur.com/CLxvT.png) While configuring I choose > I do not want to sign up for ekiga.net free service > > I do not want to sign up for ekiga call out service , because internet is NOT available to any my Linux boxes. Is there any configuration missing?![enter image description here](http://i.stack.imgur.com/J1NXc.png)


How to check in a shell script if an executable is running or not?

I have put an executable in a shell script file abc.sh. Now, I want to add _one_ line in this abc.sh, to know whether it is running before my script starts or not _and_ if yes, the _kill_ that executable.


Can't install Python3 package in Debian 7

I get error while installing _python3_ in Debian 7 (I have all updates installed):               root@nuclight:~# aptitude install python3     The following NEW packages will be installed:       python3 python3.2{a}      0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded.     Need to get 0 B/2,621 kB of archives. After unpacking 8,991 kB will be used.     Do you want to continue? [Y/n/?]      Selecting previously unselected package python3.2.     dpkg: warning: files list file for package 'python3.2-minimal' missing; assuming package has no files currently installed     (Reading database ... 101541 files and directories currently installed.)     Unpacking python3.2 (from .../python3.2_3.2.3-7_amd64.deb) ...     Selecting previously unselected package python3.     Unpacking python3 (from .../python3_3.2.3-6_all.deb) ...     Processing triggers for desktop-file-utils ...     Processing triggers for man-db ...     Setting up python3.2 (3.2.3-7) ...     /var/lib/dpkg/info/python3.2.postinst: 6: /var/lib/dpkg/info/python3.2.postinst: python3.2: not found     dpkg: error processing python3.2 (--configure):      subprocess installed post-installation script returned error exit status 127     dpkg: dependency problems prevent configuration of python3:      python3 depends on python3.2 (>= 3.2.3); however:       Package python3.2 is not configured yet.          dpkg: error processing python3 (--configure):      dependency problems - leaving unconfigured     Errors were encountered while processing:      python3.2      python3     E: Sub-process /usr/bin/dpkg returned an error code (1)     A package failed to install.  Trying to recover:     Setting up python3.2 (3.2.3-7) ...     /var/lib/dpkg/info/python3.2.postinst: 6: /var/lib/dpkg/info/python3.2.postinst: python3.2: not found     dpkg: error processing python3.2 (--configure):      subprocess installed post-installation script returned error exit status 127     dpkg: dependency problems prevent configuration of python3:      python3 depends on python3.2 (>= 3.2.3); however:       Package python3.2 is not configured yet.          dpkg: error processing python3 (--configure):      dependency problems - leaving unconfigured     Errors were encountered while processing:      python3.2      python3      Can you help me?


Busy Device on Umount

I often experience a problem to umount a directory:               umount /mnt/dir     umount: /mnt/dir: device is busy      There are many reasons why the device is busy. Sometimes there are processes running which have open locks on it, sometimes there are other directories mounted on top of `/mnt/dir`. My question: What are the steps to check why a directory couldn't be unmounted. I know there are many reasons, but it's ok if you explain a specific solution. [EDIT] [X] running processes on mounted volumes.   [X] another volume is mounted on top of a volume we want to unmount   [_] NFS locks the volume we want to unmount


What does port mean in context of a shell in unix?

From the book Advanced Programming in the Unix environment: > Linux uses the Bourne-again shell for its default shell. In fact,/bin/sh is > a link to /bin/bash.The default user shell in FreeBSD and Mac OS X is the > TENEX C shell, but they use the Bourne shell for their administrative shell > scripts because the C shell’s programming language is notoriously difﬁcult > to use.Solaris, having its heritage in both BSD and System V, provides all > the shells shown in Figure1.2. Free ports of most of the shells area > available on the Internet. What does the author mean by the term `port` here and how is it related to shells ?


How to continuously take backup of log files?

I have some applications in Lunux which creates Log files of around 41 MB each. The log files switches from log.1 to log.2 and starts overwriting log.2 once this 41MB is completed in log.1 file. I want to take the backup of these files in the way that whenever the new file log.2 reaches the size more than 1MB it take backup (gzip and store at another location) of other file (log.1). I have been using a script which takes the backup of file whenever it reaches 41MB but the trouble here is sometimes this 41MB file backup is take by script, still the data is getting written on the same file at a very huge rate because of which it loses some seconds of log data which is the reason i am trying the alternate way of making backup of other file once the new file reaches 1MB or something so that i am sure that the other file is finished writing. Any idea how do i do that?


Why do I have to use sh to execute scripts from CD/DVD media?

I hit again on this strange behaviour of the system. I'm running Debian 6.0.6 and had quite some troubles executing a script directly from CD/DVD. Finally I had to use:               sh /media/cdrom/command      to run it. What is the big deal of having to resort to sh?! What if the script relies on bash features? Really annoying and not much added to security in my opinion Does anybody know of a good reason for that behaviour? PS: if you try to run it directly with ./... you get an error that does not suggest any hint to the issue (filesystem mounted noexec):               bash: ./media/cdrom/command: No such file or directory      If you run it as bash /media/cdrom/command you get the same error (I think verification of mount options are verified by bash even for commands passed as parameters on the command line. Permanent solution is to add exec to the mount options in /etc/fstab such as:               /dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec     0       0


What's the difference between the drivers r8169 and r8168?

Realtek provides the source code for the r8168 driver which is based on the r8169 driver from the kernel tree if I may believe their source:               /*      * This driver is modified from r8169.c in Linux kernel 2.6.18      */      Both are GPL licensed, so source code may be exchanged with no legal issues. That's why I find it rather strange that Realtek maintains a separate driver with no changelogs or documentation. What's the difference for the end user? Which driver is recommended?


I bought a game from Ubuntu Software Centre, How do I download it for Linux Mint?

I bought the game TRAUMA from the ubuntu software centre, using my login user/password and paid with my debit card, I can download and play the purchased game in ubuntu fine. But I recently switched to Linux Mint, and it's not in the repositories, I looked on the trauma site and it there is no login, or anything, I don't want to pay again :( Is there any way I can retrieve my purchased game? Thank you.


Testing equivalence for exit status

Are the following two command lists portably equivalent?               $foo; echo $? #(1)      and               $foo && echo 0 || echo $? #(2)      ## Postscript Consider the command `exit-status` defined so:               #!/bin/sh     exit "$1"      Does the POSIX standard forbid the following?               > exit-status 2 && echo "impossible branch"; echo $?     1      If not, then a POSIX-compliant shell could fail to equate the two uppermost command lists. Which isn't quite the same thing as not being portable...


How can I sort a .txt file by two columns?

Feb  7  domainserver dovecot[37495]: auth(default): od(tjones): lookup failed for user: tjones      Above is a sample output of what I'd like to sort. I'd like to sort by date on the first column, but also by `tjones` on the right, which would be the user. Basically, I want all instances of `tjones` grouped together, but sorted by date. I really have no idea what command to use in order to do this, or if I need to use the awk command to rearrange columns. There are obviously more users than `tjones`, so I'd just like to sort by those two columns I tried the following, but it brought up an error "sort: multi-character tab `\t'"               sort -t '\t' -k1,1 -k5,5n auth_2014uniq.txt > auth_2014uniqtest


How to pass parameters from %prep to %build?

I have the following problem: In the `%prep`, I run a command that returns a value. I want to be able to use this value in the `%build`. I was not able to do it with macros, because `%global` gets its value on init, and `%declare` is executed when called. I also wasn't able to use bash parameters because they are not shared between `%prep` and `%build`. I have 2 workarounds: Do all in `%prep`, or save the value to a file. I'm not comfortable with any of these workarounds. This seems to be a simple task. Am I missing something?


Is GREP_OPTIONS= --color=always ignored?

I was playing around with setting `GREP_OPTIONS` and couldn't get it to work. Just curious as to why. Simple test commands output:               richard@ubuntu:~$ echo $GREP_OPTIONS          richard@ubuntu:~$           richard@ubuntu:~$ ls | grep o      Desktop     downloads     Dropbox     ebooks     workspace          richard@ubuntu:~$ ls | grep o --color=always | less -R           richard@ubuntu:~$ export GREP_OPTIONS="--color=always"      richard@ubuntu:~$ ls | grep o  | less -R         1. The 1st grep outputs to the terminal in color (each 'o' is red)   2. The 2nd grep outputs via less in color (same as 1)   3. But the 3rd grep outputs to less but in black & white - but this should be in color. So it appears that grep is ignoring `GREP_OPTIONS`. Is that a bug or am I doing something wrong? (Ubuntu 12.04.2, GNU grep 2.10)


Ctrl+Alt+F8 meaning

I know that `Ctrl`+`Alt`+`FX` (X=1 to X=7) are 7 different ttys. Suddenly, I tried to find out what other combinations `Ctrl`+`Alt`+`FX` (X=8 to X=12) leads to. After pressing the combinations, I found that a black screen with just a cursor blinking. Can somebody please explain me what this means. After again pressing `Ctrl`+`Alt`+`F7` I can go back to the XWindows.


How overwriting works for non-contiguous files?

In _ext4_ (or _ext*, ntfs, fat_ ) file system, if I overwrite a non-contiguous file will the same non-contiguous storage spaces be used or there's a different way to handle such?