title: Installing pyside on Fedora 19

text: I'm trying to install pyside from source on Fedora 19. Running `sudo python setup.py bdist_egg --version=1.2.0 --qmake=/usr/lib64` gives:               HEAD is now at 92062bc... Version bump to 0.2.14     Checking out submodule pyside-examples to branch master     Running process: git checkout master     Already on 'master'     Removing /home/andreas/pyside-setup/pyside_package     running bdist_egg     running build     Python architecture is 64bit     error: Permission denied      And without sudo:               Traceback (most recent call last):       File "setup.py", line 228, in <module>         rmtree(d)       File "/home/andreas/pyside-setup/utils.py", line 280, in rmtree         shutil.rmtree(dirname, ignore_errors=False, onerror=handleRemoveReadonly)       File "/usr/lib64/python2.7/shutil.py", line 247, in rmtree         rmtree(fullname, ignore_errors, onerror)       File "/usr/lib64/python2.7/shutil.py", line 256, in rmtree         onerror(os.rmdir, path, sys.exc_info())       File "/home/andreas/pyside-setup/utils.py", line 276, in handleRemoveReadonly         os.chmod(path, stat.S_IRWXU| stat.S_IRWXG| stat.S_IRWXO) # 0777     OSError: [Errno 1] Operation not permitted: '/home/andreas/pyside-setup/pyside_package/PySide'


title: File encryption and decryption on Linux using ucrypt

text: A few years back, I was using the `ucrypt` utility on CentOS 5. Now I am using Fedora 11 and need `ucrypt` for file encryption and decryption, but I don't have a backup of the old system. Where can I find `ucrypt` now?


title: wget to get all the files in a directory only returns index.html

text: I'm new to using bash, and I have been trying to `wget` all the files from a website to the server I have been working on. However all I'm getting back is an `index.html` file. I let it run for 15 minutes and the index.html file was still downloading so I killed it. Might my files be download after the `index.html` file? Here is the code I have been trying:               wget --no-parent -R index.html -A "Sample" -nd --random-wait -r -p -e robots=off -U Mozilla --no-check-  certificate http://somewebsite.com/hasSamples/Sample0      I'm trying to download all the files in a subdirectory that starts with Sample. I have searched quite a bit on the internet to find a resolution, and at this point I'm stumped. I probably just haven't found the right combinations of options, but any help would be much appreciated. Here is my understanding of the code: `\--no-parent` means don't search parent directories   `-R index.html` means reject downloading the index.html file, I also tried "index.html*", but it still downloaded it anyway   `-A "Sample"` kind of acts like a Sample* would in bash   `-nd` means download the files and not any of the directories   `\--random-wait` to make sure you don't get blacklisted from a site   `-r` recursively downloads   `-p` not sure really   `-e robots=off` ignores robot.txt files   -`U Mozilla` makes the user look like its Mozilla I think   The `\--no-check-certificate` is just necessary for the website.


title: How do I import wifi passwords into Fedora 19 (gnome3.8)

text: I've upgraded from Fedora 17 to Fedora 19 and would like to transfer my wifi passwords. In Fedora 17 they were stored in `~/.gnome2/keyrings/` whereas in Fedora 19 they are stored in `~/.local/share/keyrings/`. Can I just copy the `login.keyring` and `user.keystore` files to the new location or is there more involved?


title: How do I make my laptop sleep when it reaches some low battery threshold?

text: I'm using Ubuntu, but I have i3 as my window manager. Under i3, when my battery reaches 0%, the computer will just abruptly shut down, no warning or anything. Is there a simple script or configuration I can set up so that it goes to sleep at, say 4% battery?


title: Debian Squeeze apt-get update issue with HWRAID repositories

text: I'm running an inherited Debian Squeeze server (read: I just got this new job and the server was setup by the last guy), and I'm having an issue on the `apt-get`. The error at the end that comes up when doing a `sudo apt-get update` is `W: GPG error: http://hwraid.le-vert.net squeeze Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6005210E23B3D3B4`. I already referred to "no public key available" on apt-get update, but that solution did not work for me (`sudo aptitude install debian-keyring debian-archive-keyring`). What else can I try? Where should I look next?


title: Environment of another user in a child process

text: I have a parent process running as 'root' user. After `fork()`, `execl()` and `setuid()/setgid()`, the child process is started as another OS user (say user1). Printing the environment shows that this is same as the root environment (as if logging in as root) and not as if logging in as user1. Why? Is there a way to read the environment of user1 in the child process?


title: print last field from line + alternative for awk

text: Due to technical reason on my Solaris machine, I can't use `awk` in order to print the last field in line. What are the other alternatives to `awk` that print the last field from line (using `cut` or `tr` ...etc)? Example 1:               /usr/bin/hostname     machine1b     /usr/bin/hostname  | /usr/bin/sed 's/\(.\{1\}\)/\1 /g' |  /usr/bin/awk  '{print $NF}'     b      Example2               echo 1 2 3 4 5 | /usr/bin/awk  '{print $NF}'          5


title: how to make logstash read kannel log

text: I got logstash installed on ubuntu 12.04 using the apt repository. But logstash is not reading any document. In logstash log there are teh following:               {:timestamp=>"2014-08-01T22:06:09.722000+0000", :message=>"failed to open /var/log/kannel/smsbox.log: Permission denied - /var/log/kannel/smsbox.log", :level=>:warn}      I have checked the permissions on the file :               $ ls -lh /var/log/kannel/smsbox.log     -rw-r----- 1 kannel adm 42M Aug  2 00:14 /var/log/kannel/smsbox.log      So I have added logstash user to adm group `usermod -a -G root logstash` and that didn't change anything. I have even added it to root but it still doesn't work. I am actually out to question.


title: zone delegation in Bind

text: I have a lot of zones defined in my DNS server. I need to delegate one particular zone to a foreign DNS server and I don't have access to my domain- registrar control panel, currently. Is there a way in Bind to delegate the resolution of a whole zone to another DNS server? I thought it was possible to just name the foreign server `ns1.delegatenameserver.com` in the zone file but it's not working.               $TTL 3600     @               IN SOA ns1.delegatednameserver.com. hostmaster.ariel.org. (                             2013120904      ;serial                             3600            ;refresh                             360             ;retry                             86400           ;expire                             3600            ;minimum                     )                          IN NS           ns1.delegatednameserver.com.


title: Linux flavor for beginners

text: I bought a new notebook (HP Probook 4530s - i5, 4gb RAM) which has just DOS on it. The idea is to install a flavor of Linux which can serve as an alternative to Windows for my regular work (software development and net surfing) plus gives me a chance to learn the "coolest OS ever", as a kid in my company calls it (he's suggesting that I go for Debian, BTW). What distro should a beginner use?


title: Udev rule is not being used?

text: I'm setting up `udev` to handle my external USB hard drive when it gets plugged in and removed (no mounting yet). So far, I've made two new rules in `/etc/udev/rules.d/10-local.rules` to log adding/removing the disk to a file:               SUBSYSTEM=="block", ATTRS{model}=="2AS", ACTION=="add", RUN+="/bin/echo 'inserted lacie' >> /home/herman/udev_file"     SUBSYSTEM=="block", ATTRS{model}=="2AS", ACTION=="remove", RUN+="/bin/echo 'removed lacie' >> /home/herman/udev_file"      I have started the `udevd` daemon and re-plugged the hard drive several times, but `/home/herman/udev_file` is never created . In the rules I've used keys from the command `udevadm info -a -n /dev/sdb` which is the hard drive in question. What am I doing wrong here? The disk is being detected and I'm able to `mount` it just fine. Any help appreciated.


title: DD with a specific pattern

text: I was watching this Defcon video and around 4:30 he shows a custom pattern of drive wiping — the drive is filled with a constant text pattern. Whether he is joking or not, is this possible? How would it be done using Linux's `dd` command?


title: Understanding partition table with sda1 sda2 sda5

text: I just inherited a system and I am trying to understand it's partition table for the hard drive. (I'm new to this)               machine:~# fdisk -l /dev/sda          Disk /dev/sda: 250.0 GB, 250000000000 bytes     255 heads, 63 sectors/track, 30394 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000080             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *           1       30064   241489048+  fd  Linux raid autodetect     /dev/sda2           30065       30394     2650725    5  Extended     /dev/sda5           30065       30394     2650693+  fd  Linux raid autodetect      Why does the numbering go from 1 to 2 to 5. "What is on" sda2 and sda5?


title: How to run Emacs nnrss-* commands

text: Specifically, I want to run `nnrss-opml-import` command, which should import an OPML file. Trying to run the command with `M-x nnrss-opml-import` tells me the command doesn't exist. I want to experience reading RSS feeds from Emacs. This is Debian, running Emacs 24.


title: How to boot after RAID failure (software RAID)?

text: Previously I had a software raid set up using (`mdadm`) of drives `sda` and `sdb`. `sdb` failed and the only way to reboot the system was by unplugging the second hard drive. Now I've added fresh `sdb` and `sdc` to my RAID setup. `sda` is the oldest (so most likely to fail) and it is the drive from which we boot (I think, how can I check?). How can I ensure and test (through GRUB configuration, etc.) that if `sda` fails, I will still be able to boot my machine. `fdisk -l`:               Disk /dev/sda: 250.0 GB, 250000000000 bytes     255 heads, 63 sectors/track, 30394 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000080             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *           1       30064   241489048+  fd  Linux raid autodetect     /dev/sda2           30065       30394     2650725    5  Extended     /dev/sda5           30065       30394     2650693+  fd  Linux raid autodetect          Disk /dev/sdb: 500.1 GB, 500107862016 bytes     255 heads, 63 sectors/track, 60801 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1   *           1       30064   241489048+  fd  Linux raid autodetect     Partition 1 does not start on physical sector boundary.     /dev/sdb2           30065       30394     2650725    5  Extended     /dev/sdb5           30065       30394     2650693+  fd  Linux raid autodetect     Partition 5 does not start on physical sector boundary.          Disk /dev/sdc: 500.1 GB, 500107862016 bytes     255 heads, 63 sectors/track, 60801 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000             Device Boot      Start         End      Blocks   Id  System     /dev/sdc1   *           1       30064   241489048+  fd  Linux raid autodetect     Partition 1 does not start on physical sector boundary.     /dev/sdc2           30065       30394     2650725    5  Extended     /dev/sdc5           30065       30394     2650693+  fd  Linux raid autodetect     Partition 5 does not start on physical sector boundary.          Disk /dev/md0: 247.3 GB, 247284695040 bytes     2 heads, 4 sectors/track, 60372240 cylinders     Units = cylinders of 8 * 512 = 4096 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Alignment offset: 512 bytes     Disk identifier: 0x00000000          Disk /dev/md0 doesn't contain a valid partition table          Disk /dev/md1: 2714 MB, 2714238976 bytes     2 heads, 4 sectors/track, 662656 cylinders     Units = cylinders of 8 * 512 = 4096 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Alignment offset: 512 bytes     Disk identifier: 0x00000000          Disk /dev/md1 doesn't contain a valid partition table


