Installing shared library - questions and problems

I'm having trouble "installing" a shared library I download online. The library name is run time access (http://www.runtimeaccess.com/). In the quick start guide, they explain how to use the library using -L when compiling to define the library location and exporting the LD_LIBRARY_PATH env variable after adding the path of the library dir. First of all why do you need to define the lib location twice? using -L and LD_Library_PATH env variable? Second part. I'm trying to avoid passing these arguments and also avoiding modification of the LD_LIBRARY_PATH env, so all I have to do is compile like so:               $ gcc myapp.c -lrtadb      so I would like to include the lib as part of the system lib. So I copied the whole `rta-0.8.1` folder to `/usr/local/lib/rta-0.8.1` and then add a `/etc/ld.conf.d/rtadb.conf` file containing the path of the library directory `/usr/local/lib/rta-0.8.1/src` in there.               $ cat /etc/ld.so.conf.d/rtadb.conf      #rta (run time access) lib     /usr/local/lib/rta-0.8.1/src      and then I ran `sudo ldconfig` to update the shared library list - but no luck. When I try to compile my code, the library is not found:               $gcc myappdb.c -lrtadb     /usr/bin/ld: cannot find -lrtadb     collect2: ld returned 1 exit status      What am I doing wrong here? here is the list of files in /usr/local/lib/rta-0.8.1/src               user@ubuntu:/usr/local/lib/rta-0.8.1/src$ ls -l     total 724     -rw-r--r-- 1 root root  24994 2012-11-14 10:49 api.c     -rw-r--r-- 1 root root  26132 2012-11-14 11:07 api.o     -rw-r--r-- 1 root root  62634 2012-11-14 10:49 do_sql.c     -rw-r--r-- 1 root root   5419 2012-11-14 10:49 do_sql.h     -rw-r--r-- 1 root root  41184 2012-11-14 11:07 do_sql.o     -rw-r--r-- 1 root root 149186 2012-11-14 11:07 librtadb.a     lrwxrwxrwx 1 root root     15 2012-11-14 11:07 librtadb.so -> librtadb.so.3.0     lrwxrwxrwx 1 root root     15 2012-11-14 11:07 librtadb.so.3 -> librtadb.so.3.0     -rwxr-xr-x 1 root root 117749 2012-11-14 11:07 librtadb.so.3.0     -rw-r--r-- 1 root root   2387 2012-11-14 10:49 Makefile     -rw-r--r-- 1 root root  10962 2012-11-14 11:07 parse.output     -rw-r--r-- 1 root root  21929 2012-11-14 11:07 parse.tab.c     -rw-r--r-- 1 root root    425 2012-11-14 11:07 parse.tab.h     -rw-r--r-- 1 root root  25064 2012-11-14 11:07 parse.tab.o     -rw-r--r-- 1 root root   6711 2012-11-14 10:49 parse.y     -rw-r--r-- 1 root root  46636 2012-11-14 10:49 rta.h     -rw-r--r-- 1 root root  31551 2012-11-14 10:49 rtatables.c     -rw-r--r-- 1 root root  17028 2012-11-14 11:07 rtatables.o     -rw-r--r-- 1 root root  58843 2012-11-14 11:07 token.c     -rw-r--r-- 1 root root   6291 2012-11-14 10:49 token.l     -rw-r--r-- 1 root root  37996 2012-11-14 11:07 token.o      btw, I'm running Ubuntu 10.04 LTS thank you. edit: if your new to this info read link below: http://www.tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html


uploading from Netbeans to remote CentOS server failed

I have a php web application on Netbeans on my Ubuntu , and server is CentOS on a virtualBox . Suddenly uploading to server stopped and I'm getting these errors for non-root user : > >     Failed: >     file      backup_restore.php                Cannot upload file > backup_restore.php (unknown reason). >     file      jq/ajax.js                        Cannot upload file ajax.js > (unknown reason). >     file      login.php                         Cannot upload file login.php > (unknown reason). >     file      templates/backup_restore.html     Reason: Cannot change to the > remote directory /. >   I checked SELinux and it's disabled , I also tried to make a new project folder but It didn't help ! Does anyone know what is this problem ?


repairing a damaged grub with centos

I have a damaged grub in my centos system. to repairing this problem, I use rescue mode and then I execute this follwing comand :               chroot /mnt/sysimage          grub-install /dev/mapper/ddf1OSp3          and then reboot ;      when boot from hard disk, it's sshow error message "file not found" when I execute the same comand in grub.conf under grub CMD, it s work fine and the file existe !! how to proceed to resolve this problem information about system : linux kernel 2.6. repartition of disk:               $ df          /dev/mapper/ddf1OSp3    /          /dev/mapper/ddf1OSp1    /boot          /dev/sdd1               /data          tmpfs                   /dev/shm


Where is fsck startet for the root filesystem at boot?

I want to extend an existing **Debian 6.0** system so that it is able to automatically fix a corrupt root file system by restoring a separate image. That process should start automatically instead of the typical               UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY      error message (so that the machine can be left unattended). I was expecting that some script in `initrd.img` is responsible for checking the root fs (and handling error cases like the one above), but I can't find it. Is that job perhaps done by the Kernel itself or the boot loader (GRUB in this case) ? (I'm using `initramfs`)


sox: splitting audio on silence but leaving tails

I love how sox has the ability to split an audio file on silence. The issue I'm haivng is that occasionally my audio tracks end with fadeouts, or notes decaying into reverb (subtle sounds that sox will mistake for silence). I'm trying to adjust the sox command to split the tracks on silence, but LEAVE a LITTLE silence after each split. I can't figure out exactly how to do it. here's the command I have so far:               sox in.wav out.wav silence 1 2 0.5% 1 4.0 0.9% : newfile : restart      Any help with this would be greatly appreciated!


Log number of keyboard hits

How can I log a keyboard hit via shell script? My aim is to log the number of keyboard hits of a login session on my Ubuntu system. Note: I do not want to log the keystrokes itself, only the number of hits. So in the end it says:               94853 hits today.


Zipping files two by two

I have a directory that has 800 files like this:               file1.png     file1@2x.png          file2.png     file2@2x.png          file3.png     file3@2x.png          ... etc      I need to create zip files like this               file1.zip (containing file1.png and file1@2x.png)     file2.zip (containing file2.png and file2@2x.png)     file3.zip (containing file3.png and file3@2x.png)      Is there a magic command I can use to do that?


Default printing options in KDE 4 dialog

How can I set default printing options, so that they are always pre-populated in the KDE 4 print dialog window (when printing from Ocular for example)? EDIT: In particular I would like to set duplex printing and printing colour as grey to be default parameters.


Have backticks (i.e. `cmd`) in *sh shells been deprecated?

I've seen this comment many times on Unix & Linux as well as on other sites that use the phrasing "backticks have been deprecated", with respect to shells such as Bash & Zsh. Is this statement true or false?


NFS Automatic Fail-over or Load-balanced or Clustering?

I've been using `NFS` _(and it is the only one i know well in Network Files)_ for a few years. But still can not able to find out ..   * How to make `NFS` Servers in Clustered Design (or Load-balanced?)   * Or at least to having it deployed on MORE-THEN-ONE Server and to "Automatic Failover". * * * The major objective is to NOT TO let my single running NFS Server a Single- point-of-Failure. * * * Since i do not know how to make it properly, so far i have invented on my own is:   1. NFS on 2 Servers.   2. RSYNC from 1st (assumed Master) Server to another 2nd Server.   3. From Application (Web, etc) Servers, put a `Shell Script` to check the healthy state of NSF-Master Server Mount Point. And then if need, auto-unmount from it (leaving) and then auto-mount from 2nd one.   4. The main function i used in my automatic Shell Script, is `nfsstat -m` .. to check the health of mount point. _(I'm using **Redhat** )_ But anyway, i still DO NOT think it is the safe & standard way. Please kindly suggest the best ways as in something like _Industrial Standard_ if there are.


How to copy 5 newest files from one directory to another and delete the old copies

How can I copy the 5 newest files from a directory to another in a "new to old" order.


Blank lines of unknown origin when running vim after tput clear

I have a rather bizarre issue with terminal behaviour. If I execute `tput clear` to clear the screen, my cursor (as expected) goes to the top of the terminal. If I run `vi` after that (`vim` actually), when it exits there are some blank lines before the next prompt. When I do that normally, the prompt simply shows up at the next line. The following shows a transcript after `tput clear` and running `vi` twice (simply exiting each time):               +--------------------------+     |pax> vi                   |     |                          |     |                          |     |                          |     |pax> vi                   |     |pax>                      |     :                          :     +--------------------------+      As you can see, the first execution left three blank lines between the prompts, the second left none. Other terminal manipulation style programs like `less` don't exhibit this behaviour. There's nothing the least bit suspicious in my `PS1` prompt variable, it's simply set to `"pax> "` with absolutely no funny characters or escape sequences. What could be causing it? Environment: running Debian 7.3 (from `/etc/debian_version`), vim 7.3 (from `vim --version`), Gnome Terminal 3.4.1.1 (from `gnome-terminal --version`), `uname -a` output of:               Linux paxbox01 3.2.0-4-686-pae #1 SMP Debian 3.2.51-1 i686 GNU/Linux


Finding function parameters for functions in shared object libraries

I am currently fiddling around with some c libraries without documentation. I am wondering if it is at all possible to retrieve more metadata, such as parameters and return values, outside of what is provided by calling `nm -D` or `objdump -T filename | grep text`. I'm not sure if this is possible, but if it is, it saves me from hunting down whoever was in charge of the library! Edit: I'd like to be able to do this without reading machine code if possible. It appears that there are some solutions that allow me to do so easily if I was an expert at machine code, but since I am not and do not have the current desire to jump down that rabbit hole, I'm really hoping there is another way.


Command-line editing and wrapping

When entering long queries into the command-line `psql`, my terminal[1] is not wrapping the input line correctly. Additional charactes wrap back to the left of the screen, but on the same line as the existing text, and further editing is difficult. How can I enable multi-line editing in `psql`? Mutli-line editing in bash via SSH wraps correcty, so this is related to `psql` specifically. For reference:               $ psql --version     psql (PostgreSQL) 8.4.21     contains support for command-line editing      This is unrelated to using screen/byobu? When I launch `psql` outside of screen/byobu. it displays multi-line inputs somewhat better (they now span multiple lines), but editing is still not possible due to incorrect positioning of the cursor. I experienced similar difficulties editing long input lines when using iTerm2 with and without screen/byobu. In both cases, the terminals were set to default value for emulation (xterm-256color). I experienced the same difficulties using xfce4-terminal in Xubuntu in a VirtualBox. I experienced the same difficulties using PuTTY from a Microsoft Windows Vista computer. Has `psql` ever handled multi-line editing correclty? I've used it for years and have never experienced this difficuty before ... [1] Terminal.app in Apple Mac OS X Mavericks, with a secure shell session to an Ubuntu server running bash.


BSD Kernel Vs. Linux kernel?

