How to save temp data

**updated:** I'd like to save a large amount data ( ~ 100MB ) from _the standard input_ in **temporary** location for the duration of my bash session. Piping it to a _file_ won't work as I have only 30MB of free space. I also don't want to save it in a _variable_. I'd obviously have to utilize some space other than that of my _Disk Storage_. Which leaves my _RAM_. Is there some _mechanism_ that will allow me to write to it, and then to retreive the written data again. ( like when you pipe to and from `/dev/null` )


Is there any way to assign shortcuts to Nautilus bookmarks?

I have added several dirs as bookmarks to nautilus and I want to know if there a way to assign keyboard shortcuts to some of them.


Ubuntu: How can I disable boot and logout screen

I want to be able to see all stuff from the boot process, just like in Debian. I instaled `startupmanager` but It only change boot screen to more ugly. I search google and find that you must remove "quiet" from /boot/grub/menu.lst but I don't have that file on my system.


Searching for a sawfish config

On the Sawfish Wikia, there's a beautiful image: ![](http://images2.wikia.nocookie.net/__cb20110217214403/sawfish/images/3/33/Arch_170211_by_hashbox.png) Does anyone know how to configure sawfish to look like this? I can't find any docs regarding this picture/desktop.


How can I make a bootable usb flashdrive?

Can I just dd an Ubuntu 11.04 mini.iso to an usb flashdrive an boot from it? or what am I missing?


cfgmgr like command under Linux?

`cfgmgr` is a command under AIX/ksh that checks for new hardware; e.g. new HDD's that have been added without a shutdown. Question: Are there any similar commands under Linux? If "fdisk -l" doesn't recognize the new HDD (only after reboot). Or is Linux different from AIX, and this command is not needed?


alpine failed to connect to smtp.gmail.com