title: How do you create a file with an empty name?

text: I don't know how, but I created a file with an empty file name, I doubt there was a whitespace there (I'll explain why at the end):               chaouche@karabeela /mnt/ubuntu/storage $ ls     total 352K     drwx------  3 chaouche chaouche 4.0K Feb 12 11:00     drwxr-xr-x  4 chaouche chaouche 4.0K Apr 14 23:13 AUDIO     drwxr-xr-x  5 chaouche chaouche 4.0K Jul 20 22:25 BACKUPS     -rw-r--r--  1 chaouche chaouche 310K Jun 15 13:00 cv_yassine_chaouche_2012.pdf     drwxr-xr-x  2 chaouche chaouche 4.0K Jun 10 22:16 Mageia-3-i586-DVD     drwxr-xr-x  5 chaouche     1001 4.0K Oct 12  2012 MUSIQUE     drwxr-xr-x 15 chaouche chaouche 4.0K Oct 27  2012 PARISVIII     drwxr-xr-x  6 chaouche chaouche 4.0K Jun 12 18:33 SABAYON     drwxr-xr-x  5 chaouche chaouche 4.0K Jun 15 13:23 SIFTECH     drwxr-xr-x  5 chaouche chaouche 4.0K Feb  6 15:11 TOILES     drwxr-xr-x  4 chaouche chaouche 4.0K Jul 17 17:21 VIDEOS     chaouche@karabeela /mnt/ubuntu/storage $      I asked on #linux how to remove the file and a person suggested I moved all other files away then use the tab completion, which gave a very interesting behaviour :               # with tab completion     chaouche@karabeela /mnt/ubuntu/storage $ ls /     total 45M     -rwxr-xr-x  1 chaouche chaouche  34M Jan 16  2013 inkscape-0.48.4-1-win32.exe     -rwxr-xr-x  1 chaouche chaouche 8.6M Feb  4 11:42 mypaint-1.0.0-win32-installer.exe     -rwxr-xr-x  1 chaouche chaouche 2.7M Jan 17  2013 pdftkb_setup.exe          # without tab completion, wrote "/" by hand     chaouche@karabeela /mnt/ubuntu/storage $ ls /     total 212K     -rw-r--r--   1 root root    0 Apr 15  2012 1     drwxr-xr-x   2 root root 4.0K Dec  9  2012 bin     drwxr-xr-x   3 root root 4.0K Jun 15 12:10 boot     -rw-------   1 root root  74K Jul  1  2011 dead.letter     drwxr-xr-x  19 root root 4.2K Jul 20 20:14 dev     drwxr-xr-x 117 root root  12K Jul 20 21:30 etc     drwxr-xr-x   4 root root 4.0K Jun 12 18:40 home     drwxr-xr-x   2 root root 4.0K Jun  8  2011 initrd     drwxr-xr-x  20 root root  12K Dec  9  2012 lib     drwx------   2 root root  16K Jun  7  2011 lost+found     drwxr-xr-x   4 root root 4.0K Jul  3 01:56 media     drwxr-xr-x   9 root root 4.0K Apr 15 00:06 mnt     drwxr-xr-x   8 root root 4.0K Jun 30 23:19 opt     dr-xr-xr-x 198 root root    0 Jun 15 13:10 proc     drwxr-x---  28 root root 4.0K Jul 20 21:42 root     drwxr-xr-x   2 root root  12K Dec  9  2012 sbin     drwxr-xr-x   2 root root 4.0K Apr  3  2011 srv     drwxr-xr-x  12 root root    0 Jun 15 13:10 sys     -rw-r--r--   1 root root    0 Jun 12 18:40 thisismageia     drwxrwxrwt  69 root root  36K Jul 20 22:04 tmp     drwxr-xr-x  14 root root 4.0K Nov  6  2011 usr     drwxr-xr-x  18 root root 4.0K Jul  2  2011 var     chaouche@karabeela /mnt/ubuntu/storage $      If there was a whitespace in the filename it would have been replaced by \" " when I hit the tab key, but it didn't.


title: How does one install a camera driver from a c file, and what is this driver doing?

text: I need to install a driver for a MT9M032 CMOS Image Sensor USB machine vision camera made by Aptina (formerly Micron). I am working on a Macintosh running OS X 10.9.1 and am new to Linux/Unix when it comes to this sort of thing. When one comes across a c-file for a camera driver (see driver below), how does one go about installing it? What exactly is the driver doing to my system such that it will now recognize the camera? https://github.com/dorimanx/Dorimanx-SG2-I9100-Kernel/blob/master-jelly-cm- aokp/drivers/media/i2c/mt9m032.c Please also see the conversation below regarding a patch of the driver: https://linuxtv.org/patch/10062/ The bottom line is my computer does not recognize the camera, and I know that drivers have been written (i.e. see above driver for MT9M032 CMOS Image Sensor from Micron). If you think there is a better approach I should be taking please let me know.


title: Vim - Get Current Directory

text: I'm currently adding a little bit of Git functionality to my menu.vim file, and for using a certain command (Gitk) I need to find out Vim's current directory. How does one do that and include it in a command? (i.e. `:!echo "%current- directory"`) * * * I'll admit here that I asked the wrong question - but I figured it out. I'm currently using these in my menu.vim:               function g:Gitk()       :!cd $(dirname %); gitk     endfun          function g:GitGui()       :!cd $(dirname %); git gui     endfun


title: How to get hashed password in /etc/shadow using getpwnam()?

text: Apparently there is a function (getpwnam) that given a username, will return the appropriate entry in `/etc/passwd` with the other details for that user (shell, uid, gid, etc.). However, I have no idea how to get that function working with the shadow password file (`/etc/shadow`). Is this possible? If it helps, the application will be running as `root`.


title: Setenv error message

text: When I opened up the Gnome command prompt, several lines of the message: > No command 'setenv' found, did you mean command 'netenv' from package > 'netenv' (command) However, I have never used such command before. It's just I installed a software through Gnome.


title: How to restrict internet access for a particular user on the lan using iptables in Linux

text: Let's say there are two users on the LAN, A and B. How do I restrict user A from internet access using iptables rules and saving the rules so that after reboot, they are still effective. And suppose I want to grant that user access at some point, How to enable it again. I am using Ubuntu Linux 10.04. It would be nice if anybody show me how to do it from the command line, as I often login to the machine using a local ssh login. thanks in advance.


title: How to create a new user with restricted network access

text: I want to create a new user (or group), so that any application running with this user can't connect to the network. @Michael Kjörling I have followed your suggestion(with Ubuntu 12.04 64bit) and got some error information:               $ sudo iptables -A OUTPUT -m owner --uid-owner xyz ! -i lo -j REJECT --reject-with network-unreachable     iptables v1.4.12: unknown reject type "network-unreachable"     Try `iptables -h' or 'iptables --help' for more information.          $ sudo iptables -A OUTPUT -m owner --uid-owner xyz ! -i lo -j REJECT      iptables v1.4.12: Can't use -i with OUTPUT          Try `iptables -h' or 'iptables --help' for more information.     $ sudo iptables -A OUTPUT -m owner --uid-owner xyz ! -j REJECT      iptables v1.4.12: cannot have ! before -j     Try `iptables -h' or 'iptables --help' for more information.      Finally, the following one works. But I'm not sure if there is anything wrong.               $ sudo iptables -A OUTPUT -m owner --uid-owner xyz -j REJECT      $


title: How to block all the network traffic from my running user

text: How to block all the network traffic from one user? But other users are alive to the network that the blocked user is able to connect to other users who have the permission to the internet.


title: What is the point of ls -f (or, why is this hanging?)

text: I've got a directory with about 100,000 files in it. ls -f hangs for over a minute. I ran strace, and immediately started seeing getdents, so ls is clearly reading the directory. I also see a lot of calls to brk, so ls is clearly buffering things in memory. I wrote a simple program that calls readdir and outputs filenames, and it responds immediately. But ls -f does not provide output. What gives? I thought the whole point of -f is that it causes ls to do nothing more than readdir. Is there a portable, reliable way to list the contents of a directory? (Note, this is ls from gnu's coreutils on Linux.) -EDIT- There was an alias in place, but "/bin/ls -1f > /dev/null" takes 8 to 15 seconds, "/bin/ls -1fx > /dev/null" takes 4 to 11 seconds, but a simple program that just does readdir takes .011 seconds. What do I need to do to make gnu ls not suck?


title: How do I create web pages in my home directory and have the web server serve them in my web browser?

text: I have recently installed the Apache web browser in my Debian Squeeze (using command `tasksel` and selecting `[ ] Web server`). Now I get it to start via `sudo /etc/init.d/apache2 start` and then I go to my browser and key in `http://localhost` and the " **It works!** " page shows up indicating that I have installed and started the web server successfully. Now I know that the HTML file for the " **It works!** " page is in `/var/www` and I am led to beleive that if I do create new pages, I need to stuff them into this directory. Creating pages would be easy but in doing so, I need to issue the `sudo` command each and every time I create/edit a file under the `/var/www` directory. I would like to know how I can create a directory in my HOME e.g. `~/html/test/index.html` and have that page displayed when I enter the address `http://localhost/html/test` in my browser address?


title: Need Advice: What Linux distro should I install on an old PowerPC Mac

text: I'm trying to set up my brother (who has a PPC Mac, with 1 ghz processor and 256 ram) with a Linux distro that would allow him to surf the web on the device. Support has faded for the new browsers, rendering the device essentially useless when it comes to the web. Ideally I would have installed jolicloud, but alas, it is only Intel Mac compatible. Which distros still continue support for PowerPC?


title: How can I disable /proc pseudo-filesystem on a shared Linux environment?

text: Is it possible to disable the `/proc` pseudo-filesystem to prevent `w`, `ps`, `top`, etc, from showing what other users are doing? Of course, I still want "everything else" to work correctly. Is there a workable way to do this?


title: File system CRC check

text: I know that before running the kernel, u-boot (the boot loader) will check the kernel image CRC. Only if it is correct it will go further, else it will give a `"Bad CRC"` error. I want to do same thing for file system too.   1. Is there any way to do that?   2. Does the kernel check whether file system is proper or not before loading it? If yes, where is this check done? **Update:** I am using jffs2 file system. Is it possible to check CRC of this type of file system? Or any other way to make sure that the jffs2 file system is not corrupted ?


title: Console based torrent client supporting magnet link?