I wanted to know in technical terms; what is the difference between `BSD Kernel` and `Linux Kernel`.   In Linux, we can download the source kernel then `patch` it and `make` and `make modules` it. Even we have multiple tools to edit the kernel `config` such as `menuconfig`, `xconfig` and ... .   But I couldn't find such kinda vast field on BSD. First, Could I download the `BSD kernel`? How could I config it? and ... So what am I asking is: (Without referring to ancestry and etymology)   * Is the `Kernel` in each case (in)dependent of a distribution?   * Ways to config Each `Kernel` and tools available for the job?   * Whether any Patch work could be done in each case?   * Availability of the `kernel` outside the realm of distribution? (`Kernel Sources`)?   * Flavour of `Kernels` available in each case (`X??BSD`/`Linux`) Like `XEN/Vmware/GEN`?


what does a "deleted file" entry look like in the journal

I hope I've got this right: A file's `inode` contains data such as inode number, time of last modification, ownership etc. - and also the entry: » ** _deletion time_** «. Which made me curious:   _Deleting_ a file means removing it's inode **number** , thus marking the storage space linked to it as available. There are tools to recover (accidentally) deleted files (e.g. from a journal, if available). And I know the `stat` command. ## Question **What does a "deleted file" entry look like in the journal?** My guess is a quite unspectacular looking output as such as if issued the `stat`'s command`. I know that deleting a file and trying to recover it would be a first-hand experience, but then I'm not at a point where I could do this without outside help and I want to understand exactly what I'm doing. Getting into data resurrection would be sidetracking for me at the moment, as I try to get a firm grip on the basic stuff … I'm not lazy, this isn't homework, this is for private study.


Amazon EC2 micro instance large number of IO requests

I'm trying to understand why I have a huge number of EBS IO request on my Amazon EC2 micro instance. I launched the instance roughly 6 days ago and has racked up over 4 million IO requests so far. The instance came pre-loaded with a LAMP stack (Virtualmin, PHP, Apache, MySQL). I installed one Wordpress site and only loaded it in a browser a few times to do some testing. Can anyone guide me on how to determine what is generating all these IO requests possibly using `iotop` or some other Linux utility?


Backup 'empty' parts of disk drive

I have a USB drive which has around 7MB of 'empty' space at its beginning. The first partition in MBR starts at 8225kB, according to Parted. How can I back up this space using something like `dd`? I've already backed up the MBR table using `dd if=/dev/sdX bs=512 count=1 of=device.mbr`. How can I give dd a byte range in the disk to grab and then write that locally to a file on disk?


How does the kernel know which file descriptor to write data to after fork() in a concurrent server?

Basic concurrent client/server architecture: There's a main loop listening for requests on a port (for example 3000), after accepting the connection the server spawns a child process that ends up having access to file descriptors where data can be read. If we have multiple clients connected to the server, the server will have a child process per request. So S1 (child server process) reads data from C1 (a client), S2 reads from C2 and so on. My question is how is it possible that all clients (C1, C2...) are sending information to the same port (3000) and yet the server processes (S1, S2...) are reading only the information sent from the client assigned to them? Where is the multiplexing being done and how?


How to renumber GPT partitions on an umounted disk?

I tried to sort (renumber) partitions on `/dev/sdb` via terminal, using `gdisk` from the operating system (running on `/dev/sda`) and none of the `sdb` partitions mounted but the only option I get is `[-l]` which lists options the option I'm trying to use.               root@arch-bill /home/bill # lsblk     NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sda      8:0    0 931.5G  0 disk      |-sda1   8:1    0  15.6G  0 part /     |-sda2   8:2    0 915.9G  0 part /home     `-sda3   8:3    0     2M  0 part      sdb      8:16   0   1.8T  0 disk      |-sdb1   8:17   0     2M  0 part      |-sdb2   8:18   0     4G  0 part      |-sdb3   8:19   0    16G  0 part      |-sdb4   8:20   0    60G  0 part      `-sdb6   8:22   0   1.8T  0 part      sr0     11:0    1  1024M  0 rom       root@arch-bill /home/bill # blkid     /dev/sdb1: PARTUUID="c1073e4b-fc00-4f02-8b81-6f17b8a188c4"      /dev/sdb2: LABEL="var" UUID="62921c0a-5d34-464d-8a7a-2ff46ad8f12b" TYPE="ext4" PARTUUID="c350316a-0bd8-4e82-8597-123553977f99"      /dev/sdb3: LABEL="rootbkp" UUID="c245c20e-d503-4b61-aaaf-060aae1b21d4" TYPE="ext4" PARTUUID="b1f391db-de37-479c-8b44-ff27f3bd6aa5"      /dev/sdb4: LABEL="snapster" UUID="8fef4e0a-efd4-455b-b484-83bd4500161f" TYPE="ext4" PARTUUID="02801cd9-3fe5-4814-9b92-c4c83b86173d"      /dev/sdb6: LABEL="homebkp" UUID="51d73ac7-fd96-4ac1-b4f3-4abf6bc4936b" TYPE="ext4" PARTUUID="481ae7d0-228f-4979-8949-befbd498534b"      /dev/sda1: UUID="91865df2-0841-42f5-80f3-a5133976e70f" TYPE="ext4" PARTUUID="48dc34cb-e791-4838-b9f2-2fe2b2cced33"      /dev/sda2: UUID="e5743a89-13ed-4c96-b39d-78cb6478fb72" TYPE="ext4" PARTUUID="4156cbf2-2a2d-47ae-87cf-99c14cf8f2c2"      /dev/sda3: PARTUUID="8669392a-663e-4e15-bc63-a6a5e95c97ad"           root@arch-bill /home/bill # gdisk -s /dev/sdb     GPT fdisk (gdisk) version 0.8.10          Usage: gdisk [-l] device_file     1      root@arch-bill /home/bill # gdisk -l /dev/sdb                                                                                :(     GPT fdisk (gdisk) version 0.8.10          Partition table scan:       MBR: protective       BSD: not present       APM: not present       GPT: present          Found valid GPT with protective MBR; using GPT.     Disk /dev/sdb: 3907029168 sectors, 1.8 TiB     Logical sector size: 512 bytes     Disk identifier (GUID): 0645408C-0374-4357-8663-D2A3512E07BD     Partition table holds up to 128 entries     First usable sector is 34, last usable sector is 3907029134     Partitions will be aligned on 2048-sector boundaries     Total free space is 4204653 sectors (2.0 GiB)          Number  Start (sector)    End (sector)  Size       Code  Name        1            2048            6143   2.0 MiB     EF02          2            8192         8396799   4.0 GiB     0700          3         8398848        41953279   16.0 GiB    0700          4        41955328       167786495   60.0 GiB    0700          6       167788544      3902834687   1.7 TiB     0700       1 root@arch-bill /home/bill #


How to tell aptitude to automatically install missing packages instead of removing ones to statisfy dependencies?

I'm creating a live CD with Skype using live-build. During the build process I run the following script:               # Download the Skype package suitable for Squeeze     wget --continue -O skype-install.deb \         http://download.skype.com/linux/skype-debian_4.0.0.7-1_i386.deb     # Install the package.     dpkg -i --force-architecture --no-debsig skype-install.deb || true     # Fix missing dependencies     aptitude -f install      The problem is that `aptitude -f install` suggest to remove Skype instead of installing the missing libraries. I have to tell it interactively to prefer the second solution. Can I tell somehow on the command line? Ideally I'd like to run it unattended like               aptitude -y --some-flag-to-ensure-no-removals -f install


Use a keyboard shortcut to switch between synergy-"ized" monitors/windows

Is it possible to map a command to my keyboard so that I can switch between my various windows? I checked on the synergy website but was not able to find very much about the subject. I'm trying to be able to essentially alt+tab and cycle through all the applications I have running on all my computers. It's not necessary that all windows show up on the main screen but I'd like to be able to shift focus to a different window without having to move my mouse.


Open a directory and let it update itself using "tail -f"

Similar to my last question: Open a text file and let it update itself; is there a way I could do the same but for a folder instead? As I have a log folder, can I use `tail -f` with a folder? i.e.               $ tail -f /tmp/logs/      I know that this won't work, but is there an alternative? I am using RHEL 5.10


Multiple PHP Versions / cPanel with mod_fcgid

I'm trying to get multiple PHP versions working on a cPanel server which was compiled with mod_fcgid and PHP 5.3. Below is the PHP config generated by cPanel.               AddHandler fcgid-script .php5 .php4 .php .php3 .php2 .phtml     FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php5     FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php4     FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php     FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php3     FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .php2     FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .phtml      I did compiled PHP 5.2 from source and placed it's files under /usr/local/php52 then created a wrapper as below;               #!/bin/sh          exec /usr/local/php52/bin/php-cgi      Then added the below to Apache's PHP configuration file.               AddHandler fcgid-script-php52 .php52     FCGIWrapper /usr/local/cpanel/cgi-sys/php52 .php52      I am not sure if this is the correct approach for this. Now what I wonder is how I can have a specific account to utilize this wrapper instead of default one?


Scaling issues of i7 3520M with intel_pstate module on Kernel 3.10.0

Few days ago I updated my openSUSE 12.3 system from Kernel 3.9.8-1.gf3348a8-desktop to 3.10.0-1.g3dcd746-desktop and since then, turbo mode of my i7 3520M is enabled by default and it does not throttle down when idle. It is constantly running at 3.6GHz. The `intel_pstate` module is enabled by default, thus any userspace settings are ignored (as intended). Tools such as cpufreq or cpupower are not installed any more on my machine. Booting the 3.9.8 Kernel still shows its old behaviour, that the CPU is throttling as expected. In addition, adding `intel_pstate=disable` to the kernel command line deactivates the intel_pstate module resulting in the desired behaviour of a throttling CPU. Another point of minor interest is, that I'm not able to trigger the turbo mode of my CPU if it is throttling (i.e. Kernel 3.9.8 or disabled intel_pstate). Any help is appreciated.


Are layer 2 protocols part of NIC or NIC's device driver at kernel?

1. Are layer 2 protocols like IEEE 802.2 (LLC), PPP, HDLC, frame relay, etc part of NIC or NIC's device driver at kernel?   2. When we configure layer 2 protocol to be used like PPP, where is the configuration file stored? The only thing I am quite sure is IEEE 802.3 has to be part of NIC because it controls the transceiver (transmit/receive) activity on the medium/media.


Fault injection into a specific function

I want a tool for fault injection in linux C code programs (currently I'm trying to inject faults on Gedit). I want to corrupt function return values, like a bit flip into the binary representation, corrupt internal values, internal comparisons, but without the need to modify the code manually and recompile the program again. I want it in execution time.


Pip install - CPU you selected does not support x86-64 instruction set

I'm trying to use `pip install mysql-python` inside a virtualenv container and am getting the error               building '_mysql' extension          gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,2,4,'final',1) -D__version__=1.2.4 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1          _mysql.c:1:0: error: CPU you selected does not support x86-64 instruction set          error: command 'gcc' failed with exit status 1      Why is gcc trying to use `-march=i686` when I'm on a 64-bit system and using a 64-bit version of Python?


How to execute changes on remote server as root?

I'm wondering if there is a way to execute a script/commands from the the local machine without making any modifications as root on the remote machine? **Some background** I'm trying to setup some tasks via Capistrano and I require `sudo` access. There are about 30+ servers and for me to manually update `/etc/sudoers` will be painful so I was wondering if there is a method to update this file remotely?


How can I learn some advanced logrotate techniques?

The `logrotate` section in the Linux administrator's handbook is very brief. The `man` page is ok but lacks examples. Where can I find some more comprehensive information, examples, and best-practice information for this command?


Is file /etc/vfstab Solaris specific?

Is file /etc/vfstab Solaris specific. I mean it only exists in SunOS/Solaris and there is no such file in other UNIX-es/Linux/*BSD.


Ubuntu Server Continuously "goes to sleep"

I am running a web server at home using Ubuntu 11.4 (maybe? I can't 100% recall) on an older AMD 2400+ desktop with 1 or 2 GB of RAM. Sorry I can't recall the details 100%. Anyway, I have a KVM hooked up to a monitor and PS2 keyboard that I use to switch between the server and my iMac (The keyboard is only hooked up so I can switch between the two easily. Many times a week, Pingdom will tell me the server is down and I can't hit the server. When I get home (it rarely happens when I am home), I hit the Ctrl key twice to switch to the server, hit the space bar and everything is now up and running again. I need to look again, but I don't believe there is any power saving features turned on in the BIOS. Does anyone have any other suggestions of what I may have going on? I have my uncle's website running on it now and I really would like to have a better up- time than 95% As a note, I do not have any GUI installed so everything has to be done on the console (or through WebMin) and I know my way around, but I am by no means experienced.


Do all Linux distro's use the same cryptographic hash function?

Do all Linux distro's use same Cryptographic hash function? If yes, is it provided with the kernel itself? **EDIT:-** I refer to the function mainly used for storing user login passwords.


Should /usr owner be root?

After having installed the MySQL database on openSUSE I realized that for all files in `/usr/bin` the owner was changed to the "mysql" user of the "mysql" group. Maybe there was some mistake of mine. The worst problem was with the `/usr/bin/sudo` command, which obviously did not work, but I've taken back the ownership to _root_ (having logged to _root_ ) and it is OK now. Should I change owner of all files in `/usr/bin` to _root_ or may this cause some malfunctioning of other programs? Should they also have the "Set UID" option marked in the Privileges tab as `sudo` does?


How can I find and filter a specific column in a .csv file?

I have .csv files with the following structure:               cat,dog,mouse,pig,bird,cow,...     21,34,54,566,78,1,...     23,10,12,569,56,4,...     32,20,13,123,56,3,...     34,30,44,322,66,2,...      I want to filter the column related to the mouse, for instance:               54     12     13     44      How do I do it? Please keep in mind that I do not know in which column the mouse is found (my files are quite large, there are several files to filter, and the positions of the columns vary). If I knew the exact position, I could use, for instance:               cat $file | awk '{printf("%s\n", $3);}' > filtered_file      What if I do not know the mouse is in column 3? I really appreciate any help.


Russian timezone is not up-to-date

I have noticed, that the Russian timezone is not up-to-date. The GMT offset is set to +3 h now, whereas the current GMT offset is +4 hours. Could someone tell me how can i manually edit the tzdata file to set it up to date?


Listing audio files with bit rate in the command line

Is there a way to list the contents of a folder via the command line in such a way that the audio files in mp3 format have the bit rate info? I tried `ls -l` but it doesn't work.


What is the foolproof/proper way to set hostname and domain on CentOS

I've seen a few ways of changing hostnames of domain names. One way is to issue the `hostname` command followed by the name such as:               hostname localhost.localdomain      `/etc/sysconfig/network` also has a `hostname` field, but changing that does not affect the output of the `hostname` command. My question is, where is each of these used, which do I care about and why? What's the proper way of setting the hostname?


Is it possible to copy data from one screen session to another?

I recently needed to copy X amount of lines from a file, that I opened in `vim` and then paste them to another file opened in a different screen session (and different server). So on screen #1 I ran in `vim`: `:15,20y` and on screen #2 I tried to use `p` to paste the lines, but I couldn't because the register was empty (to be honest, I was expecting that but I just wanted to give it a try). I eventually worked my way around in order to get those lines to the right place, but I wonder if it is possible to copy-paste data between screen sessions.


Shutdown my (backup) hard disk on Linux when I don't use it

I have a hard disk in my computer that I use to make backups of my data. I do not use this disk otherwise. How can I stop this disk from spinning once my backup is finished? Also how would I make it spin back up again before the backup takes place later on? The drive is a regular SATA drive.


How to limit a UNIX user to only a given script?

How can I limit a UNIX user (BESIDES sudo!) to only allow it to run a script as root?


Whether monitor is off without appealing to X or /proc

How can I know whether the monitor is on or off if `X` is not running, and without appealing to `/proc/acpi/video`? The latter isn't available from my kernel. If `X` is running it's just a matter of                 $ DISPLAY=:0 xset -q 2>/dev/null| grep "^\s*Monitor is"      But what if `X` is **not** running?


Keep NumLock always on

I have standard keyboard with numerical keys on the right side (I guess it's called 104-key keyboard). I want to use the numerical keys only as numerical keys. That means, I don't want the `NumLock` to switch on and off the numerical keys. However, sometimes it happens (I don't know how, perhaps by me accidentally hitting the `NumLock` key) that the numlock is turned off, and I have to press it again. This is extremely annoying. Is it possible to disable switching off numlock? In other words: **I want my numerical keys to always act as number keys, and to disable the numlock switch**. I am using Debian and LXDE (Openbox).


problem reading and comparing files using nested loops

while read newfile <&3; do         if [[ ! $newfile =~ [^[:space:]] ]] ; then  #empty line exception         continue      fi         #      while read oldfile <&3; do         if [[ ! $oldfile =~ [^[:space:]] ]] ; then  #empty line exception         continue      fi            echo Comparing "$newfile" with "$oldfile"         #         if diff "$newfile" "$oldfile" >/dev/null ; then           echo The files compared are the same. No changes were made.         else             echo The files compared are different.         fi          done 3</infanass/dev/admin/oldfiles.txt     done 3</infanass/dev/admin/newfiles.txt      I think this is the right way to do nested loops.. but it doesnt quite work right.


How is cron scheduling actually implemented and makes sure scripts run on time?

I want to ask about cron jobs. OK, we place the scripts in the crontab and the cron daemon executes them. Now if I understand this, each minute, cron checks the crontab of each user and executes the configured scripts. But how is this actually done? Does it fork child processes etc? It can not execute the tasks sequentially since the timings would be lost (e.g. due to waiting a long-running script to finish). So how is this actually implemented. Just to help out, I'm not looking for low level code. A high level description (of the algorithm perhaps?) or how this is implemented in most distros would suffice to me.


Bootup prompt for ecryptfs password

Is it possible to setup ecryptfs mounts to prompt for password upon bootup? Say for example /home and /var are ecryptfs folders that need to be mounted; how do I force a prompt upon bootup to ask for mount passwords?


Can't map XF86AudioRaiseVolume key in QJoyPad

I wanted to map my PSone gamepad to do some basic KDE/keyboard/mouse functions and everything works well except one thing. I use logitech ultra-x keyboard which has a few multimedia buttons (play, home, volumeup, volumedown..) and I wanted to map `volumeup` and `volumedown` keys to my pad with everything else. `volumedown` works well, but `volumeup` makes some trouble. after I start qjoypad and map it - it does work but after mapping it I still see the "[NO KEY]" (while it is doing its job - volumeup; that's strange).. after I turn qjoypad off and on I get this error: "Error reading button 6" and after that "Error reading definition for joystick 0". This is my layout:               QJoyPad 4.1 Layout File          Joystick 1 {         Axis 4: gradient, dZone 6505, maxSpeed 11, tCurve 2, sens 2, mouse+h         Axis 5: gradient, dZone 6264, maxSpeed 11, tCurve 2, mouse+v         Button 1: key 114         Button 2: mouse 3         Button 3: mouse 1         Button 4: key 113         Button 5: key 122         Button 6: key 123         Button 7: key 62         Button 8: key 105         Button 9: key 23         Button 10: key 65     }      With `xev` I got it what 122 and 123 are (they work normaly under KDE when I press them, it's just that 123 wont map and stay mapped for my pad)               keycode 122 = XF86AudioLowerVolume     keycode 123 = XF86AudioRaiseVolume      Any hint on what I should do to fix this and make my configuration stay? If it means anything, or helps anyhow - system is arch with 2.6.35 kernel, kde 4.5.1.


How to install Linux on a Lenovo ThinkPad T400

I want to completely format my computer and replace my current OS with Linux. How should I go about doing this? Particularly, how do I handle finding all the device drivers I'll need? I'm using a Lenovo ThinkPad T400


Uname gives unfamiliar timestamp for kernel

I'm recompiling a new kernel (adding some debugging info) on Ubuntu by doing the following:               make vmlinux; make install;      after this I do a reboot and select my new custom kernel from the list. However, when I do:               uname -a      I get a timestamp that doesn't correspond to the last time I built the kernel. When I look in /boot not a single file in there matches up with this timestamp. Also, my changes aren't showing up in the log files. What could be going on here?! Thanks!


sed: match two lines

I have a text file, where records are split on two lines. I would like to put them on one line. The records look something like this:               2013-07-29      apt-get install git     2013-07-29      apt-get install rsync     2013-07-31      apt-get install nmap     2013-08-02      apt-get install cifs-utils     2013-08-05      apt-get install telnet      I would like to get the following:               2013-07-29 apt-get install git     2013-07-29 apt-get install rsync     2013-07-31 apt-get install nmap     2013-08-02 apt-get install cifs-utils     2013-08-05 apt-get install telnet      I tried with `sed`, but I am unable to match two lines. Is there some trick in `sed`, or is there some better tool ?


Failed dependencies

I am searching for the following :   1. libpython2.5.so.1.0   2. libtinfo.so.5   3. python(abi) = 2.5 I searched , but I am not able to find these. I am running Centos 5.6 with linux kernel 2.6.18-238.el5.               $ rpm -q --provides python | grep -Fw 'python(abi)'     python(abi) = 2.4      As far as I searched, libtinfo.so.5 is a part of ncurses library now. But It is searching for that specific dependecy library. My current python version is 2.4.3. If someone has any idea about installing these dependencies please help me out.


AES-NI not passed to guest in Virtualbox

I'm trying to use encryption inside a virtual machine. The problem is that the AES-NI doesn't seem to be passed to the guest virtual machine. I have Vt-x enabled. This is my host cpuinfo:               processor       : 0     vendor_id       : GenuineIntel     cpu family      : 6     model           : 42     model name      : Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz     stepping        : 7     cpu MHz         : 1600.000     cache size      : 8192 KB     physical id     : 0     siblings        : 8     core id         : 0     cpu cores       : 4     apicid          : 0     initial apicid  : 0     fpu             : yes     fpu_exception   : yes     cpuid level     : 13     wp              : yes     flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid     bogomips        : 6801.03     clflush size    : 64     cache_alignment : 64     address sizes   : 36 bits physical, 48 bits virtual     power management:      This is my guest cpuinfo:               processor       : 0     vendor_id       : GenuineIntel     cpu family      : 6     model           : 42     model name      : Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz     stepping        : 7     cpu MHz         : 3399.615     cache size      : 6144 KB     physical id     : 0     siblings        : 2     core id         : 0     cpu cores       : 2     apicid          : 0     initial apicid  : 0     fpu             : yes     fpu_exception   : yes     cpuid level     : 5     wp              : yes     flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc rep_good nopl pni ssse3 lahf_lm     bogomips        : 6799.23     clflush size    : 64     cache_alignment : 64     address sizes   : 36 bits physical, 48 bits virtual     power management:      Am I missing some configuration option? Or is this a problem of Virtualbox?


Grub-customizer: error while loading shared libraries: libarchive.so.13: cannot open shared object file: No such file or directory

I wrote this question at stackoverflow and got recommended I prob would have a better shot here. So I'm trying to install grub customizer so I can make Windows the default OS to boot since I use that more frequently (I'm sorry). Anyway, I finally got it isntalled, but now I can't start it cause of the error message in the description. My real problem is that, that file do exist... I think... I am a real linux novice. I've only used it from now and then for roughly 6 months. Mostly worked with the allready installed software and other times apt-get has worked! Anyway! Here is what I get in my terminal.               root@ninjaPanda:~# gksu grub-customizer     grub-customizer: error while loading shared libraries: libarchive.so.13: cannot open shared object file: No such file or directory     root@ninjaPanda:~# ls -l /usr/local/lib/     total 8056     drwxr-sr-x 2 root staff    4096 Aug 29 13:30 grub-customizer     -rw-r--r-- 1 root staff 5217320 Aug 29 13:26 libarchive.a     -rwxr-xr-x 1 root staff     997 Aug 29 13:26 libarchive.la     lrwxrwxrwx 1 root staff      20 Aug 29 13:26 libarchive.so -> libarchive.so.13.1.2     lrwxrwxrwx 1 root staff      20 Aug 29 13:26 libarchive.so.13 -> libarchive.so.13.1.2     -rwxr-xr-x 1 root staff 3002216 Aug 29 13:26 libarchive.so.13.1.2     drwxr-sr-x 2 root staff    4096 Aug 29 13:26 pkgconfig     drwxrwsr-x 4 root staff    4096 Aug 27 18:45 python2.6     drwxr-xr-x 4 root root     4096 Aug 27 18:45 python2.7     drwxrwsr-x 3 root staff    4096 Aug 27 18:45 python3.2     drwxr-sr-x 4 root staff    4096 Aug 27 18:45 site_ruby      Edit: Someone told me it could Possibly /etc/ld.so.conf does not contain /usr/local/lib. and asked me to run this.               root@ninjaPanda:~# ldd grub-customizer     ldd: ./grub-customizer: No such file or directory


Disable screen blackout in KDE while watching iPlayer

How can I turn off the screen blackout in Linux when playing a film in BBC iPlayer? I usually use it in Chrome, but if there is a way to do it in Firefox (Iceweasel) than it is good enough as well. I think by default iPlayer uses Flash, but if there is a way to switch to HTML 5 that does the job than I am fine to do it as well. I know how to turn it off completely, but obviously I want it to save energy in all other circumstances.


How to switch user if the Screen is Lock

Sometime this happen that when I had to do something on server I find that the screen is lock and I dont know the password of that user to unlock it and switch the user. So i need to know that How to Switch the user even if the screen(User) is lock Note :: OS is redhat 5.*


Solaris 10, useradd command

When I used `useradd` command to add a new user for my Solaris 10 System, I specify `/home/user-name` to be its home directory. but the command didn't run successfully, and when I put the `/export/home/user-name` as its home directory it runs successfully. The first command is: `useradd -md "/home/munix" -s "/bin/ksh" munix` --> give me an error, which is the home directory can not be created, but the user is added to passwd file the second command is: `useradd -md "/export/home/munix munix" munix` --> home directory created successfully why????


How can I peek at the output of a running crontab task on OpenBSD?

I have an hourly hour-long crontab task running with some `mtr` (`traceroute`) output every 10 minutes (that is going to go for over an hour prior to it being emailed back to me), and I want to see the current progress thus far. On Linux, it can be done by accessing the open fd of the temporary file to which the results of the script are saved. How can I do this on OpenBSD? I've tried doing `fstat | fgrep -e USER -e cron -e mtr`, but couldn't find any temporary files at all.


How can I access a deleted open file on Linux (output of a running crontab task)?

I have an hourly hour-long crontab job running with some `mtr` (`traceroute`) output every 10 minutes (that is going to go for over an hour prior to it being emailed back to me), and I want to see the current progress thus far. On Linux, I have used `lsof -n | fgrep cron` (`lsof` is similar to BSD's `fstat`), and it seems like I might have found the file, but it is annotated as having been deleted (a standard practice for temporary files is to be deleted right after opening):               COMMAND     PID       USER   FD      TYPE     DEVICE  SIZE/OFF       NODE NAME     ...     cron      21742       root    5u      REG      202,0      7255      66310 /tmp/tmpfSuELzy (deleted)      And cannot be accesses by its prior name anymore:               # stat /tmp/tmpfSuELzy     stat: cannot stat `/tmp/tmpfSuELzy': No such file or directory      **How do I access such a deleted file that is still open?**