When I try to send email from alpine I get the following error: > Error sending: connection failed to gmail-smtp... (The message disappear before I have the time to copy it). I suspect this is a firewall issue (I'm in a university campus). How can I fix this (or at least confirm)? Edit: I tried to telnet: > yotam@sumsum:$> telnet smtp.gmail.com 587 > > Trying 209.85.229.109... telnet: > > Unable to connect to remote host: Connection timed out


Remove end of line characters from stdout? Multiple lines into a single line

I have a script which outputs the following text. This is the output from a Netopia 2210-02 ADSL2 modem.               ADSL Line State:        Up     ADSL Startup Attempts:  1     ADSL Modulation:        DMT     ADSL Data Path:         Fast     Datapump Version:       DSP 7.2.3.0, HAL 7.2.1.0     SNR Margin:                   8.20        9.00 dB     Line Attenuation:            57.50       31.00 dB     Output Power:                17.09       12.34 dBm     Errored Seconds:                 0           0     Loss of Signal:                  0         476     Loss of Frame:                   0           0     CRC Errors:                  57921         416     Data Rate:                    2880        1024      How can I remove the end-of-line character for each line? I would like the output to look something like this (Yes it's ugly):               ADSL Line State:        Up ADSL Startup Attempts:  1 ADSL Modulation:        DMT ADSL Data Path:         Fast Datapump Version:       DSP 7.2.3.0, HAL 7.2.1.0 SNR Margin:                   8.20        9.00 dB Line Attenuation:            57.50       31.00 dB Output Power:                17.09       12.34 dBm Errored Seconds:                 0           0 Loss of Signal:                  0         476 Loss of Frame:                   0           0 CRC Errors:                  57921         416 Data Rate:                    2880        1024       I tried some solutions like this, but they don't work:               # (This simply outputs the contents of the script, unmodified)     stefanl@hosta:~/Work/Cacti $ ./script | sed -e 's/$//'      I also tried using `tr`. I was expecting the following command to replace each newline character with the space character. This would take the multiple lines and combine them into one long single line. Instead, this only displays the last line of output. It seems to overwrite each subsequent line with the next line of output.               stefanl@hosta:~/Work/Cacti $ ./script | tr '\n' ' '     Data Rate:                    2880        1024stefanl@hosta:~/Work/Cacti $     stefanl@hosta:~/Work/Cacti $      **Update** : Upon further examination, it looks like each line is preceded by a return character. This shows up as `^M` when using `less`. So, I added two `tr` statements. One to delete newline characters, one to delete the return character.               ./script | | tr -d '\n' | tr -d '\r'


fdisk unable to open

I am having problems using `fdisk` to clear the partition table of my sd card. The sd card is identified in the `/dev` folder when inserted into the sd card reader, but when the following command in run:               fdisk /dev/sde      the response in the terminal is: > unable to open sde I have also tried using `sde1`, which is the partition on the sd card, and it still failed. How do I fix this?


Remap "Show the Overview" to control in Gnome ( Fedora 20 )

I would like to remap "Show the Overview" to control, but the gui will not allow it. Is there a config file somewhere I can use to specify this? Screenshot


Why does the less-than sign not work as a replacement for cat in bash?

I heard about "useless use of cat" and found some suggestions, but the following outputs nothing in my bash shell.               < filename      Using cat works as expected though.               cat filename      I'm using Fedora Core 18 and GNU bash, version 4.2.45(1). EDIT: Using it in front of a pipe doesn't work either.               < filename | grep pattern      Whereas using cat works as expected.               cat filename | grep pattern      EDIT2: To clarify, I know that I can use this               grep pattern < filename      but I read here http://stackoverflow.com/questions/11710552/useless-use-of-cat that I can also use it in front of the command. It does not work in front of the command though.


Wget or curl a self-signed certificate from server

From my browser, I can browse to a machine in my companies local intranet and (after marking the certificate as trusted) export that certificate to a file. I'm trying to automate this process into a shellscript so I can make my life a little easier when using various commandline tools without throwing security out the window. Trying to google this topic has been difficult and has mainly yielded results about how to trust a certificate you have already downloaded while using wget or curl, but that's not what I need in this case. How can I download the server's public self-signed certificate to a local file via wget or curl?


What config changes are being tracked by aureport?

I am interested in using aureport to audit my server. When I run:               # aureport -c      It gives the following output:               ===================================     # date time type auid success event     ===================================     ...     35. 05/10/2014 12:34:44 CONFIG_CHANGE -1 yes 6     36. 05/11/2014 12:34:49 MAC_POLICY_LOAD 1000 yes 234      However, it doesn't say what `CONFIG_CHANGE` and `MAC_POLICY_LOAD` refers to. And changes I made on some config files in `/etc/` folder doesn't seem to be recorded. The man page says only:                  -c, --config               Report about config changes      Any idea what kind of configuration changes are being tracked by aureport?


After restarting Chromium, fonts are malformed

As I mention in the title, everything works great until I restart Chromium. Then the fonts appear as in the screenshot. The weird is that only the tab title and the link is malformed. And it wont fix till a system restart. Arch Linux, fully updated, with KDE. Thanks in advance for any help. ![enter image description here](http://i.stack.imgur.com/W1eWG.png)


Can't add large number of rules to iptables

I made a very simple bash script (echo at start, runs commands, echos at end) to add approx 7300 rules to iptables blocking much of China and Russia, however it gets through adding approximately 400 rules before giving the following error for every subsequent attempt to add a rule to that chain:               iptables: Unknown error 18446744073709551615      I even tried manually adding rules afterwards and it won't let me add them (it gives the same error). The command to add each rule looks like this:               /sbin/iptables -A sshguard -s x.x.x.0/x -j DROP      `sshguard` is a chain I created for use with the sshguard daemon, and I wanted to add the rules there so I wasn't muddying up the `INPUT` chain. The ip ranges I am supplying are not to blame here, as I have supplied valid ranges to test and they are met with the same error. Flushing the chain of rules and adding individual ones work, but again, not after ~400 entries. I did some googling beforehand, but the others having this issue don't seem to be having it for the same reasons I am. Is there some kind of rule limit per chain with iptables? Also, is this the proper way to go about blocking these ranges (errors aside)?               # iptables -V     iptables v1.3.5          # cat /etc/issue     CentOS release 5.8 (Final)          # uname -a      Linux domain.com 2.6.18-028stab101.1 #1 SMP Sun Jun 24 19:50:48 MSD 2012 x86_64 x86_64 x86_64 GNU/Linux      **Edit:** To clarify, the bash script is running each iptables command individually, not looping through a file or list of IPs. Also, my purpose for blocking these ranges is preventative -- I am trying to limit the amount of bots that scrape, crawl, or attempt to create spam accounts on a few of my websites. I am already using sshguard to block brute force attempts on my server, but that does not help with the other bots, obviously.


1:1 NAT with several identical LANs

I want to connect several LANs located on remote buildings.   The "central" site have a Linux computer running OpenVPN. Each remote site also run OpenVPN.   1. the central site has a LAN numbered 192.168.0.0/24   2. several remote sites are also numbered 192.168.0.0/24   3. I can't/won't/don't want to/whatever modify LAN numbering   4. I don't have control on most remote OpenVPNs I then need to :   1\. define virtual LANs   2\. configure a 1:1 NAT for each site   3\. the 1:1 NAT has to be configured on the central router ![LAN map](http://i.stack.imgur.com/EJjId.png) .   So each site is seen to have a 10.10.x.0/24 LAN.   When a computer want to reach, say, 192.168.0.44 on site 12, it just have to send a paquet to 10.10.12.44 Operating a VPN is not a problem for me. I currently connect 60+ sites. But I don't find a simple way to do this 1:1 NAT. Here is an example of a packet sent from the central site to a remote site, and its response packet : ![enter image description here](http://i.stack.imgur.com/YC3HD.png) I did some tests with iptables NETMAP but I can't manage to make it work because I don't find a way to modify source+destination after routing decision.   I prefer to avoid the new `--client-nat` OpenVPN's feature.   Maybe I have to force routing with `ip route` ? Or to loop twice into the network stack with `veth` ? Note : I don't want to use masquerade. Only 1/1 NAT. EDIT :   It's not possible with a regular openVPN setup. Because a packet from a remote site is indistinguishable from a packet from another site : both have similar source and destination addresses, and both come from the same tun (or tap) interface. So it's not possible to source-NAT it. Solution 1 : do the NAT on the remote sites. Not possible in my case. I have to do it only on the central site. Solution 2 : setup one VPN for each remote site. So I'll have one tun for each. I think this can be ok. Not very memory efficient but ok. Solution 3 : setup a (unencrypted) tunnel inside the VPN for each site. This will give one interface for each. Simple tunnels are are not cross-platform (to my knoledge). For example GRE or ipip or sit are ok for Linux, but some distant sites are running only one Windows computer, so openVPN is installed on it. So impossible to setup a simple tunnel. Other option is to use a more complicated tunnel (wich ?) but the overhead on the system and on the sysadmin may be bigger than having multiple VPNs Solution 4 : compile the latest openVPN, because its include a 1:1 NAT feature. I test this this week.


FUSE : Allow any user in the fuse group to unmount

I'm currently trying to write a couple of systemd/udev configuration files that will allow me to automount/unmount MTP Android devices on my Archlinux laptop. It took me some time, but so far it works pretty well. Now, I would like for any user with `fuse` permissions to be able to unmount the device. So far, it's only possible for the same user as the one `go-mtpfs` was started as. I'm well aware that MTP is designed so that you can just unplug the device without consequences, but having an error message pop up when clicking "Eject" in Nautilus is kind of unexpected and not really nice. I tried the following, but failed :   * Add myself to the `fuse` group, start `go-mtpfs` as `root` and try to unmount as myself   * Start `go-mtpfs` as the `fuse` user and group, and try to unmount as myself, also in the `fuse` group Any idea? Also, if you have an elegant way to achieve the same thing without having to rely on the `fuse` group, I'd love to hear about it! **systemd service** _(/etc/systemd/system/android-mtp.service)_ :               [Service]     Type=forking     ExecStartPre=/bin/mkdir -p /media/Android     ExecStart=/usr/sbin/daemonize -l /var/lock/go-mtpfs.lock /usr/bin/go-mtpfs -allow-other=true /media/Android     ExecStop=/bin/umount /media/Android     ExecStopPost=/bin/rmdir /media/Android      **udev rule** _(/etc/udev/rules.d/99-android-mtp.rules)_ :               # Google Nexus 7 16 Gb Bootloader & recovery mode     SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e40", MODE="0666" # Bootloader     SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d001", MODE="0666" # Recovery          # Google Nexus 7 16 Gb PTP mode (camera)     SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e43", MODE="0666" # PTP media     SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e44", MODE="0666" # PTP media with USB debug on          # Google Nexus 7 16 Gb MTP mode (multimedia device)     SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e41", MODE="0666" # MTP media     SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e42", MODE="0666" # MTP media with USB debug on          # Google Nexus 7 MTP mode : automatic unmount when unplugged (all android versions)     ENV{ID_MODEL}=="Nexus", ENV{ID_MODEL_ID}=="4e41", ACTION=="remove", RUN+="/usr/bin/systemctl stop android-mtp.service"     ENV{ID_MODEL}=="Nexus", ENV{ID_MODEL_ID}=="4e42", ACTION=="remove", RUN+="/usr/bin/systemctl stop android-mtp.service"     ENV{ID_MODEL}=="Nexus_7", ENV{ID_MODEL_ID}=="4e41", ACTION=="remove", RUN+="/usr/bin/systemctl stop android-mtp.service"     ENV{ID_MODEL}=="Nexus_7", ENV{ID_MODEL_ID}=="4e42", ACTION=="remove", RUN+="/usr/bin/systemctl stop android-mtp.service"          # Google Nexus 7 MTP mode : automatic mount when plugged (all android versions)     ENV{ID_MODEL}=="Nexus", ENV{ID_MODEL_ID}=="4e41", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="android-mtp.service"     ENV{ID_MODEL}=="Nexus", ENV{ID_MODEL_ID}=="4e42", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="android-mtp.service"     ENV{ID_MODEL}=="Nexus_7", ENV{ID_MODEL_ID}=="4e41", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="android-mtp.service"     ENV{ID_MODEL}=="Nexus_7", ENV{ID_MODEL_ID}=="4e42", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="android-mtp.service"


X11 forwarding through SSH

I have been playing around with X11 forwarding the past few hours and so far I've managed to forward my desktop pc's X Server to my laptop, using X11VNC as server and X2VNC as client. X2VNC uses Xinerama to provide a dual-screen-like behavior between my laptop and my desktop pc. It's actually really great! I know that most Linux systems run Xorg and desktop environments on TTY7. Therefore I was thinking, is it in any way possible to have the VNC-tunnel tied to it's own TTY? It would be great to be able to switch forth and back between two TTY's in order to choose which machine to manage. And I would like this approach more than using Xinerama or a GUI.


Adding repositories with “./”

I'm trying to add this unoficcial repository to my Ubuntu 12.04 machine (32 bits), in order to install a software called SLTV. According to the official site, the following lines should be used:               deb http://debian.holoscopio.com/sltv/ ./     deb-src http://debian.holoscopio.com/sltv/ ./      If I add manually these 2 lines to `/etc/apt/sources.list` (or to a new file in `etc/apt/sources.list.d/`) and then run apt-get update, I get an error message -- I'm not at work now, so I can't provide the exact error, but I can edit this post to include the message tomorrow. I noticed the repository lines in the above example don't have the "main/stable/whatever" arguments. I'm not exactly sure what they mean. I'm guessing it's related to the distro release and to the machine architecture. From what I see on other repositories and packages such as dropbox, the line `deb http://linux.dropbox.com/ubuntu karmic main` are a reference to the `http://linux.dropbox.com/ubuntu/dists/karmic/main/` folder. But on this particular repository of the first example, the `Packages.gz` file is on the `sltv` folder. I'm guessing this is the reason for the `./` in the repository line. And I'm guessing this being in the repository line is the reason for the error. My questions are:   1. Are my guesses wrong or correct?   2. In either case, how to proceed?


Executing backup script on external HDD plug using udev

I have tried to write a custom udev rule to run a backup.sh script when I plug my USB 3.0 external hard disk to my home server. I created a new file in `/etc/udev/rules.d` called `10-custom.rules`. In this folder I have other files: `70-persistent-cd.rules`, `60-vboxdrv.rules` and `70-persistent-net.rules`. This is what I wrote in the file (all in one single line):               BUS="usb", SYSFS{idVendor}="1058", SYSFS{product}="Western Digital Technologies, Inc.", NAME="gioviusb", RUN+="/home/scripts/usbplug.sh"      This is the output of `lsusb`:               Bus 006 Device 011: ID 1058:0748 Western Digital Technologies, Inc.      Every other solution I found seems to be outdated. I am running debian 7 wheezy.


Install Backtrack 5 r2 into running LUKS setup installed with ubuntu

One Harddisk (sda) Two Partions. With a working ubuntu running. 1) /boot 2) LVM with this virtual volumes/partions/ or whatever they are called inside:   1. Swap   2. Ubuntu   3. Home   4. Prepared for Backtrack Of course i would like to share home and swap. I have seen tutorials, but they look outdated and complicated and they are for setting up everything just with backtrack. Its seems you have to do some things manually after backtrack install to get it running with LUKS. I like to know whats it is exactly what backtracks don't does automatically and how to install backtrack in my prepared partition. I want to tell backtrack NOT to install a boot-loader (i think its possible) and setup the grub from ubuntu to be able to boot backtrack.


Accidentally set screen resolution too high, it won't change back

I'm using VMware with Arch and XFCE. The default screen resolution was too small for me so I wanted to change it to something higher. I accidentally selected a screen size that was too big and I thought it was going to go back to the screen size it was before but it just stayed as a black screen. I have rebooted VMware and Arch is still a black screen. Is there anyway to fix this without reinstalling?


Checking the status of custom services with a script

I have a handful of shell scripts that start WebLogic managed servers. I need to design a master script that does the following:   * Executes the shell script for a component\managed server   * Checks to see if the port for that component is listening for 2 minutes (this can be any value but none of these services should take longer than 2 mins to start)   * If the service starts within the 2 minutes, continue on and start the next service otherwise write a log message that the service failed to start and then continue on The script will look something like this:               svcs = some_array_of_svcs          log  = '/path_to_log/log.txt'          ' start each service'     for each $svc in $svcs        echo "starting $svc" >> ${log}        . /path_to_scripts/$svc     ' check to see if the service started     loop for max 2 mins        if port is listening           echo 'Service started successfully' >> ${log}           start the next service        else           echo 'Service did not start within the specified timeout' >> ${log}           start the next service        end if     next I need the code to check the port status for _n_ minutes per service.


tab-expansion and “./” bash shell

Maybe someone here would be able to help me out. Have installed Ubuntu 12.04 LTS (kubuntu) on two machines. The `.bashrc` and `.bash_profile` files are identical as the file structures on each machine is the same. **On machine 1** : I run bash scripts within a terminal window with the simple: `./scriptname.sh` **On machine 2** : I cannot do this and must use: `sh scriptname.sh` Nor can I use `./` and tab-complete the script filename. All executable bits are set correctly, all files and folders have the correct permissions. In the header of the scripts the shebang is set correctly. Any ideas why this would be occurring? When I try `ls -l`, I get:               -rwxrwxrwx 1 adelie adelie 351 Nov 4 20:32 file_motion_grab.sh      Output of `getfacl` is:               # file: file_motion_grab.sh     # owner: adelie     # group: adelie     user::rwx     group::rwx     other::rwx      More general - any new script on the second machine must be invoked with: sh scriptname.sh Something probably wrong in the .bash files. But not sure where to look. **EDIT** Yep parent directory is all set correctly.


Linux Mint does not shut down

Sometimes (very rarely actually) I have a problem that when I try to shut down my desktop, it will freeze with the following screen and I can only shut it down by pressing the power button for 8 seconds: ![Shutdown failure](http://i.stack.imgur.com/HLvzM.jpg) Does anyone know why this error occurs (I am guessing it is because of the proprietary fglrx-driver) - or how I could get more diagnosing information if it reoccurs? I guess there would be a lot more information than I can capture with a simply photo, but as soon as the screen appears it is impossible to do anything. The problem is, it occurs very rarely (maybe once a month) so it is not really a big hassle and I can not willingly recreate it. I would just like to know what exactly is causing it. Edit: After stumbeling over this bug \- this seems to be the reason for it: the fglrx driver seems to the buggy.


How can I list all files in a Linux directory that holds basic commands and shells used by root and other users using a full path?

I know I'll be using the command `ls` but I don't know what holds the basic commands and shells used by root and other users using the full path.


dircolors "missing second token"

I'd like to customize the colors of `ls` and as far as I understand the way to go is with `dircolors`. I did:               dircolors > ~/.dircolors      Immediately after this I launch a terminal and get this error:               dircolors: /home/frank/.dircolors:1: invalid line;  missing second token      I have not changed anything in `~/.dircolors`. Running Ubuntu 11.10 x64. The file looks like this.                   LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:';     export LS_COLORS


vim is too slow when saving files

I run vi under Linux CentOS 5.3. Each time I exit from a file, I have to wait several seconds before vi saves the file. The same thing happens with vim. I ran this command:               strace -odetails -ff -f -r -v vi test      This is the section from the log file that shows a long delay (16 seconds). The delay is not always the same:                0.000041 write(1, "q", 1)          = 1     0.000040 select(1, [0], NULL, [0], {4, 0}) = 1 (in [0], left {3, 737000})     0.262932 select(1, [0], NULL, [0], NULL) = 1 (in [0])     0.000055 read(0, "\r", 250)        = 1     0.000047 select(1, [0], NULL, [0], {0, 0}) = 0 (Timeout)     0.000050 write(1, "\r", 1)         = 1      0.000057 stat64("/root/yyy58/test", 0xbfb50ee8) = -1 ENOENT (No such file or directory)      0.000060 write(1, "\33[?25l", 6)   = 6     0.000044 ioctl(0, SNDCTL_TMR_START or TCSETS, {c_iflags=0x500, c_oflags=0x5, c_cflags=0xbf, c_lflags=0x8a3b, c_line=0, c_cc="\x03\x1c\x7f\x15\x04\x00\x01\x00\x11\x13\x1a\x00\x12\x0f\x17\x16\x00\x00\x00"}) = 0      0.000077 ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {c_iflags=0x500, c_oflags=0x5, c_cflags=0xbf, c_lflags=0x8a3b, c_line=0, c_cc="\x03\x1c\x7f\x15\x04\x00\x01\x00\x11\x13\x1a\x00\x12\x0f\x17\x16\x00\x00\x00"}) = 0     0.000063 write(1, "\"test\"", 6)   = 6     0.000043 stat64("test", 0xbfb511c0) = -1 ENOENT (No such file or directory)     0.000089 open("test", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 4      0.000089 write(4, "\nsdf\nsf\nsdf\nsd\nfsdf\nsdf\nsdf\ns\nd\n"..., 42) = 42     0.000076 fsync(4)                  = 0     16.520635 stat64("test", {st_dev=makedev(0, 189), st_ino=30549058, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=8, st_size=42, st_atime=2011/08/06-15:59:23, st_mtime=2011/08/06-15:59:23, st_ctime=2011/08/06-15:59:23}) = 0     0.000106 close(4)                  = 0     0.000061 write(1, " [New] 13L, 42C written", 23) = 23     0.000054 _llseek(3, 0, [0], SEEK_SET) = 0     0.000038 write(3, "b0VIM 7.0\0\0\0\0\20\0\0\0\0\0\0\0\0\0\0\345\37\0\0root"..., 4096) = 4096     0.000055 stat64("/root/yyy58/test", {st_dev=makedev(0, 189), st_ino=30549058, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=8, st_size=42, st_atime=2011/08/06-15:59:23, st_mtime=2011/08/06-15:59:23, st_ctime=2011/08/06-15:59:23}) = 0     0.000089 write(1, "\r\r\n\33[?1l\33>", 10) = 10     0.000042 write(1, "\33[?12l\33[?25h\33[?1049l", 20) = 20      0.000036 close(3)                  = 0      0.000030 unlink("/root/yyy58/.test.swp") = 0     0.000150 exit_group(0)             = ?      How can I fix this or better trace the problem?


Setting up a mail server to simply be able to see emails sent

I'm writing an application right now that simply sends emails. All I'd like to be able to do is see clearly that my application is, in fact, sending email and that I'm getting the included attachment. Is there a utility SMTP mail server which will help me do this without actually sending the email?


Recursive grep for words in a particular file type

I wanted a command line command to search all shell scripts in the filesystem for a particular word, so I asked around at work and got the following solutions:               grep word `find / -name \*.sh 2>/dev/null`     find / -name "*.sh" 2>/dev/null | xargs grep word      However, I'm not that familiar with the command line, so both of these solutions seem opaque to me. I'd prefer to do something that looks like:               ls -r *.sh | cat | grep -H word      But it seems that you can't pipe filenames into cat (at least I think that's what the problem is). What is the most legible solution? And secondly, what is the most efficient solution? Edit: I needed to know which file the word was found in, so I could modify the script.


Proper management of ld.so.conf and shared libraries

I'm curious as to how other Linux admins manage /etc/ld.so.conf and in general, shared libraries across multiple Linux servers. We have about 30-40 Linux servers running SLES 11. Since they are tied to Active Directory, users can log into any server with their same credentials. Originally, each server had its own local ld.so.conf. However, we ran into issues where a specific piece of software, php for example, would run on server X but crash on server Y because a sys admin rearranged ld.so.conf on server Y. We strive for consistency across servers so users can easily use any number of servers for load balancing. There are certain servers that have specific purposes of course though. We thought symlinking to a shared ld.so.conf with a script that goes out and runs ldconfig on all servers whenever a change is made. I thought it would bring consistency across all servers, but I see how some servers would need a custom ld.so.conf because it runs different software that may need a different lib version. I've only been a Linux admin for under three years, so this may be a simple answer for some, so just looking for advice on this topic. Questions that came to mind:   * local or symlinked /etc/ld.so.conf?   * clean out old versions of shared libs if multiple versions exist in different lib directories?


How to reload a background process?

I have a python script which I would like to run in the background. So I do this:               $ nohup python script.py &      If I am frequently making changes to the script, I need to terminate the process and run the script again.               $ kill -9 <pid_of_bg_process>     $ nohup python script.py &      Is is possible to reload the process without terminating it?


Achieving full resolution with PowerVR SGX454 on Ubuntu 12.04

I have a Mini-PC with an ASRock AD2700B-ITX motherboard, which has an Intel PowerVR SGX545 on-board graphic chip. I installed Ubuntu 12.04 on it today. Everything is working properly and is quite quick and responsive, except that the video resolution is too low. I cannot set it higher than 1280x1024. I have a BenQ G2220HD display, which is capable of 1920x1080. Since both the graphics chip and the display are capable of higher resolutions, I assume this is a driver problem?


how to install monodevelop with d language add-in on Mint 12

I installed monodevelop from the repositories because I want to try the mono-D plugin, but when I go to the Gallery in Add-in Manager, it says "No add-ins found" I tried adding http://mono-d.alexanderbothe.com/ as a repository, but it requires monodevelop version 2.95 and the one in the repository is version 2.6: The selected add-ins can't be installed because there are dependency conflicts The package 'Ide v2.9.5' could not be found in any repository


Hibernate does not power down laptop

I have an Asus U30J laptop with both windows 7 and Linux Mint 12 installed. When I try to hibernate the laptop, the following message appears on the screen and I have to push the power button to power down: > i2c wr fail: -6 When I power up the laptop I can see that the hibernation taked place and I'm able to restore the session. So, which is the souce of the previous commented error? and why doesn't power down the laptop? I've been searching in google but I cannot find an useful link.


Phrase Express Equivalent for Linux?

Is there some sort of auto text-insertion program with macros, similar to PhraseExpress for Windows in Linux? In case you've never seen this application it offers the following features:   * Organize frequently used text snippets.   * Expand abbreviations in any program.   * Automate repetitive tasks.   * Auto-complete repetitive phrases.   * Quick access to the Windows Clipboard History.   * Correct spelling mistakes in any application. The key feature being that you can paste prebuilt snippets of text. There are of course other features I'm interested in, but in general I was wondering if there was an application that offered similar features to PhraseExpress on Linux.


Remapping scancode for Caps Lock

In Windows I was able to set Caps Lock to act as a second Enter, which can be pressed by the left little finger. I added this parameter to the registry to do that: > [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] > "Scancode > Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1c,00,3a,00,00,00,00,00 How can I do the same in Linux?


How to share a tethered iPhone internet connection with VirtualBox guest?

I mostly connect to my Linux distros to the internet via a USB iPhone tethered connection (MyWi app). I have just installed an Windows XP guest OS via Virtualbox on Ubuntu 12.04. How do I connect the guest OS to the internet via my tethered iPhone connection?


Software installation with GUI package installer using sudo permission

I have the sudo permission, and I can install any software using the CLI. But I want to know that whether `sudo` works with package installers in GUI mode. For example I have a `.chm` file and I want to open it with a mouse click, but `chmviewer` is not installed. So some prompt appears to search on net and by clicking on that pop-up it has suggested some packages e.g `kchmviewer`. But when I clicked on `<install>` it pops-up asking for the root password, which I dont have. Is there a way to install software in GUI mode when you have sudo permission, but not the root password?   Just for curiosity I want to know how to use `sudo` with a GUI installation mode. BTW: I have already installed `kchmviewer` from command line :)


vsftpd does not list content of a directory

I have set up a FTP server using `vsftpd` and enabled anonymous upload and download. The problem I have is that when I upload a directory it will be uploaded successfully (I can see it in server), but the next time I want to check that directory, FTP client shows an empty directory!! There is no error logged in `/var/log/vsftpd.log`. The `pub` folder (home folder for anonymous ftp user) has also write permission. I tested various config options but none helped! The latest config options I set are like below:               anonymous_enable=YES     local_enable=YES     write_enable=YES     anon_upload_enable=YES     anon_mkdir_write_enable=YES     anon_other_write_enable=YES     dirlist_enable=YES      I even turned off firewall once for testing it, but it didn't change anything!


how to invoke vim with line numbers shown

I know that from inside `vim` the command to display line numbers is `:set number`. Is it possible to invoke `vim` so that line numbers are shown from the beginning?


Where does Mutt put deleted messages if no purge is performed?

If I delete one or more email messages in Mutt and then say no when it asks (when changing folders or quitting the program) if I want to purge the deleted messages, what does Mutt do with them? After quitting the program and exiting the terminal, then the next time I login to email with Mutt, they (the messages marked for deletion but never purged) no longer show up in the message lists, but the purge was never run. Where are they? I am checking mail via IMAP.


Changing password in multiple boxes using script

I'm working in a environment which has around 400 AIX boxes. I don't have root access and I'm a normal user. The environment has no LDAP kind of centralized mechanism for authentication so the passwords are maintained in `/etc/shadow` file only. The security policy makes us change passwords every 30 days which creates a big complication where we can't change passwords on all boxes every month, which leads us to have different passwords on each box. It's a big headache to maintain the passwords. Is there a way to write a script which will login and change passwords in a list of the boxes so that we can change the password every month on all the boxes so that we will have the same passwords? Please advise the logic, so that I can write a script.


Converting and rescaling a lot of png images to jpeg

I have a lot of .png images in a folder. Is there a command (or software) that can convert all them to .jpg and (simultaneously) rescale the created .jpg files to 25% of their original size?


Is there an application to find similar documents?

Is there any good software that finds groups of multiple files that are similar, or where one file includes a part of another? I have a directory with lots of files mixed up. Among the files, are different versions of files, and the file names are messed up.


How are you organizing your $HOME?

I've always wanted to know more about how people (power users and lambda users) were organizing there `$HOME`. The trend is currently is using `xdg- users-dirs` which define a set of _most used_ folders like : `Music/`, `Video/`, `Documents/`, … As a lot of geeks or developers or sysadmin, I do tweak a lot my shells and I do wrote a lot of scripts. The thing is :   * Where do you usually put your scripts ?    * Where do you usually put the lib that is common for a lot of your scripts and ?   * What about docs or man ? For example, for a long time, I did put everything in a `$HOME/.local` folder that was more or less like `/usr/local` (You could find `bin/`, `lib/`, `share/`, `docs/`, `logs/`). I'm thinking to not bother with the `.local/` and put everything on home but I was wondering how people deal with that.


Viewing .doc and .docx documents with MathType equations on Linux

Is there a way to view `.doc` and `.docx` documents with embedded MathType equations on Linux? When I try to open them with LibreOffice, I get blank boxes where the math is supposed to be - the same behavior I get on MS Word without MathType installed. But is Windows-only, so I can't install it on my Linux. Is there a way to view those documents with the equations on Linux? I don't want to edit them, just to view them, and I don't mind if I have to convert the to some other format first, as long as the conversion can be done from Linux(I hate logging into Windows just to convert a document to PDF...)


Finding Stalled or Failed Updates on System

I was wondering if there is a way to grep through systems to find old updates that have stalled or failed. I am using RHEL 6.


HP-UX 9: Backup filesystem using tar

So I've got an HP-UX 9 box that I'm trying to backup, first to a tape with fbackup, to no avail, and now to a folder shared over NFS. I'm using the command "tar -cvf /nfs/Results/backup.tar /" where the single '/' should mean that I want everything within the root directory to be backed up, but for whatever reason it's only backing up a certain directory within /dev/ and then terminating. I get the feeling it doesn't like how I'm specifying the directory to be backed, so how might I get around this?


Is it possible to execute scripts in BIND based on lookup

Is it possible, to set up BIND as DNS server on my local network, and make execute scripts when it gets a lookup? I would like to execute a Python or Bash script, based on the incoming DNS lookup, how can I solve this? If possible in Bind, please tell me how, and if not, tell me if it is possible in other DNS server implementations, that run on Ubuntu. Thank you very much.


diff - output line-numbers

I want to use cli tool for file comparison and need line-number before output line with which help I could jump to line difference, because I use tool which understands where to jump, if the line begins like this `:line-number: regular line contents` So I tried `diff`, and reading documentation seems like it might be possible:                 -D, --ifdef=NAME                output merged file with `#ifdef NAME' diffs           --GTYPE-group-format=GFMT   format GTYPE input groups with GFMT           --line-format=LFMT          format all input lines with LFMT           --LTYPE-line-format=LFMT    format LTYPE input lines with LFMT         These format options provide fine-grained control over the output           of diff, generalizing -D/--ifdef.         LTYPE is `old', `new', or `unchanged'.  GTYPE is LTYPE or `changed'.         GFMT (only) may contain:           %<  lines from FILE1           %>  lines from FILE2           %=  lines common to FILE1 and FILE2           %[-][WIDTH][.[PREC]]{doxX}LETTER  printf-style spec for LETTER             LETTERs are as follows for new group, lower case for old group:               F  first line number               L  last line number               N  number of lines = L-F+1               E  F-1               M  L+1           %(A=B?T:E)  if A equals B then T else E         LFMT (only) may contain:           %L  contents of line           %l  contents of line, excluding any trailing newline           %[-][WIDTH][.[PREC]]{doxX}n  printf-style spec for input line number         Both GFMT and LFMT may contain:           %%  %           %c'C'  the single character C           %c'\OOO'  the character with octal code OOO           C    the character C (other characters represent themselves)      but there is no example or explanation about this complicated switch. Is it possible to get such output from `diff`? If so how?


Can't find or create trash while deleting files

I was unable to remove a file anymore with thunar: ![enter image description here](http://i.stack.imgur.com/QJfdK.png) How should I create the "Trash" folder ?


What changes may break a live persistent USB installation?

From my experience it looks like the persistence feature is just an enhancement that provides some space for remembering supplementary changes (installing supplementary software, like office suites, some multimedia players, internet browsers, and for the settings made inside applications). But I am under the impression that the persistence space is not meant for changes in the system files or in the important drivers. Attempting such changes seems useless (they are not remembered) or dangerous (the drive would not boot after a while). I was not able to keep a such drive operating properly and there must be some changes that have entailed this. What they may be and can they be avoided?


Exclude files that have very long lines of text from grep output

I often run grep commands to find things in my code, but the problem with web projects is that there will often be compressed JavaScript and CSS files which create one huge line of text, so that if a match is found, the whole terminal window is filled for more then a 1000 lines, making it extremely impractical to find what I'm looking for. So is there a way to avoid files that have say single lines of text over 200 characters?


Where can I find the Linux driver for headphones in the kernel tree?

I have headphones with three buttons on them which allow me to control my music player with my phone. I want to write a driver for my headphones to make it control my music player on my pc (Ubuntu Linux). So I think I should write a special program for my device. I have some basic knowledge about kernel programming and Linux device drivers. Who can tell me where I can find the default driver for headphones, or some ideas and suggestion are also appreciated.


How can I secure an OpenBSD-based Apache webserver?

I have an OpenBSD server that has a running webserver (the built-in apache web srv). How can I harden this setup? I want to only server static html files, no php, no sql.


How To Locate Dependencies Needed by RPM Packages

I am trying to deal with keeping our RHEL 5 server patched up, but also dealing with our security constraints. This particular server is not allowed to talk to the Internet. So yum isn't really an option. When we get RHN Alerts, I manually go to Red Hat's portal and view the available packages via Classic Management, and download the necessary RPM's to my workstation, then I FTP them onto the server. This all works well and fine, until a particular dependency is needed that's not included in the packages. For example... > root@myserver:~/rhn-packages $ rpm -Uvh *.rpm error: Failed dependencies: > libfontenc.so.1 is needed by libXfont-1.2.2-1.0.5.el5_10.i386 Searching in Red Hat's packages for libfontenc doesn't get me anywhere. How do I go about getting this dependency installed?


Vim insert mode completion for sentences

I would like to have insert mode completion for sentences rather than lines in vim. `C-x C-l` completes lines, but cannot complete sentences that do not start with a new line. For example:               I have a dog. My dog's name is Spot.      I want to be able to type:               My dog      then hit a key to complete the sentence. What is the best way to do this? A thread with the same title did not have a solution.


How to terminate a hung process in SSH?

I have a SSH session with a VM running on Amazon AWS. One of the programs I had run hung up and froze the SSH terminal. So I hit `Enter`+`~`+`.` Now when I am trying to connect to my machine it says connection timed out.   1. Does this mean that connection was only terminated from the client side and is still active on server? If so how do I create a new connection?   2. `Ctrl`+`C` does not work on a SSH shell. Does this mean it is not possible to terminate the hung up command without terminating the SSH session?


List Kerberos principals with valid TGTs

Is it possible to query my (MIT) Kerberos KDC to return a list of principals who have been issued TGTs that are currently valid? My use case is that I would like to find out which users are currently logged in on any machine in a networked environment by querying only the KDC machine.


Immortal SSH Session

I've got a little TurnKey Linux Debian Squeeze VM that I use for SFTP. I had a user login and transfer a file the other day and now I can't seem to kill the session. I'm still a little shaky in Linux but here are the symptoms:   * `netstat - tanp` shows the user with an established connection with a PID/Program name of `2603/sshd`   * `kill -term 2603` runs successfully but...   * `netstat -tanp` shows the foreign address in `TIME_WAIT` with an additional entry of `ESTABLISHED` with the same foreign address and a new PID Lather, rinse, repeat. I confirmed with the user that he's not actually connected (he in fact uninstalled the SFTP client on his side). I also tried restarting ssh and rebooting the VM several times and it pops back up as ESTABLISHED. Any idea what's happening or how I can kill this?


How do I install Solaris 10 on a Sunblade 150 machine using external DVD drive?

I want to install Solaris 10 on a Sunblade 150 Machine. It comes on a CD-ROM. Can I install it using an external DVD-drive?


How can a group own a file?

Whe I do `ls -l`, two of the fields are username of the owner and name of the owning group. The username is clear - I created the file, it is mine. However the group entry confuses me. My user is a member of several groups. What is so special about the group with the name same as my username, that _it_ owns newly created files and not some other group e.g. sudoers.


How to get vimchat to work in linux

I added               Bundle 'throughnothing/vimchat'      to my `~/.vimrc` file and ran `:PluginInstall`. That all ran fine, then I added an account and password to the `~/.vim/Bundle/vimchat/config` file like this:               user@domain = password      When I run `vim` and type `:VimChat` (after restarting) I get this message:               E492: Not an editor command: VimChat      Clearly the installation somehow failed, but I'm a bit at a loss on how to diagnose this. The installation seemed to go fine! I'm using `vim 7.4`


split a file, pass each piece as a param to a script, run each script in parallel

I have a words.txt with 10000 words (one to a line). I have 5,000 documents. I want to see which documents contain which of those words (with a regex pattern around the word). I have a script.sh that greps the documents and outputs hits. I want to (1) split my input file into smaller files (2) feed each of the files to script.sh as a parameter and (3) run all of this in parallel. My attempt based on the tutorial is hitting errors               $parallel ./script.sh ::: split words.txt # ./script.sh: line 22: split: No such file or directory      My script.sh looks like this               #!/usr/bin/env bash          line 1 while read line     line 2  do             some stuff     line 22 done < $1      I guess I could output split to a directory loop thru the files in the directory launching grep commands -- but how can do this elegantly and concisely (using parallel)?


corrupted library after hard shutdown

yesterday night my laptop executes a hard shutdown because my battery was out of charge. After the reboot `Xorg` hangs and the troubleshooting was pretty hard. A first file system check of my `ext4` partition yields no error. Further I began to check the related `logs` and found nothing irregular. Since i use `xdm` i eventually looked in `/var/log/xdm.log` where i found the following line, that i had overlooked several times before               /usr/bin/X: symbol lookup error: /usr/lib/libpciaccess.so.0: undefined symbol: gzopen64      Then i invoked               apt-get install --reinstall libpciaccess      and after a reboot everything was fine again. I know that a hard shutdown can corrupt data because the disc cache can't be physically written anylonger. Since i have no deeper understanding of the file systems interna i wonder why `/usr/lib/libpciaccess.so.0` was harmed by the shutdown? Particularly given that the system only reads from a shared library so probably corruption is less likely to occur in those sectors where those are located. Furthermore i would like to know which filesystems are more resistant to hard shutdowns and which are less. Thanks for your time and best regards


What is making my cursor 'randomly' disappear when using gnome-teminal?

It happens often that my cursor on `gnome-terminal` disappears, forcing me to work on a new tab/window. It seems like a random occurrence. Does anyone else experience this? What about other X terminal emulators? How can I fix this (or maybe it's just a bug)? **update** : A simple work-around is to switch away from the terminal and switch back. **update 2** : I don't experience this any more, maybe because I'm using GNOME 3 version of the terminal.


Strange messages on (un)installation

A lot of times when I (un)install packages, I get strange warning messages. Here's a snippet:               Processing triggers for libglib2.0-0 ...     Processing triggers for man-db ...     Processing triggers for desktop-file-utils ...     Processing triggers for gnome-menus ...     Processing triggers for menu ...     Processing triggers for gconf2 ...     WARNING: node <gettext_domain> not understood below <schema>     WARNING: node <gettext_domain> not understood below <schema>     WARNING: node <gettext_domain> not understood below <schema>     WARNING: node <gettext_domain> not understood below <schema>     WARNING: node <gettext_domain> not understood below <schema>     WARNING: node <gettext_domain> not understood below <schema>     WARNING: node <gettext_domain> not understood below <schema>     WARNING: node <gettext_domain> not understood below <schema>     Processing triggers for hicolor-icon-theme ...     Processing triggers for shared-mime-info ...      Anyone knows what causes this? These seem like harmless messages, but what do they mean? How to I get rid of them? [ **update** ] Running `sudo gconf-schemas --register-all` doesn't help, and gives me the same warning messages. [ **note** ] I use Debian Squeeze.


Installing Rubymine without sun-java6-jre

I'm using Ubuntu 10.04 and am looking to install Rubymine. It seems every tutorial recommends installing `sun-java6-jre` before downloading `rubymine` but `aptitude` and `apt-get` are returning nothing, claiming that `sun- java6-jre` no longer exists. I'm completely unfamiliar with how to handle tar files and am unfamiliar with what to do once I start extracting files from the download.


How to be notified when a USB device was plugged?

My system have to auto-mount for usb devices, how can I be notified when a usb device is plugged? Where can I read more about? I would like to treat that using shell script or C.


How can I install a 64bit Linux virtual machine on a 32bit Linux?

I've got a computer (Intel core i5) with 32bit Linux installed (ubuntu 11.04) and I would like to install a 64bit Linux virtual machine on it so I can test 64bit command-line applications on it.


qemu no boot device found!

I am trying to set up a Linux x86_64 virtual machine on a 32bit Linux computer and I've been told aqemu's Wizard is a good option. I can follow the wizard steps, but when I try to start the virtual machine, I receive a "No boot devices found!" error. Any ideas what might be happening?


Redirecting Output of print to multiples files in awk

I want to print same lines to 2 different files. What I am doing right now is:               print ID[i]" "Value[i]" "TS1[i]" "TS2[i] > "file1.txt";     print ID[i]" "Value[i]" "TS1[i]" "TS2[i] > "file2.txt";      Can I write a single command to redirect it to two different files ? **EDIT** I don't want to print my whole command output to the multiple files, I want to write some of records based on some condition into multiple files,I am printing this within `awk` script so I need an **efficient** way to do it.


Upgrading kernel 2.6.18 to 2.6.32 on CentOS 5.10

I've been looking on Google for 4 hours and I can't find a solution to my problem. I have a computer running CentOS 5.10 using Kernel 2.6.18-371.9.1.el5 and I would like to upgrade my kernel to 2.6.32 in order to run lxc (it need at least kernel 2.6.29). I've been following this HowTo and tried to install the 2.6.32 source package by typing:               [user@stag-devCentOS]$ rpm -i http://vault.centos.org/6.5/updates/Source/SPackages/kernel-2.6.32-431.20.3.el6.src.rpm 2>&1 | grep -v mock      I know it's the kernel for 6.5 version but I wasn't able to find a 2.6.32 kernel for CentOS 5.10. When I'm running this command line, I get a md5 sum mismatch like this               [tanguy@stag-devCentos ~]$ rpm -i http://vault.centos.org/6.5/updates/Source/SPackages/kernel-2.6.32-431.20.3.el6.src.rpm 2>&1 | grep -v mock     warning: /var/tmp/rpm-xfer.ecr3WX: Header V3 RSA/SHA1 signature: NOKEY, key ID c105b9de     error: unpacking of archive failed on file /home/tanguy/rpmbuild/SOURCES/Makefile.common;53a94866: cpio: MD5 sum mismatch      I tried to add `--nomd5` and rebuild but it doesn't help. I've tried a manual upgrade of the kernel, everything gone well until boot. i'm getting this error:               switchroot: mout failed: No such file or directory     Kernel panic - not syncing Attempted to kill init!     Pid: 1, comm: init Not tainted 2.6.32.27 #1     Call Trace:     [<ffffffff81041d3a>] ? panic+0x86/0x13d     [<ffffffff810c644e>] ? pcpu_chunk_relocate+0x10/0x6b     [<ffffffff810cb3db>] ? deactivate_super+0x20/0x77     [<ffffffff8104a66c>] ? exit_ptrace+0x20/0xee     [<ffffffff810448ae>] ? do_exit+0x72/0x633     [<ffffffff81044edc>] ? do_group-exit+0x6d/0x97     [<ffffffff81044f18>] ? sys_exit_group+0x12/0x16     [<ffffffff8100b96b>] ? system_call_fastpath+0x16/0x1b      Do you have any idea ?


From Python script to Kernel Module

So I have a python script that emulates an ESC_KEY on pin 17 (Raspberry Pi).               #!/usr/bin/env python     #Imports for Pins,input     import RPi.GPIO as GPIO     import uinput     from time import sleep          #Setup     key_events=( uinput.KEY_ESC, )     device=uinput.Device(key_events)     GPIO.setmode(GPIO.BCM)     GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_UP)          #MAIN     while True:        GPIO.wait_for_edge(17,GPIO.FALLING)        device.emit(uinput.KEY_ESC,1)        sleep(2)        device.emit(uinput.KEY_ESC,0)      Is there an "easy" way to set this up as a kernel module, or does anyone have some good documentation to create this kernel module? Do I need to rewrite it using C? It seems as this is eating alot of resources when running in python, I'm hoping it would be less a strain on the system when run as module.


How to troubleshoot No Sound on CentOS 6.4 w/ USB headset?

Have a new Dell machine with a fresh install of CentOS 6.4. I have a headset hooked up via USB, but no sound. I'm not sure CentOS is recognizing my sound card -- or maybe it's not recognizing the USB headset? Card and headset are listed in /proc/asound/cards:               [root@Azaz07 asound]# cat cards     0 [Intel          ]: HDA-Intel - HDA Intel                           HDA Intel at 0xf7d10000 irq 30          1 [USB            ]: USB-Audio - Plantronics .Audio 478 USB                           Plantronics Plantronics .Audio 478 USB at usb-0000:00:1a.0-1.3, full speed      I successfully followed the steps here to install kmod-alsa, but it didn't seem to make a difference. I also tried to install "Sound and Video" as a group package, as detailed here, but got an error:               [root@Azaz07 ~]# yum groupinstall "Sound and Video"     Loaded plugins: fastestmirror, refresh-packagekit, security     Loading mirror speeds from cached hostfile      * base: mirrors.sonic.net      * elrepo: elrepo.org      * extras: centos.mirror.freedomvoice.com      * rpmforge: mirror.hmc.edu      * updates: mirror.pac-12.org     Setting up Group Process     Checking for new repos for mirrors     Warning: Group Sound and Video does not exist.     No packages in any requested group available to install or update      What should I check / troubleshoot from here to get my USB headset working?


How to simulate unplugged network cable or down server?

I have simulated network latency with netem and It's great. Now I want to simulate unplugged network cable or when server goes down. I need this to make testing of my application easier and I couldn't find anything on the web that would help me. My servers are virtual CentOS instances and they are on Virtualbox. I want to do this from a php web page.


error printing in mint

I have installed mint 13 xfce on my parents desktop. I installed the hp psc 500 printer correctly and the first test page was printed perfectly. However, when they want to print a document now, there is an error that something went wrong. I mailed the error reports to myself: 1: https://db.tt/c8eUDt08 2: http://pastebin.com/Viwa7FJ5 I don't understand what is in those 2 documents. Can you guys help me fix this? edit: the output from `sudo service cups status` is: `cups start/running. process 638.`


xrdp access running programs from another desktop session?

I trying to remote desktop into my Linux Mint at work, my default desktop is Cinnamon and I have a few gui programs already running in Cinnamon. However Xrdp seems to have issues with Cinnamon so I switched to gnome fallback. Great solution, except that I can't access my running programs in Cinnamon. I can see them running in the background when I do `ps`. Can I access those programs in the fallback mode? Or do I have to run a new instance of those programs?


How configurable is MPTCP?

I work on embedded Linux devices that usually have hard wired Ethernet as well as cell modem connections. If I were to use MPTCP would it be possible to easily configure the system to use eth0 all the time if it's available, then fall back to ppp0 if eth0 is down? Also would such a handoff be transparent to the network application using the socket?


Running a script after tty1 has loaded

I have been attempting to write a script to run dcled on start up, the program that runs this. I am using Debian Jessie with multiarch enabled. This is essentially a small file server. I am attempting to do this because I thought it would be cool to see a little led screen print out every time someone attempts to log into the server without having to actually log in and read `/var/log/auth.log`. Here is the script I have so far.               !/bin/bash          ### BEGIN INIT INFO     # Provides:          dcled.sh     # Required-Start:    $all     # Required-Stop:     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: dcled     # Description:       print file to dcled     ### END INIT INFO          # Author:           PATH=/usr/bin          tail -f /var/log/auth.log | dcled -s 50 -p 4      The script works and runs the last line of `/var/log/auth.log` (when something is new is written to it), but the `tty` terminal does not show up. I have used by `update-rc.d` and `insserv` to attempt to do get this to work 100% correct to no avail. Any help with this would be greatly appreciated.


Replacing text between two HTML Comments

I am new to the world of `sed`/`awk` and regex in general and have been studying their usage, but have been floundering trying to meet my need: I have an `htm` page that has a single line notice that needs to be updated with user inputted text (via shell script) between two comments acting as tags, for example:               <!--BeginNoticeMSG-->NOTICE: This is a notice<!--EndNoticeMSG-->      The user inputted text (stored in a variable, let's call it `$NEWNOTICE`) would then need to replace what's between the tags, so effectively:               <!--BeginNoticeMSG-->$NEWNOTICE<!--EndNoticeMSG-->      Which would get inserted into the `htm` file as (for example):               <!--BeginNoticeMSG-->This is a test notice<!--EndNoticeMSG-->      How can I identify and replace the text between the tags properly?


Shell script to search files for identical text entries

Here's a nice teaser for a shell scripting guru:   1. Take a directory with several text files. Can be a few up to ~1000.   2. All files contain an identifier on a given line (always the same line).   3. Identify which files have identifier that is NOT UNIQUE, i.e. Duplicated in other file(s) in the directory.   4. Output or save the list of duplicates This is needed for a routine admin 'clean-up' of system generated files that SHOULD be unique but through user error may not be.


is there a libboost-all instead of libboost-all-dev?

I need `libboost` dependency for a package I'm running, but the only package I can find is `libboost-all-dev`, and I'm not sure what the "dev" means and if I need it. Is there a `libboost-all-<Something>` that I need to install instead?


Could I add GPT BIOS Boot Partition after Debian installation?

I recently installed Debian Wheezy on a server with 24TB of storage (RAID 6). When I partitioned the big volume I selected Manual option and created the partition scheme. When I was partitioning, I observed that Debian automatically created two small partitions of 1MiB (one at beginning and another at end of disk). I inmediately remembered that this space was probably being allocated for GPT BIOS Boot Partition so I didn't worry about it and I left them there. However, when I installed a new kernel through Debian updates and GRUB was reinstalled I received the next error message:               /usr/sbin/grub-setup: warn: This GPT partition label has no BIOS Boot     Partition; embedding won't be possible!          /usr/sbin/grub-setup: warn: Embedding is not possible.  GRUB can only     be installed in this setup by using blocklists. However, blocklists     are UNRELIABLE and their use is discouraged.          Installation finished. No error reported.      This message is fairly clear. However, despite GRUB was correctly installed and this server is booting fine, I would like to avoid this problem. If I execute `parted` I can see that this space is being identified as free so my question is: Could I use parted to create a new partition in this free space (at beginning or end of disk) and set it as GPT BIOS Boot Partition (`set [num] bios_grub on`)? Could it be risky to do it now (after installation)?


Stereo capture with v4l2

I am trying to capture images from 2 cameras using the driver v4l2. I want to capture them at the same time so I use threads with conditions to start the capture at the same time. The problem is that the capture is always slower for the second device (I tried with different cameras and inverting them). I modified a little bit this example for the capture. I use this camera (both camera), but I also tried with one camera from minoru and a common webcam (in 640*480 at 15 fps) Here is the output of my program:               Signal     /dev/video1 debut: 00:00:00.637.043     /dev/video0 debut: 00:00:00.637.157     /dev/video1 fin: 00:00:00.637.645     /dev/video0 fin: 00:00:00.700.939     Signal     /dev/video1 debut: 00:00:00.701.104     /dev/video0 debut: 00:00:00.701.163     /dev/video1 fin: 00:00:00.704.868     /dev/video0 fin: 00:00:00.768.935     Signal     /dev/video1 debut: 00:00:00.769.024     /dev/video0 debut: 00:00:00.769.138     /dev/video1 fin: 00:00:00.769.627     /dev/video0 fin: 00:00:00.836.922      So I don't understand why the first capture is really fast and the second one is not. Any idea or recommandations ? Could this come from the v4l2 drivers ?


Why does the MINIX installation ask how big /home should be?

While installing MINIX is was asked how big do want `/home` to be. > \--- Step 5: Select the size of /home --------------- > > MINIX will take up 611 MB, without /home. > > How big do you want your /home to be in MB (0-1435) ? [287] After pressing `enter` > 287 MB Ok? [Y] What's the reason of asking that? Is it possible to change it later on? I was never asked such a question while install Ubuntu (Linux) and I'm free (guessing) to store as much data in it as I want, limited by the partition size. Installing on 2 GB virtual drive.


chmod: What does the `+a` parameter mean?

I was following a tutorial and it told me to run               sudo chmod +a "SOME_PARAMS" some/dir      I was surprised to see that fail telling me               chmod: invalid mode: `+a'      So I wonder: What does the `+a` mode mean? How would I translate it into something Ubuntu understands? And I also like to know why it isn't universally supported.


How do I know that a /dev/dm-XX device isn't used by anything on SLES 10.4 (64bit)?

I have a device that I can see in the output of `fdisk -l`:               /dev/dm-XX      (`XX` is a number.) How do I know that I can use this `/dev/dm-XX` to add it to a RAID1 array? How can I be 100% sure that nothing is using this `/dev/dm-XX`?


Linux clean install on an HP ThinClient

I'm having some issues with installing and removing stuff in Linux. I have a HP ThinClient (T5325) and was following these instructions to remove the HP OS and set up a Debian OS:   http://41j.com/blog/2011/10/hp-t5325-thin-client-hacked-to-full-debian-system/ At one point I had to go someplace and when I came back the ThinClient was frozen so I rebooted it. After that nothing really works for me. I can't remove programs or add any (if I try it always says that some dpkg list files are missing and it also always tries to remove hptc-control-center but fails). I also noticed that there is little space left of the built in 512mb flash drive. So I was wondering if there was a way from bash to just remove everything non essential to bash and networking? I have tried to plug in an USB stick and boot either Ubuntu or the HP ThinState to restore the ThinClient (I took a backup) but I can't boot to USB. The HP site and other sites say just plug in the USB and press the power button 2 or 3 times. But on my device the power button does nothing. The moment I plug in power the device turns on and the led on ther power button turns on.


PROLINK WN2001 driver for LinuxMint 15

I just installed LinuxMint 15 and have a desktop that I have installed a PROLINK WN2001 Wireless USB onto. The installation disk has only Windows drivers and now I am looking for a driver for LinuxMint 15. I would also need help as I am very new to Linux on how to install this driver.


Why is bash used in boot scripts?

Why programs run at boot/shutdown are written in `bash` script? If a compiled language (or a faster interpreted language, like Python) was used, then its running time would be shorter.


Any one here used Plan9

Does any one here tried the Plan 9 by bell-labs which is a successor to Unix[according to wikipedia] if yes how was your experience.?


/etc/resolv.conf changes during reboot

My ISP asked me to use custom `nameserver` settings. I have placed these in `/etc/resolv.conf`. Unfortunately, every time I reboot the computer, the contents of this file is changed. To connect to the Internet, I must first edit that file. How can I ensure that this file does not change?


Where is hibernation resume getting the device node from?

A while back, I set up hibernation on my Linux system. It's been working really well, up until tonight when I installed another hard disk, which shuffled the device node names around. So now on boot I get a message saying something to the effect of (I didn't write down the exact wording) `couldn't stat /dev/sda3` and asking me to enter the hibernation device node name or press Enter to continue without resuming from hibernation. This happens on a plain boot, not resuming from hibernation (I haven't tried resuming from hibernation, and am afraid it wouldn't work very well at all when the system can't properly identify the device to resume from hibernation from). When I do use hibernation, I do so using the /usr/sbin/hibernate script provided by the `hibernate` package (version `2.0+15+g88d54a8-1` is installed); I don't recall really setting it up in any particular manner. This started because when I installed the new hard disk, it appeared earlier in the detection order than the SSD I have the root file system and swap space on. That shouldn't pose a problem, particularly as I am using stable /dev/disk/by-*/ names all around -- or so I thought. I grepped through /boot and /etc, but none of the matches appear relevant. /proc/swaps shows /dev/sdb3 which is the name that partition is now known under. /etc/fstab names it using its /dev/disk/by-id/ata-*-part3 name. I'm using a fairly up-to-date Debian Wheezy. Here's my /etc/default/grub:               # If you change this file, run 'update-grub' afterwards to update     # /boot/grub/grub.cfg.     # For full documentation of the options in this file, see:     #   info -f grub -n 'Simple configuration'          GRUB_DEFAULT=0     GRUB_TIMEOUT=300     GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`     GRUB_CMDLINE_LINUX_DEFAULT="quiet pci=nomsi"     GRUB_CMDLINE_LINUX=""          # Uncomment to enable BadRAM filtering, modify to suit your needs     # This works with Linux (no patch required) and with any kernel that obtains     # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)     #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"          # Uncomment to disable graphical terminal (grub-pc only)     GRUB_TERMINAL=console          # The resolution used on graphical terminal     # note that you can use only modes which your graphic card supports via VBE     # you can see them in real GRUB with the command `vbeinfo'     #GRUB_GFXMODE=640x480          # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux     #GRUB_DISABLE_LINUX_UUID=true          # Uncomment to disable generation of recovery mode menu entries     #GRUB_DISABLE_RECOVERY="true"          # Uncomment to get a beep at grub start     #GRUB_INIT_TUNE="480 440 1"          GRUB_PRELOAD_MODULES="uhci usb_keyboard"      and here is /boot/grub/grub.cfg:               #     # DO NOT EDIT THIS FILE     #     # It is automatically generated by grub-mkconfig using templates     # from /etc/grub.d and settings from /etc/default/grub     #          ### BEGIN /etc/grub.d/00_header ###     insmod uhci     insmod usb_keyboard     if [ -s $prefix/grubenv ]; then       set have_grubenv=true       load_env     fi     set default="0"          if [ x"${feature_menuentry_id}" = xy ]; then       menuentry_id_option="--id"     else       menuentry_id_option=""     fi          export menuentry_id_option          if [ "${prev_saved_entry}" ]; then       set saved_entry="${prev_saved_entry}"       save_env saved_entry       set prev_saved_entry=       save_env prev_saved_entry       set boot_once=true     fi          function savedefault {       if [ -z "${boot_once}" ]; then         saved_entry="${chosen}"         save_env saved_entry       fi     }     function load_video {       if [ x$feature_all_video_module = xy ]; then         insmod all_video       else         insmod efi_gop         insmod efi_uga         insmod ieee1275_fb         insmod vbe         insmod vga         insmod video_bochs         insmod video_cirrus       fi     }          terminal_input console     terminal_output console     if [ "${recordfail}" = 1 ] ; then       set timeout=-1     else       set timeout=300     fi     ### END /etc/grub.d/00_header ###          ### BEGIN /etc/grub.d/05_debian_theme ###     set menu_color_normal=cyan/blue     set menu_color_highlight=white/blue     ### END /etc/grub.d/05_debian_theme ###          ### BEGIN /etc/grub.d/10_linux ###     function gfxmode {             set gfxpayload="${1}"     }     set linux_gfx_mode=     export linux_gfx_mode     menuentry 'Debian GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-c050d662-f94a-447a-9342-0fc69f65a513' {             load_video             insmod gzio             insmod part_msdos             insmod diskfilter             insmod mdraid09             insmod ext2             set root='mduuid/0a1be8bb7679264ae488bd5c6f66e022'             if [ x$feature_platform_search_hint = xy ]; then               search --no-floppy --fs-uuid --set=root --hint='mduuid/0a1be8bb7679264ae488bd5c6f66e022'  c050d662-f94a-447a-9342-0fc69f65a513             else               search --no-floppy --fs-uuid --set=root c050d662-f94a-447a-9342-0fc69f65a513             fi             linux   /boot/vmlinuz-3.2.0-4-amd64 root=UUID=c050d662-f94a-447a-9342-0fc69f65a513 ro   quiet pci=nomsi             initrd  /boot/initrd.img-3.2.0-4-amd64     }     submenu 'Advanced options for Debian GNU/Linux' $menuentry_id_option 'gnulinux-advanced-c050d662-f94a-447a-9342-0fc69f65a513' {             menuentry 'Debian GNU/Linux, with Linux 3.2.0-4-amd64' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.2.0-4-amd64-advanced-c050d662-f94a-447a-9342-0fc69f65a513' {                     load_video                     insmod gzio                     insmod part_msdos                     insmod diskfilter                     insmod mdraid09                     insmod ext2                     set root='mduuid/0a1be8bb7679264ae488bd5c6f66e022'                     if [ x$feature_platform_search_hint = xy ]; then                       search --no-floppy --fs-uuid --set=root --hint='mduuid/0a1be8bb7679264ae488bd5c6f66e022'  c050d662-f94a-447a-9342-0fc69f65a513                     else                       search --no-floppy --fs-uuid --set=root c050d662-f94a-447a-9342-0fc69f65a513                     fi                     echo    'Loading Linux 3.2.0-4-amd64 ...'                     linux   /boot/vmlinuz-3.2.0-4-amd64 root=UUID=c050d662-f94a-447a-9342-0fc69f65a513 ro   quiet pci=nomsi                     echo    'Loading initial ramdisk ...'                     initrd  /boot/initrd.img-3.2.0-4-amd64             }             menuentry 'Debian GNU/Linux, with Linux 3.2.0-4-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.2.0-4-amd64-recovery-c050d662-f94a-447a-9342-0fc69f65a513' {                     load_video                     insmod gzio                     insmod part_msdos                     insmod diskfilter                     insmod mdraid09                     insmod ext2                     set root='mduuid/0a1be8bb7679264ae488bd5c6f66e022'                     if [ x$feature_platform_search_hint = xy ]; then                       search --no-floppy --fs-uuid --set=root --hint='mduuid/0a1be8bb7679264ae488bd5c6f66e022'  c050d662-f94a-447a-9342-0fc69f65a513                     else                       search --no-floppy --fs-uuid --set=root c050d662-f94a-447a-9342-0fc69f65a513                     fi                     echo    'Loading Linux 3.2.0-4-amd64 ...'                     linux   /boot/vmlinuz-3.2.0-4-amd64 root=UUID=c050d662-f94a-447a-9342-0fc69f65a513 ro single                     echo    'Loading initial ramdisk ...'                     initrd  /boot/initrd.img-3.2.0-4-amd64             }     }          ### END /etc/grub.d/10_linux ###          ### BEGIN /etc/grub.d/20_linux_xen ###          ### END /etc/grub.d/20_linux_xen ###          ### BEGIN /etc/grub.d/30_uefi-firmware ###     ### END /etc/grub.d/30_uefi-firmware ###          ### BEGIN /etc/grub.d/40_custom ###     # This file provides an easy way to add custom menu entries.  Simply type the     # menu entries you want to add after this comment.  Be careful not to change     # the 'exec tail' line above.     ### END /etc/grub.d/40_custom ###          ### BEGIN /etc/grub.d/41_custom ###     if [ -f  ${config_directory}/custom.cfg ]; then       source ${config_directory}/custom.cfg     elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then       source $prefix/custom.cfg;     fi     ### END /etc/grub.d/41_custom ###      and here is /etc/uswsusp.conf:               # /etc/uswsusp.conf(5) -- Configuration file for s2disk/s2both     resume device = /dev/sda3     splash = y     compress = y     early writeout = y     image size = 15529056419     RSA key file = /etc/uswsusp.key     shutdown method = platform      This should be an easy change if I can just find the proper place to make the change in. So, just **where is the resume code getting that device name from** and **how do I change it to reflect the new reality?** _(I worked around the problem by swapping the devices involved such that the SSD came first in the detection order, but I'm still interested in an answer to this question.)_


PPPoE reports network is down

When I try to connect to the Internet using `pon provider`, I get this error:               error sending pppoe packet: Network is down     error receiving pppoe packet: Network is down      If I configure the Internet with `pppoeconf`, then run `pon provider`, the connection works. I should not have to run `pppoeconf` every time I turn on my computer. How can I connect to the Internet, with `pon` without having to run `pppoeconf` every time? Update: When I installed Debian, the installer could not establish a DHCP connection, so I skipped the "Configure network" option. I have found, running this command allows me to start the Internet, without having to configure `pppoeconf` again.               ifconfig eth0 up     pon dsl-provider      Is there some place I should add `ifconfig eth0 up` so that it begins during startup and shutdown or when I run `pon` or `poff`?


Cannot access GRUB after deleting Win 8

I have Windows Vista and Linux Mint 12 KDE installed on my PC, each installed on it's own hard drive. I recently wanted to try out Windows 8 Consumer Preview and see how it ran on my PC so I created a partition on my Windows hard drive for Win 8. After installing Win 8, GRUB no longer appeared when I turned on my computer, but a Windows 8 bootloader that let me choose between Windows Vista or Windows 8. Well after testing out Windows 8 a bit, and trying to get it to detect my wireless adapter (outdated drivers), I wanted to use Linux so in Vista I wiped the partition that had Win 8 installed and reallocated the memory for Vista. When I started my computer it still tried to use the Windows 8 bootloader and had all sorts of errors, and would automatically restart the computer over and over again. I almost had a heart attack that my computer was unusable, but after booting from the Win 8 CD I was able to boot into Vista, and in System Configuration removed the 'Windows 8' boot option which set 'Windows Vista' as default. Great, now my computer boots, but where is GRUB? How can do I use GRUB again to access my Linux distro on my other hard drive?


Monitoring file reads for cache warming

After adding more memory to my Linux machine I was tempted to use the cache more agressively. The thing is: I boot up my machine, go to bathroom, come back and log in. It takes like half a minute to log in. Then I start firefox and again it takes some time. When I log out and back in, all these things happen within seconds, because the cache is warm then. So I thought: how can I teach my machine to put all these files into the cache while I am in the bathroom. I looked into preload and found the results somewhat disappointing. The net cause of this seems to be that it only tracks mmap()ed files and not files which are read by means of read(). I suspect this is because mmap()ed files are easier to observe. When an application mmap()s a file it stays in memory for some time, whereas open()-read()-close() could all happen within a fraction of a second (correct me if I'm wrong). There does not seem to be a simple way to get notified when a file is read from. There is inotifiy, but it requires registering directories and IIRC correctly, is not meant for monitoring entire filesystems. Ideally I would like to have a device in /dev (like a tty) from which I can read the filenames from which some application reads from. (1) Is something like this available ? (2) Are there reasons why this is difficult ? If I had information about read file accresses I could easily warm the cache during boot.


How to salvage an unreadable usb flash drive

I have a 16GB USB flash drive that somehow got corrupted to the point in which even `fdisk -l` can't find it (I get a one-line error message saying: " _Unable to open /dev/sdc_ ") However, it is being attached, being assigned `/dev/sdc` as dmesg shows:               usb 1-7: new high speed USB device using ehci_hcd and address 69     usb 1-7: New USB device found, idVendor=048d, idProduct=1167     usb 1-7: New USB device strings: Mfr=0, Product=0, SerialNumber=0     usb 1-7: configuration #1 chosen from 1 choice     scsi68 : SCSI emulation for USB Mass Storage devices     usb-storage: device found at 69     usb-storage: waiting for device to settle before scanning     usb-storage: device scan complete     scsi 68:0:0:0: Direct-Access     XXXXXXXX U167CONTROLLER   0.00 PQ: 0 ANSI: 2     sd 68:0:0:0: Attached scsi generic sg3 type 0     sd 68:0:0:0: [sdc] Attached SCSI removable disk      I verified it using `ls -l /sys/block | grep -vE 'loop|ram'` as well:               lrwxrwxrwx. 1 root root 0 Mar 13 04:50 sda -> ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda     lrwxrwxrwx. 1 root root 0 Mar 13 14:42 sdb -> ../devices/pci0000:00/0000:00:1d.7/usb1/1-1/1-1:1.0/host67/target67:0:0/67:          0:0:0/block/sdb     lrwxrwxrwx. 1 root root 0 Mar 13 21:20 sdc -> ../devices/pci0000:00/0000:00:1d.7/usb1/1-7/1-7:1.0/host68/target68:0:0/68:          0:0:0/block/sdc     lrwxrwxrwx. 1 root root 0 Mar 13 04:50 sr0 -> ../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0      But when I issue `od -N 128 /dev/sdc` I receive this single-line error message:               od: /dev/sdc: No medium found      **I don't need the data on that USB flash drive** , I only need to know if there is a way to make it format-able (then reformat it) again. Is this possible? If so, how do I go about this? **Update** : I just tried:               dd if=/dev/zero of=/dev/sdc1 bs=1M count=6000 conv=fsync      And got:               dd: writing `/dev/sdc1': No space left on device     1000+0 records in     999+0 records out     1047941120 bytes (1.0 GB) copied, 2.34859 s, 446 MB/s      Which tells the device is alive and kicking? This is becoming interesting...


What does this egrep command do?

What does this `egrep` command do?               egrep '[^A-M][0-9]+' /etc/passwd      So far I think it searches for any file in `/etc/passwd` that starts with A-M and includes the number(s) 0-9. Is that right?


Which embedded Linux platform supports Suspend to RAM?

I am trying to save maximum energy for a certain embedded Linux application. Currently I am using Raspberry Pi. But it looks like Raspberry Pi doesn't support Suspend to RAM. What alternative embedded Linux platforms can support this feature?


Start Repl/CLI in Background and Feed Commands

Lets say the `python` repl takes a long time to start up, is there a way to start it up in the background so I can create an alias and feed it commands like `python-current "command to run"`.


Having the 'id_rsa.pub' file in my dotfiles public repo securely

So this is something that I'm wondering, how can I have this file in my dotfiles GitHub repo? I'm sick and tired of having to generate a new SSH key every time I'm on a new computer or re-install my OS etc. So what's the best way to do this? I imagine assigning the file a passphrase upon the key's generation is enough? That should encrypt it or make it unusable without it. Is this good enough? If not, is there a way to encrypt the file so that I can safely upload it to the Internet with no worries but can use it at any moment with the correct password?


Directory stack order in zsh

I am working on Zsh 5.0.2 (latest stable version), and I noticed that:               dirs -v      and               cd -<TAB>      show a **different** list of directories (or at least directories in different order). Moreover, it seems as if `cd - shows` oldest directories at the top, with the more recent directories at the bottom (exactly the opposite of what I want) Why are these lists different and how can I change the options of these lists?


If Mac OS X is UNIX, why is it that it is not open sourced and the license is proprietary?

If Mac OS X is a Unix, as answered in this question, why is it that it is not open sourced and the license is proprietary, as stated in this Wikipedia article? According the the genealogy from this Wikipedia article OS X came from BSD, so again, why is it closed source and licensed as proprietary? But, the Darwin OS, also from Apple is open sourced?


Keyboard shortcut to move window to a side in Gnome

In Windows I can press Windows key + (left/right/up/down) keys to press a window against the upper, right, down, left side. Is there an equivalent in Ubuntu? Distro: Ubuntu 12.04, using Gnome.


command line tool to remove selected tags from mp3 files

Using MP3 Diags to clean up my mp3 collection, I've discovered that in addition to the ID3v2 tag, some files also have a Lyrics3, ID3v1, and some an APE tag. Are there command line tools out there to remove all but the ID3v2 tag?


Terminate metacity

The last two lines of my `.xinitrc` looks like this               xterm -g 80x24+10+10 -bg black -fg green &     metacity      When I used `twm`, I could exit it from the menu (return to the `tty` where I run `xinit`), but how do you exit `metacity`? The `man metacity` does not mention this, but it refers to the panel menu (which I don't have). Maybe it's there?


Why don't you need to update drivers? (Or do you?)

In my life I've not once updated drivers on any of my Linux systems, though they have all been desktops. A friend was asking me why one does not need to update Linux drivers and I found myself unable to answer their question. Is it due to the open source community building good drivers before they are submitted to the kernel, or do driver updates occur when I do normal system updates or something?


smartctl: suspend read-scan the remainder of the disk

I have started read-scan the disk using:               smartctl -t select,10-11 -t afterselect,on -t pending,45 /dev/sda      It seems, however, it kills the disk performance. I had expected that the read-scan would (just like the tests) be suspended when there was disk activity. I had also expected the read scan (like the tests) would run without load on the server, but according to `iostat -x -d 1` it seems read-test goes through the controller. Is this normal? Can I suspend the read scan when the disk is active (e.g. only run read scan if idle for 500 ms)?


Is it possible to overwrite your mounted OS partition with dd?

I was just wondering if I could run the following command on my mounted OS partition i.e. the one I booted from:               sudo dd if=/dev/zero of=/dev/sda bs=1M       I can't really experiment with this because you only get to run it once.


How to use the Meta/Alt Key with tput?

I want to redefine keybindings for the commandline of a lisp dialect. The commandline is actually modeled after Vi and implemented with tput/terminfo. I want an alternative version with Emacs keybindings, and I would like to give it a try without using gnu readline or so. A typical key assignment looks like this:               (setq *XtF1 (in '("tput" "kf1") (line T)) ...      This question is about the               ("tput" "kf1")      part, ignore the rest. Now, "kf1" is easy to find in the terminfo man-page:                  key_f1                     kf1     k1    F1 function key      I find there 3 entries for "meta" too:                  has_meta_key               km      km    Has a meta key                                                 (i.e., sets 8th-bit)             meta_off                   rmm     mo    turn off meta mode        meta_on                    smm     mm    turn on meta mode                                                 (8th-bit on)      But how can I use this info to define typical Emacs keybindings like e.g. M-f, M-b, M-d etc. with tput?


Change column width in an emacs Ibuffer on the fly

Is it possible to change the column width in an `emacs` `Ibuffer` on the fly?


Logging in to VirtualBox via SSH

I'm starting with VirtualBox and Linux on a Windows machine. I can log in to Linux using the Virtual Box command line but I want to do something pretty easy: log in from an external (not virtualbox) command line to Linux using ssh. I've created a user hsander to do so: `ssh hsander@10.0.2.15` but: I get the message: Connection timed out To do so I looked for my Linux ipaddress using: `/sbin/ifconfig -a` I get the following: ![enter image description here](http://i.stack.imgur.com/Uq0gG.jpg) Normally the IP is shown next to "inet addr:...." but I think 10.0.2.15 is a pretty rare IP isn't? So what am I doing wrong? I've been searching on Google but yet no solutions...


How do I get the MD5 sum of a directory's contents as one sum?

The md5sum program does not provide checksums for directories. I want to get a single MD5 checksum for the entire contents of a directory, including files in sub-directories. That is, one combined checksum made out of all the files. Is there a way to do this?


How to summarize error messages of an emerge run?

An update on a gentoo system with               # emerge --update --newuse --deep --keep-going @world      creates lots of text on the console. Error messages and warnings appear between less important informative lines of the compiler. **Which tools help to summarize the problems of the last update runs?**


How to meet required dependencies in order to install expect pecl extension on Mac OS X?

I am attempting to install the expect pecl extension. > OS version = 10.7.3   >  PHP version 5.3.10 installed via macports   >  expect version 5.45 installed via macports The command I am executing:               sudo pecl -d preferred_state=beta install expect      fails with `ld: library not found for -lexpect` The `libexpect5.45.dylib` file is located in `/opt/local/lib`. Full output of the install command is here. From what I can tell pecl just can not find the libexpect library, I even tried prepending:               LD_LIBRARY_PATH=/opt/local/lib/expect5.45     LD_LIBRARY_PATH=/System/Library/Tcl/8.5/expect5.45     LD_LIBRARY_PATH=/opt/local/lib      Each location has an `expect5.45.dylib` file. It did not help. Can anyone help me figure out how to get this extension installed?


Rebuild mount points after destroying partitions

When I installed Ubuntu, I had a partitions with the windows OS installed, but now I've made some changes, I've erased Windows, created two new partitions in the storage ocuppied by windows before, and installed Linux Mint and a new /home partition for Linux Mint. But now, when I go to my Ubuntu, the system does obviously try to mount the disappeared partition in the `windows` folder. How can I change the default booting mount points? PD: I understand that isn't a Ubuntu specific question, since the same problem would be appear in the same situation with other Linux-base OS.


How does one make a backup of system-connections on to a USB flash/thumb drive?

I am using Debian Wheezy. I would like to back up system-connections (full path is `/etc/NetworkManager/system-connections`) on to a USB stick which has been formatted with FAT32. The folder in question contains the imported profiles of several OpenVPN config files. I tried to drag the said folder to my USB stick unsuccessfully. The error message is "Permission denied". * * * This post has been edited to include 2 pieces of feedback on slm's answer. Feedback #1 I didn't know that _rsync_ is a package that I had to install. Anyway I installed it using _Synaptic_. I assumed that _rsync_ would work only using _sudo_. Therefore I issued the command _sudo -i_ and input my password. Below are the results:               root@hostname:~# rsync -avz /etc/NetworkManager/system-connections /media/USB     sending incremental file list     system-connections/     rsync: chown "/media/USB/system-connections" failed: Operation not permitted (1)     rsync: chown "/media/USB/system-connections/Wired connection 1" failed: Operation not permitted (1)          sent 619 bytes  received 58 bytes  1354.00 bytes/sec     total size is 5482  speedup is 8.10     rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1070) [sender=3.0.9]      I don't know why I received "Operation not permitted" error. Strangely when I peered into the contents of my USB flash drive, I saw the contents of system-connections had been copied on to my USB stick. If the file copy is successful, why the error message? * * * Feedback #2 I was unable to connect to the internet after having done the above file copy using _rsync_. I rebooted my laptop computer twice and both times after reboot I tried to connect to the internet without success. What I did next was to uninstall _rsync_ using _Synaptic_. Next I rebooted my computer. Now I'm able to connect to the internet. What happened?


Changing pasword for debian live

I have a hooks file, in the hooks folder, that looks like this:               echo "root:rootpw" | chpasswd         echo "user:userpw" | chpasswd      After boot, Debian asks for user and password. When I type `user` along with the password above it does NOT work. But, if I type root with the password then I can login? After that I looked at the shadow file, but there is NO `user` in the shadow file.               ld config .. with username=user ..      Any solution?


Is it necessary to run a SSH daemon if I use Chef locally?

I want to write a `chef` cookbook to setup Linux desktop environments. I created a `kitchen` by `knife solo init chef-repo`, and created a cookbook `hello` and a node file `localhost.json`. Then I run:               $ knife solo cook localhost      and got this error:               Running Chef on localhost...     Checking Chef version...     ERROR: Network Error: Connection refused - connect(2) for "localhost" port 22     Check your knife configuration and network settings      Should I run a ssh daemon even if I use chef host and client in localhost? I'm using `Linux Mint 16` in a VirtualBox environments. And this is my `~/.chef/knife.rb` config file:               log_level                :info     log_location             STDOUT     node_name                'ironsand'     client_key               '/home/ironsand/.chef/ironsand.pem'     validation_client_name   'chef-validator'     validation_key           '/etc/chef-server/chef-validator.pem'     chef_server_url          'https://vm-mint:443'     syntax_check_cache_path  '/home/ironsand/.chef/syntax_check_cache'


Automatically restarting network connection

I'm having a small issue with my Synology NAS. It keeps throwing off the connection to the internet (local network works fine though). It is quite random, sometimes it doesn't happen for days, sometimes it happens every 10-20 minutes. Tried a hard reset, clean update, everything, yet even on a clean system, in a few day it continues. No other computers show such symptoms on the network. Usually this problem can be solved by an ifdown&&ifup combo, but I'm getting annoyed by it - any time I wish to use the download station, I need to open a terminal session to make sure there's network connection for those few minutes. So the question would be - is there a simple way of automatically resetting the network interface in case there's no connection to the outside? I've been thinking of a minute-poll to google.com, if the request takes longer than 10 seconds, restart the network interface. But I'd prefer something native, that does this automatically (sincerely, I do not wish to write such a script, it's a way too long and tedious process for me).


dropboxd hangs at `Connecting...` when started trough systemd on boot

I've got a systemd service file `dropbox.service` set up as follows:               [Unit]     Description=dropbox     After=local-fs.target network.target          [Service]     User=romeovs     ExecStart=/usr/bin/dropboxd          [Install]     WantedBy=multi-user.target      this succesfully starts the dropbox daemon if it is run any time after boot. Something seems to go wrong when I `enable` it to run at boot though. `dropbox status` just shows that dropbox is `Connecting...`. My guess is that the network needs to be fully up before dropbox is started. How can I force this with systemd?