title: Scripting Language Evolution

text: I have an assignment due Monday and I need some help because I have no knowledge on the subject and can't even understand what to search exactly. I am not waiting for an essay or something just some guidance or some links. "You are to write a paper on the evolution of server-side technologies used for writing Web applications since the early days of the Web to the present day. Your paper is expected to focus on the following areas: How scripting languages have evolved, providing code examples. You should highlight the changes that you consider the most significant for application developers and provide analysis as to why you have selected them." As I understand it, I have to mention shell scripting and its evolution and other languages that have evolve.. I am not sure. Thank you in advance!


title: mount: / not mounted or bad option

text: I'm running a custom Raspbmc build on my raspberry pi. On startup, I always see the message               mount: / not mounted or bad option      The filesystem is still mounted, but still want to know whats causing the trouble. my `/etc/fstab` looks like this:               proc            /proc           proc    defaults,noatime,nodiratime         0       0     devpts          /dev/pts        devpts  rw,nosuid,noatime,nodiratime,gid=5,mode=620        0       0     /dev/mmcblk0p1  /boot           vfat    ro,noatime,nosuid,nodiratime         0       0     UUID=7e790ee3-660b-46ab-8378-d8ea91730162  /               ext4    defaults,data=writeback,nobh,nodiratime,noatime 0       0     tmpfs           /home/pi/.xbmc/temp     tmpfs   rw,size=5M,nosuid,noexec,nodev,noatime,nodiratime,gid=1000,uid=1000     0       0     /tmp            /var/tmp                none    rw,noexec,nosuid,nodev,bind     0       0


title: The key codes for Caps Lock, Shift, Left Control and FN key?

text: Can somebody please provide the key codes for these keys:   * Caps Lock   * Left Shift   * Left Control   * Option key   * FN The key code I'm talking about is something along the lines of `\<Esc>[200~`, although I have no idea what that outputs. :P Thanks! I need this for remapping some keys in Vim, tmux etc.


title: How do I show desktop icons in Elementary OS?

text: How can I show icons on the desktop in Elementary OS Luna? I tried using "gnome-tweak-tool" and "gconf-editor" but they didn't work.


title: What is the difference between the use of ; and executing a script

text: I'm using `bash` as my main shell, but it's an open question and responses for shells others than `bash` are very welcome. If I'm typing interactively               #original line      #wget http://something.com && unzip something && mv -f something /home/poney/      #new line     wget http://something.com ; unzip something ; mv -f something /home/poney/      Does it make any difference in term of execution pile, order, memory, interpretation, permission compare to a script that contains those line:               #!/bin/bash     wget http://something.com     unzip something      mv -f something /home/poney/      ### PS: except the fact that executing a script is shorter than typing 3 command in a row obviously.


title: Limit find results in SSH

text: I using a line like this to search for a bunch of files:               find . -name "page.php      The results are hundreds of lines and I can't see it all. (I'm trying to just copy/paste it into excel to analyze it). I tried this:               find . -name "index1.php | less      That did something, but I was in this screen that I couldn't figure out how to exit out of. I had to close putty and open it up again. What is the best way to just limit the results to the viewable area so I can copy, then hit return and get the next group. Or, is there a way to make putty not truncate the results? Thanks in advance.


title: Install a package and all its dependencies without a confirmation prompt with FreeBSD pkg