Scripting vmware-player with Windows in Linux

I have a Windows XP virtual machine, that I run with vmware-player on Linux. In the virtual machine, I have a .bat script that reads some input from a given place (insite the machine's virtual disk), does something with it and puts it somewhere (again, in the virtual disk). What I want to do is somehow "automate this". To be more exact, what I want to do is:   * run the vmware machine in the player    * somehow copy input file from the "regular computer" to the virtual machine   * run the .bat script in the Windows XP    * after the .bat script is done, copy the file "out"   * and then turn off the virtual machine (just suspending is fine) I would suspect this will be quite simple, but I have no idea where to look. I hope this question is on-topic, since the _outside machine_ is running Linux. However, it is slightly Windows-related too, since the _virtual_ machine runs Windows XP.


Linux drivers for Ricoh Aficio SP 100SU

Does anyone have a driver for the Ricoh Aficio SP 100SU on Linux? Any directions to correctly install it and have the printer work?


Ensure torrent client uses openvpn

I recently signed up to a VPN provider and to log in, I use network manager for my normal wireless connection and then start the openvpn connection from network manager. In my browser I can check that I'm using the tunnel by going to an ip location finder site but how do I ensure that my torrent client actually uses this connection? For example, couldn't it happen that my VPN provider logs me out after some time (intentionally or not) and then my torrent client starts using the still available normal wifi connection?


Install Tribes: Ascend on Linux Mint?

I've been able to install any game that I want besides Tribes: Ascend. I'm trying to install it on Wine 1.4.1, and I get the following install error: `Failed to start the Hi-Rez Authentication and Update service` I've done a plethora of research looking for this game ported to Linux and any possible bugs. I've found this bug, but no fix for it. Does anyone know a workaround for this game?


How to expand a substring of a command?

I would like to know what a command would look like if I entered a substring of this command. I'm not interested in the result, but in the history expansion. The purpose of this is to show in an interactive way, how the expansion works in zsh. For example, let's say I want to illustrate the usage of zsh history modifiers:               mv /Volumes/hdd1/path/to/a/file.foo !#$:r:s/foo/bar/ # moves and renames at the same time     ....................................0123456789abcdef      (The line above is a rule for referencing substrings in this question) Some of the substrings are valid, some are not. I would like for each substring ending at [0..f], to execute the history expansion, as if I typed `TAB` after each character in [0..f].


Semi-asynchronous pipe

Assume I have the following pipe:               a | b | c | d      How to wait for completion of `c` (or `b`) in `sh` or `bash`? This means that script `d` can start any time (and does **not** need to be waited for) but requires complete output from `c` to work correctly. The use case is a `difftool` for `git` that compares images. It is called by `git` and needs to process its input (the `a | b | c` part) and display the results of the comparison (the `d` part). The caller will delete input that is required for `a` and `b`, this means that before returning from the script, process `c` (or `b`) must terminate. On the other hand, I cannot wait for `d` because this means I'm waiting for user input. I know I can write the results of `c` to a temporary file, or perhaps use a FIFO in `bash`. (Not sure if the FIFO will help, though.) Is it possible to achieve this without temporary files in `sh`? **EDIT** : Perhaps it would be sufficient if I could find out the process ID of the `c` (or `b`) process in a reliable fashion. Then the whole pipe could be started asynchronously, and I could wait for a process ID. Something along the lines of               wait $(a | b | { c & [print PID of c] ; } | d)      **EDIT^2** : I have found a solution, comments (or still better solutions) are welcome.


appendable and greppable archive on CentOS to hold many log files (logrotate on steroids)

I have a bunch of applications on a CentOS 6.3 box, which generate daily logs (text files with a very similar content) in this vein:               /data/logs/app/my-2014-06-29.log     /data/yet_another_app/logs/catalina.20140629     /data/in_fact/there_are/around_500_such_paths/2014-06-29-1.log      I need to keep 5 years of these logs. I currently treat them in a traditional Unix way, just compressing them in place (as `.log.bz2`), but I'm unhappy they still occupy a lot of space. I feel I could save a lot of space but compacting them and then compressing (think one giant .zip that holds entire year of logs). Requirements: ## RHEL kosher No "compile from source" please. If it isn't mature enough to be distributed in an .rpm then it's not for me. ## grep Archive should allow a recursive grep (like `grep -rli`):               grep_my_zip  -rli  pattern   /this/and/that/wildcards/2014-06-*      The archive shouldn't de-compress everything when grepping, just the files that match a wildcard. ## append Each week I'm putting my files into the _same_ archive and deleting them from filesystem:               append_and_remove   $( find /this/and/that  -name '*.log' -type f -mtime +31 )     # weekly log cleaning job      This is not the weekly archive, I want to append to a single big yearly archive each week. ## MS Windows access Archive, while mainly operated on CentOS Linux, should also allow a single file retrieval on Windows for emergency purposes (so a squashfs-style filesystem is not a viable option). ## Optional stuff (a plus, but not neccessary)   * append should be space effective - consider that previous log files are very similar to the current log files   * logrotate integration for the weekly job   * grep_my_zip that works on Windows   * archive could also be updateable (i.e. writable), not only appendable Originally posted on this pitiful sibling


Specific directory permission for one user using sftp

My web server structure looks like this:               /Home/User/Public_Html/Website_one                           /Website_two                           /Website_three/Directory_one                                         /Directory_two                                         /Directory_three                                          /Directory_four      Now, I need my friend to have access from this server only to `Directory_two` and `Directory_four` under `website_three`. I have created an SFTP account based on SFTP Jails. I also created a `home` folder for him and SFTP works fine. But the problem is I couldn't give him access to those directories with sub files. How can I give him access only to `Directory_two` and `Directory_four`?


Bash: How to read one line at a time from output of a command?

I am trying to read the output of a command in bash using a `while loop`.               while read -r line     do         echo "$line"     done <<< $(find . -type f)      The output I got               ranveer@ranveer:~/tmp$ bash test.sh     ./test.py ./test1.py ./out1 ./test.sh ./out ./out2 ./hello     ranveer@ranveer:~/tmp$       After this I tried               $(find . -type f) |      while read -r line     do         echo "$line"     done       but it generated an error `test.sh: line 5: ./test.py: Permission denied`. So, how do I read it line by line because I think currently it is slurping the entire line at once. Required output:               ./test.py     ./test1.py     ./out1     ./test.sh     ./out     ./out2     ./hello


Redirect Output with Iptables

Is possible on Debian to change the port of packets that are going to a specific port, using iptables? **Example:** I want packets going in the outbound direction to a.b.c.d for port 1723 to be redirected to the address a.b.c.d on port 10000. Is this possible?


mutt: macro for saving messages to a folder

This is an expansion on my previous question. I have following macro, which will save **tagged** messages to my `archive` folder.               macro  index  S  ":set confirmappend=no delete=yes\n<tag-prefix-cond><save-message>=archive\n<sync-mailbox>:set confirmappend=yes delete=ask-yes\n"      and a second macro for doing the same action, but on the current message (not tagged):               macro index A ":set confirmappend=no delete=yes\n<save-message>=archive\n<sync-mailbox>:set confirmappend=yes delete=ask-yes\n"      Is there a way to combine these two macros into one? I.e., I would like a macro that does following action when I press `S`:               a) in case any messages are tagged, move all of them to `archive`     b) in case no messages are tagged, move current message to archive