text: https://en.wikipedia.org/wiki/Magnet_URI_scheme OS: OpenBSD/Linux. Are there any torrent clients that support magnet links? It's an important thing that they need to be console-based only!


title: Bash: split list of files into different files?

text: I have several files in a directory like:               data1.dat     data2.dat     ....     data24678.dat          To run another code, I need to have a text file with the names of the files but I need to split in 50 files per text file, like: File1.txt :               /PATH/OF/FILE/data1.data     /PATH/OF/FILE/data2.data     /PATH/OF/FILE/data3.data     ......     /PATH/OF/FILE/data50.data      File2.txt :               /PATH/OF/FILE/data51.data     /PATH/OF/FILE/data52.data     /PATH/OF/FILE/data53.data     ......     /PATH/OF/FILE/data100.data      any idea?? I was trying like:               ls -1 | xargs -n 50 >> File1.txt      but I don't know who to select each "item" in the xargs command. Thanks!!


title: How to alter stored procedure in a MySQL database using the Linux command prompt?

text: I want to alter the stored procedure in my server machine. I'm uploading the codes via SSH Linux command prompt, I need to alter an existing stored procedure in my server. I don't have c-panel or phpMyAdmin access. I have to update it via a command prompt. ### stored procedure               DELIMITER $$          USE `dbname`$$          DROP PROCEDURE IF EXISTS `add_data`$$          CREATE DEFINER=`root`@`localhost` PROCEDURE `add_data`(         f_id INT(11),          f_guild_parent_id INT(11),OUT lastid INT         )     BEGIN          INSERT INTO tablename              (              id,              character_detail_id,              media_id,              )              VALUES               (               f_id,              f_character_detail_id,              f_media_id,              NOW() ,              NOW()                );               SET lastid = LAST_INSERT_ID();         END$$          DELIMITER ;      I need the command to perform this. Can any one give me the command with an example?


title: Failed to load VMMR0.r0 (VERR_SUPLIB_OWNER_NOT_ROOT)

text: when I try to start a `vm` in `Virtualbox`, I get the error in the title message. I have already checked `/usr/lib/virtualbox/VMMR0.r0` and the permissions are               -rw-r--r-- 1 root root 785K Sep 21  2013 /usr/lib/virtualbox/VMMR0.r0      What other things will cause this error, and what other things can I try?


title: Installing multiple packages with one yum command

text: Is there a way to install 2 or more packages using one yum command               yum install mysql php vsftp


title: Why won't my bash script exit after execution?

text: I compiled a short bash one-liner to focus a running application or launch it if it isn't running:               #!/bin/bash     #intellilaunch.sh          wmctrl -a $1 || $1 & disown     exit 1      The command exits perfectly fine when run directly from the command line:               :~$ wmctrl -a firefox || firefox & disown     [1] 32505      A quick check with the system monitor shows that only firefox is running. However, when I launch firefox via the script (`./intellilaunch.sh firefox`) it spawns a persisting new process called `intellilaunch.sh firefox`, which only exits after closing firefox. What am I doing wrong? **Edit** : I modified my script according to michas' suggestion:               #!/bin/bash          program=$(basename $1)          if ! wmctrl -a "$program"; then       "$1"&     fi      Not a one-liner anymore but it works perfectly fine now!


title: When to use BIND vs internal DNS for Samba 4 backend

text: The docs say, "Bind as DNS backend is recommended, if you plan setup a complexer DNS setup, than the Samba **4** internal DNS currently made possible." What exactly is the threshold for "a complexer DNS setup"? I plan to use this on a small business network's CentOS 6.4 server for Internet access and to allow the main server to be accessed via http by a few different names and IP addresses. (We currently have a Windows server set up to do this task and are migrating.) Does this count as complex enough to require Samba's internal DNS, or would it be better to install BIND? For the record I am using Samba 4 as an AD DC with NetBIOS disabled, as I have it in Windows.


title: Kernel can't find /dev/sda file during boot

text: I configured a gentoo kernel (kernel-2.6.36-gentoo-r5), but when I boot it can't mount `/dev/sda1`:               ALERT! /dev/sda1 does not exist . Dropping to a shell .      I use the shell to go to the `/dev` directory, and I find that it have no `sda*` or `hd*` files. However, when I boot into my Debian kernel (vmlinuz-2.6.32-5-686), it can find and mount the `/dev/sda1` partition. What's the problem? How can I fix it? I didn't add any module names to `/etc/modules.autoload.d/kernel-2.6` file to let them auto-load during boot -- is that the cause of the problem?


title: kernel compilation error

text: > **Possible Duplicate:**   >  Kernel can't find /dev/sda file during boot I got the following errors after new kernel compilation (linux-2.6.25.tar.bz2) > mount: could not find filesystem '/dev/root'   >  setuproot: moving /dev failed: no such file or directory   >  setuproot: error mounting /proc: No such file or directory   >  setuproot: error mounting /sys: No such file or directory   >  switchroot: mount failed: No such file or directory   >  kernel panic - not syncing: Attempted to kill init! How to troubleshoot?


title: Make `rm` move to trash

text: Is there a Linux script / application which, instead of deleting files, moves them to a special “trash” location? I’d like this as a replacement for `rm` (maybe even aliasing the latter; there are pros and cons for that). By “trash” I mean a special folder. A single `mv $* ~/.trash` is a first step, but ideally this should also handle trashing several files of the same name without overwriting older trashed files, and allow to _restore_ files to their original location with a simple command (a kind of “undo”). Furthermore, it’d be nice if the trash was automatically emptied on reboot (or a similar mechanism to prevent endless growth). Partial solutions for this exist, but the “restore” action in particular isn’t trivial. Are there any existing solutions for this which don’t rely on a trash system from a graphical shell? (As an aside, there have been endless discussions whether this approach is justified, rather than using frequent backups and VCS. While those discussions have a point, I believe there’s still a niche for my request.)


title: how to change `rm` to as a command like `mv ~/ .trash`

text: I like to use rm but I often made mistakes so that I remove something mistakenly so I want to make somthing like `mv .trash` so that                rm file       is equal to                mv file ~/.trash      besides, I also want to periodically empty the ~/.trash folder then if I have made rm as `mv`, how to empty the ~/.trash folder thanks


title: Dual Boot Linux and Windows 7 with GRUB

text: My Vaio already has Windows 7 and I want to dual boot it with Linux. I was advised to use GRUB (non-legacy). I already created an extended partition aimed at Arch Linux. I am going to install Arch there. As I am a newbie, I had this idea to avoid breaking my system.   1. I install Arch on the extended partition from an external USB Hard Drive. Windows partitions and hard disk MBR should not be touched.    2. I install GRUB onto the MBR of a USB flash drive stick, so I can start my notebook from the USB device and run GRUB menu from there (with the possibility of choosing between Windows or Arch).    3. I make a backup of HDD MBR using `dd`.   4. I copy GRUB onto the hard disk MBR. If I break something I will still boot with method sub 2 and I could restore the MBR backup.  For point 2 I need to store all GRUB config files on the USB stick. Possible? For point 3, I could to start a live Arch from an external USB Hard Drive and the command should be (including partition table):               # dd if=/dev/sdb of=/tmp/mbr.bak bs=512 count=1      Before studying GRUB manual I'd like to know if my strategy is correct or if there are better alternatives.


If I `nano` two files, one of which reads 'this' without me entering a newline, and one of which reads 'is' without me entering a newline, I want to be able to then `cat` the two files together into something like 'thisis'. Instead, the newlines are inserted automatically.               alec@ROOROO:~/$ cat test1 test2 > test3     alec@ROOROO:~/$ cat test3     this     is      So, how can I concatenate two files without adding a newline?


title: Securely allowing users to create accounts

text: 1) I'm struggling to find a secure way to allow new users to create accounts without granting them admin rights to do so. If you already have an account on my system and can work UNIX command line, then you can use programs such as puTTY to access it. I'm currently making a program that lets you visually transfer files back and forth, with a layout similar to dropbox. However, I'd like to add a "Create new user" feature and I'm not sure how to securely do it. Sure, I can have the program execute something like "sudo adduser jim" and supply the sudo password, but this would require me to include an administrative password within the jar file. I know there are obfuscation programs out there, but it doesn't necessarily make it more secure. I'd prefer to create users with ssh, but I'm open to whatever works and is secure. 2) I just thought of something. What if I created an administrative user with a their sudo ability limited to only creating new users? Does this sound like a reasonably secure solution? If so, how should I go about doing this? If not, what are the cons of this method? EDIT: This is my solution so far: assuming I have sanitized inputs I'll make a script that will take the first argument as a username, and the second as the password, then set it's permissions (setuid bit) to be non-writable, and when non-root accounts run it, they are allowed to run this and ONLY this with root privileges. Here is the most basic code so far:               adduser --disabled-password --gecos "" "$1"     echo "$1":"$2" | chpasswd      What do you think? How do you think I can improve it?


eee pc 1025c shows black screen after booting on Ubuntu 10.04 It does work in recovery mode, but not in default mode


title: Skype - not using GTK+