text: Is there a way to automatically install packages and their dependencies, like with `apt-get -y` in Debian, without being prompted each and every time? Installing Webmin, NGiNX and nano in 1 step, all their dependancies automatically:               sudo apt-get -y install webmin nginx nano      On FreeBSD 10, _(I'm still getting used to Ports)_ I would type:               pkg install webmin nginx nano      If I append the `-y` switch, it just fails. I looked at the documentation at meBSD and FreeBSD Handbook and there doesn't seem to be an option/switch to use. Any ideas anyone?


title: Saving source code from the internet

text: How can I save all the documents from this adress to my PC? https://svn.linuxsampler.org/svn/liblscp/trunk/ This is a package I need to build "Open Octave DAW" from source.


title: Building Linux from Scratch stuck, incompatible sed version?

text: I am trying to build Linux from Scratch per LFS website While I was able to install all the packages until 6.7.1 without any error, I am stuck at Installation of Linux API headers (This is after I chroot into the installation) with the error,               /bin/sh: /tools/bin/sed: No such file or directory      Now I checked if, the file exists and I found it does.               ls -all /tools/bin/sed     -rwxr-xr-x 1 root root 260350 Aug  7 20:27 /tools/bin/sed      exists in the installation, and I found it does. If I try executing sed, I get the error.               /bin/sh: /tools/bin/sed: No such file or directory      Trying to find the type of file sed is, I get               file /tools/bin/sed     ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.24       I notice that the for part in sed is different from other files in /tools/bin which have **for GNU/Linux 2.6.25** What am I missing here?


title: chroot: failed to run command ‘/bin/bash’: No such file or directory

text: When I run the `chroot` command an error is given:               failed to run command ‘/bin/bash’: No such file or directory


title: Does the vmlinux header contain the length of the kernel image?

text: I am trying to disassemble a compound file that consists of several parts, one of which is an uncompressed kernel sandwiched between several other files. I am trying to find the exact length of the kernel part which is proving difficult. Is there some indication in the vmlinux header of how much data the bootloader is supposed to read before executing, or is it assumed that all contents of the vmlinux file are to be loaded at handoff from the bootloader?


title: Proper syntax for "id -r" command

text: I'm trying to see if `id -r` will print out the UID or username of the user who logged into the system despite any `su`'s or `sudo`'s. I'm interested in doing this so I can keep people a little more accountable and to tailor script functioning accordingly (i.e: they issue a sudo on a script and it pulls information from the logged in user's home directory). I realize `sudo` sets `SUDO_USER` but I don't want to rely on this because it's a variable that can be modified by the user, and it just has the username of the user who issued the most recent sudo (i.e: `sudo -i ; sudo -iu randomUser ; echo $SUDO_USER` prints out "root" instead of the actual user). Nothing in the man pages or that I can find online seems to indicate what the proper use of this command is and the obvious permutations aren't working:               [root@ditirlns03 ~]# id -r     id: cannot print only names or real IDs in default format     [root@ditirlns03 ~]# id -r jadavis6     id: cannot print only names or real IDs in default format     [root@ditirlns03 ~]# id -r root     id: cannot print only names or real IDs in default format      At this point, I'm still not sure `id -r` is going to print out what I want, mostly because I can't figure out how to get it to print out anything at all.


title: I can't install Scientific Linux CERN 5.7 on VMware 9 nor 8

text: After installing VMware I use create the new virtual machine to install SLC 5.7. I choose the installer disk image file(iso) which is the iso file of SLC 5.7 in one of my hard drives. Continue a few more steps it asks me: > What type of media contains the packages to be installed? Local CDROM Hard > drive NFS Image FTP HTTP None of the choices works. Why VMware can't find the iso file? I extracted the iso file and write it on DVD and use the installer disk but this error appears again. I tried everything comes to my mind, but still I can't install it.


title: Guake transparency Debian

text: When I open guake in Debian Weezy using lxde its transparency does not work. I'm shown the desktop instead of the window I had been looking at. Is there a fix for this?


title: Is there any prompt decoration package available for iPython?

text: One can argue, that IPython can be a productive replacement for bash. I wonder, if anyone here have seen some sort of prompt decoration for IPython, that can be compared to the standard bash prompt, or - ideally - to liquid prompt?


title: mounting a SD card without a partition

text: I try to mount a SDHC card under GNU/Linux. Unlike what happens usually, `/var/log/syslog` doesn't mention `sdb1`, just:               Jul 26 16:07:53 xvii kernel: [  159.404842] scsi 6:0:0:0: Direct-Access     Singim   SD Card   MMC/SD 1.4F PQ: 0 ANSI: 0 CCS     Jul 26 16:07:53 xvii kernel: [  159.405115] sd 6:0:0:0: Attached scsi generic sg2 type 0     Jul 26 16:08:01 xvii kernel: [  168.239600] sd 6:0:0:0: [sdb] Attached SCSI removable disk      Moreover `fdisk -l /dev/sdb` outputs nothing. What should I do? **EDIT (2014-07-27):** I could have this SD card again, and it seems to be faulty. Yesterday, I was trying it via a USB card reader. Today, I've tried it directly by putting it in the SD slot of my laptop, and I got thousands of I/O errors:               Jul 27 11:56:35 xvii kernel: [ 8091.317234] mmc0: new high speed SDHC card at address 1234     Jul 27 11:56:35 xvii kernel: [ 8091.317477] mmcblk0: mmc0:1234 SA04G 3.68 GiB     Jul 27 11:56:35 xvii kernel: [ 8091.320119] mmc0: Got data interrupt 0x00200000 even though no data operation was in progress.     Jul 27 11:56:35 xvii kernel: [ 8091.322277] mmcblk0: error -84 transferring data, sector 0, nr 8, cmd response 0x900, card status 0xb00     Jul 27 11:56:35 xvii kernel: [ 8091.322289] mmcblk0: retrying using single block read     Jul 27 11:56:35 xvii kernel: [ 8091.324862] mmcblk0: error -84 transferring data, sector 0, nr 8, cmd response 0x900, card status 0x0     Jul 27 11:56:35 xvii kernel: [ 8091.324872] end_request: I/O error, dev mmcblk0, sector 0     Jul 27 11:56:35 xvii kernel: [ 8091.326398] mmcblk0: error -84 transferring data, sector 1, nr 7, cmd response 0x900, card status 0x0     Jul 27 11:56:35 xvii kernel: [ 8091.326405] end_request: I/O error, dev mmcblk0, sector 1     Jul 27 11:56:35 xvii kernel: [ 8091.329056] mmcblk0: error -84 transferring data, sector 2, nr 6, cmd response 0x900, card status 0x0     [...]      and `gdisk -l` didn't find any partition table, and `lsblk` output about the card:               mmcblk0                  179:0    0   3.7G  0 disk      A bit later I tried again, and the card was recognized:               Jul 27 12:08:00 xvii kernel: [ 8776.617712] mmc0: new high speed SDHC card at address 1234     Jul 27 12:08:00 xvii kernel: [ 8776.618117] mmcblk0: mmc0:1234 SA04G 3.68 GiB     Jul 27 12:08:00 xvii kernel: [ 8776.620324]  mmcblk0: p1      and I could mount it: /dev/mmcblk0p1 on /media/mmc type vfat (rw,nosuid,nodev,noexec,noatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=utf8,shortname=mixed,errors=remount- ro,user=vinc17) `gdisk -l /dev/mmcblk0` found only a MBR partition table, but the second partition table overlaps the last partition.


title: New menu item called "arch_grub" emerged as a temporary boot device

text: I have Ubuntu installed along with Arch. I re-installed Arch a few times already. Now it works well. Once when I was re-installing Arch during boot when I chose the "Choose temporary boot devise" option at BIOS and I saw a new menu item (among "Hdd", "Usb", "Dvd") appeared being `arch_grub`. I ran boot- repair utility later but this menu item is still there. How do I get rid of it?               $ sudo fdisk -l     [sudo] password for alex:           Disk /dev/sda: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x000a1bc4             Device Boot      Start         End      Blocks   Id  System     /dev/sda1          526336   382824447   191149056   83  Linux     /dev/sda2            2048      526335      262144    b  W95 FAT32     /dev/sda3       382826494  1953523711   785348609    5  Extended     Partition 3 does not start on physical sector boundary.     /dev/sda5      1946028032  1953523711     3747840   82  Linux swap / Solaris     /dev/sda6   *   382834688  1946025983   781595648   83  Linux          Partition table entries are not in disk order      and               $ lsblk     NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sda      8:0    0 931.5G  0 disk      ├─sda1   8:1    0 182.3G  0 part /media/alex/arch     ├─sda2   8:2    0   256M  0 part /media/alex/arch_boot     ├─sda3   8:3    0     1K  0 part      ├─sda5   8:5    0   3.6G  0 part [SWAP]     └─sda6   8:6    0 745.4G  0 part /     sr0     11:0    1  1024M  0 rom


title: How to Print Summary of Packages that Can be Updated?

text: When I log into Ubuntu Server 12.04 LTS, I'm met with a message that looks something like this:               6 packages can be updated.     6 updates are security updates.      How can I get a detailed summary of the updates above? I don't want to _blindly_ install these updates with `sudo apt-get dist- upgrade`. I'd like to know what I'm installing before I install it, or even pick and choose which updates I want to apply.


title: Setting nvidia properties during X-server startup

text: I am using the proprietary nvidia drivers in KDE (Debian Testing) and as many others experience issues with performance. I noticed that it gets a bit better if I run:               nvidia-settings -a InitialPixmapPlacement=0      at least with Google Chrome. How can I add this to the standard start-up configuration? I tried adding an option to `xorg.conf` and I tried adding this line to a newly created `.xinitrc`, but it didn't work. Where should I have it added?


title: How to list sample of files from a directory

text: I have a directory that contains hundred thousands of files.   I need to list sample of these files (example 10 files), without processing all the files found in the directory which will take too much processing time.


title: Gaining root privileges in SCO

text: I am learning Linux for work, so am still a bit rusty on the edges. I need to change the folder permission of the directory `/opt`, and I know in Linux, you do the following:               chmod 775 /opt      I get a message under that saying:               chmod: WARNING: cannot change /opt/: Operation not permitted (error 1).      Does that mean I need sudo permissions? But the `sudo` command is not recognized. But in SCO, it is different, as SCO is a little older than Ubuntu. I have found this link on the net, but don't quite understand what they mean by "memo": http://osr507doc.sco.com/en/OSUserG/_Changing_file_permissions.html Is there an easier way of doing this, like something similar to Linux?


title: Find out when the recoll index was last updated

text: Is there a way to find out, when a recoll-index was last updated?


title: Black screen after logged in. Xubuntu 12.10

text: Hi I'm a total noob in Linux/ubuntu. I had Xubuntu 12.10 running for a month or so without major problems. A few days ago after downgrad firefox from 29 to 28 by removing and reinstalling and upgrading system , the system blacked out and can't get into GUI ever again. The symptoms are: log in screen fine, after logged in, a black screen with a white cursor stopped in the middle the screen, unmovable, everything stucked here. I had tried to log in to tty1, and here I tried a few things:   1. run `startx`, a small error window pops out saying "failed to load session "gnome"", and an button "log out", I clicked it and was brought back to tty1 seeing a lot of messages(*1)   2. run `lspci | -i VGA`, it gives "00.02 0 VGA compatible ....Intel..integrated....." which is my integraded intel graphic card.   3. run `sudo apt-get --purge remove nivdia*`, it gives 0 installed package to remove. so nothing to remove here.   4. try to check file /etc/X11/xorg.conf, but no such file, instead there are several named a little bit different like xorg.conf.d*....   5. I send a copy of /var/log/Xorg.0.log to my email and it is attached here http://paste.ubuntu.com/7403846/ Can someone help me trouble shoot this? thanks very much!


title: No domain defined in /etc/resolv.conf

text: I see more and more servers that have no **domain** defined in the `/etc/resolv.conf` file. Only a **search** entry.   In what cases is this setup used ?   Are there any cases where it must not be used ?               nameserver xxx.xxx.xxx.xxx     nameserver yyy.yyy.yyy.yyy     nameserver zzz.zzz.zzz.zzz          search domain1 domain2 domain3 ...


title: How to delete in vim everything in between the cursor and the end of the line while on insert mode?

text: While in normal mode I can delete all the characters after the cursor by typing `d$`. I'd like to achieve the same but in **_insert mode_** in the same way that you can delete things to the left of the cursor with `Ctrl` + `W`


title: Remove spaces and headers from a dumped database table

text: I have dumped the database table data into a flat file and below is how the data looks like : (Kindly copy from below               ;metier_code              ;     ;-------------------------;          (0 rows affected)     ;CRDS_Ptf_No;          ;                                ;                         ;          ;                                ; ;                         ;                         ;               ;               ;               ;                         ;                         ;     ;Status;     ;-----------;----------;--------------------------------;-------------------------;----------;--------------------------------;-;-------------------------;-------------------------;---------------;---------------;---------------;-------------------------;-------------------------;-----;------;     ;       NULL;ABCD      ;ABHJARS                         ;                         ;ABCD      ;ABCD                            ;Y;                         ;                         ;               ;               ;               ;                         ;                         ;     ;A     ;     ;       1234;XEU-ANKD  ;XEU-AJKD                        ;                         ;ABCD      ;ABCD                            ;Y;                         ;                         ;               ;               ;               ;                         ;                         ;     ;A     ;     .     .     ;      11745;ANJLDMAOKD;AMKDJ AN DJ JAHF AS CPFVH ACCR  ;NONE                     ;AN DJ JAHA;AN DJ JAHA                      ;Y;NO ANKIO GAP             ;YES AMK SCF              ;               ;               ;               ;                         ;                         ;     ;I     ;     ;      11744;AMKDIONSKH;AMKDJ AN DJ JAHF AS CPFVH MTM   ;NONE                     ;AN DJ JAHA;AN DJ JAHA                      ;Y;NO ANKIO GAP             ;YES AMK SCF              ;               ;               ;               ;                         ;                         ;     ;I     ;          (5436 rows affected)     (return status = 0)          Return parameters:          ;           ;     ;-----------;     ;       5436;               (1 row affected)     ;       ;           ;     ;-------;-----------;     ;grepkey;       5436;          (1 row affected)      want to convert the above as below format: Row should contain the seq no (Prefixed) Need to remove columns names and the blank spaces present in the original file at begining and ending. BELOW IS THE FORMAT OF DATA THAT I AM GETTING BY USING THE SUGGESTED CODE:               awk -F ';' '/^;-----------;/ {start=1;next;};  start==0 {next;}; {gsub(" +",""); print NR "" $0;}' temp_file > test      FORMAT after executing above script :               7;NULL;ABCD;ABHJARS;;ABCD;ABCD;Y;;;;;;;;;A;     8;NULL;XEU-ANKD;XEU-AJKD;;ABCD;ABCD;Y;;;;;;;;;A;     .     .     5443;11744;AMKDIONSKH;AMKDJ AN DJ JAHF AS CPFVH MTM;;QWERDF;QWERDF;Y;;;;;;;;;A;     5444     5445(5436rowsaffected)     5446(returnstatus=0)     5447     5448Returnparameters:     5449     5450;;     5452;5436;     5453     5454     5455(1rowaffected)     5456;;;     5457;-------;-----------;     5458;grepkey;5436;     5459     5460(1rowaffected)      Above : the prefix row number is not coming in sequence(Incrementing by using the preceeding lines that is not the actual data). Initial file was containing additional info in flat file like column name @ begining , at the end of file few additional details that i wanted like count of records etc I want the data in below format (Which shall have prefix row number and shall include only rows of table , not the additional preceeding and exceeding data)               1;NULL;ABCD;ABHJARS;;ABCD;ABCD;Y;;;;;;;;;A;     2;NULL;XEU-ANKD;XEU-AJKD;;ABCD;ABCD;Y;;;;;;;;;A;     3;NULL;SWAPOLEIL;SWAPOLEIL;;QWERDF;QWERDF;Y;;;;;;;;;A;     .     .     5436;11744;AMKDIONSKH;AMKDJ AN DJ JAHF AS CPFVH MTM;;QWERDF;QWERDF;Y;;;;;;;;;A;          5436 - is the number of rows present in the table from where i am fetching the data.      Thanks in advance! (Tried the other suggested solutions as well . However, dint got the desired result)


title: How to send data from serial port over wifi?

text: I have microcontroller device which reads data from sensors and sends it via Serial to USB converter (ftdi232 cable). This Serial to USB converter is connected to ARMv7 mini-computer - CuBox with Ubuntu 13.04. I have also connected WiFi USB adapter to CuBox. I would like to read data from serial port and send it via WiFi and receive on Windows PC. It is possible without network socket programming, using available tools? Something like pipe/bridge/redirection between serial port and WiFi. I don't need to communicate with this box, so constant and one-way stream of data over WiFi will be sufficient. Thanks you for any resources and ideas how to set up this communication.


title: VIM commenting out what I paste

text: I got this when trying to copy this gist on vim: https://gist.github.com/w0ng/3278077 ![enter image description here](http://i.stack.imgur.com/MnvS9.png) I notice the same behaviour everywhere: If I paste something that includes a comment, everything that follows the comment is pasted commented. Maybe it has something to do with the fact that if I write a comment on insert mode and press enter, the following line automatically appends a comment. How can I get rid of this behaviour?


title: How to make the system automatically kill some processes?

text: Sometimes my computer starts to behave sluggishly after running too many programs/processes simultaneously, at points almost looking crashed/frozen. Using Debian Linux, is there a way to automatically kill some processes before memory gets too scarce for smooth operation?


title: Fedora 19 freezes after login

text: I have been using F19 for a couple of days until I've decided to do an yum update. Everything went well but after reboot I can't get past the login screen anymore. I enter my username/password, then the login screen disappears and Fedora freezes, displaying only the login screen background image. I've tried logging in through terminal (Ctrl+Alt+F3) but after entering my details the terminal just hangs and I can't do anything (I can input commands but there's no reaction). Do you have any idea how to fix this?


title: where is /var/log/messages

text: I have several sources saying that `/var/log/messages` has system log message but I don't have that file (Ubuntu 11, Debian). Is the messages file somewhere else now? I tried using `locate` to look for it but didn't see it.


title: I get this shutdown prompt, then my laptop dies. What is happening?

text: I get a dialog box that says 'Shut down the system now', the same as if I had clicked 'quit' in the main menu. This happens seemingly randomly. If I choose 'cancel', it sometimes goes away. Other times,it pops back up again. Whether or not I click cancel, my laptop will shutdown immediately, as if all the power has gone. When I run 'last -x', I see this:               korgan   pts/1        :0               Sat Jul 27 07:32   still logged in        korgan   tty8         :0               Sat Jul 27 06:57   still logged in        runlevel (to lvl 2)   3.5.0-17-generic Sat Jul 27 06:57 - 07:42  (00:44)         reboot   system boot  3.5.0-17-generic Sat Jul 27 06:57 - 07:42  (00:44)         korgan   pts/1        :0               Fri Jul 26 20:27 - 21:13  (00:46)         korgan   pts/1        :0               Fri Jul 26 17:05 - 18:07  (01:02)         korgan   tty8         :0               Fri Jul 26 17:02 - crash  (13:54)         runlevel (to lvl 2)   3.5.0-17-generic Fri Jul 26 17:02 - 06:57  (13:54)         reboot   system boot  3.5.0-17-generic Fri Jul 26 17:02 - 07:42  (14:39)         shutdown system down  3.5.0-17-generic Fri Jul 26 17:02 - 17:02  (00:00)         shutdown system down  3.5.0-17-generic Fri Jul 26 17:01 - 17:02  (00:00)         runlevel (to lvl 6)   3.5.0-17-generic Fri Jul 26 17:01 - 17:01  (00:00)         korgan   tty8         :0               Fri Jul 26 16:20 - 17:01  (00:41)         runlevel (to lvl 2)   3.5.0-17-generic Fri Jul 26 16:19 - 17:01  (00:41)         reboot   system boot  3.5.0-17-generic Fri Jul 26 16:19 - 17:01  (00:41)          There is a 'crash' entry at 13:54 on the 26th, although the crash that happened last night was before the reboot the following day, the 27th. I've checked the temperature of the cpu when I get this prompt and it's nothing irregular, usually around 52 °C. I don't know what my next step should be. I'm running Linux Mint 14 on a Gateway NV53A. I looked at `/var/log/syslog` and I found this, at the point of shutdown:               Jul 27 09:29:39 Ono-Sendai kernel: [ 9146.988498] type=1701 audit(1374935379.026:3114): auid=4294967295 uid=1000 gid=1000 ses=4294967295 pid=5729 comm="chrome" reason="seccomp" sig=0 syscall=2 compat=0 ip=0x7f368d4f96c0 code=0x50000     Jul 27 09:29:39 Ono-Sendai kernel: [ 9146.988507] type=1701 audit(1374935379.026:3115): auid=4294967295 uid=1000 gid=1000 ses=4294967295 pid=5729 comm="chrome" reason="seccomp" sig=0 syscall=2 compat=0 ip=0x7f368d4f96c0 code=0x50000     Jul 27 09:31:13 Ono-Sendai kernel: imklog 5.8.6, log source = /proc/kmsg started.     Jul 27 09:31:13 Ono-Sendai rsyslogd: [origin software="rsyslogd" swVersion="5.8.6" x-pid="619" x-info="http://www.rsyslog.com"] start     Jul 27 09:31:14 Ono-Sendai rsyslogd: rsyslogd's groupid changed to 103     Jul 27 09:31:14 Ono-Sendai rsyslogd: rsyslogd's userid changed to 101     Jul 27 09:31:13 Ono-Sendai rsyslogd-2039: Could not open output pipe '/dev/xconsole' [try http://www.rsyslog.com/e/2039 ]     Jul 27 09:31:14 Ono-Sendai bluetoothd[672]: Bluetooth daemon 4.101     Jul 27 09:31:14 Ono-Sendai bluetoothd[672]: Starting SDP server     Jul 27 09:31:14 Ono-Sendai bluetoothd[672]: DIS cannot start: GATT is disabled     Jul 27 09:31:14 Ono-Sendai bluetoothd[672]: Failed to init deviceinfo plugin     Jul 27 09:31:14 Ono-Sendai bluetoothd[672]: Failed to init proximity plugin     Jul 27 09:31:14 Ono-Sendai bluetoothd[672]: Failed to init time plugin     Jul 27 09:31:14 Ono-Sendai bluetoothd[672]: Failed to init alert plugin     Jul 27 09:31:14 Ono-Sendai bluetoothd[672]: Failed to init thermometer plugin     Jul 27 09:31:14 Ono-Sendai avahi-daemon[699]: Found user 'avahi' (UID 111) and group 'avahi' (GID 120).     Jul 27 09:31:14 Ono-Sendai kernel: [    0.000000] Initializing cgroup subsys cpuset     Jul 27 09:31:14 Ono-Sendai avahi-daemon[699]: Successfully dropped root privileges.     Jul 27 09:31:14 Ono-Sendai avahi-daemon[699]: avahi-daemon 0.6.31 starting up.     Jul 27 09:31:14 Ono-Sendai avahi-daemon[699]: Successfully called chroot().     Jul 27 09:31:14 Ono-Sendai avahi-daemon[699]: Successfully dropped remaining capabilities.     Jul 27 09:31:14 Ono-Sendai kernel: [    0.000000] Initializing cgroup subsys cpu     Jul 27 09:31:14 Ono-Sendai kernel: [    0.000000] Linux version 3.5.0-17-generic (buildd@allspice) (gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1) ) #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 (Ubuntu 3.5.0-17.28-generic 3.5.5)


title: XUbuntu: Window manager stopped to work

text: I installed XUbuntu on my netbook and it worked like a charm for about a week. Then, today, the _Software center_ application crashed and since then the window manager stopped to work. Thera are following symptoms:   1. Small buttons for maximizing, restoring and minimizing a window are not visible.   2. I cannot switch between the applications using `Alt-Tab`. I almost always selected the `Save session` checkbox in the logout screen. I tried to deselect this checkbox and restart. It didn't help - the window manager is still not working. When I login with a guest account, everything works (but I cannot access my data from the other account easily). I think that there is some cached data, which was not cleaned up and causes the window manager to crash at every login. How can I fix this problem (make the aforementioned symptoms disappear) ?


title: Monitoring cisco devices from linux or windows?

text: how can i know the status of a large no of devices (approx 600,000).If i want to moniter the status of the device whether up or down. Will any scripting language be sutable for such a task because the only way i can think of monitoring these devices from a linux/windows machine is to ping the device status.but again pinging will not be a good idea beacuse it will take a lot of time. If i need to login and check the status of ports then that would take a lot more time. what is the best way possible? How many devices can i ping if i use parralell processing?


title: How to download several urls into one file

text: I have URLs like this.               http://203.90.117.109/wds_cdma/wds.aspx?min=404000290205346     http://203.90.117.109/wds_cdma/wds.aspx?min=404000832812637     http://203.90.117.109/wds_cdma/wds.aspx?min=404000853093050         After that it should hit the browser. It will get some output like this                404000290205346|9225534526|2|Prepaid|2      404000832812637|9204506289|2|Prepaid|2      404000853093050|9247868854|2|Prepaid|2      I also tried the following:               wget -t 45 -0 log.txt -i input.txt      It generates the output in single files but I want all three files in one file.


title: Where are sudo incidents logged?

text: When someone is not in the sudoers group and try to use sudo, get an error message like this one: `yzT is not in the sudoers file. This incident will be reported.` I'm trying to figure out in which log this information is logged, for check who tried to run a command with sudo for example, but can't find it. The first Google search says `/var/log/syslog` but I don't see any information related to sudo there.


title: Cat 2 files and avoid duplication of lines

text: I have the **file1** with the following content               {"name":"clio5", "value":"13"}     {"name":"citroen_c4", "value":"23"}     {"name":"citroen_c3", "value":"12"}     {"name":"golf4", "value":"16"}     {"name":"golf3", "value":"8"}      And I have the **file2** with the following content               {"name":"clio5", "value":"14"}     {"name":"citroen_c4", "value":"25"}     {"name":"golf4", "value":"18"}      I want to execute a shell command in order to display the content of the **file1** and the **file2**. if a `name` exist in both **file1** and **file2** so I want to display only the related line of the **file2**. So the output should look like this:               $command taking account file1 file2     {"name":"clio5", "value":"14"}     {"name":"citroen_c4", "value":"25"}     {"name":"citroen_c3", "value":"12"}     {"name":"golf4", "value":"18"}     {"name":"golf3", "value":"8"}      The command should not edit **file1** neither **file2** The command should be as simple as possible The command could contains `grep`, `sed`, `awk`


title: How to run a command after apt-get upgrade

text: Recently I came across the nice `checkrestart` tool, that checks if running processes use an outdated version of a recently updated library and would need a restart to load them with the updated lib. At the moment I have to call `checkrestart` by hand every time I have used `apt-get upgrade` or `aptitude upgrade`. Is there a way to invoke such a command automatically after `apt-get` or `aptitude` have upgraded some packages? Bonus points if the solution also works with `unattended-upgrades`.


title: Transparently run wine programs

text: When I want to run a wine program I have to type e.g. `$ wine ~/.wine/drive_c/Program\ Files/TextAloud/TextAloudMP3.exe` Would it be possible to run directly `TextAloudMP3`? I mean not only from command line (I could create alias) but in whole graphical environment. I'm launching programs with `dmenu`.


title: ZFS on Linux gets corrupted on export

text: **Edit:** I am not using Sabayon Linux anymore. I suggest to close this question. I just started experimenting with ZFS on Linux. I use Sabayon Linux with kernel 3.8. I used a whole single USB disk to create a pool. I tried to do only the basics               zpool create -f testing /dev/disk/by-id/usb-WD_My_Passport_0748_575837314333323139313238-0:0      Which create the zpool successfully.               zpool export testing      Goes without any errors. However, when trying to import the pool back:               zpool import             pool: testing          id: 18027227446368584194       state: FAULTED      status: One or more devices contains corrupted data.      action: The pool cannot be imported due to damaged devices or data.        see: http://zfsonlinux.org/msg/ZFS-8000-5E      config:              testing     FAULTED  corrupted data           sdb       UNAVAIL  corrupted data      I'm using 64 bit kernel with 2 GB of memory. I'm finding it hard to believe that this is a ZFS on Linux bug, since it's very trivial.


title: Finding data transfer rates on individual TCP/IP connections

text: In a application that has multiple TCP/IP connections with other applications on a Linux system how can I find the amount of data transferred between individual connections.


title: Why are there several keys unbound in vim?

text: There are several keys that are unbound in vi/vim, such as `g, q, v and #`. Is there a particular reason why these keys are unbound? Can I just use them however I want or will I be breaking certain conventions concerning their use?


title: what are some uses of .(single period) & ..(double period) in the shell command line

text: The single period `.` means current working directory The double period `..` means parent of the current working directory I can only think of `.` being used in relative pathname etc `cd ./bin/usr` How are the above `.` & `..` used in the shell command line


title: Can iptables be used to monitor TCP timeouts/resets system-wide?

text: I'm trying to determine if an application's connection to a database is internal to the application or due to a networking event. This seems like something netfilter would have system-wide visibility on. To that end, I wanted to use `-j LOG` with `iptables` to log all TCP resets and timeouts that occur on the system. I don't know what to use for the matching criteria, though. I feel like the answer would involve the `conntrack` module at some point but I've been able to locate next to nothing on it. The database server is MS-SQL and the J2EE application is running on a RHEL 5.10 VM. The latter is the machine I'm trying to perform the logging on. **EDIT:** I found this blog post which shows how to log TCP resets (amongst other things) with the `\--tcp-flags` option to `iptables`. So the outstanding issue is figuring out how to log connections with no explicit RST but are closed due to the connection being seen as stale/timing out.


title: Arch Linux hangs after soft reboot

text: After installing Arch Linux with Gummiboot I have to hard reboot to avoid a black screen. If I run `sudo reboot` the screen just goes black and nothing more happens after activating an item in the boot menu. Any ideas?


title: Using TMUX on boot up of Linux CentOS

text: I'm trying to figure out a way in which I can boot TMUX under a user other than root, but automatically whenever Linux starts. At least that's what I think I need. What I _want_ is to be able to SSH into a remote box using the aforementioned user and type "tmux attach" and see the running program that was launched when TMUX was started. The issue seems to be that I can't get TMUX started under the user of choice via the rc.local file (Linux CentOS 6.3), but instead it seems the TMUX session belongs to root instead. Normally not a problem, but I want to use SSH and don't wish to try to use SSH as root. Is there a way to "switch" to a different user while executing the rc.local script? BTW, I do have TMUX booting and launching my program via script but I need to be logged in as that user in order to see the program using SSH.


title: Can I delete the MBR from GRUB?

text: Can I delete the Master Boot Record from GRUB? If so, how?


title: Multi-user text mode runlevel in Ubuntu

text: I use Ubuntu as a server, and I want to change its runlevel to be full multi- user text mode (like init 3 in RedHat). Using `runlevel` command, I see that am running `N 2` which is Graphical multi-user with networking based on this  wiki entry. So I'm wondering, is _1- Single-user mode_ in Ubuntu the equivalent for _3- Full multi-user text mode_ in RedHat?


title: Easy way to parse syslog date format

text: I'd like to write a script that analyses the last week's syslog. But my syslog logs in a stupid date format, e.g. "May 22". If it logged as 2013-05-22, this task would be trivial. Is there a way using awk / bash / perl / sed that I can easily 'grep' the logs for all lines between two datetimes?


title: Unpredictable memory explosions

text: The main server at my company has recently been having a lot of downtime. For reasons that neither I nor the other admins can determine, it has random (VERY sudden) explosions in memory. It becomes unresponsive because it exhausts all the memory, and then we have to reboot it. Very annoying. It's a Debian system, we haven't upgraded to Squeeze or anything, it's been perfectly stable for a long time. The problem is that the logs are totally useless. They don't seem to indicate that anything is going wrong. I'm guessing that some process is buggy and hogging all of the memory, but I have NO way of proving that at the moment. Remote logging is no help, because it's not complaining about anything -- it thinks everything is peachy. So my question is: how would you approach this problem? Any insight is appreciated. Thanks.


title: How to run find -exec?

text: I'd like to find the files in the current directory that contain the text "chrome".               $ find . -exec grep chrome     find: missing argument to `-exec'      What am I doing wrong?


title: Kernel panic - not syncing: No init found. While booting from U-Boot

text: Kernel mounted the root file system but can not find any init script. I'm sure that script exists in my ramdisk.img! I also checked out this and GE863-PRO3 U-BOOT Software User Guide 1VV0300777 Rev. 6 – 2010-01-25. Any idea or alternative documentation? My environment: GE863-PRO3 128/64 version               U-Boot 1.2.0 (Aug 18 2010 - 12:16:10)- 221 Telit          DRAM:  64 MB          Bank #1     Flash:NAND Numonyx NAND01G-B2B 128MB 1.8V 8-bit     Hardware ECC (ECC data size = 512 bytes)     Nb min erasable unit:   1024     min erasable Size: 131072     Size=134217728 bytes     Logical address: 0x40000000     No bad block detected     Area 0: 40000000 to 403BFFFF (RO)  Primary Bootstrap     Area 1: 403C0000 to 4043FFFF (RO)  U-Boot code     Area 2: 40440000 to 404BFFFF (RO)  U-Boot Environment     Area 3: 404C0000 to 407BFFFF       User Area 1     Area 4: 407C0000 to 47FFFFFF       User Area 2      U-BOOT commands:               setenv bootargs console=ttyS0,115200 mem=64M ver=4384k icofat=257k rootfstype=jffs2 root=/dev/mtdblock1 rw mtdparts=at91_nand:7936k(ARMboot)ro,-@7936k(root) init=/bin/busybox     ethinit 192.168.122.3     erase 404C0000 47FFFFFF     tftp 20200000 ramdisk.img     cp.b 20200000 0x407c0000 14cd78     tftp 20200000 uImage     bootm      boot output:               VFS: Mounted root (jffs2 filesystem).     Freeing init memory: 96K     Setting DMA Console     Failed to execute /bin/busybox.  Attempting defaults...     Kernel panic - not syncing: No init found.  Try passing init= option to kernel.     Function entered at [<c01de28c>] from [<c01de304>]     Function entered at [<c01de2a0>] from [<c0020398>]      r3:c3c1ac40 r2:c3c1ac40 r1:c3c1deb0 r0:c01c3cab     Function entered at [<c00202dc>] from [<c00085e0>]      r4:c020d2c0     Function entered at [<c00083b8>] from [<c003a454>]


title: X Window opened from screen

text: Bit of an oddish one, if I've opened an X window over SSH in a screen session will it reopen when screen is reattached? I've been able to detach and the process stays running fine, with the X window continuing to update with me logged onto the server but I'm just curious if I'll be able to detach and logoff, then reattach and bring the window back.


title: Create and open file with one command?

text: I want to create a text file and open it in a text editor with a single command. I know `touch file.txt` creates a file and `open file.txt` opens the file, but is there a way to do this with a single command?


title: Is there an exhaustive list of plugins for Dovecot?

text: **Background**   I am looking for plugins for Dovecot (specifically authentication plugins) because I would like to look at source code for reference as to how to make an authentication plugin for Dovecot. I have search through the official list on the Dovecot website as well as a Google search for a list of plugins available. Unfortunately I haven't been able to find anything that fits what I am looking for. **Questions**   Are there more plugins available than in the official list?   Where can I find these plugins?   Are there any authentication plugins available for Dovecot? I am looking for a response that answers all of the questions above. Thank you for your assistance.


title: mdadm : difference in metadata versions

text: Can anyone tell me the difference between the different metadata versions for mdadm? When I try the command `mdadm --examine /dev/sda1`, I can't seem to find "preferred superblocks" on version 1.2. This field shows up in metadata version 0.9. Is there a way to get such metadata information? Or is the output of `mdadm --examine` just the information I'm going to get for version 1.2?


title: Unknown btrfs error, partition won't mount

text: unix friends, a day or so ago my btrfs partition just stopped working, which means i can't mount it anymore which is why my Fedora Linux doesn't boot anymore. I don't really have much information, but Gparted outputs the following when i attempt to check the partition:               checking extents     checking fs root     checking root refs     btrfsck: extent_io.c:602:free_extent_buffer: Assertion `!(eb->refs < 0)` failed.      When I tried to mount the partition with a Fedora 18 Live DVD I got a SIGSEGV from the mount program and additionally an unknown kernel error which was also tainted. Do you have any idea how to restore the data on this partition or it is lost for sure?


title: Connecting from OpenVPN Server to MySQL Server

text: I have an OpenVPN server installed on a server. What I'm trying to do connect from the OpenVPN server using the mysql client to the MySQL server than is connected to the OpenVPN server using a client. I can ping back and forth between the servers, no issues. However, if I use the MySQL client on the OpenVPN server to try to connect to the MySQL server I get a               ERROR 2003 (HY000): Can't connect to MySQL server on '10.8.0.6' (111)      with 10.8.0.6 being the connected to the OpenVPN server at 10.8.0.1. I thought it might be IPTables but adding explicit INPUT and OUTPUT one the client and the server didn't change anything. Telnet 10.8.0.6 3306 didn't work either. I have verified that MySQL is running on 3306:               me@db:~# lsof -i4 -P | grep -i mysql     mysqld  6192 mysql   10u  IPv4  40596      0t0  TCP localhost:3306 (LISTEN)      So what am I doing wrong? Google has been less than helpful, as far as what I could find it should just work.


title: Can't play music using Banshee on Arch Linux

text: When running Banshee from the terminal, after I click on a song, a little x appears next the song title and I get this output:               GStreamer-CRITICAL **: gst_element_query: assertion `GST_IS_ELEMENT (element)' failed      As Banshee starts, I also get this output (it may not be related, I have no idea):               [Warn  17:57:43.999] Failed to start DAAP client - System.Exception: No Zeroconf providers could be found or initialized. Necessary daemon may not be running. (in `Mono.Zeroconf')      I've tried updating gstreamer, but that didn't help. I'm currently using Gnome3. Anyone know what's going on?


title: RT3290 Wireless still not working

text: I've been trying to get my wireless working for two weeks now. I have 1814:3290 wireless card. I am on Linux Mint 14 64-bit. I have tried all the suggestion on here: http://askubuntu.com/questions/240553/how-do-i-install-ra3290-bin-wireless- driver-into-lib-firmware http://ubuntuforums.org/showthread.php?t=2104129 http://askubuntu.com/questions/240553/how-do-i-install-ra3290-bin-wireless- driver-into-lib-firmware I updated my kernel to 3.8.5-030805-generic. The first thing I tried was compiling the drivers (using original kernel 3.5.0-17-generic). When I compiled and installed, my wireless worked, but, I kept getting kernel panics every time I logged in. So I `modprobe -r rt3290sta`. After that I tried updating the kernel to the one I have now and copying the bin file. The kernel saw the wireless card but it was not active or anything. I checked `rfkill` and nothing was blocked. So then I tried compiling the drivers again after `make clean` first. Now when I try to compile the drivers I get this:               /home/dis/Downloads/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/pci_main_dev.c:43:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rt2860_remove_one’     /home/dis/Downloads/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/pci_main_dev.c:44:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rt2860_probe’     /home/dis/Downloads/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/pci_main_dev.c:63:46: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__devinitdata’     /home/dis/Downloads/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/pci_main_dev.c:85:17: error: ‘rt2860_pci_tbl’ undeclared here (not in a function)     /home/dis/Downloads/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/pci_main_dev.c:86:17: error: ‘rt2860_probe’ undeclared here (not in a function)     /home/dis/Downloads/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/pci_main_dev.c:88:5: error: implicit declaration of function ‘__devexit_p’ [-Werror=implicit-function-declaration]     /home/dis/Downloads/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/pci_main_dev.c:88:29: error: ‘rt2860_remove_one’ undeclared here (not in a function)     /home/dis/Downloads/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/pci_main_dev.c:292:24: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rt2860_probe’     /home/dis/Downloads/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/pci_main_dev.c:463:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rt2860_remove_one’     /home/dis/Downloads/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/pci_main_dev.c:71:1: error: ‘__mod_pci_device_table’ aliased to undefined symbol ‘rt2860_pci_tbl’     cc1: some warnings being treated as errors     make[2]: *** [/home/dis/Downloads/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/pci_main_dev.o] Error 1     make[1]: *** [_module_/home/dis/Downloads/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux] Error 2     make[1]: Leaving directory `/usr/src/linux-headers-3.8.5-030805-generic'     make: *** [LINUX] Error 2      Everything is up to date also. I'm not sure where to go from here. Maybe I should downgrade my kernel to 3.6 or 3.7? Edit: So I downgrade my kernel to 3.7.2 and recompiled the drivers. The kernel sees my wireless card but doesn't really seem to work and everything freezes. Going to try kernel 3.6. Edit2: After more testing I found out that 3.7.2 and 3.6.11 both give me kernel panics after installing the wireless driver. Edi3: I installed 3.7.11 and compiled and installed the wireless drivers. Wireless worked for 3 seconds and then had a kernel panic.


title: Why is `kill -s INT <zsh PID>` behaving differently from `Ctrl-C`?

text: Starting with:               % donothing () { echo $$; sleep 1000000 }     % donothing     47139      If at this point I hit `Ctrl-C` at the same terminal that is controlling the shell, then the function `donothing` does indeed terminate, and I get the command prompt back. But if instead, from a different shell session, I run               % kill -s INT 47139      ...the `donothing` function does _not_ terminate. (Ditto if I pass `-47139` as the last argument to `kill`.) Do I need to use a different PID from the one I'm using to achieve with `kill -s INT` the same effect that I can achieve interactively with `Ctrl-C` at the controlling terminal? (I'm primarily interested in the answer for `zsh`.) * * * EDIT: in response to Gilles comment: no, I have not set any traps (though I would be interested to learn how to confirm that no traps are set: is there a way to list all the active traps?); and yes, I can reproduce this behavior with `zsh -f`. In fact, I can reproduce it under the most extreme way I know to get an absolutely "bare" `zsh` (please let me know if there's a better way):               % /usr/bin/env -i /usr/bin/zsh -f     % donothing () { echo $$; sleep 1000000 }     12345      ...etc. Since my original post, I have replicated the behavior described above both under Darwin and under NetBSD, but not under Linux (i.e. under Linux `kill -s INT <zsh PID>` does kill the `donothing` function defined above, without killing the parent shell in the process). So maybe this is a BSD-ish thing. More specifically, in every Unix I've tried this with, the `sleep` process is a child of the `zsh` process, but only under Linux is the `SIGINT` signal that was sent to the `zsh` process propagated to the `sleep` process. Therefore, in order to be able to kill the `donothing` function non- interactively under Darwin and NetBSD I need a way to find the PID of the `sleep`-ing child, and send the `SIGINT` to it (which, admittedly, does sound pretty heartless). More generally, to kill a shell function non-interactively under Darwin and NetBSD, I need to recursively/depth-first find the _descendants_ of the `zsh` process and send them the `SIGINT` to them...


title: Split a physical X display into two virtual displays?

text: I just purchased a TripleHead2Go and configured it using OSX. What this box does is simply take 1-3 multiple external monitors and combine their signal into one single resolution. I'm using two external 1920x1080 displays with it, bringing my display size to 3940x1080, alongside my laptop's regular display of 1920x1200. My laptop is running FGLRX 8.95 with Catalyst 12.3, the video card is an AMD Radeon HD 6700M. Here's what I'm looking at, presently: ![enter image description here](http://i.stack.imgur.com/g7qwJ.png) ![enter image description here](http://i.stack.imgur.com/XTbs2.png) Here is my xorg.conf file: http://pastebin.com/jgm9AwqN Is there a way for me to "split" this massive display into two, virtual 1920x1080 displays so that windows will maximize properly, one to each monitor?


title: Symbolic linking to ~/ instead of ~/[path/file]

text: I moved all of my dot files out of `~/` in to `~/data/dotfiles` I then did `ln -s ~/data/dotfiles/[filename] ~/` My intention was `ln -s ~/data/dotfiles/[filename] ~/[filename]` This included my `.vimrc` , `.bashrc` And others Now when I open a terminal session or open vim I get `too many levels of symbolic links.` I'm unsure if I delete the symbolic link from my home directory or from the directory the files live in. Any help would be appreciated. As per request: `jsw:dotfiles jsw$ ls -l ~/.vimrc ~/data/dotfiles/.vimrc lrwxr-xr-x 1 jsw staff 6 1 Aug 13:54 /Users/jsw/.vimrc -> .vimrc -rw-r--r-- 1 jsw staff 11044 31 Jul 10:51 /Users/jsw/data/dotfiles/.vimrc`


title: DHCP server: offer different subnet addresses for different interfaces

text: I'm running Ubuntu 10.04 on my home router which has multiple network interfaces. I have `dhcpd` configured to provide addresses from `192.168.1.0/24` subnet on certain interface. However, I'd like to also provide addresses from `192.168.2.0/24` subnet for another interface. How can I configure `dhcpd` to do so? Or, if I use another DHCP server software, for example, `dnsmasq` - how can that be configured to do the same thing?


title: How do I tell if a Wine application uses hardware or software rendering?

text: I'm building an appliance/kiosk-type machine which is going to run a single fullscreen _Wine_ application (Synthesia). I'm using Arch Linux running LXDE on an original 7-inch EeePC (well, souped up to 2Gb of RAM, but the CPU is rather slow, something like 633 Mhz). The game can use either a DirectX or OpenGL renderer and I'm finding it to be quite choppy, especially with the DirectX renderer. However, I remember that the machine was perfectly capable of running Tuxracer and other OpenGL games, and Synthesia definitely should be less demanding to graphics - all it does is drawing a few colored bars. So, the point is - the display is choppy and the CPU utilization is at 100% when the program runs so I suspect it may be using software rendering. The video chip is Intel and I have `xf86-video-intel` installed. How do I check if the application uses hardware or software rendering? If the software rendering is being used, how do I set it to hardware rendering?


title: Unmet dependencies error on Debian

text: I'm on Debian wheezy, i want to install chkrootkit               sudo apt-get install  chkrootkit      i get this error :               Reading package lists... Done     Building dependency tree            Reading state information... Done     You might want to run 'apt-get -f install' to correct these:     The following packages have unmet dependencies:      skype : Depends: libqt4-dbus (>= 4:4.5.3) but it is not going to be installed              Depends: libqtwebkit4 (>= 2.1.0~2011week13) but it is not going to be installed     E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).      I'm not sure, but the main problem here is about this message :               E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).      please any suggestion ? I'm a newbie on Debian/Linux OS


title: Determine the last 7 days backup size

text: Consider I have a folder `/home/abdul/backup` which contains `.gz` file for the past 1 year...My requirement is to get the size of last 7 days...


title: Compiling Source Code Error

text: While I'm compiling a open source project on Cent OS 5.5 I'm getting error "cc1plus warnings being treated as errors". Why and how to solve this problem.


title: xrdp: Super_L not working

text: My virtual machine runs `xrdp` and when I connect with `rdesktop`, the "windows" key (i.e. Super_L) is not assigned properly. Using `xev` I see that when the windows key is pressed, instead of showing `Super_L`, it shows `Control_L`. The real `CTRL` key also shows `Control_L`. In other words, both the windows key and `CTRL` have the same effect. How can I fix this, so that the Windows key maps to `Super_L`, same as on my laptop?


title: bypass firewall with Openvpn + Squid

text: I have 2 VPS servers, one in China and another in the US. The server (`openvpn` client) in China is connected to the US one via `openvpn`. I also have `squid` running in the China server. I want to redirect all traffic to `squid` through the `openvpn` tunnel to the US server, so users can access blocked sites including youtube.com, facebook, twitter and the likes. I currently have all outgoing `http` and `https` traffic on the China server going through the `openvpn` tunnel. I verify this, because when visiting normal sites, the public IP address has already become the US IP address. Yet I still cannot access blocked sites due to DNS pollution, and all these sites resolve to the unreachable IP address. How can I circumvent the DNS pollution issue in this case? I know there are other ways to bypass the gfw (e.g. SSH tunnel, VPN) but this method is the most convenient one for ordinary users.


title: grep for strings that were found in a previous statement

text: I'm trying to find out if an address definition is used inside of fortigate configuration file. I extracted the section out of the configuration file, that contains the addresses. In that section the lines look like this:               edit "address name"         set associated-interface "someinterface"         set subnet 1.1.1.1 0.0.0.0      So now I wanted to use the address name and check if any rule or address group uses this by doing the following:               IFS='     '     for address in $(grep edit addresses.txt | cut -c10- | sed 's/"//'g); do echo $address; grep -n $address fortigate.conf; done      The IFS part I took from here. This returns me a list of names of address definitions, but the grep command doesn't find anything, which is weird, since it should at least find itself, no?


title: What regular expression engine type does bash use?

text: I use RegEx Buddy to prototype and debug my regular expressions. RegEx Buddy allows me to choose between a number of different regular expression engine types (.NET, Java, Perl, GNU BRE, GNU ERE, POSIX, BRE, POSIX ERE etc). What regular expression engine does bash use (for example in `if` and `case` statements)? I'm running Centos 5.5 32 bit and bash 3.2.25(1):               [kevin@mon01 scratch]$ bash --version     GNU bash, version 3.2.25(1)-release (i686-redhat-linux-gnu)     Copyright (C) 2005 Free Software Foundation, Inc.      I'm guessing it'll be GNU BRE or GNU ERE?


title: mdadm metadata: should i take precautions to prevent superblock overwrite?

text: Situation:   * I'm creating a new RAID1 array using mdadm.   * I won't be using additional layers, such as LVM or dm-crypt.   * I've noticed that metadata version 1.2 is now the default. I understand it's the recommended version, if all other parts of the system (for example grub2) support it. This is the case for me.   * From the manpage and several other sources I understand that metadata 1.2 means the superblock is stored at the beginning of the disk. At 4KiB from the start.   * On previous RAID1 arrays I created, I used metadata version 0.90 which stores the superblock at the end of the disk instead. To prevent it from being overwritten, I left the last part of the disk unpartitioned. It's my intention to partition the new RAID1 array with a GPT partition table, first partition starting at sector 2048. If a sector is 512 bytes, this means the actual partition will start at 1024KiB from the start of the disk. Questions:   * Should I take any precautions to prevent the version 1.2 superblock from being overwritten, or is starting the first partition at sector 2048 enough to be relatively safe?   * I imagine grub will write at the start of the disk, but it will probably only need the first 512 bytes. Do any other programs write right after those bytes on the disk?   * Is the part right after the end of the first sector, up to sector 2048, a 'regulated' part of the disk? Do other programs check if any other data is present before they start writing there? I couldn't find anything specific about this. I understand that using `dd` can destroy a superblock ;-) and so does `mdadm --zero-superblock`. I'm more concerned about any other utilities or filesystem layers such as LVM of which I may not immediately realise they could overwrite that specific part of the disk where the superblock is stored.


title: cronjob for automatic DB backup to date prefixed file

text: I am using the latest Linux Mint. I was wondering if it's possible to create a special cronjob for a database backup. In my `/etc/cronjob` file I have the following code:               # Minute   Hour   Day of Month       Month          Day of Week        Command         # (0-59)  (0-23)     (1-31)    (1-12 or Jan-Dec)  (0-6 or Sun-Sat)                     30        4          *            *                1-6            /home/users/backup.sh      In my `/home/users/backup.sh` I have:               mysqldump -uroot -p MyDatabase > /home/users/backup_MyDB/full_myDB.sql      Instead of `full_myDB.sql` I would like to have something like `2014-04-04_full_myDB.sql` where the date is added dynamically depending on the date we have. If the SQL Backup file is **older than one week** I would like the cronjob to _delete_ it automatically. Hope someone can help me.


title: Connecting to FTP sites via squid

text: I'm using the squid proxy on _CentOS_ but, I can't connect to FTP sites from WAN. I did open FTP ports in the firewall on CentOS. However, I receive a "Page cannot be displayed" error when I try to connect to FTP sites. What should I do?


title: What alternative backends does sudo support and how is it configured?

text: When preparing for the Red Hat Certified Engineer certification examination, I came across this quote in my study notes about the `sudo` command. > By default, the policy is maintained as a flat text file, > /etc/sudoers(although other, possibly remote, backend databases are also > supported). I have never heard of this piece of information until recently and a quick Google search does not turn up anything useful with regards to this. Is this particular quote accurate? If so, how do I make the appropriate changes to configure `sudo` to use an alternative(presumably centralized) database for its policies?


title: Why doesn't terminal show color schema once logged as root?

text: I'm currently using Debian 7 Wheezy, and I've noticed that the **colors palette** on terminal (which might be useful to identify among a large set of files and folders) are not enabled once I log as root. Same, I've noticed the **tab completion** doesn't work the same in this situation. How can I configure these issues?


title: vim: Can I make *only* y perform a copy?

text: I'm learning to like vim, but one thing that I haven't yet fully embraced is the copy and paste situation. In a muggle text editor I would `Ctrl`-`C` copy a piece of text and then edit/delete and then paste the text somewhere else. However in vim I can't do this because after I copy text with `y`, modifying the text often involves `d` and `x` which obliterates my original text. Is there any way to make `d` and `x` not copy the text? Or otherwise, how should I be using these vim features?


title: Using grep/sed/awk to classify log file entries

text: I need to process a very large log file with many lines in different formats. My goal is to extract unique line entries who have the same starting pattern, e.g. '^2011-02-21.*MyKeyword.*Error', effectively obtaining a list of samples for each line pattern, therefore identifying the patterns. I only know a few patterns so far, and browsing through the file manually is definitely not the option. **Please note that besides the known patterns, there is a number of unknown ones too, and I'd like to automate extracting those as well.** What is the best way to do this? I do know regular expressions quite well, but haven't done much work with awk/sed which I imagine would be used at some point in this process.


title: How can I find out about "rootfs"

text: Running Debian 7; when I execute a               cat /etc/mtab      I can see all sorts of useful information about the filesystems that are mounted, such as the filesystem and options used to mount then; however for the rootfs I see only:               rootfs / rootfs rw 0 0      How can I know more about the rootfs; which physical device/partition was used, filesystem, mount options etc? On my system /etc/mtab is in fact a symbolic link to /proc/mounts               lrwxrwxrwx 1 root root 12 May  9  2013 /etc/mtab -> /proc/mounts


title: Lightweight MS Paint/MacPaint equivalent FLOSS in Linux?

text: What is an equivalent to MS Paint and MacPaint that works on Linux? There is a BSD-licenced one called Paintbrush that's great for Mac OS X, but I have not found one on Linux. I hope it can be lightweight, i.e. few dependencies, don't need GNOME, KDE, etc., but anything is fine.


title: How to jail a fastcgi server (or a web-proxied server)?

text: If you have a web-server (e.g. nginx) often you use a fast-cgi server or another application-http-server for dynamic content. That means in both cases you have a nice process separation between the web-server process and the fast-cgi (or application-http-server process - in the following called slave). The web-server is configured such that fast-cgi goes over a socket or http request are proxied. Creating different users for the slave and the web-server you can protect filesystem locations, if there is a security problem in the slave process. But how do I jail the slave process even more under Linux? (Such that it cannot access the net, send mails etc.) I can think of following routes:   * SELinux   * Linux system namespaces ('containers', cgroups) What is the most convenient way on a current distribution like e.g. Debian? How to do it in practice? Any configuration examples?


title: NVIDIA installer can't find kernel source/build files (compiled from kernel.org)

text: I just compiled and installed the new 3.0-rc2 kernel from kernel.org on my Fedora 15 system. Everything seems to work fine and I can successfully boot into the system. However, this broke my previously installed NVIDIA driver, so I need to compile a new one. I downloaded the installer from nvidia.com, but I am having trouble with the installation. To compile the kernel I unzipped the kernel archive to my home directory, then simply reused my Fedora config for the new kernel. Everything resides in `~/linux_build/linux-3.0-rc2`. After booting to runlevel 3 I get an error with the NVIDIA installer:               ERROR: If you are using a Linux 2.4 kernel, please make sure        you either have configured kernel sources matching your        kernel or the correct set of kernel headers installed        on your system.             If you are using a Linux 2.6 kernel, please make sure        you have configured kernel sources matching your kernel        installed on your system. If you specified a separate        output directory using either the "KBUILD_OUTPUT" or        the "O" KBUILD parameter, make sure to specify this        directory with the SYSOUT environment variable or with        the equivalent nvidia-installer command line option.             Depending on where and how the kernel sources (or the        kernel headers) were installed, you may need to specify        their location with the SYSSRC environment variable or        the equivalent nvidia-installer command line option.      I ran the installer like this:               bash NVIDIA-Linux-x86_64-270.41.19.run --kernel-source-path=/home/tja/linux_build/linux-3.0-rc2      Usually this was solved by installing the kernel headers from `yum`, but here I am using a new kernel with no RPM available. _How do I manually install the needed headers/source files for the NVIDIA installer?_


title: find not recursive when file at top

text: Imagine a source tree. There are xml files everywhere. But since there is a XYZ.xml at the root of this tree it won't find my xml files.               find -iname *.xml      returns               ./XYZ.xml      instead of               ./XYZ.xml     ./a/b/c/bob.xml     ./b/d/top.xml


title: Find doesn't want to find *.sh in certain level

text: I have a problem with `find`. It doesn't find *.sh files if I am in certain directory level. It does, however, find *.sql files.               /path$ cd do_not_upload/updates/1.1.1/     /path/do_not_upload/updates/1.1.1$ find . -path *.sh     ./run_pre_update/002.sh     ./run_pre_update/001.sh     ./run_post_update/001.sh     /path/do_not_upload/updates/1.1.1$ find . -path *.sh     ./run_pre_update/002.sh     ./run_pre_update/001.sh     ./run_post_update/001.sh     /path/do_not_upload/updates/1.1.1$ cd ..     /path/do_not_upload/updates$ find . -path *.sh     ./1.1.3/run_pre_update/002.sh     ./1.1.3/run_pre_update/001.sh     ./1.1.3/run_post_update/001.sh     ./1.1.1/run_pre_update/002.sh     ./1.1.1/run_pre_update/001.sh     ./1.1.1/run_post_update/001.sh     /path/do_not_upload/updates$ cd ..     /path/do_not_upload$ find . -path *.sh     ./updates/1.1.3/run_pre_update/002.sh     ./updates/1.1.3/run_pre_update/001.sh     ./updates/1.1.3/run_post_update/001.sh     ./updates/1.1.1/run_pre_update/002.sh     ./updates/1.1.1/run_pre_update/001.sh     ./updates/1.1.1/run_post_update/001.sh     /path/do_not_upload$ cd ..     /path$ find . -path *.sh     /path$ find . -path *.sql     ./do_not_upload/updates/1.1.3/sql_migrations/002.sql     ./do_not_upload/updates/1.1.3/sql_migrations/001.sql     ./do_not_upload/updates/1.1.1/sql_migrations/002.sql     ./do_not_upload/updates/1.1.1/sql_migrations/001.sql          $ find --version     find (GNU findutils) 4.4.2          /path$ stat do_not_upload/       File: ‘do_not_upload/’       Size: 60          Blocks: 0          IO Block: 4096   directory     Device: 14h/20d Inode: 159862      Links: 3     Access: (0775/drwxrwxr-x)  Uid: ( 1000/  jorgee)   Gid: ( 1000/  jorgee)     Access: 2014-09-10 14:02:34.449376973 -0300     Modify: 2014-09-10 13:54:13.805363567 -0300     Change: 2014-09-10 13:54:13.805363567 -0300      Birth: -


title: Is bluetooth keyboard associated with `stdin`?

text: I know that keyboard is standard input and is referred by the `stdin` file. I sometimes use a Bluetooth(BT) keyboard when working on my laptop. Both keyboards, my laptop keyboard as well as the BT keyboard work simultaneously. So, are both keyboards associated with `stdin`? If yes, how are they synchronized?


Want to replace the words with space in multiple files using SED commmand I have a word as 'Danny' with single quotes in many of my files in multiple directories which I want to change to 'Danny Samuel' since I have a space in the new word this command wont work               find . -type f -exec sed -e 's/'Danny'/'Danny Samuel'/g' -i.php '{}' +


title: Searching command history

text: I search the terminal command history by pressing `Ctrl``r` but what if:               This is an old command          This is an | less -S older command I press `Ctrl``r` and then I type "this is an" and the old command commes up but not the older. How can I search all the "this is an" commands? Is it possible to pipe all similar commands to grep or something? If I `set -o vi`, how do I undo it?


title: Use X over an intermediate machine

text: EDIT: I didn't setup my `sshd_config` file correctly on the WORK machine. Even though I uncommented the line `X11Forwarding no`, I didn't realize that it said "no" instead of yes. Since the default is "no", I just assumed, without paying much attention, that it would be `X11Forwarding yes` after I uncomment it. I have a public machine, MIDDLE. I have another machine at work: WORK that I want to be able to access from my home computer: HOME. HOME can access MIDDLE and WORK can access MIDDLE but MIDDLE cannot access either machine directly and HOME and WORK can't access each other directly. I have an SSH server running on WORK with X11Forwarding enabled. If I setup a reverse tunnel from WORK to MIDDLE, and then from HOME do `ssh -X MIDDLE` and then `ssh -X -p <someport> localhost`, I get `X11 forwarding request failed on channel 0`. Commands I am using to setup the tunnels:               # On machine WORK:     user2@WORK:   $ ssh -R 33333:localhost:22 user1@MIDDLE          # On machine HOME:     user@HOME:    $ ssh -Y user1@MIDDLE     # And then on machine MIDDLE:      user1@MIDDLE: $ ssh -Y user2@localhost -p 33333      Note: `user1 != user2`. Is there some way to achieve what I want?


title: Command for forcing a pointer ungrab (captured mouse release)

text: Sometimes Firefox doesn't release the mouse after dragging, so I need to kill the application to force it to release its pointer grab. Is there any command to force an application to ungrab the pointer without killing it?


title: Viewing Debian documentation offline

text: How do I read various manuals, guides and howtos, which are usually in the form of deb packages with names ending in `-doc` and installed in `/usr/share/doc` directory?


title: Help understanding modifiable in Vim

text: During a OS upgrade (Linux), Vim or some part of it has been updated as well. Now it happens that sometimes when I save a file (the file is not saved) I get this error: > E21: Cannot make changes, 'modifiable' is off I did `:help E21` and the manual says:                       {not in Vi}     *E21*     When off the buffer contents cannot be changed.  The 'fileformat' and     'fileencoding' options also can't be changed.     Can be reset with the |-M| command line argument.      It's not clear to me what it means. I use and start the editor the usual way, nothing is changed. The workflow is the same, too. I open different windows with `CTLR-W N`, then load and edit files there and switch between windows, etc. I'd like to know how to disable this behavior and about side effects.


title: Can't run yum update

text: I've been banging my head on the keyboard with this! I'm working on CentOS 6.5 x86_64. Firstly I tried to update `php` and `apache` using easy apache. The update failed very quickly so I went on the usual hunt around the internet. It appears I also can't run `yum update`. Here is the bottom of the readout:               Error: Package: glibc-utils-2.12-1.132.el6_5.2.x86_64 (updates)            Requires: libgd.so.2()(64bit)            Removing: gd-2.0.35-11.el6.x86_64 (@base)                libgd.so.2()(64bit)            Updated By: gd-2.1.0-1.el6.x86_64 (CentALT)                Not found     Error: Package: cpanel-webalizer-2.23_05-2.cp1136.x86_64 (installed)            Requires: libgd.so.2()(64bit)            Removing: gd-2.0.35-11.el6.x86_64 (@base)                libgd.so.2()(64bit)            Updated By: gd-2.1.0-1.el6.x86_64 (CentALT)                Not found     You could try using --skip-broken to work around the problem     You could try running: rpm -Va --nofiles --nodigest      I've tried running `rpm -Va --nofiles --nodigest` but to no avail. A lot of what I have read mentions repos. I have the following repos installed:               CentOS-Base.repo     CentOS-Vault.repo     mod-pagespeed.repo     CentOS-Debuginfo.repo     epel.repo     remi.repo     centalt.repo     CentOS-Media.repo     epel-testing.repo      I know there is a problem with `centalt.repo` as when I try to go to the base URL I get a `403:forbidden` message. I've tried using `wget` to install `gd-2.0.35-11.el6.x86_64.rpm` but it says it's already installed. Which, to me, means `libgd.so.2()(64bit)` should also be installed (according to http://www.rpmfind.net//linux/RPM/centos/6.5/x86_64/Packages/gd-2.0.35-11.el6.x86_64.html). I'm really stuck here... I really hope someone can help me get this sorted out. I need to update PHP for a client.


title: Get the latest directory (not the latest file)

text: My folder `parent` has the following content:               A.Folder B.Folder C.File      It has both folders and files inside. `B.Folder` is newer. Now I just want to get `B.Folder`, how could I achieve this? I tried this,               ls -ltr ./parent | grep '^d' | tail -1      but it gives me `drwxrwxr-x 2 user user 4096 Jun 13 10:53 B.Folder`, but I just need the name `B.Folder`.


title: Different access rights for different groups for a folder on Linux

text: I have a folder on a Linux machine that I would like to be read only for members of one group, read write for members of another group, and read write for the owner. `Other`s would not be able to access this folder at all. Is there a way to do this without using ACLs?


title: Why does vim color this .bashrc line incorrectly? Fixable?

text: I have the following line in my .bashrc that allows me to use rlwrap with sqlplus. Why does vim seem to color this wrong?               alias sqlplus='rlwrap -c -f /usr/bin/rlwrap -b '\''\(\){}[],+=\&^%$#@"";|\'\'' sqlplus'      vim coloring suggests unbalanced quotes and incorrect subsequent lines, i.e. ![enter image description here](http://i.stack.imgur.com/IEbil.png) but the line (and subsequent lines) actually work fine. Making changes such as adding an extra end quote "fix" the coloring but mess up the command, i.e. I then get               -bash: /home/mdurrant/.bash_profile: line 18: unexpected EOF while looking for matching `''     -bash: /home/mdurrant/.bash_profile: line 21: syntax error: unexpected end of file      Is there a way to have the command work correctly **and** have the coloring be correct?


title: script to send e-mail for success or failure

text: My Oracle backup sends out an e-mail with notification that backup completed and it was successful or failed depending upon it find some pattern. Our backup logs are getting very big - 14mg. Since this file is larger then 10MB, this messages are getting dropped by the Exchange servers. Please help me fix this issue, i.e. i need this process to just send an e-mail with the pattern "ORA-" or "RMAN-" error codes(if failure) or just a e-mail that indicates success or failure. NOTE: this is just a part of the code - Let me know if you have any questions.               #### Check for RMAN/ORA Errors and notify accordingly          RMANERROR=`egrep "ORA-|RMAN-" $RMAN_LOG_TSBKUP`     RMANWARN=`egrep "ORA-|RMAN-" $RMAN_LOG_TSBKUP|egrep -vE "$EGREP_EXCLUDE"`               if [ -z "$RMANERROR" ]     then        echo "No Errors"        cat $RMAN_LOG_TSBKUP |mailx -s "SUCCESS - DW_TS_BACKUP Complete" `cat $EMAIL_SUCCESS_DIST`     elif [ -z "$RMANWARN" ]     then        echo "No Errors, but Warnings"        cat $RMAN_LOG_TSBKUP |mailx -s "SUCCESS (with ignorable WARNINGS) - DW_TS_BACKUP Complete" `cat $EMAIL_SUCCESS_DIST`     else        echo "Errors Found !!!!"        mailx -s "FAILURE - DW_TS_BACKUP Complete" `cat $EMAIL_FAIL_DIST`     fi     }


Can an executable know where it is stored? For my open source project, I wrote a small bash script to automate some operations. The script lies at the root of the project and performs its tasks on all files below. People have the project files on their own computers, at their favorite path, so I can't just hardcode `cd /home/nico/projects/theproject` at the beginning of the script. I don't want to force people to manually `cd` to the project's directory everytime before executing either. I would like people to be able to use a Gnome shortcut to launch the script. To do so, the script needs to know where itself is stored.


title: How to add another domain to my chrooted named server

text: Firstly I successfully have a domain working in a chroot named. There are files in `/var/named/chroot/var/named` called `mydomain.com.db` and `named.local` and `named.root`. Also in `/var/named/chroot/etc` there is named.conf. So mydomain.com works as both a hosted website and it has `ns1.mydomain.com` and `ns2.mydomain.com`. Now what I want to do is only to add another domain `mydomain2.com` to this setup, however I'm having trouble to find tutorial articles on adding another domain. They mostly seem to focus on just the adding of the first domain. I guess I have to create a new zone file and reference it in the `named.conf` but I don't know what the zone file should contain. I tried some trial and error guessing but it didn't work.


title: Limit CPU/RAM usage per user?

text: I'm running game server applications on dedicated server that I have, but I want to be able to limit the CPU/RAM/etc usage on a per-user basis to make sure one of the servers doesn't eat up more resources than it is supposed to be given. I've seen people recommend ulimit for this, but the way to limit CPU in it is confusing... What I'm aiming to do is limit each user to 1 thread ( out of 16 ) and 1G of RAM.. I'd also prefer not to do this in VMs, as I only have 3 IPs and my previous attempts to setup NAT have been rather unsuccessful.


title: Failure Writing a Multi-Session Audio/Data CD w/ cdrdao

text: I'm trying to create a multi-session CD (CD-Extra), but hitting some errors with `cdrdao`. I'm following these steps. The audio session of the CD finished successfully, but writing the data portion results with:               [valid=0] Info fld=0, Current      SCSI command failed: sense key: 0x05: Illegal Request     Raw sense data: 0x70 0x00 0x05 0x00 0x00 0x00 0x00 0x0a 0x00 0x00      0x00 0x00 0x21 0x02 0x00 0x00      ERROR: Write data failed.     ERROR: Writing failed.      I tried with the `generic-mmc-raw` driver, and get another error message:               ERROR: Cannot set write parameters mode page.      Any ideas on what would cause this? Is there another method that can be used to create a mult-session disc?


title: What do you use the -t "tag" option for in logger?

text: When using the "logger" command to write messages to the system logs from scripts, I use the `-t` "tag" to store the scripts name along side the message it's written to the log. I do this to make finding entries easier for troubleshooting.   * Are there any ad-hoc standards for using this tag message?   * If you use it, what do you put in there?


title: Watch file using multitail even if it has not been created

text: I've a MapServer logfile; it is created in `/tmp/mapserv.log`, but obviously it is flushed at every reboot, and is created only when a loggable event occurs. I'm already using Multitail, but now I need to watch the folder `/tmp` for a file that has not even been created, waiting for it to appear. Any hint?


title: What type of permissions should a user's home directory and files have?

text: I'm working with a fresh install of Ubuntu 12.04 and I've just added a new user:               useradd -m testuser      I thought that the `-m` flag to create a home directory for users was pretty standard, but now that I've taken a closer look I'm a little confused: By default the new directory that was just created shows up as:               drwxr-xr-x  4 testuser testuser 4.0K May 20 20:24 testuser      With the `g+r` and `o+r` permissions that means every other user on the system can not only `cd` to that user's home directory, but also see what is stored there. When reading over some documentation for suPHP it recommends setting the permissions as `711` or `drwx--x--x` which is how it would make the most sense to me. I noticed that I can change the permissions on the files inside `/etc/skel` and they are set correctly when creating new users with `useradd -m` but changing the permissions on the `/etc/skel` directory itself does not seem to have any effect on the new directories that are created for users in `/home/`   * So - what type of permissions should a user's home directory and files have - and _why_?   * If I wanted permissions to be different for `useradd -m` - like the `711` / `drwx--x--x` as I saw mentioned, how is one to do that? Must you create the user and then run `chmod` ?


title: Emacs on Minix 3?

text: Has anybody managed to install Emacs on Minix 3? Emacs was available on earlier versions of Minix. I am OK with an earlier version of Emacs if necessary. I don't find Zile, mg or Elle adequate and would prefer the full version of Emacs, even if it is an old version. I don't need a GUI version `emacs-nox` is OK, I will be running it from the command line anyway.


title: Color terminal under USS

text: I've been using a remote terminal connected to USS under a mainframe for some time. Is there a way to configure this terminal to be colored? I'm using PuTTY and xterm. **Added:** USS stands for UNIX System Services, UNIX implementation for mainframes.


title: How to remove Oracle Wallet using orapki?

text: Hi i'm on Centos using oracle 11g And i've created a wallet using :               $ orapki wallet create -wallet /u01/app/oracle/admin/DB11G/wallet -pwd WalletPasswd123 -auto_login      Now i want to remove it to try again and can't find how to do that. all the samples are using the Oracle Wallet Manager which is a GUI i don't have. Any help?


title: Sendmail/procmail/Exchange truncating mail

text: The level of enlightenment by a colleague to find a pattern in this has saved me from a new depth of madness. My hope is that the brain trust here can now tell me why... **The Scene:** We have several generic mail IDs with procmail setup to redistribute mail based on the original recipient. For example, mail sent to generic_ID1 goes to staff1,staff2; mail to generic_ID2 goes to staff3,staff4; et cetera...               GENERIC_ID1_RECIPIENTS="staff1@domain,staff2@domain"          :0     * ^TO.*generic_ID1     ! $GENERIC_ID1_RECIPIENTS      **The Problem:** Mail was being truncated, seemingly at random. The pattern finally discovered showed that it occurred when a sentence ended with a period at column 76 and a hard carriage return: not at column 75 or 77; not at column 76 with more text to follow on that same line. Any text following that period was lost. Addendum: we've just seen it reoccur (and reproduced it) with a period at column 226. I am gobsmacked. I am able to confirm that procmail receives the message whole by copying the message before redelivery:               :0c                       # note: 'c'     * ^TO.*generic_ID1     ! $GENERIC_ID1_RECIPIENTS      I believe that sendmail may be truncating it upon redelivery but I'm unsure how to diagnose or prove that (I am not a sendmail admin, just a procmail user). The problem is entirely reproducible. **The Questions:** Why is this happening and how can I fix it? Much thanks. **EDIT: Updated title and tags. The solution is in the comments.**


title: How to parse a file to extract 3 digits numbers kept in a "group number"

text: I am a beginner, and trying to write a shell script to parse a text file that is extracted from a standardization pdf file. I would like for each test group (identified by Group 0, Group 1... to get the list of test numbers, such as 101, 102, 412... for group 0. I have tried sed, awk, but I do not have sufficient skills to succeed. Ideally I would like to get the output translated into LaTeX code, ie each output item surrounded by a suitable string, such as               \section{Group0}     \Testdetails{101}     \Testdetails{102}     ...............     \section{Group1}     \Testdetails{305}     ................      This is the source file.                                                               Table 6                                 Tests                     EN 2591-                   Remarks                                                                      All models      Group 0      Visual examination                                101      Examination of dimensions and mass                102      To be performed on one pair per layout, in                                                                 sealed and un-sealed versions      Contact insertion and extraction forces           412      To be performed on one pair per layout, in                                                                 sealed and un-sealed versions      Measurement of insulation resistance              206      Only specimens of group 6      Voltage proof test                                207      Only specimens of group 6      Contact resistance - Low level                    201      Contact resistance at rated current               202      Mating and unmating forces                        408      On specimens of groups 2, 4 and 6      Visual examination                                101      Group 1      Rapid change of temperature                       305      Visual examination                                101      Interfacial sealing                               324      Measurement of insulation resistance              206      Immersed connectors      Voltage proof test                                207      Immersed connectors      Insert retention in housing (axial)               410      Contact retention in insert                       409      Mechanical strength of rear accessories           420      Contact retention system effectiveness            426      (removable contact walkout)      Visual examination                                101      Group 2      Contact retention in insert                       409      Rapid change of temperature                       305


title: How do I apply software patches?

text: I have an application `foobar` for which someone has written a patch to add a feature I like. How can I use the patch?


title: What is the difference between PATH and LD_LIBRARY_PATH?

text: I am having some difficulties understanding the difference between `PATH` and `LD_LIBRARY_PATH`. I have an installation setup that needs a file pkg.tcl and I am not where to add the path to it: should it be to `PATH` or `LD_LIBRARY_PATH`?


title: 32-bit, 64-bit CPU op-mode on Linux

text: I'm confused. Running Fedora Linux, `lscpu` yields:               Architecture:            i686     CPU op-mode(s):          32-bit, 64-bit     ...      But when I try to install a 64-bit program (Chrome) I get error like: > Package /....x86_64.rpm has incompatible architecture x86_64. Valid > architectures are ['i686', 'i586', 'i486', i386'] I'm less interested in being able to install Chrome and more interested in why `lscpu` says that my CPU can run in 64-bit mode; clearly this can't mean I can run 64-bit programs. Can anyone clarify?


title: Linux efficient command to find if 32 bit/64 bit

text: I am trying to figure out the list of possible ways to find out if a Linux machine is 32 bit or 64 bit. **Method 1:** The command **uname -m** will specify if my machine is 32 bit or 64 bit. **Method 2:** I can run the command **getconf LONG_BIT** to find if it is 32 bit or 64 bit. **Method 3:** I can check for the lm bit in the /proc/cpuinfo file. If that bit is not set, then I can say my machine is a 32 bit machine. Which of the above methods is the more accurate way of telling if my machine is a 32 bit machine or 64 bit machine? Or is there any other efficient way/command to find out the same?


title: Stuck on installing grub to a usb stick (unknown filesystem/no such partition)

text: I just spend all day on trying to get my system to boot again, I'm getting a bit desperate...snif. The setup is as follows:   * a debian installed in a luks encrypted usb hard disk with lvm volumes for system and swap   * a usb stick with an ext partion for /boot, with grub installed to the mbr of this stick Ok, so I was stupid enough not to have a backup of the usb stick and now I lost it. So I set off recreating /boot on another stick with great difficulty. This is what I have so far booting from a live cd:               # mount everything so we can chroot     vgchange -a y     mount /dev/lvm/system /mnt          # the stick for /boot     mount /dev/sdf1 /mnt/boot     mount -o bind /dev     /mnt/dev     mount -o bind /dev/pts /mnt/dev/pts     mount -o bind /proc    /mnt/proc     mount -o bind /sys     /mnt/sys          chroot /mnt          # get some kernel files in boot     rm /initrd.img     dpkg -i /var/cache/apt/archives/linux-image3.xxxx.deb          apt-get purge   grub-pc     apt-get install grub-pc          # here is the first problem. The usb stick I formatted with palimpsest      # (mbr) and created an ext2 primary partition on it. Grub complains that      # 'your embedded area is exceptionally small, core.img won't fit in it..'          # start over:     fdisk /dev/sdf     o (reformat with dos partition table)     n (new partition)     1 (partition number 1)     2 (set the starting cylinder to 2 in order to have more space behind mbr)     +100MB (size)     w (write results          mkfs -t ext2 /dev/sdf1          # now grub installation works.      When I reboot, I do get grub, but drops to rescue mode with unknown filesystem               >insmod ext2     >ls     hd0 (have nothing but the usb stick on this machine)     >ls hd0     unknown filesystem     > ls (hd0,0/1/msdos1)     all give: no such partition         I have been faffing around for hours now, trying on other machines, trying to change /boot/grub/device.map mainly with /dev/disk/by-id/xxx:0 and xxx:0-part1. No avail, wherever I boot all disks are "unknown filesystem", and all attempts to check a partition give "no such partition" both on the usb stick and on other drives in the machines I test on. The problem is that I don't find any details about the inner workings of grub. I don't even know if device.map is read on boot at all, or if that plays only by the time grub.cnf is being parsed (and thus /boot/grub has already been found). I have the impression that nothing is being read from my stick except the core.img right after the mbr, however I have no idea how core.img knows which partitions to boot from, is that hardcoded in on install? Is the device.map thus important to get right on running grub-install? I also don't know if the partition should be bootable, I suppose not since grub is installed to the drive, but I find little info about all these more detailed issues. Any ideas to get this working are greatly appreciated.


title: OpenBSD X, mouse only scrolls down

text: I just got a new OpenBSD 4.8 instance up and running with Xfce. The only issue I'm having is that the mouse wheel only ever scrolls down. When I physically scroll up, X scrolls down. When I do scroll up X seems to page down, as it scrolls much more area than when I scroll down.


title: Terminal not displaying correctly after quitting Xorg

text: I am running a fresh arch-linux install (as of 17/07/12) with the ATI catalyst drivers (as mentioned on the wiki page). When I run `xinit`, everything works fine and looks great but when I exit the xsession it doesn't return me to the standard bash terminal correctly. Instead I get what appears to be the top left quarter of the original terminal which is unresponsive apart from the occasional visual corruption when I press keys. What can I do to fix this? **EDIT:** Using `Ctrl`+`Alt`+`F1` shows the same thing.


title: equivalent to Ubuntu's apport-bug in Fedora or Mint?

text: What is the Fedora equivalent to the Ubuntu command apport-bug to submit bug reports? In Ubuntu, one can use:               apport-bug <package-name>      For example:               apport-bug xorg      To submit bug reports that include all the logs and relevant information about the system. What is the equivalent in Fedora? How about Mint?


title: Bash Script Argument Regex Group Conflict

text: I have a simple bash script:               input_dir="`dirname $1`/`basename $1`/"     output_dir="`dirname $2`/`basename $2`/"     ext=$3     ...     ...     ...     echo -n `rename "-f" "'s/.*([0-9]{11}_[0-9]{11}).*\.(.*$)/$1.$2/'" "$output_dir"*.$ext`      The problem is that it does not work because the match groups `$N` conflict with command line arguments to the script. How can I solve this?


title: why would typing Ctrl+c twice stop a running process in Linux?

text: There are Linux programs, for example vlc, that recommend typing `ctrl`+`c` twice to kill their execution from a terminal if the program didn't stop after the first one. Why would typing `ctrl`+`c` twice work when the first time didn't work?


title: Can I spoof the MAC address in Android?

text: Is it possible to spoof the MAC address of the wireless interface using `wpa_supplicant.conf` in Android when I connect as a client to an access point? **Edit** Unfortunately, Android doesn't support               ifconfig eth0 hw ether 00:00:00:00:00:00      I've been using               ip link set eth0 address 00:00:00:00:00:00      but that only works temporarily. After I disconnect and reconnect to the access point, the mac resets itself.


title: Bash script to find and kill a process with certain arguments?

text: I want a script which kills the instance(s) of `ssh` which are run with the -D argument (setting up a local proxy). Manually, I do `ps -A | grep -i ssh`, look for the instance(s) with -D, and `kill -9 {id}` each one. But what does that look like in bash script form? (I am on Mac OS X but will install any necessary commands via `port`)


title: How to view a TTF font file?

text: Is there an application to simply preview a font from a TTF file without installing it?


title: How to remove LiveCD after installing OS on VirtualBox?

text: After going through the process of installation of a Unix OS (in this case Mageia) on VirtualBox 4.08, the next step is to remove the LiveCD. Since the LiveCD is virtual, how should one proceed to remove it? Deleting the ISO does not seem like a clean way to do this. Should the setting be changed in the storage section? ![enter image description here](http://i.stack.imgur.com/pYjGd.png)


title: More doubts in bzImage

text: The description of the `bzImage` in Wikipedia is really confusing me. ![alt text](http://i.stack.imgur.com/JXbyA.png) The above picture is from Wikipedia, but the line next to it is: > The bzImage file is in a specific format: It contains concatenated > bootsect.o + setup.o + misc.o + piggy.o. I can't find the others (`misc.o` and `piggy.o`) in the image.   I would also like to get more clarity on these object files. The info on this post about why we can't boot a `vmlinux` file is also really confusing me. Another doubt is regarding the `System.map`. How is it linked to the `bzImage`? I know it contains the symbols of `vmlinux` before creating `bzImage`. But then at the time of booting, how does `bzImage` get attached to the `System.map`?