Scanner works in laptop, not in desktop

I have an Epson Perfection 660 flatbed scanner that works on my laptop. This is what appears in `/var/log/syslog` when I plug it in:               Dec 18 15:43:57 lap kernel: [   31.868278] usb 6-2: new full-speed USB device number 2 using uhci_hcd     Dec 18 15:43:57 lap kernel: [   32.033506] usb 6-2: New USB device found, idVendor=04b8, idProduct=0114     Dec 18 15:43:57 lap kernel: [   32.033514] usb 6-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0     Dec 18 15:43:57 lap kernel: [   32.033519] usb 6-2: Product: EPSON Scanner     Dec 18 15:43:57 lap kernel: [   32.033524] usb 6-2: Manufacturer: EPSON      Now I want to use that scanner in my desktop computer. I followed the same instructions, but it does not work. The problem is that it's not recognized as a valid USB device. It does not appear on `lsusb`, and this is what shows in syslog:               Dec 18 15:31:34 desktop kernel: [  390.193219] usb 3-14: new full-speed USB device number 18 using xhci_hcd     Dec 18 15:31:39 desktop kernel: [  395.213900] usb 3-14: unable to read config index 0 descriptor/start: -110     Dec 18 15:31:39 desktop kernel: [  395.213902] usb 3-14: can't read configurations, error -110     Dec 18 15:31:39 desktop kernel: [  395.325902] usb 3-14: new full-speed USB device number 19 using xhci_hcd     Dec 18 15:31:44 desktop kernel: [  400.346570] usb 3-14: unable to read config index 0 descriptor/start: -110     Dec 18 15:31:44 desktop kernel: [  400.346572] usb 3-14: can't read configurations, error -110     Dec 18 15:31:45 desktop kernel: [  400.458648] usb 3-14: new full-speed USB device number 20 using xhci_hcd     Dec 18 15:31:50 desktop kernel: [  405.479280] usb 3-14: unable to read config index 0 descriptor/start: -110     Dec 18 15:31:50 desktop kernel: [  405.479282] usb 3-14: can't read configurations, error -110     Dec 18 15:31:50 desktop kernel: [  405.591352] usb 3-14: new full-speed USB device number 21 using xhci_hcd     Dec 18 15:31:55 desktop kernel: [  410.611960] usb 3-14: unable to read config index 0 descriptor/start: -110     Dec 18 15:31:55 desktop kernel: [  410.611962] usb 3-14: can't read configurations, error -110     Dec 18 15:31:55 desktop kernel: [  410.611973] hub 3-0:1.0: unable to enumerate USB device on port 14      At first sight, looks like the laptop uses UHCI, whereas the desktop uses XHCI. Both systems use Linux Mint 16, kernel 3.11.0-12 x86_64. The behavior is the same regardless of the usb port used. What can I do?