text: I am on a x64 Archlinux running openbox DE and have been strugling for some time now to configure Skype to use my GTK+ theme which i set to Oxygen. I have tried following this wiki as well as this thread and none has worked out for me. I have already installed lib32-gtk-engines package from Archlinux AUR packages site. Still Skype wont change its appearance. The GTK+ theme is set as you can see: ![enter image description here](http://i.stack.imgur.com/8GdGo.png)


title: Why is od calculating decimal values wrong?

text: This question is related to the answer from enzotib to the question: How could I use Bash to find 2 bytes in a binary file, increase their values, and replace? This converts the two bytes into its hex value:               $ echo -n $'\x1b\x1f' | od -tx2     0000000 1f1b     0000002      But now, this should give me the decimal value:               echo -n $'\x1b\x1f' | od -tu2     0000000  7963     0000002      But if I convert the hex value into decimal it should be               $ printf "%d" 0x1b1f     6943      Why is that? Am I using `od` wrong for decimal output?


title: How to create an installable liveCD backup of my system (keep all installed packages but not home directories)

text: What tool should be used to do this? I have taken a look a remastersys but the image it generated wasn't installable. (I could just boot it, and login, although all my packages were installed). If anyone knows a way of getting this image installable please tell me. I also looked at live build which seemed to allow you to customize a liveCD, but not clone an installation. Can anyone reccomend tools to use or guide me through steps to take?


title: wlan is first brought to life when ethernet is plugged in

text: Endless timeouts...         Request timed out.         Request timed out.         Request timed out.         Request timed out.         Request timed out.         Reply from 192.168.1.11: bytes=32 time=105ms TTL=64         Reply from 192.168.1.11: bytes=32 time<1ms TTL=64         Reply from 192.168.1.11: bytes=32 time<1ms TTL=64         Reply from 192.168.1.11: bytes=32 time<1ms TTL=64         Reply from 192.168.1.11: bytes=32 time<1ms TTL=64         Reply from 192.168.1.11: bytes=32 time<1ms TTL=64         Reply from 192.168.1.11: bytes=32 time<1ms TTL=64         Request timed out.         Request timed out.         Reply from 192.168.1.11: bytes=32 time=105ms TTL=64         Reply from 192.168.1.11: bytes=32 time=26ms TTL=64         Reply from 192.168.1.11: bytes=32 time=48ms TTL=64         Reply from 192.168.1.11: bytes=32 time=71ms TTL=64         Reply from 192.168.1.11: bytes=32 time=5ms TTL=64         Reply from 192.168.1.11: bytes=32 time=17ms TTL=64         Reply from 192.168.1.11: bytes=32 time=39ms TTL=64         Reply from 192.168.1.11: bytes=32 time=61ms TTL=64         Reply from 192.168.1.11: bytes=32 time=87ms TTL=64      I'm having a small problem with my debian box (not running any gnome/kde...). I can get the wireless to work, but only if I connect the ethernet cable in for a second or two. Above is my ping result from my workmachine. I turned off the debian box, started the ping and turned the debian box on. I got a endlessly Request timed out untill i plugged in the ethernet. I've then removed the the ethernet cable (the two time outs in the middle there). Wireless is still up after ethernet is removed and I can putty my way in. I'm using `auto wlan0` but I've also tried `allow-hotplug` :-( /etc/network/interfaces)


title: Change server date using PHP

text: Is this possible to change Linux server date using php code? Is there any way to give necessary permissions to Apache to do this? What is the procedure to give root permissions to Apache?


title: Creating a new TLD for private network

text: I want to setup a new TLD (`foo.`) for my the private network so that I can host some child domains which will be accessible from within the network. For this purpose I have setup a DNS server (172.16.100.1) for `foo.`. For this I created a zone file `foo-zonedb.rr` with the following records:               $ORIGIN foo.     $TTL  100     @       IN  SOA ns1.tld.foo. hostmaster.tld.foo (                     2012030701                     900                     300                     300                     600             )     @    300 IN NS ns1.tld.foo.     @    300 IN  A 172.16.143.197     ns1.tld.foo.    300 IN A 172.16.143.197      And also I have added the following entries in `/etc/named.conf`               zone "foo." {                  type master;                  file "foo-zonedb.rr";                  notify explicit;         };      Now suppose every machine on the network uses `172.16.1.1` as their DNS server. What configuration should I have to do on `172.16.1.1` so that it won't redirect DNS request for `foo.` domain to root DNS servers?


title: Rename files by incrementing a number within the filename

text: I have a directory which contains numbered image files, something like this:               01.png     02.png     03.png     03.svg     04.png     05.png     06.jpg     07.png     08.png     09.png     09.svg     10.png      Sometimes there may be multiple versions of a file in different formats (eg. a `png` and `svg` version of the `03` and `09` files above) but the numbers are otherwise consecutive. Typically there are 40-80 such files in each directory. The numbers correspond to the order these images appear in a manuscript (a Word document, but that's not important). There is no other way to determine the order of the images. If I add a new image to the manuscript I need to place a copy of the image in this directory with the correct numbering. So if the new image is the fifth in the manuscript I need to rename the files in the directory to this in order to make room for it:               01.png     02.png     03.png     03.svg     04.png     06.png     07.jpg     08.png     09.png     10.png     10.svg     11.png      What is the most straightforward way from the command line, or from a script or macro to renumber all the files starting at a certain number? I have a standard Fedora Linux install using bash.


title: Making a progressbar with "dialog" from rsync output

text: I'm looking for a way to filter/redirect rsync output in a manner where it can be fed to the "dialog --gauge" command, so I can get a nice looking progressbar during file sync. Currently I have only tested it directly at the prompt, but I'm planning to do this in a (bash) shell script. I have looked around the internet and found bits and pieces, but I'm still missing something to make it work (Disclaimer: This might be a totally wrong approach, and is a redirect/piping monstrosity) What I have currently put together:               rsync -avz --progress -e "ssh" user@server:/home/user/data/ /home/user/data | awk -f /home/user/rsync.awk | sed 's/\([0-9]*\).*/\1/' | dialog --title "My Gauge" --gauge "Hi, this is a gauge widget" 20 70      First I have the actual rsync command with the --progress option Output from rsync is piped into awk and uses the followng awk filter:               {        if (index($0, "to-check=") > 0)        {             split($0, pieces, "to-check=")             split(pieces[2], term, ")");             split(term[1], division, "/");             print (1-(division[1]/division[2]))*100     }     #   else     #   {     #       print "#"$0;     #   }        fflush();     }      This filters out rsync output and provides the percentage in the following format:               53.7037     55.5556     57.4074     59.2593     61.1111     62.963      So to get rid of the decimal numbers, I feed the output to sed:               sed 's/\([0-9]*\).*/\1/'      Which gives the following output:               64     66     68     70     72     74     75     77      Those numbers are piped into dialog like this:               dialog --title "My Gauge" --gauge "Hi, this is a gauge widget" 20 70       As far as I know, "dialog --gauge" etc. should accept this, but it just displays progress to be 0% until it suddenly reaches 100% Can someone point me in the right direction here? Am I far away from a working progressbar? Is there a better way to achieve this? Regards, Christer **EDIT** : After taking @lynxlynxlynx' answer into account, the correct command line is:               rsync -avz --progress -e "ssh" user@server:/home/user/data/ /home/user/data \       | awk -f /home/user/rsync.awk \       | sed --unbuffered 's/([0-9]*).*/\1/' \       | dialog --title "My Gauge" --gauge "Hi, this is a gauge widget" 20 70


title: Installing Linux/NetBSD on an old Sky digibox?

text: I've just been updgraded to Sky+ and I've got an old Sky box (Thomson `286_544` aka Thomson `DSI4212C`). How would I go about installing NetBSD (compatible with nearly everything) on it? Has anyone ever done this?


title: Seperate messages of multiple sshds in syslog-ng

text: Is there a common way of distinguishing between the messages of multiple processes in syslog-ng beside setting different facilities? +1 if filtering and therefore logging in different files would be possible. I have a system setup with two running sshd instances. One is running in a chrooted environment. Since syslog is used, all messages end up in the same logfile. One possibility would be to change the facility of the jailed sshd to something like local0, but I wonder if there is some 'cleaner' way to do this. Installing other syslog daemon, for example rsyslog is not an option here. This question is somehow related to: http://stackoverflow.com/questions/20010873/syslog-process-specific-priority and syslog: process specific priority


title: Passing multiple directories to the -prune option in find

text: I am using `find` to locate and delete backup files but wish to exclude certain directories from the search. The backup filenames could terminate in `.bck`, `bak`, `~`, or `backup`. The Minimal Working Example (MWE) code with only three directories to exclude is:               #! /bin/bash     find . -type d \( -path "./.*" -o -path "./Music" -o -path "./Documents" \) -prune -o -type f \( -name "*.bck" -o -name "*.bak" -o -name "*~" -o -name "*.backup" \) -print0 | xargs -0 --no-run-if-empty trash-put      The syntax `\\( -path "dir1" -o -path "dir2" ... -o -path "dirN" \\) -prune` seems a little clunky, especially if there are around ten directories to exclude, although I have shown only three in the MWE. Is there a more elegant way using either an input file, with the list of excluded directories, or an array- or list-like construct, that could be pressed into service? I am sorry for not being more explicit when I wrote my original question. NB: `trash-put` is a utility that moves the files to the `Trashcan` instead of deleting them [1]. [1]. https://github.com/andreafrancia/trash-cli


title: How to copy from/to the tmux 'clipboard' with shell pipes?

text: When working in a shell environment I run fairly often into the need to copy 'intermediate pipe output' around (eg. from/to already running editors, to other shells, other machines, etc.). When in a windowing environment, an easy (and generic) method to solve this is often via the system clipboard, eg.:   * X11: `... | xsel -i` / `xsel -o | ...`   * OS X: `... | pbcopy` / `pbpaste | ...` How can I get similarly convenient behavior using the tmux copy/paste facility?


title: Not Getting standard boot countdown screen in Dualboot (Linux 6.2 & Windows 8)

text: **Problem** I have installed (Dual Booted) Red Hat 6.2 on a Windows machine ,In windows boot manager it is not showing Linux ,its only showing windows 8 . I am pressing arrow keys but only windows 8 is coming. Any solution to it help me out?


title: viewing dll and exe file properties/attributes vi command line

text: I have a need to see some additional file properties for exe and dll files. If I open windows explorer and add the additional columns to my view, I can see things like Company, Copyright, Product name and Product version when it exists for that file. This data is available via windows explorer so it stands to reason that while the data/string may exist somewhere in the file itself I should be able to extract that information via command line in linux. I've tried using 'strings' but have been met with limited success. Files where I know all the aforementioned data fields I cannot always see with 'strings' I'm hoping that someone may have an alternative solution. Maybe something I haven't thought of yet, to see this information.


title: zerofree verbose returns what?

text: `zerofree -v /dev/sda1` returned   `123642/1860888/3327744`. The man page does not explain what those numbers are: http://manpages.ubuntu.com/manpages/natty/man8/zerofree.8.html I found some code on github: https://github.com/haggaie/zerofree/blob/master/zerofree.c And there's this line:               if ( verbose ) {       printf("\r%u/%u/%u\n", modified, free, fs->super->s_blocks_count);     }      So I guess the middle number was the free space (in kB?), the first one might be the amount that was written over with zeros, and the last one lost me. What do you think?


title: chmod allowing write when I am not setting it

text: I've got a perl script which systematically changes permissions. The first thing the script does is remove all permissions. It does this by calling `chmod`(from perl). I did this as I found the set guid bit wouldn't clear unless I explicitly cleared it:               system('find',             $topdir,             '-exec', 'chmod', 'u-swrx,g-swrx,o-swrx', '{}', ';'     );      I set different permissions for groups and directories. Using `find`, I call it from perl as follows (in this case for directories):               system(         'find',         $topdir,         '-type', 'd',         '-exec', 'chmod', 'g=rx', '{}', ';'       );      Now even though I only set rx, when I check file permissions after the script has finished executing, the scripts appear to have rwx. Is there something I should look out for, as I don't quite follow why this is happening; I don't explicitly set it anywhere. I do set ACLs as well, but they all behave as expected. The only thing of note I see when I check with getfacl is `mask::rwx` and `default:mask::rwx`. Could that be what is causing the problem?


title: openwrt eth2.1 can not receive packets

text: I have network configure:               config interface 'lan'         option ifname 'eth2.1'         option type 'bridge'         option proto 'static'         option ipaddr '192.168.2.1'         option netmask '255.255.255.0'         option macaddr '00:17:a5:00:07:5d'          config interface 'wan'         option ifname 'eth2.2'          config switch         option name 'mt762x'         option reset '1'         option enable_vlan '1'          config switch_vlan         option device 'mt762x'         option vlan '1'         option ports '0 1 2 3 5 6t'          config switch_vlan         option device 'mt762x'         option vlan '2'         option ports '4 6t'      ifconfig:               br-lan    Link encap:Ethernet  HWaddr 00:17:A5:00:07:5D             inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:12 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:0 (0.0 B)  TX bytes:504 (504.0 B)          eth2      Link encap:Ethernet  HWaddr 00:17:A5:70:07:44             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:632 errors:0 dropped:440 overruns:0 frame:0           TX packets:343 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:97202 (94.9 KiB)  TX bytes:11616 (11.3 KiB)           Interrupt:3           eth2.1    Link encap:Ethernet  HWaddr 00:17:A5:70:07:44             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:12 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:0 (0.0 B)  TX bytes:504 (504.0 B)          eth2.2    Link encap:Ethernet  HWaddr 00:17:A5:70:07:44             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)      I ping 192.168.2.2, which is my host. eth2.1 tx is 12, but rx is 0. I'm sure hardware is ok. when i connect to port 0， host can connect the router。


title: Ubuntu live CD keeps on going back to the choice screen

text: I had Ubuntu installed before, but then I decided to switch to Windows 7. I deleted all of the partitions and formatted the drive (via the Windows installation disk). Windows works fine, but now I want to reinstall Ubuntu. When I boot via the livecd, it gives me the options screen, "try Ubuntu without installing", "install Ubuntu" etc. Whenever I try the "try Ubuntu without installing", "install Ubuntu" options, it goes to the Ubuntu loading screen for a bit, then sends me right back to that same decision screen. If I select the last option, "check CD for errors", just goes through what I assume is a check, and then sends me to a screen that says, "press any key to continue". Once I press a key, it sends me back to the decision screen. I've tried using different install disks and re-downloading the ISO (from the torrent file they have on their website and the direct download option). I've even tried Ubuntu Gnome just in case. Same deal. What can I do? I'm assuming it has something to do with the Windows format that I did. Maybe the format wasn't very thorough, and Ubuntu is picking up some remnant information it doesn't know what to do with?


title: How to find which serial port is in use?

text: **The Question:** I plugged in a device (i.e. GSM modem) through a serial port (a.k.a. RS-232), and I need to see with which file in _/dev/_ filesystem this device was tied up, to be able to communicate with it. Unfortunately there no newly created file in _/dev/_ nor an output in dmesg when a device plugged, so this seems to be a hard question. **Background:** I had never worked with a serial devices, so yesterday, when there appears a need in this, and I tried to Google, the Google gave up to find anything helpful. I spent a few hours in seek, and I want to share a found answer as it could be helpful for a someone.


title: What's the exact behaviour of the command: ip address change?

text: I have been fiddling with IPv6 and address lifetimes. I found out that the `valid_lft` attribute will make a v6-address disappear automagically, if used correctly. To extend an address' lifetime I would               ip addr change 1:2:3:4::1/112 dev eth0 valid_lft 86000      The use of `ip addr change` does not appear in any man-page I have access to (Debian,Ubuntu, and online) and also not in the official documentation. I found it in an article referring to an email from 2009 to the ipv6-ops mailing-list. From what I could determine playing around, I guess one can always use `ip addr change` instead of `ip addr add`, because if an address does not exist, `ip` will add one, just if `ip addr add` was used. Is that correct, i.e., can anybody explain what precisely `ip addr change` does and how it differs from `ip addr add`?


title: What's a good way to debug issues with X forwarding over ssh where just some applications won't run?

text: As far as I understand it, X forwarding is usually pretty simple. Once I can run some things like `xeyes` or `gimp` over ssh, complex applications like `firefox`/`iceweasel` should also be able to run. However, I have one notebook from where I can't get a forwarded iceweasel (or icedove) session via ssh and X forwarding. Background info in this question: Newer versions of Mozilla (Iceweasel / Icedove) not working when X forwarding is used Since this may either be a bug in mozialla iceweasel and icedove for new-ish versions, or an issue with X (forwarding) on the one particular notebook, or a feature of X forwarding that's required by just some applications, I feel I need to debug the issue thoroughly. I need advice on how to debug. Things like calling ssh using the verbose option. Log files to look at while calling the nonfunctional X-forwarded applications. There has to be some clue, somewhere.


title: Where are the sound level settings for mplayer saved?

text: This is a followup to Somehow managed to mute mplayer and can't figure out how to restore sound. I've noticed that the sound level settings in mplayer are saved on exit. However, I can't figure out where they are saved. There are config files in the `.mplayer` directory, but none of them are being written to. This is on Debian wheezy with mplayer version `2:1.0~rc4.dfsg1+svn3454`.


title: Removed `rm` command in cygwin

text: Having the need to use a `bash` shell on a Windows computer (I'll spare you the details), I installed Cygwin, and a friend as a joke ran `rm /usr/bin/rm` on the terminal, and surprisingly nothing much happened other than `rm` being removed. Is there any way to get back the `rm` program on Cygwin, or for that matter any distribution of Linux? As far as I know, there isn't any `rm` package on Red Hat or Debian systems I can reinstall.


title: Timezone, Time setting in Linux using shellscript

text: I really need your help on a job of setting timezone and time on a router using Linux OS **remotely from Web** ( Linux OS based on Linux Kernel 2.6.30).   For fulfilling this job, I use CGI and Shellscript. Below are steps:   1. Get Time, Timezone info from Browser    2. Execute CGI to set time (using C)   3. CGI executes Timezone_Setting shellscript Here is what I'm doing for the script in step 3: The parameter($1) is one of the following string (A):   "GMT-12", "GMT-11", "GMT-10",..."GMT", "GMT+1",.. "GMT+12". It seems that I can use the following to set timezone: **`ln -sf /usr/share/zoneinfo/Japan /etc/localtime`** **Questions:**   1) Am I doing the right way?   2) How can I use the command above with my A strings correctly? Note: In the above command, "Japan" is one of the files in my "/usr/share/zoneinfo" directory. And I can do a conversion before using the command like:               "GMT-9" <-> Japan          "GMT-5" <-> EST     ( etc. )      but It seems not the good solution.


title: Console Terminus Font Size in Slackware?

text: I am running Slackware 14.1 mostly from the command line on a 1366x768 monitor (using a vesa mode appropriate for the resolution, 0x34c if it matters, giving me a screen resolution of 1366x768x32 in the CLI) and find the font size of the terminus font I have selected `lat2 terminus16` to be just a little too small to read comfortably. I like the font but would like to use a larger size e.g. 18 or 20. `setconsolefont` displays only that size of the terminus font. How do I install, or if it is already installed, set a larger size for use?


title: Ubuntu 13.04 disconnecting issue

text: Weird situation here. I can download anything I want with no problems whatsoever. As soon as I try to download a torrent via a magnet link, I disconnect from the wireless router after about three minutes. This happens in both Transmission and Deluge. It happens regardless of the torrent. It happens regardless of the site. But go find a random program or 2-hour YouTube video, and there's no problem. I just upgraded from 11.04 (clean install), and I never had this issue before. Anybody have any ideas on what's going on here?


Apache Downloading a lot data, how to find out which script? I host a few sites, i noticed a ton of bandwidth being Downloading (not so much when uploading) when the httpd service is running, when I stop it, so does the heavy download use. and I tried the netstat 80 grep command only to get a endless list of connections. How could I find out what script (lets say a php) is downloading all this data? Running Centos httpd


title: Glob with Numerical Order

text: I have this list of pdf files in a directory:               c0.pdf   c12.pdf  c15.pdf  c18.pdf  c20.pdf  c4.pdf  c7.pdf     c10.pdf  c13.pdf  c16.pdf  c19.pdf  c2.pdf   c5.pdf  c8.pdf     c11.pdf  c14.pdf  c17.pdf  c1.pdf   c3.pdf   c6.pdf  c9.pdf      I want to concatenate these using ghostscript in numerical order (similar to this):               gs -q -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=out.pdf *.pdf      But the shell expansion order does not reproduce the natural order of the numbers but the alphabetical order:               $ for f in *.pdf; do echo $f; done     c0.pdf     c10.pdf     c11.pdf     c12.pdf     c13.pdf     c14.pdf     c15.pdf     c16.pdf     c17.pdf     c18.pdf     c19.pdf     c1.pdf     c20.pdf     c2.pdf     c3.pdf     c4.pdf     c5.pdf     c6.pdf     c7.pdf     c8.pdf     c9.pdf      How can I achieve the desired order in the expansion (if possible without manually adding `0`-padding to the numbers in the file names)? I've found suggestions to use `ls | sort -V`, but I couldn't get it to work for my specific use case.


title: Parallel execution of a program on multiple files

text: I have a small script that loops through all files of a folder and executes a (usually long lasting) command. Basically it's               for file in ./folder/*;     do         ./bin/myProgram $file > ./done/$file     done      (Please Ignore syntax errors, it's just pseudo code). I now wanted to run this script twice at the same time. Obviously, the execution is unnecessary if ./done/$file exists. So I changed the script to               for file in ./folder/*;     do         [ -f ./done/$file ] || ./bin/myProgram $file >./done/$file     done      So basically the question is: Is it possible that both scripts (or in general more than one script) actually are at the same point and check for the existance of the `done` file which fails and the command runs twice? it would be just perfect, but I highly doubt it. This would be too easy :D If it can happen that they process the same file, is it possible to somehow "synchronize" the scripts?


title: Conditional pipeline

text: Say I've got the following pipeline:               cmd1 < input.txt |\     cmd2 |\     cmd4 |\     cmd5 |\     cmd6 |\     (...) |\     cmdN > result.txt      Under certain conditions I would like to add a `cmd3` between `cmd2` and `cmd4`. Is there a way to create a kind conditional pipeline without saving the result of cmd2 into a temporary file ? I would think of something like:               cmd1 < input.txt |\     cmd2 |\     (${DEFINED}? cmd3 : cat ) |\     cmd4 |\     cmd5 |\     cmd6 |\     (...) |\     cmdN > result.txt


title: How to disable mouse-over workspace switcher in Cinnamon?

text: Here is the same question. But I can't find **Enable Edge Flip** option in System Settings => Windows menu to disabling this behavior in Mint 16.


title: How can I add additional resolution for my screen?

text: I tried to launch a game (GTA San Andreas) on wine. GTA showed `Cannot find 800x600x32 video mode` and closed immediately. The Computer I currently have is a Lenovo IdeaPad G510, with Intel HD Graphics 4600 graphical processor. I didn't change anything in wine settings. My OS is Debian 7.5 (wheezy). I googled and got the error `"Cannot find 800x600x32 video mode"` is caused by my graphical card not supporting resolution requested by GTA resolution. I ran `xrandr` command and got:               xrandr: Failed to get size of gamma for output default Screen 0:     minimum 1366 x 768, current 1368 x 768, maximum 1368 x 768 default     connected 1368x768+0+0     0mm x 0mm    1366x768        0.0      1368x768  0.0*      As I can see `800 x 600` isn't an available resolution for my screen.   * Is there any way to add it?   * Should I edit Xorg configuration file, etc. ?


title: growing up with linux scripting and online resource to learn it

text: Is learning Linux shell scripting good for developing own career?I use linux and very much interested in scripting. Where should I start from?


title: What version of bash am I running

text: I tried to change default bash on OS X Mavericks,   * Installed new `bash` trough `brew`,   * run `chsh -s /usr/local/bin/bash`,   * went to "Users and group" made sure that Login shell for my login points to the same, added path to `/etc/shells`, rebooted machine. now `echo $BASH_VERSION`shows `4.2.45(2)-release` but `sh --version` still says `GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)` Which one is true? And if the second one, then what am I doing wrong, why it wouldn't switch to bash I installed?


title: Change elementary os hostname?

text: How do I change my hostname in Elementary OS? I've tried `vi /etc/host` didn't do anything.


title: stop pipe() opening stdin

text: I've currently got code that forks two processes. The first reads a http streaming radio and pushes the data down a pipe (opened with `pipe()` ) for the second process to read, decode and output to the sound card using OSS. I've been trying to debug the decoding part (separate issue) and I've come across a situation where the pipe has a file descriptor of 0 when I print it out. As far as I can tell this means stdin. Is this a known problem with pipe, that it can accidentally open one of the standard file descriptors? If so, how do I get around it? My pipe/fork code is below. There is quite a bit of other code, that I hope is irrelevant.               //this is the "switch channel" loop     while(1)     {                   /*create the pipes         *         * httpPipe is for transfer of the stream between the readProcess and the playProcess         *         * playPPipe is for transfer of commands from the main process to the playProcess         *         * readPPipe is for transfer of commands from the main process to the readProcess         *         */                   if(pipe(httpPipe) == -1)         {             cout << "ERROR:: Error creating httpPipe: " << endl;         }              if(pipe(PlayPPipe) == -1)         {             cout << "ERROR:: Error creating PlayPPipe: " << endl;         }         if(pipe(ReadPPipe) == -1)         {             cout << "ERROR:: Error creating ReadPPipe: " << endl;         }                   cout << "httpPipe:" << httpPipe[0] << ":" << httpPipe[1] << endl;         cout << "PlayPPipe:" << PlayPPipe[0] << ":" << PlayPPipe[1] << endl;         cout << "ReadPPipe:" << ReadPPipe[0] << ":" << ReadPPipe[1] << endl;                   pid = fork();         if(pid == 0)         {             /* we are in the readProcess             *  this process uses libcurl to read the icestream from the url             *  passed to it in urlList. It then writes this data to writeHttpPipe.             *  this continues until the "q" command is sent to the process via             *  readPPipe/readReadPPipe. when this happens the curl Callback function             *  returns 0, and the process closes all fds/pipes it has access to and cleans             *  up curl and exits.             */             rc = 0;                  close(httpPipe[0]);             writeHttpPipe = httpPipe[1];                  close(ReadPPipe[1]);             readReadPPipe = ReadPPipe[0];                  rc = readProcess(urlList.at(playListNum));             if(rc > 0)             {                 cout << "ERROR:: has occured in reading stream: " << urlList.at(playListNum) << endl;                 close(writeHttpPipe);                 close(readReadPPipe);                 exit(16);             }                   }else if(pid > 0)         {             pid = fork();             if(pid ==0)             {                 /* we are in the PlayProcess                  * the playProcess initialises libmpg123 and the OSS sound subsystem.                  * It then reads from httpPipe[0]/readHttpPipe until it recieves a "q" command                  * via PlayPPipe[0]/readPlayPPipe. at which point it closes all fd's and cleans                  * up libmpg123 handles and exits.                  */                 close(httpPipe[1]);                 sleep(1);                      close(PlayPPipe[1]);                 readPlayPPipe = PlayPPipe[0];                      playProcess();                 exit(0);                  }else if(pid > 0)             {                 /* This is the main process                  *  this process reads from stdin for commands.                  *  if these are valid commands it processes this command and                  *  sends the relevant commands to the readProccess and the PlayProcess via                  *  the PlayPPipe[1]/writePlayPPipe and ReadPPipe[1]/writeReadPPipe.                  *  It then does suitable clean up.                  */                 string command;                      //close ends of pipe that we dont use.                 close(ReadPPipe[0]);                 close(PlayPPipe[0]);                 close(httpPipe[0]);                 close(httpPipe[1]);                      //assign write ends of pipes to easier variables                 writeReadPPipe = ReadPPipe[1];                 writePlayPPipe = PlayPPipe[1];                 rc = 0;                      //wait for input                 while(1)                 {                     cin >> command;                     cout << command << endl;                          rc = 0;                          /* Next channel command. this sends a q command to                      * readProccess and playProcess to tell them to cleanup and exit().                      * then it breaks out of the loop, increments the playListNum and                      * we start all over again. The two processes get forked, this time with a new channel                      * and we wait for input.                      */                     if(command == "n")                     {                         rc = sendCommand("q");                         if(rc != 0)                         {                             cout << "ERROR: failed to send command: " << command << ":" << endl;                         }                         break;                     }                          /* Quit program command.                      * This sends a command to the two proceesses to cleanup and exit() and then exits.                      *                      */                     if(command == "q")                     {                         rc = sendCommand("q");                         if(rc != 0)                         {                             cout << "ERROR: failed to send command: " << command << ":" << endl;                         }                         exit(0);                     }                      }             }else             {                 cout << "ERROR:: some thing happened with the fork to playProcess..." << endl;             }         }else         {             cout << "ERROR:: some thing happened with the fork to readProcess..." << endl;         }              //clean up the pipes otherwise we get junk in them.         close(writePlayPPipe);         close(writeReadPPipe);         delete json;                   //Parse JSON got from the above url into the list of urls so we can use it         JsonConfig *json = new JsonConfig(parms->GetParameter("URL"));         json->GetConfigJson();         json->ParseJson();         json->GetUrls(urlList);              cout << "####---->UrlListLength: " << urlList.size() << endl;              //increment which url in the list we are going to be playing next.         playListNum++;                   //if the playlist is greater than or equal to the urlist size then we are back at the start of the list         if(playListNum >= (int)urlList.size())         {                  playListNum = 0;         }          }      This loop is so that I can go through a list of radio stations. When 'n' is pressed it sends a command to the two child processes which shut them down cleanly, and then closes all the pipes and loops back around, opening all them up again and forking the two processes again. The first time it goes through the loop it seems like this works, but on the second time around I get the following output.               URL: 192.168.0.5:9000/playlist     GetConfigJsonurl: 192.168.0.5:9000/playlist     httpPipe:3:4     PlayPPipe:5:6     ReadPPipe:7:8     GetConfigJsonurl: 192.168.0.5:9000/playlist     ####---->UrlListLength: 2     httpPipe:0:4     PlayPPipe:7:8     ReadPPipe:9:10      So basically I would like to know how to stop pipe from opening up the std file descriptors.


title: Small apt based linux

text: I want to setup some VMs running as small a Linux as I can. The criteria:   1. Package system based on Apt.   2. Runs some GUI ( can be very small ).   3. Runs in as little ram as possible: in this context 64M is good and 256M is bordering on too much.   4. Install on a hd, not ram resident.   5. As little HD space as possible. Ideal would be 1G.   6. Fast boot and shutdown times. Suggestions?


title: Strange encoding in Slackware

text: I am a student and learning about operating systems, I was modifying a file using vi, when I accidentally did something (I don't remember what) that change the codification/encoding and now this is how I see everything. ![this](http://i.stack.imgur.com/XbJdV.jpg) That screenshot is while using `vi`, but the problem is system wide. I tried searching but couldn't find anything. I can delete, everything and reinstall, as it is just a virtual machine but I'd rather learn what happened.


title: Creating JFFS2 image

text: I am working on Embedded Linux, trying to create JFFS2 file system in the host and trying to load it on a NAND device in the target board - Olinuxino a13 wifi using Livesuite. I successfully created a JFFS2 file system but it did not load in the target board. Are there any properties that should be taken care of while creating JFFS2 image? Please check this link for more info.


title: fsck ext4 on ssd: max mountcount and checkinterval

text: I'm using an ssd as the only drive in my laptop (Debian stable). It seems that SuSE sets mountcount to -1, disabling fsck at boot. The thread linked says that ext4 needn't be fsck'd anyway. Is that true?


title: How to halt a command while it's running?

text: I want to know how to halt a command while it is already running. My need to do this is that I was going to update my system (Fedora 20) as usual, so I ran the command `sudo yum update` and it started gathering the packages marked for update. The problem is that my internet connection is extremely slow today and this process is taking ages (I've been here one hour and it is still in 30%, while, normally, it takes about a minute to get to 100%) and want to stop it safely for today. **How can I do that?**


title: is there a way to escape a process in bash with out quitting it?

text: For example, I type `sudo apt-get update` and then a long list of stuff will come up for minutes.. if I want to escape from seeing this tiresome updating and take control of bash command line again(without quitting the original command), is there a hotkey or something like that to do it?


title: Internet(ADSL) connection doesn't seem to be working on Arch

text: I've already set up ADSL and used it already for a system update, so I'm sure the set up is ok but pacman suddenly stopped working and when I checked ping wasn't working too. How can I find out what went wrong and how can I fix it?


title: Adding directory to PATH through Makefile

text: I'm having some trouble in exporting the PATH I've modified inside the Makefile into the current Terminal. I'm trying to add to the PATH, the bin folder inside wherever the Makefile directory is. Here's the relevant strip of the makefile:               PATH := $(shell pwd)/bin:$(PATH)          install:         mkdir -p ./bin          export PATH         echo $(PATH)      The echo prints it correctly but if I redo the echo in the terminal, the PATH remains the same.


title: Upgrade Suse 10.3 to 11.3 and startup fails

text: I upgraded my Suse 10.3 installation to 11.4 using the update option from a network installation disk. When the update was complete I was asked to reboot. When I did the reboot I am asked to login. This seemed a little strange as it used to automatically log me in. I login with either the root login or a user login that I have created on my system. As soon as it accepts my login it lists when I lasted logged in and that I have new mail and then gives me "module is unknown" and shows me the login prompt again. I have no idea how to see what module is unknown. Is there a way to get more information about what the system is unhappy about? Would a new install instead of an update have been a better option? I was unsure what I would lose on the disk if I did a new install.


title: Open files in emacs by filename instead of complete path

text: Assume I have a bunch of directories and can guarantee that no two directories have a common filename (i.e. if `foo/bar` exists, then `bar` doesn't exist in any of the other directories). How can I setup emacs such that, given a hard- coded list in `.emacs` of the directories to search, I can tell it to open `bar` and it figures out that it's in `foo` rather than me needing to tell it `foo/bar` every time? It'd be even better if it handled name collisions somehow (e.g. a list of possible matches), but that's not mandatory as I'm certain in this case the directories have no filenames in common


title: Linux: how to rename cdrom drives

text: I'm running Debian. I've changed computer, migrating the root partition, a few times. My cdrom drive is listed as /dev/cdrom3. This does sometimes cause some problems. I'd like to rename it to /dev/cdrom0. I was able to rename my ethernet card to eth0, but cannot find instructions on how to do this. Do you have any idea? Thanks


title: What's .deb and .rpm and how is it different from .msi?

text: What are these file formats and how do they differ from the `.msi` format in Windows? Also what are the pros and cons of these package management schemes?


title: No core-dumps after recent upgrades: How to analyze it?

text: When I execute a program that I work on, it fails with the following message:               ...     Aborted (core dumped)      However, no core dump is created. Core dumps were written previously, and I don't remember that I changed anything related to it. Here are the outputs of `ulimit -a` (core file size is unlimited):               $ ulimit -a     core file size          (blocks, -c) unlimited     data seg size           (kbytes, -d) unlimited     scheduling priority             (-e) 30     file size               (blocks, -f) unlimited     pending signals                 (-i) 24047     max locked memory       (kbytes, -l) unlimited     max memory size         (kbytes, -m) unlimited     open files                      (-n) 1024     pipe size            (512 bytes, -p) 8     POSIX message queues     (bytes, -q) 819200     real-time priority              (-r) 99     stack size              (kbytes, -s) 8192     cpu time               (seconds, -t) unlimited     max user processes              (-u) 24047     virtual memory          (kbytes, -v) unlimited     file locks                      (-x) unlimited        * I verified that my user can create files in the current directory.   * I read about `/proc/sys/fs/suid_dumpable`. Currently, it is set to 0 on my machine. I tried to change it to 1 or 2 but no difference.   * I also tried to execute the program as root, but that did not make a difference either. I'm running Arch Linux with a 3.7.8-1 kernel. I also downgraded the kernel, but again no difference. (Unfortunately, I don't remember when I could produce the last successful core-dump.) Now I'm running out of options. Do you know how I can further analyze why no core dumps are produced?


title: Add Chakra os benz to grub 1.99

text: I have Debian 7 with grub 1.99 in `sda1` and Chakra OS **without grub** in `sda2` I want to make a dual boot via grub 1,99, how?


title: Does a `scp` transfer close when I close the shell?

text: I have `scp` transfer (from one remote server to another), that is quite big. So maybe I want close the computer from which I executed this command, will this end the transfer? I have `ssh` access to the shell using the program Bitwise.


title: How can I find out the free space on an LVM PV in human readable format?

text: I'm looking for a way I can get the free space on an LVM physical volume without having to use a calculator. I know the `pvdisplay` command will show me the size of a PE size as well as the free PE, and thus by multiplying the PE size by the free PE I know the free space in KB. But I'd like a command which tells me the free space in megabytes, gigabytes, etc. The output of `pvdisplay` is:               [root@df02 mysql]# pvdisplay       /dev/cdrom: open failed: No medium found       --- Physical volume ---       PV Name               /dev/sda2       VG Name               MMB       PV Size               29.71 GB / not usable 19.77 MB       Allocatable           yes        PE Size (KByte)       32768       Total PE              950       Free PE               221       Allocated PE          729       PV UUID               QfZGfn-a3VV-IRkw-bV9g-6iqm-zXjN-y5e6gr      So the free space in this case is 32768 KByte * 221 Free PE = 7241728 KiB, or 6.90625 GiB. But that's a lot of math to do without a calculator ;-) Is there a command which can give me the free space on an LVM physical volume in megabytes/gigabytes?


title: How can I find the git commit in a repo that is more similar to a specified branch?

text: I have a branch in a git repo. How can I find the single commit in the repo that most closely matches the branch? Like if I run a diff, between this branch and every other commit in the repo, I want to find the commit that produces the least amount of diff lines.


title: ls command: what does the first line mean?

text: When I do `ls -l` I get this:               calico@A000505:~/Documentos$ ls -l     total 2020     -rwxr-xr-x 1 calico calico    8559 2010-11-16 11:12 a.out     -rwxrw-rw- 1 smt    smt    2050138 2010-10-14 10:40 Java2.pdf     -rwxrw-rw- 1 ocv    ocv        234 2010-11-16 11:11 test.c      But what does the "total 2020" mean? I only have 3 files so it's not the number of files or directories, and I guess it's not the size either. So what is it?


title: what is total in the output of ls command

text: > **Possible Duplicate:**   >  ls command: what does the first line mean? I have an empty directory.I am using following command to view the contents of that directory.               ls -lart      The output I get is below.               total 12     drwxr-xr-x 5 root  root  4096 Oct  2 12:26 ..     drwxr-xr-x 2 apx   aim   4096 Nov 29 18:40 .      I don't have any files in this directory,then what counts out to 12 here ( `total 12` ) ?


title: Is there a problem using resize2fs too often?

text: I have a partition which contains MySQL data which is constantly growing. My LVM PV has precious little free space remaining and therefore I find I'm frequently adding additional space to my `/var` partition using `lvextend` and `resize2fs` in smallish increments (250-500 MB at a time) so as not to give too much space to `/var` and then be unable to allocate those PEs to other partitions should I need to later. I'm concerned about reaching some limit or causing a problem by calling `resize2fs` too often to grow this filesystem. Is there a limit to how often `resize2fs` can be used to grow an Ext3 filesystem? Is it better to do one large Ext3 resize rather than many small ones? Does resizing using `resize2fs` too often carry a potential for problems or data loss?


title: How to get rid of ogg information in Linux?

text: How can I get this "something" out of the .ogg file? How can I clear comments/infos like this from the file?               $ strings foo.ogg |grep -i SOMETHING     ARTIST=SOMETHING     $       OS: Scientific Linux 6.3


title: How to mount the CD-ROM on Solaris 10?

text: How to mount the CD-ROM on Solaris 10 without knowing the CD-ROM device name?


title: How to enable CGI in OpenBSD?

text: I installed an OpenBSD 5.3 in Virtualbox. Webserver is apache: httpd_flags="" in rc.conf. httpd.conf               # cat /var/www/conf/httpd.conf                                                                                <Directory "/var/www/htdocs/cgi-bin/">         AllowOverride None         Options +ExecCGI         Options None         Order allow,deny         Allow from all     </Directory>          AddHandler cgi-script .cgi     <Location /cgi-bin/*.cgi>     Options +ExecCGI     </Location>          ServerType standalone     ServerRoot "/var/www"     PidFile logs/httpd.pid     ScoreBoardFile logs/apache_runtime_status     Timeout 300     KeepAlive On     MaxKeepAliveRequests 100     KeepAliveTimeout 15     MinSpareServers 5     MaxSpareServers 10     StartServers 5     MaxClients 150     MaxRequestsPerChild 0     MaxCPUPerChild 0     MaxDATAPerChild 0     MaxNOFILEPerChild 0     MaxRSSPerChild 0     MaxSTACKPerChild 0     Include /var/www/conf/modules/*.conf     Port 80     <IfDefine SSL>     Listen 80     Listen 443     </IfDefine>     User www     Group www     ServerAdmin you@your.address     DocumentRoot "/var/www/htdocs"     <Directory />         Options FollowSymLinks         AllowOverride None     </Directory>     <Directory "/var/www/htdocs">         Options Indexes FollowSymLinks         AllowOverride None         Order allow,deny         Allow from all     </Directory>     UserDir disabled     DirectoryIndex index.html     AccessFileName .htaccess     <Files .htaccess>         Order allow,deny         Deny from all     </Files>     UseCanonicalName On     TypesConfig conf/mime.types     DefaultType text/plain     <IfModule mod_mime_magic.c>         MIMEMagicFile conf/magic     </IfModule>     HostnameLookups Off     ErrorLog logs/error_log     LogLevel warn     LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined     LogFormat "%h %l %u %t \"%r\" %>s %b" common     LogFormat "%{Referer}i -> %U" referer     LogFormat "%{User-agent}i" agent     CustomLog logs/access_log common     Alias /icons/ "/var/www/icons/"     <Directory "/var/www/icons">         Options Indexes MultiViews         AllowOverride None         Order allow,deny         Allow from all     </Directory>     IndexOptions FancyIndexing     AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip     AddIconByType (TXT,/icons/text.gif) text/*     AddIconByType (IMG,/icons/image2.gif) image/*     AddIconByType (SND,/icons/sound2.gif) audio/*     AddIconByType (VID,/icons/movie.gif) video/*     AddIcon /icons/binary.gif .bin .exe     AddIcon /icons/binhex.gif .hqx     AddIcon /icons/tar.gif .tar     AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv     AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip     AddIcon /icons/a.gif .ps .ai .eps     AddIcon /icons/layout.gif .html .shtml .htm .pdf     AddIcon /icons/text.gif .txt     AddIcon /icons/c.gif .c     AddIcon /icons/p.gif .pl .py     AddIcon /icons/f.gif .for     AddIcon /icons/dvi.gif .dvi     AddIcon /icons/uuencoded.gif .uu     AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl     AddIcon /icons/tex.gif .tex     AddIcon /icons/bomb.gif core     AddIcon /icons/back.gif ..     AddIcon /icons/hand.right.gif README     AddIcon /icons/folder.gif ^^DIRECTORY^^     AddIcon /icons/blank.gif ^^BLANKICON^^     DefaultIcon /icons/unknown.gif     ReadmeName README     HeaderName HEADER     IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t     AddEncoding x-compress Z     AddEncoding x-gzip gz     AddLanguage en .en     AddLanguage fr .fr     AddLanguage de .de     AddLanguage da .da     AddLanguage el .el     AddLanguage it .it     LanguagePriority en fr de     BrowserMatch "Mozilla/2" nokeepalive     BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0     BrowserMatch "RealPlayer 4\.0" force-response-1.0     BrowserMatch "Java/1\.0" force-response-1.0     BrowserMatch "JDK/1\.0" force-response-1.0     <IfDefine SSL>     AddType application/x-x509-ca-cert .crt     AddType application/x-pkcs7-crl    .crl     </IfDefine>     <IfModule mod_ssl.c>     SSLPassPhraseDialog  builtin     SSLSessionCache         dbm:logs/ssl_scache     SSLSessionCacheTimeout  300     SSLMutex  sem     SSLRandomSeed startup builtin     SSLRandomSeed connect builtin     SSLRandomSeed startup file:/dev/arandom  512     SSLLog      logs/ssl_engine_log     SSLLogLevel info     </IfModule>     <IfDefine SSL>     <VirtualHost _default_:443>     DocumentRoot /var/www/htdocs     ServerName new.host.name     ServerAdmin you@your.address     ErrorLog logs/error_log     TransferLog logs/access_log     SSLEngine on     SSLCertificateFile    /etc/ssl/server.crt     SSLCertificateKeyFile /etc/ssl/private/server.key     CustomLog logs/ssl_request_log \           "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"     </VirtualHost>                                       </IfDefine>     #       files:               # ls -la /var/www/bin/      total 3284     drwxr-xr-x   2 root  daemon     512 Aug 26 10:23 .     drwxr-xr-x  10 root  daemon     512 Aug 24 19:09 ..     ----------   1 root  bin     250676 Mar 13 01:23 bgpctl     ----------   1 root  bin     222004 Mar 13 01:23 ping     ----------   1 root  bin     238388 Mar 13 01:23 ping6     -r-xr-xr-x   1 root  daemon   10704 Aug 26 09:51 printf     ----------   1 root  bin     189236 Mar 13 01:23 traceroute     ----------   1 root  bin     193332 Mar 13 01:23 traceroute6     # ls -laR /var/www/htdocs/                                                                                total 12     drwxr-xr-x   3 root  daemon  512 Aug 26 09:13 .     drwxr-xr-x  10 root  daemon  512 Aug 24 19:09 ..     drwxr-xr-x   2 root  daemon  512 Aug 26 10:02 cgi-bin          /var/www/htdocs/cgi-bin:     total 16     drwxr-xr-x  2 root  daemon  512 Aug 26 10:02 .     drwxr-xr-x  3 root  daemon  512 Aug 26 09:13 ..     -rwxr-xr-x  1 root  daemon   61 Aug 26 10:24 SEARCH.cgi     #      # cat /var/www/htdocs/cgi-bin/SEARCH.cgi     printf "Content-type: text/html\n\n";      printf hi     #      # which printf     /usr/bin/printf     #      # cksum /usr/bin/printf /var/www/bin/printf     4034907417 10704 /usr/bin/printf     4034907417 10704 /var/www/bin/printf      testing it               [user@notebook ~] wget http://domain.foo:8080/cgi-bin/SEARCH.cgi -O -     --2013-08-26 08:09:16--  http://domain.foo:8080/cgi-bin/SEARCH.cgi     Resolving domain.foo (domain.foo)... ::1, 127.0.0.1     Connecting to domain.foo (domain.foo)|::1|:8080... failed: Connection refused.     Connecting to domain.foo (domain.foo)|127.0.0.1|:8080... connected.     HTTP request sent, awaiting response... 500 Internal Server Error     2013-08-26 08:09:16 ERROR 500: Internal Server Error.          [user@notebook ~]       logs               # cat /var/www/logs/error_log       [Mon Aug 26 10:09:13 2013] [error] [client 10.0.2.2] Premature end of script headers: /htdocs/cgi-bin/SEARCH.cgi     #       I copied the "printf" binary for the test.. **Q** : How can I enable CGI on OpenBSD? I just want to have echo/sed/ifthenelse/tr/head/awk/egrep in the cgi.. (the purposie is to enable users to use the "grep" from the website in files) but even a simple test with printf doesn't work..what am I missing? UPDATE#1: what's wrong with the               printf "Content-type: text/html\n\n";       line in the SEARCH.cgi? (because I think the problem is there..) - is printf needed in /var/www/bin? I copied it there, but it still doesn't work (because of the "Premature end of script headers"). p.s.: the "http://domain.foo:8080" is the obsd machine, I just used port forward from virtualbox. UPDATE#2: I removed the ksh from the cgi head (later I added back, see comments) UPDATE#3:               # cat error_log       Abort trap      [Thu Aug 29 09:44:09 2013] [error] [client 10.0.2.2] Premature end of script headers: /htdocs/cgi-bin/SEARCH.cgi     # cat /var/www/htdocs/cgi-bin/SEARCH.cgi                                                                                #!/bin/ksh          perl -e 'print"Content-type: text/html\n\n";'     #


title: Strategies for building distributed computing system with hybrid Mac and Linux systems

text: I want to build a distributed computing system to run Matlab, C and other programming languages for scientific computing. Now I've several old Mac machines with Lion Mac OS installed acted as web servers or personal computers. I also have one latest 16-Xeon-core machine to be installed with Linux. I've not decided which Linux distribution should we use for the new machine, but we need to consider the following factors. Please help me to decide which Linux distribution I can use, what distributing computing software I can use and how to manage the data backups and queue assignments.   1. All machines with either Mac or Linux OS's can be served as a cluster system for parallel or distributed computing. To be specific, we want to run programs crossing machines in a queue with multiple users and threads. In the case that all machines are not symmetric, but we don't want to lower the speed of the most powerful machine.    2. The new machine is preferred to be used as a head node, but at least a secondary machine should also be able to act as a head node in case the head node was shut down.   3. Backup process should be easy to setup, and can be controlled remotely. This is not as important as the first two factors. At least we can backup important data manually.  I searched Google already, but I haven't found decent solutions for my case. Thank you in advance for your suggestions!


title: file command + how to view all results from file command

text: I use the file command in order to verify if file (PATH) is text/ascii file or encrypted file Because file command have allot of results ( small example in example 1 ) I want to get the all possibilities that we can get from file results Please advice from where we can find the total list of file results? (relevant for linux/solaris) Example 1 File command results ( very short list ....)                  ASCII text        ASCII text, with CRLF, LF line terminators        ASCII English text        ASCII English text, with very long lines             etc....


title: Give an icon to the Gnome Shell 3.6 activities button

text: In previous versions of `gnome-shell` in Gnome 3, it was possible to use an icon in place of the "Activities" text in the left upper corner. These tutorials tell how to achieve this, the second one even providing an extension. It does not work with `gnome-shell` version greater than 3.2, though. Can the icon be brought to the current version, too?


title: Creating a UNIX account which only executes one command

text: Is there a way to create a user account in Solaris which allows the users to run one command only? No login shell or anything else. I could possibly do it with `/usr/bin/false` in `/etc/passwd` and just get the user to `ssh <hostname> <command>`, but is there a nicer way to do it?


title: SSH minimal rights user - su only

text: > **Possible Duplicate:**   >  Creating a UNIX account which only executes one command I am trying to setup a user account that only has as minimal rights as possible. The user should be able to log in via SSH and then use the "su" command to get root access **BUT nothing else**. Is this even possible? So no basic commands like "cd", "ls" or "mkdir" should be available! The user should only be able to see one empty folder and then be able to use the "su" command to get full system access of the real OS (if chroot is used to achieve this). Any ideas how this could be achieved? Thanks in advance!


title: Open screen in terminal after user login

text: When a user logins to my Debian server using e.g. Putty, I need to perform the following:   1. It will automatically execute command `screen -r MyWindow`, and   2. the user won't be able to leave the screen window, so I want the user to have disabled all commands. How can I do that?


title: Does info also look up manpage?

text: Besides `man`, `info` can also provide information of a command.   1. For the commands I have tried, I find that `info` provides the same information as `man`. So I wonder if `info` always look up manpages? What else does it also loop up? I.e. what is its source?   2. Do the two provide info for the same set of commands?


title: Text between two tags

text: I wanna retrieve whatever is between these two tags – `<tr> </tr>` – from an html doc. Now I don't have any specific html requirements that would warrant for an html parser. I just plain need something that matches `<tr>` and `</tr>` and gets everything in between and there could be multiple `tr`s. I tried awk, which works, but for some reason it ends up giving me duplicates of each row extracted.               awk '     /<TR/{p=1; s=$0}     p && /<\/TR>/{print $0 FS s; s=""; p=0}     p' htmlfile> newfile      How to go about this?


title: /etc/hosts file refer to another configuration file

text: How can I get the `/etc/hosts` file to refer to another configuration file for it's list of hosts? Example `/etc/hosts`:                ## My Hosts      127.0.0.1   localhost      255.255.255.255 broadcasthost           #Other Configurations      <Link to /myPath/to/MyConfig/ConfigFile.txt>           #Other Addresses      3.3.3.3 MyAwesomeDomain.com      4.4.4.4 SomeplaceIWantToGoTo.com      ConfigFile.txt               ##My additional Hosts     1.1.1.1 SomeLocation.com     2.2.2.2 AnotherLocation.com      How do I add a link/Reference to `/etc/hosts` file such that ConfigFile.txt will be loaded?


title: "Unable to resolve hostname" - how to cleanly change hostname without rebooting

text: At work, I work on a small website using Ubuntu servers hosted on Amazon EC2 instances. We have two webservers, and at any given time one of them is 'live' and one is 'testing', but when we've got our new features or bugfixes working on the 'testing' server, we run a script that uses the AWS API to swap the IP addresses assigned to the two boxes so that the domains being served by the two servers are swapped. Consequently, at any given moment, one of these servers can be either our 'live' server or our 'testing' server, but these are not permanent states. To avoid confusion when SSHing into either of these servers, especially if some silly person (like me) leaves an SSH session open for a long time and gets confused about which server they're on, I want to modify the hostnames of the two servers so that the prompt and title in the terminal window will read `ubuntu@ourwebsiteLIVE` or `ubuntu@ourwebsiteTESTING` depending upon whether the server is currently live or testing. I know I can do this by running `hostname ourwebsiteLIVE` etc. in our IP- swapping script, and have already implemented this. It works, but now every time I `sudo` anything on either of our servers it prints e.g. > sudo: unable to resolve host ourwebsiteLIVE which doesn't seem to break anything, but is fairly irritating. I figure it also might end up breaking stuff in future if I try to chain commands that pipe output to each other, so I guess it's technically not just an aesthetics issue. All the solutions I've seen to the 'unable to resolve hostname' message involve modifying `/etc/hosts` or some similar file _and then rebooting the server_. I can see that this would be fine for many use cases, but is far from ideal for us since we're modifying the hostname routinely and programmatically; we don't want to have to wait for a reboot every time we run our swap script. Is there a way I can make the error message go away without having to reboot?