talkd doesn't print a message

I wanted to use talk with my brother (we both have Debian jessie). So i installed inetutils-inetd, inetutils-talk, and inetutils-talkd. Now i wanted to try wether it works. So i created a testuser named foo. The i logged in as this user and as my original user. I switched mesg on both terminals to yes and then tried this on my originals user:               $talk foo     [Service connection established.]     [Checking for invitation on caller's machine]     [Checking for invitation on caller's machine]     [Checking for invitation on caller's machine]     [Checking for invitation on caller's machine]     [Checking for invitation on caller's machine]     [Checking for invitation on caller's machine]      And foo never gets a message like it is described in the manpage. I also checked that inetd is running and enabled talkd by inetd. Here's the only line in /etc/inetd.conf that isn't uncommented.:               talk    stream  tcp nowait  root    /usr/sbin/talkd talkd      I also tried to let both users try to talk to each other, but that didn't work either. Does anyone know how i can get talk to work?


Errors after creating partitions during Fedora 20 installation

I made drives like this :                 /       10GB       /home   37GB       swap     8GB      but there is an error :                 you have not created a bootloader stage1 target device.       you have not created a bootable partition.      what should I do?


First line of awk output isn't what I expect

I am trying to figure out why a part of a file name disappears. In my case, I have created three files               $ ls     some-part-of-file.1  some-part-of-file.2  some-part-of-file.3      and when I use awk with `FS = "-"`, one of them is blank.               $ ( echo some-part-of-file.1 ; echo some-part-of-file.2 ; echo some-part-of-file.3 ) | awk '{ FS = "-" ; print $0 " " $2}'     some-part-of-file.1     some-part-of-file.2 part     some-part-of-file.3 part      Why does `some-part-of-file.1` `$2` not print `part` like the others?


Big file overwriten with a 0B file

I just opend for write (by mistake) a big file with data (about 200 MB). Now I have this file and it has 0B. I want to know If I can find raw data on disk for recovery... ?


Is the FreeBSD login program compatible with AFS?

Is FreeBSD's `login` program compatible with AFS, so you can just login normally instead of using the `kinit` method (this is possible according to the OpenAFS manual)?


Fail to install node.js on Debian

I'm running Raspbmc which is running a minimal Linux distribution based on Debian. And I would like to install node.js via package manager but I'm fail to install on my system. Which it come with this error.               In file included from /usr/include/linux/kernel.h:4:0,                      from /usr/include/arm-linux-gnueabihf/sys/sysinfo.h:25,                      from ../deps/uv/src/unix/linux-core.c:34:     /usr/include/linux/sysinfo.h:8:2: error: unknown type name '__kernel_long_t'     /usr/include/linux/sysinfo.h:9:2: error: unknown type name '__kernel_ulong_t'     /usr/include/linux/sysinfo.h:10:2: error: unknown type name '__kernel_ulong_t'     /usr/include/linux/sysinfo.h:11:2: error: unknown type name '__kernel_ulong_t'     /usr/include/linux/sysinfo.h:12:2: error: unknown type name '__kernel_ulong_t'     /usr/include/linux/sysinfo.h:13:2: error: unknown type name '__kernel_ulong_t'     /usr/include/linux/sysinfo.h:14:2: error: unknown type name '__kernel_ulong_t'     /usr/include/linux/sysinfo.h:15:2: error: unknown type name '__kernel_ulong_t'     /usr/include/linux/sysinfo.h:18:2: error: unknown type name '__kernel_ulong_t'     /usr/include/linux/sysinfo.h:19:2: error: unknown type name '__kernel_ulong_t'     /usr/include/linux/sysinfo.h:21:22: error: '__kernel_ulong_t' undeclared here (not in a function)     make[1]: *** [/root/src/node-0.10.21/out/Release/obj.target/libuv/deps/uv/src/unix/linux-core.o] Error 1     make[1]: Leaving directory `/root/src/node-0.10.21/out'     make: *** [node] Error 2      I'm following this step to install node.js               sudo apt-get install python g++ make checkinstall     mkdir ~/src && cd $_     wget -N http://nodejs.org/dist/node-latest.tar.gz     tar xzvf node-latest.tar.gz     mv node-v0.10.19 node-0.10.19     cd node-0.10.19     ./configure     checkinstall --install=no


Recover files on unmounted partition

I have 2 partitions on my macbook, but I can't mount one of them. When I run the disk utility, the console (show details area) returns the message: > Updating boot support partitions for the volume as required.Error: Disk > Utility can’t repair this disk. Back up as many of your files as possible, > reformat the disk, and restore your backed-up files. I need to recover my files that are on the unmounted partition. Is there a way to list and recover these files without mounting the partition?


Ubuntu 10.0 sound muted automatically on ThinkPad

My laptop is ThinkPad T61, with Ubuntu 10.10 installed. The sound works all well, until I plugged the Creative XiFi Go USB sound card. After I reboot my computer, the internal speaker is muted automatically. I have to use 'alsamixer' to unmute it each time. How can I persistent this setting?


Shell filename pattern that expands to dot files but not to `..`?

Recently I had a little mishap caused by a shell pattern that expanded in an unexpected way. I wanted to change the owner of a bunch of dot files in the `/root` directory, so I did               chown -R root .*      Naturally, the `.*` expanded to `..` which was a bit of a disaster. I know in `bash` this behaviour can be changed by tweaking some shell option, but _with the default settings_ is there any pattern that would expand to every dot file in the directory but not to `.` and `..`?


Passing print pattern as a variable to awk

I am trying to use `awk` to print variables from various columns in a line delimited by `,` .The columns and pattern which I want to print is stored in another variable `b`. The pattern `a` and print patter `b` are given below:               a='15986327,415532694,850257614,875121642,20140819'     b='$1","$2","$4'      I am trying to get the output as below.               15986327,415532694,875121642      I am trying to pass the pattern `b` to awk using `-v` switch but not sure how to use that with `print` inside `awk`. Tried below commands but this is not the output I was trying to get to.               echo $a |awk -v ba="${b}" -F"," '{print ba}'     $1","$2","$4          echo $a |awk -v ba="${b}" -F"," '{print $ba}'     15986327,415532694,850257614,875121642,20140819


How can I script the creation of a single partition that uses the entire device?

I am specifically using this to partition and mount EBS volumes on Amazon EC2 instances, but really this should be generally applicable to initializing any new drive. As the question says I want to script the creation of a single primary partition which uses all available space on the given device. I won't know ahead of time how big the device is and it could be very large (i.e. several TB). In researching this it seems `parted` is the best command to use for scripting. I think something along the lines of `parted /dev/sdf mkpart primary 0 END` is what I want, but I'm having a hard time figuring out an elegant way to determine what END should be. Does anyone know an easy way to do this?


Save setxkbmap settings?

I'm having trouble setting my keyboard settings to swedish, running Raspbian on a raspberry pi. I've tried everything and the only thing that worked was the command `setxkbmap se`. But this doesn't permanently save the settings, and it's back to default after reboot. Is there a command to permanently save these settings?


Script to list only files of type ASCII text in the current directory?

How to write a shell script which searches the current UNIX directory and returns the names of all files of type ASCII text?


Low-level serial configuration?

I'm using embedded Linux platform, kernel is 2.6. I'm using stty command to configure ttyS* high level. The problem is that when I want to turn hardware flow control on:               stty -F /dev/ttySA0 crtscts      it cannot communicate with other device (which also have flow control enabled - this is checked). I have found that in /proc/tty/driver/sc16is7x2 (this is serial device) there is:               serinfo:1.0 driver revision:     0: uart:sc16is752 port:00000001 irq:53 tx:155 rx:0 DSR|CD|RI     1: uart:sc16is752 port:00000002 irq:53 tx:10 rx:0 DSR|CD|RI      while on the other platform with the same hardware (and where hardware flow control works) there is something like:               serinfo:1.0 driver revision:     0: uart:sc16is752 port:00000001 irq:53 tx:155 rx:0 CTS|DSR|CD|RI     1: uart:sc16is752 port:00000002 irq:53 tx:10 rx:0 CTS|DSR|CD|RI      So the difference is in "CTS|DSR|CD|RI" vs "DSR|CD|RI". Could this "DSR|CD|RI" be a problem I cannot use hardware flow control?


Getting capabilities of my CD/DVD drive when wodim --devices doesn't work

I used to be able to run either commands successfully on my Fedora 14 Thinkpad T410 laptop:               $ wodim --scanbus     $ wodim --devices      However since upgrading to Fedora 19 this no longer seems to work and I'm not sure why. Are there any alternative methods for getting the drives capabilities from `wodim`?


No CentOS Windows 8 GRUB Options on Restart

How do I dual-boot CentOS 6.3 **Minimal Version** on an Acer 64-bit Windows 8 Laptop and get the GRUB options to select either CentOS or Windows 8 when I restart? (Currently it boots straight into Windows 8. Also I do not want the full version of CentOS with the GUI ). Here are the steps I took to dual boot CentOS with Windows 8:   1. Using the Disk Management tool, I shrank my C drive and left the new space (50000 MB) unallocated   2. Rebooted using the CD (changed boot order with CDRom first)   3. Selected English, US English   4. Selected **Basic Storage Devices**   5. For networking, I left hostname as default   6. Selected the City   7. Entered my root password, confirmed root password   8. For Installation Type, I selected **Create Custom Layout**   9. Selected the Free space, clicked Create   10. Create Storage dialog, I selected **LVM Physical Volume** , create   11. File System Type ( **swap** ), Size (2000 MB), Additional Size Options (Fixed size), ok   12. Selected the free space again, create, Create Partition (Standard Partition), create, Mount Point (/), File System Type (ext4), Size (47000), Additional Size Options (Fill to maximum allowable size), ok, Next, write changes to disk   13. **Install boot loader on /dev/sda2 (ticked), Boot loader operating system list (CentOS /dev/sda7 is selected but there is another option labeled Other /dev/sda4 which is not selected)**   14. After installation completed successfully, I rebooted, pressed F2, changed the Boot order back to **Windows Boot Manager** , saved, exit I also noticed that CentOS File System is labelled RAW in the Disk Management tool. * * * **EDIT 1** Here is my first update to my Windows 8 CentOS 6.3 Minimal dualboot problem: I changed the boot order in the BIOS to boot from the HDD instead of Windows Boot Manager and after another restart, it booted into CentOS this time (still no GRUB menu). I found the grub.conf file and notice a line in it that said "hiddenmenu" that was NOT commented out. So I commented it out and upon another restart I got the GRUB screen to appear but only CentOS and "Other" were there, no Windows 8 options. In the grub.conf file there was an entry for "Other" rootnoverify (hd0,3) chainloader +1. My question is, how do I chainload Windows 8? I've already disabled Secure Boot **(but left boot type set to UEFI because the "legacy boot" option did not allow my system to boot at all)**. How do I get the GRUB to allow me to choose between Windows 8 and CentOS?


Linux Mint gets stuck at boot from Live-CD

I am trying to install Linux Mint (Cinnamon) from a CD. It will act like it is loading for a while, the CD drive will make a ton of noise for a while, and then everything just freezes (the CD drive will go silent). I tried this a few times and then started in `compatibility mode`. Every time, I get the following:               failed to load file amd-ucode/microcode_amd.bin      I'm trying to install on an older Toshiba Satellite laptop (with Ubuntu currently installed). Any ideas on a fix ?


Comparison of shells?

Do shells have any actual advantages or disadvantages? They can all run any binary, they all support pipes and `>` (output to file). Why would one choose `bash` over `sh`, or `sh` over `ksh`, etc? Why does any shell other than `sh` exist in the first place?


Terminate Root Processes

Is there a way to terminate a root process without entering an administrator's password? You might be wondering why I'd want to do this 'cause it sounds fishy. Well I just need to end a process started by a daemon from an agent but daemons runs as root and agents are user specific.


Archbang can't connect to wireless

Last week I tried Crunchbang 11, it couldn't connect to wireless. Yesterday I removed it and installed Archbang from CD (final 2012 version). Everything was working perfectly, when I did `pacman -Syu` and rebooted, Archbang stopped detecting my wireless card so I bet that the new Linux drivers aren't compatible with my HP Pavillion G. It's not the first time that I've seen drivers incompatible with my laptop, I've seen it last week with Crunchbang, and I've had graphics issues with every Linux that i've used on this laptop. What I would like to do is simple. I want to downgrade the Archbang wireless drivers, I want my original drivers back, the ones installed in the final 2012 version (I have the CD, can I use it?), and then I don't want to allow pacman to upgrade my wireless drivers, so next time I run `pacman -Syu`, I want everything to be upgraded except my wireless drivers, and if possible my graphic card drivers. You see Ubuntu 12.04 works great, 12.10 doesn't work at all, I don't even see the login screen, even with `nomodeset`. I don't want that to happen, and Archbang is a rolling release so I don't know if the next time I upgrade my packages I'll face some issues, I want to allow pacman to upgrade everything, just don't mess with my graphics and my wireless, that's it.


Vimperator status bar not working

I have just installed Vimperator 3.8.2 on Firefox 32 (running Fedora 20). The status bar at the bottom of the window does not display any information in Normal mode , even though when I do               :set status?      I get               status=input,location,bookmark,history,tabcount,position,      Nor do I get the little highlighted Error indicator, or mode indicators when I enter Insert or Caret. Everything else seems to work just fine. I haven't modified any of the default values. What might be causing this?


Specifying which git repo to use

I have a bash script, called cgit, that acts as **git** for one specific git **repo** (located at `/.git`):               #!/bin/bash     cd /;     sudo git $@ > /dev/stdout      I use it to keep track of imporant system files:               cgit add /etc/rc.conf      The trouble is when I try to add content relative to the directory I'm in, for example:               cd /home/user     cgit add .ssh/config      **cgit** would try and add `/.ssh/config` to the `/.git` repo. Any suggestions or work-arounds?


Awk print problem

I have a code that takes values from a log file and populates them into an excel spreadsheet:               function ltrim(s) { sub(/^[ \t]+/, "", s); return s }     function rtrim(s) { sub(/[ \t]+$/, "", s); return s }     function trim(s)  { return rtrim(ltrim(s)); }          function getfield( xml, fieldname) {         i = index ( xml, "fieldName=\""fieldname"\"");         if(i < 1){           ts = "";         }         else{            ts = substr( xml, i + length("fieldName=\""fieldname"\"") );            ts = substr( ts, index( ts, "value=\"" ) + length( "value=\"" ) );            ts = substr( ts, 1, index( ts, "\"")-1);            gsub(/&/, "&", ts );            if ( index( ts, "," ) > 0 ) ts ="\""ts"\"";         }                 return ts;             }     BEGIN   { FS = "--------";OFS=",";}      {sub(/..,[A-Z][A-Z]/, "CT-PT")}                  {                     orig = $0;                    # $7 = getfield(orig, "Modalities In Study");                     $9 = getfield(orig,"Subject Patients Sex");                     $10 = getfield(orig,"Modality Body Region");                     $11 = getfield(orig, "Patients Birth Date");                     $12 = getfield(orig, "Protocol Name");                     $13 = getfield(orig, "Timepoint ID");                     print;              }      Everything is working great except for one thing. If I place this print statement anywhere in the code, it loops in the whole Excel spreadsheet. So basically the print statement appears in every other row. I only want it to appear in the first row:               {print "Study Instance UID,Number of Series,Number of Instances, Exam Transfer Date,Exam Date,Subject Number,Modalities In Study,Upload Status,Subject Patients Sex,Modality Body Region,Patients Birth Date,Protocol Name,Timepoint"}      I am not sure why this occurs. I even tried placing this line right after function `trim(s) { return rtrim(ltrim(s)); }` but still keeps looping in the spreadsheet. Does anyone have any suggestions or might know why this occurs?


Is there a linux vfs tool that allows bind a directory in different location (like mount --bind) in user space?

For a user process, I want to mount a directory in other location but in user space without root privilieges. Something like mount --bind /origin /dest, but with a vfs wrapper. Like a usermode fine-tuned chroot. The program would wrapper the syscalls to files to "substitute" the paths needed. It could be called with a command line like: bindvfs /fake-home:/home ls /home I am sure that this alredy exists! :)


What does libgcc_s.so contain?

I tried running objdump on the lib to figure it out without success. Is there a way to find out what a library does?


Why is vimdiff so slow?

Whenever I'm in `vimdiff` mode, my PuTTY session slows down considerably. This is especially noticeable when I try to scroll down many lines by keeping `j` pressed.   1. Why is it so slow in comparison to regular Vim running under `vsplit`? I realize it matches across lines and color-highlights the differences, but does that account for all the speed differences?   2. What can I do about it? I would like to keep line matches across files (and color highlighting as well). What settings can I change to help speed up the performance of my `vimdiff` utility?


Can I truncate long file names in ls listing

I have a number of files with very long names. Please, is there a way to use ls -C and truncate the file names to get more columns for an overall view? Or is there a better way to get a compact listing?


Terminal emulator for Android that supports viewing images?

I am planning on logging into my unix desktop via an Anroid tablet. Is there a terminal emulator that will allow me to view images, such as making plots in ipython, via X11 protocol?


How to remove a file from the git index

How do I remove a file from a git repositorie's **index** without removing the file from the working tree? If I had a file `./notes.txt` that was being tracked by git, I could run `git rm notes.txt`. But that would remove the file. I'd rather want git just to stop tracking the file.


Compile proftpd with MySQL authentication support on AIX


Why does a disk clone using dd take up more space on the target than the source image?

I'm doing some Android development on Ubuntu 11.10. I'm building a set of SD card and eMMC card Android images using a Bash script. Due to Android's idiosyncrasies, I have several file system images that need to be copied to the target card. There are several lines in my script to copy over the images that look like this:               image_dir=/some/directory     node=/dev/some/block/device     dd if=${image_dir}/data.img of=${node}; sync      Here's where things get weird. After partitioning the card and copying over`data.img` using this `dd` command, there is a vast inconsistency between the size of the `data.img` on my dev machine and the amount of space taken up on the target SD card partition. For instance, the `data.img` file on my disk takes up 128 **megabytes** of space, roughly, but takes up almost 2.5 **gigabytes** on the partition of the SD card. For obvious reasons, this is a serious problem. I've tried modifying the number of blocks `dd` reads and writes, but that didn't seem to change the amount of space required. I've done a fair bit of googling, but I can't seem to find any references to problems like this. What can I do to fix this issue so the image doesn't take up so much space? Could there be something wrong with the `data.img` file? Am I using `dd` wrong? I've been tearing my hair out over this for a week, help me StackExchange, you're my only hope. EDIT: Question clarified above: It's not that the **file system** takes up a lot of space on the partition, it's that the partition is filled almost completely with data after running `dd`, despite the file system image being substantially smaller than said partition.


How do I add and cancel print jobs in debian wheezy?

So I have a Canon MP150 printer running in debian wheezy, which I've added using the CUPS print manager (going to `http://localhost:631/jobs/`). I tried to print with not enough paper in the printer and it came up with an error (ie. the printer showed `E2` on the display and then failed to print). I added paper and nothing happened, so I thought I'd just delete the print job. Deleting it in the print manager (clicking on the job and pressing the `stop` icon) had no effect, so I went into the `CUPS` server and clicked `Administration->Manage Jobs`. I see the jobs there, but when I click `Cancel Job` I get a page like this: > Request Entity Too Large I tried restarting my computer but the print job is still there, and I am unable to print. I looked online and found some solutions that suggest deleting the printer driver and reinstalling, but judging by my linux printer experience thus far I'm guessing this is a problem I'll be encountering frequently, so a quicker solution would be helpful!


Raspbian migrating to bigger SD card

As I was running out of space on my Raspberry PI, I picked up another SD card. The 'old' card was only 4GB, the new one is 8GB. I made an image with Win32DiskImage and wrote this to the 8GB card. Everything went well. But, I discover that actually nothing was happend, so still 4GB... I checked out the web and discover that this is quite normal. So, I searched for a 'how to'. And I found one: click. So, I followed this tutorial, or at least I tried so. It looks like my SD card layout isn't the same at all. But, I tried to so with: /dev/mmcblk0p6 . But didn't work out, so I re-wrote the image to the SD card. By the way, I installed Raspbian using the NOOBS method. Some more information: `df -h` gives:               pi@raspberrypi:~$ df -h     Filesystem      Size  Used Avail Use% Mounted on     rootfs          3.4G  3.0G  216M  94% /     /dev/root       3.4G  3.0G  216M  94% /     devtmpfs        215M     0  215M   0% /dev     tmpfs            44M  268K   44M   1% /run     tmpfs           5.0M     0  5.0M   0% /run/lock     tmpfs            88M     0   88M   0% /run/shm     /dev/mmcblk0p5   60M  9.4M   50M  16% /boot      `fdisk /dev/mmcblk0` gives:               pi@raspberrypi:~$ sudo fdisk /dev/mmcblk0          Command (m for help): p          Disk /dev/mmcblk0: 8072 MB, 8072986624 bytes     4 heads, 16 sectors/track, 246368 cylinders, total 15767552 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: 0x00004bf1                  Device Boot      Start         End      Blocks   Id  System     /dev/mmcblk0p1            8192      240234      116021+   e  W95 FAT16 (LBA)     /dev/mmcblk0p2          245760     7663615     3708928   85  Linux extended     /dev/mmcblk0p3         7663616     7729151       32768   83  Linux     /dev/mmcblk0p5          253952      376831       61440    c  W95 FAT32 (LBA)     /dev/mmcblk0p6          385024     7663615     3639296   83  Linux          Command (m for help): q          pi@raspberrypi:~$      `parted /dev/mmcblk0` gives:               pi@raspberrypi:~$ sudo parted /dev/mmcblk0     GNU Parted 2.3     Using /dev/mmcblk0     Welcome to GNU Parted! Type 'help' to view a list of commands.     (parted) unit chs     (parted) print     Model: SD F0F0F (sd/mmc)     Disk /dev/mmcblk0: 1955,38,37     Sector size (logical/physical): 512B/512B     BIOS cylinder,head,sector geometry: 1955,128,63.  Each cylinder is 4129kB.     Partition Table: msdos          Number  Start      End        Type      File system  Flags      1      1,2,2      29,101,15  primary   fat16        lba      2      30,60,60   950,44,43  extended      5      31,62,62   46,93,28   logical   fat32        lba      6      47,95,31   950,44,43  logical   ext4      3      950,44,44  958,60,59  primary   ext4          (parted)      So, any help is welcome...


Shell script to compile C files

I used to have a shell script that would compile all of the FILE.c files in a directory to FILE.out I lost it and am trying to remake it and have the following which I know is very similar but can't tell where I am going wrong.               #!/usr/bin/env bash          for i in 'ls *.c'     do         gcc -g3 -o3 $i -o {$i%.}.out     done


cURL socks5 proxy: "Empty reply from server"

I'm accessing an http resource using Chrome, FoxyProxy without any problems. The proxy is defined as `socks5` in the standard port `1080`. I've tried accessing the same resource using cURL (actual URLs changed for privacy reasons):               $ curl -vvv -socks5 SOCKS_SERVER:1080 -X GET "THE_URL_FROM_BROWSER"      And got:               * About to connect() to SOCKS_SERVER port 1080 (#0)     *   Trying IP... connected     * Connected to SOCKS_SERVER (IP) port 1080 (#0)     > GET / HTTP/1.1     > User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5     > Host: SOCKS_SERVER:1080     > Accept: */*     >      * Empty reply from server     * Connection #0 to host SOCKS_SERVER left intact     * Connection #0 seems to be dead!     * Closing connection #0     * About to connect() to URL_HOST port 80 (#0)     *   Trying SOME_IP...      Which never comes back with a response. Any idea why cURL can't access the same resource accessed by FoxyProxy?


Installing Linux Mint on a blank SSD

I've dual booted Mint and Windows 7, but I'd really like to get rid of Windows all together. And from what I understand, it's not really a true dual boot, but it's actually just running from inside Windows. So I was wondering if there was a way to install Mint on a blank SSD (in an external enclosure), so I can just later swap it for my HDD. And if this isn't possible, please explain why.


Specify partition data in sfdisk and parted

With this line:               (echo o; echo n; echo p; echo 1; echo ; echo +24G; echo a; echo t; echo 7; echo w) | fdisk /dev/sda      I can create a new active primary partition for NTFS, 24 Giga large. The syntax is ugly but effective. How can I do the same with `parted` or `sfdisk`?


Is it safe to just copy shared libraries onto embedded Linux device?

The following is contained in the vendor user manual for its embedded Linux distro on the hardward board they supply > Developers can put their program onto X-Linux device via FTP or NFS. Before > running it, use ldd command on development workstation to check dependency > files. Also put relative files onto X-Linux to ensure program can run > properly. Here is an example when we put “syslinux” onto X-Linux:                 [root@X-Linux]:/sbin # ldd syslinux                linux-gate.so.1 => (0xb80a0000)               libc.so.6 => /lib/libc.so.6 (0xb7f60000)                /lib/ld-linux.so.2 (0xb80a1000)        [root@X-Linux]:/sbin #       > From above messages, **/lib/libc.so.6** and **/lib/ld-linux.so.2** are > needed by syslinux. Put those two files onto X-Linux to ensure syslinux can > work properly. I will have to write software to run on this device and a lot of advice I have received on stack exchange points me in directions that contradict this advice (suggesting setting up specific embedded development environment, linking to older versions of libc, static linking etc). Is the above information given by the vendor a safe and reliable way to do things???


Kernel compilation of version 2.4 on a system running 3.2.0

My current kernel version on with my OS running on is 3.2.0. Can I compile a kernel of version 2.4.0 on it? Is there any perfect kernel documentation available? (As I see different ways of compiling kernel, expecting a unified documentation which lists all possible ways)


The netcat command can't access an open port

I have two servers over which I am trying to install some software. One is server1(IP 10.1.2.205) and the other is server2(IP 10.1.2.206). Both are able to ping each other by name and by IP address (ie. from server2 i can `ping server1` or `ping 10.1.2.205`) I have the following output when I type in `netstat -lnt` on server1                   Proto Recv-Q Send-Q Local Address ForeignAddress State           tcp        0      0 0.0.0.0:111    0.0.0.0:*     LISTEN          tcp        0      0 0.0.0.0:22     0.0.0.0:*     LISTEN          tcp        0      0 127.0.0.1:631  0.0.0.0:*     LISTEN          tcp        0      0 127.0.0.1:25   0.0.0.0:*     LISTEN          tcp        0      0 0.0.0.0:52666  0.0.0.0:*     LISTEN          tcp        0      0 0.0.0.0:6817   0.0.0.0:*     LISTEN          tcp        0      0 0.0.0.0:6818   0.0.0.0:*     LISTEN          tcp        0      0 0.0.0.0:5672   0.0.0.0:*     LISTEN          tcp        0      0 :::111         :::*          LISTEN          tcp        0      0 :::22          :::*          LISTEN          tcp        0      0 ::1:631        :::*          LISTEN          tcp        0      0 :::36483       :::*          LISTEN          tcp        0      0 :::5989        :::*          LISTEN        Now when I try using the netcat command from server2, I get the following results : `nc -v 10.1.2.205 22`   `Connection to server1 22 port [tcp/ssh] succeeded! SSH-2.0-OpenSSH_5.3` `nc -v server1 22`   `Connection to server1 22 port [tcp/ssh] succeeded! SSH-2.0-OpenSSH_5.3` The problem is with the following outputs though :   `nc -v server1 5989`   `nc: connect to server1 port 5989(tcp) failed: No route to host`   I get the same response on every other port.   No other port on server1 responds. My ports of interest are the 6817 and 6818 ports. I have an application that needs to listen and respond on these ports between these two machines. Output of : `iptables -L`                   Chain INPUT (policy ACCEPT)         target  prot opt source   destination                  ACCEPT  all  --  anywhere anywhere  state RELATED,ESTABLISHED                    ACCEPT  icmp --  anywhere anywhere                     ACCEPT  all  --  anywhere anywhere                     ACCEPT  tcp  --  anywhere anywhere  state NEW tcp dpt:ssh          REJECT  all  --  anywhere anywhere  reject-with icmp-host-prohibited               Chain FORWARD (policy ACCEPT)         target  prot opt source   destination                  REJECT  all  --  anywhere anywhere    reject-with icmp-host-prohibited               Chain OUTPUT (policy ACCEPT)         target  prot opt source   destination          What could be wrong ?


Force installation of doc packages

I often find myself missing documentation when I happen to be offline. For this reason, I would like to force `aptitude` to install the corresponding doc packages whenever I install a package. Is there a way of doing that more elegant than putting an alias that goes through arguments and add the `*-doc` that exist before forwarding the arguments to `aptitude`?


How to obtain current user environment in pam_script?

I'm running `pam_script` after `pam_krb5` with a session open script. In my script, I need to use the ticket cache generated by krb5 to do something. Well, the script was actually run as root, and `KRB5CCNAME` or `PAM_KRB5CCNAME` is all empty. What should I do?


smbmount cifs share through alias source ip

On a box having samba 3.6.x and a IPv4 number plus an alias IPv4 number, is it possible to force smblient (mount.cifs) to **use the second (alias) IP** for mounting a windows share. Something comparable to ping's -I option:               ping -I my_alias_ip destination_ip      I didn't find anything related in _man mount.cifs_.


change terminal window default location

How do I change the default `gnome-terminal` location on **screen**. I checked out the preferences but they only have option to change default size. I also checked out `.gconf/apps/gnome-terminal/` but didnt find any thing out.   All in all my `gnome-terminal` should normally be `gnome-terminal --geometry=80x24+200+200`   I dont want to do it through launcher because I will always have to start the terminal from launcher to get that location.


incorrect/overwritten margins when using vim in GNU screen

When ssh'd into a work server via PuTTY I'm seeing strange behavior with the left margins when using GNU screen and vim. For example, I'll open up a Python script and all indentations will be gone i.e.               def __init__(self):     self.name = str(self.__class__.__name__)     self.nestables = None     self.attributes = {}      and not               def __init__(self):         self.name = str(self.__class__.__name__)         self.nestables = None         self.attributes = {}      However if I scroll down one line at a time newly appearing lines on screen will have proper indentation. I see similar behavior in htop, with the left margin getting overwritten or being indented incorrectly. I figure there's a termcap/terminfo setting I can put in my .screenrc but everything I've tried so far has not worked. I see this both in Debian 7 and CentOS 6. Anyone else encountered this before? **Edit:** I am indenting with spaces, not tabs, and am using PuTTY from my Windows 7 workstation. I tried to reproduce the issue at a normal Windows cmd window using Cygwin/SSH and the margins are just fine, so it does appear to be PuTTY specific. ... and it turns out that I had "Implicit CR in every LF" checked by default in PuTTY and that was the culprit. Screen was a red herring.


Reinstall gnome 3

I have Kali linux and lately I had some problems with my ATI Radeon GPU overheating. I had to reinstall the drivers. Since I'm a newbie, obviously, something gone wrong and my beautiful Gnome 3 desktop has turn into beastly- gnome-2[actually a fallback session]. Now the GPU fan works just fine but I also want to get back my old desktop. I already tried this and it's not working. I've tried googling my problem but I didn't find anything useful. Are there any chances to "reinstall/reset" it?


regex to match identifiers without double _

I want a regex to match identifiers consisting of letters, digits and `_`, without double underscores. My current attempt:               ^(?!_)(?!.*?_$)[a-zA-Z][a-zA-Z0-9_]+$      Example:               Abdfsdfsdf__      1B2345_     v1__23456     __23456789b     12345-6789     123456789     1_fsdfdfsdf     v_fsdfsdf_fsdfd     v_123     v__123     v134234_fsdfsd     123456     a1b2c3d4e5      Matched:               v1__23456     v_fsdfsdf_fsdfd     v_123     v__123     v134234_fsdfsd     a1b2c3d4e5      How can I remove the rows `v1__23456` and `v__123` from the matches?


Is it better to set rules in ip6tables or disable ipv6?

I have the following network configuration:               # ifconfig -a     eth0      Link encap:Ethernet  HWaddr 00:e0:1c:73:02:09               inet addr:10.1.4.41  Bcast:10.1.255.255  Mask:255.255.0.0               inet6 addr: fe80::2e0:4cff:fe75:309/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:858600 errors:0 dropped:0 overruns:0 frame:0               TX packets:1069549 errors:0 dropped:0 overruns:5 carrier:0               collisions:0 txqueuelen:1000               RX bytes:142871181 (136.2 MiB)  TX bytes:717982640 (684.7 MiB)          lo        Link encap:Local Loopback               inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:65536  Metric:1               RX packets:37952 errors:0 dropped:0 overruns:0 frame:0               TX packets:37952 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:3396918 (3.2 MiB)  TX bytes:3396918 (3.2 MiB)      I have DHCP server in my network and I can get the following lease:               lease {       interface "eth0";       fixed-address 10.1.4.41;       option subnet-mask 255.255.0.0;       option routers 10.1.255.253;       option dhcp-lease-time 120;       option dhcp-message-type 5;       option domain-name-servers 82.160.125.52,213.199.198.248,82.160.1.1;       option dhcp-server-identifier 192.168.22.22;       renew 3 2014/01/01 18:34:41;       rebind 3 2014/01/01 18:35:30;       expire 3 2014/01/01 18:35:45;     }      I can ping `127.0.0.1`, `::1`, `10.1.4.41`:               $ ping 10.1.4.41     PING 10.1.4.41 (10.1.4.41) 56(84) bytes of data.     64 bytes from 10.1.4.41: icmp_seq=1 ttl=64 time=0.065 ms     64 bytes from 10.1.4.41: icmp_seq=2 ttl=64 time=0.075 ms     64 bytes from 10.1.4.41: icmp_seq=3 ttl=64 time=0.085 ms     ^C     --- 10.1.4.41 ping statistics ---     3 packets transmitted, 3 received, 0% packet loss, time 2000ms     rtt min/avg/max/mdev = 0.065/0.075/0.085/0.008 ms          $ ping 127.0.0.1     PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.     64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.066 ms     64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.056 ms     64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.055 ms     ^C     --- 127.0.0.1 ping statistics ---     3 packets transmitted, 3 received, 0% packet loss, time 1999ms     rtt min/avg/max/mdev = 0.055/0.059/0.066/0.005 ms          $ ping6 ::1     PING ::1(::1) 56 data bytes     64 bytes from ::1: icmp_seq=1 ttl=64 time=0.052 ms     64 bytes from ::1: icmp_seq=2 ttl=64 time=0.049 ms     64 bytes from ::1: icmp_seq=3 ttl=64 time=0.037 ms     ^C     --- ::1 ping statistics ---     3 packets transmitted, 3 received, 0% packet loss, time 1998ms     rtt min/avg/max/mdev = 0.037/0.046/0.052/0.006 ms      I can't ping the ipv6 address `fe80::2e0:4cff:fe75:309`:               $ ping6 fe80::2e0:4cff:fe75:309     connect: Invalid argument      I have set some iptables rules (ipv4):               # iptables -S     -P INPUT DROP     -P FORWARD DROP     -P OUTPUT ACCEPT     -N TCP     -N UDP     -A INPUT -i eth0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT     -A INPUT -i lo -j ACCEPT     -A INPUT -i tun0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT     -A INPUT -m conntrack --ctstate INVALID -j DROP     -A INPUT -p udp -m conntrack --ctstate NEW -j UDP     -A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -m conntrack --ctstate NEW -j TCP     -A INPUT -p tcp -j REJECT --reject-with tcp-reset     -A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable     -A INPUT -j REJECT --reject-with icmp-proto-unreachable     -A OUTPUT -m conntrack --ctstate INVALID -j DROP      And it works as expected for ipv4. But when I check ip6tables, I can see some packets go there:               # ip6tables -nvL     Chain INPUT (policy ACCEPT 381 packets, 27624 bytes)      pkts bytes target     prot opt in     out     source               destination          Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination          Chain OUTPUT (policy ACCEPT 390 packets, 26296 bytes)      pkts bytes target     prot opt in     out     source               destination      I followed this guide, and they say that I should copy the iptables (ipv4) configuration and paste it in ip6tables (ipv6). But when I do this, no packet can go through the rule `RELATED,ESTABLISHED` in the ipv6 table. All of them are dropped because of INPUT chain policy (`DROP`).               # ip6tables -nvL     Chain INPUT (policy DROP 5 packets, 360 bytes)      pkts bytes target     prot opt in     out     source               destination         0     0 ACCEPT     all      eth0   *       ::/0                 ::/0                 ctstate RELATED,ESTABLISHED         0     0 ACCEPT     all      lo     *       ::/0                 ::/0         0     0 ACCEPT     all      tun0   *       ::/0                 ::/0                 ctstate RELATED,ESTABLISHED         0     0 DROP       all      *      *       ::/0                 ::/0                 ctstate INVALID         0     0 UDP        udp      *      *       ::/0                 ::/0                 ctstate NEW         0     0 TCP        tcp      *      *       ::/0                 ::/0                 tcp flags:0x17/0x02 ctstate NEW         0     0 REJECT     tcp      *      *       ::/0                 ::/0                 reject-with tcp-reset         0     0 REJECT     udp      *      *       ::/0                 ::/0                 reject-with icmp6-port-unreachable          Chain FORWARD (policy DROP 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination          Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination         0     0 DROP       all      *      *       ::/0                 ::/0                 ctstate INVALID          Chain TCP (1 references)      pkts bytes target     prot opt in     out     source               destination          Chain UDP (1 references)      pkts bytes target     prot opt in     out     source               destination      As you can see there's no output packets, so why google and stack exchange try to connect to my machine? And how do they do it because even I can't ping my ipv6 address? They also say if my ISP doesn't have ipv6 (in the lease, there's no ipv6 entry) I should disable ipv6 and had done this before by using `ipv6.disable=1`. I asked similar question at `meta.stackoverflow.com`, and I got an answer that I shouldn't disable ipv6. I have no idea what to do. I have some connection problems, I mean sometimes I can't access pages at stack exchange, or google, I have also problems with pastebin.com. In each case there are the same symptoms -- after typing an address in my browser, I have to wait sometimes several minutes in order to access the site and after reloading it 2-3 times, I can browse it freely, at least for a certain period of time.


No installation steps when Installing CentOS 6.4 on VMware Fusion

This is my first real day on using linux. I'm following a book guide. I installed CentOS 6.4 on my mac using VMWare Fusion. However, during the installation, it did not guide me through the installation steps (e.g., choosing software selection like Server, Server-GUI, Desktop-KDE, or choosing `/home`, `/tmp`, `/var` and other stuff). I just directly, got my CentOS up and running. Any one know how can I get this installation steps?


What makes OSX programs not runnable on Linux?

I know there are many differences between OSX and Linux, but what makes them so totally different, that makes them fundamentally incompatible?