title: how to initialize `/etc/group`?

text: After editing `/etc/group`, How this update starts functioning without restarting the system in Unix?   Is there any command we need to run?


title: Full access by group user of /var/www/html

text: > **Possible Duplicate:**   >  How to add write permissions for a group? On Centos 6 I'm trying to give full access to make and delete by the user `mitch` for `/var/www/http`. I did `addgroup www` and then `chmod -R 775 /var/www/html` then `groupmod -g www mitch`, and did a `chgrp -R www /var/www/html` but when I went into /html on mitch and tried to make a file with `touch` it said "permission denied." Can someone help me make anyone in `www` able to create and delete in the html dir?               drwxr-xr-x.  6 root root 4096 Feb 13  2012 .     drwxr-xr-x. 22 root root 4096 Sep 29 23:30 ..     drwxr-xr-x.  2 root root 4096 Feb 13  2012 cgi-bin     drwxr-xr-x.  3 root root 4096 Oct  1 21:23 error     drwsrwsr-x.  2 root www  4096 Oct  2 16:15 html     drwxr-xr-x.  3 root root 4096 Oct  2 16:13 icons      is the ls -la output for the /var/www dir


title: Permissions not extended to user in minecraft group

text: I have a directory, under /srv: `drwxrwxr-x 3 minecraft minecraft 4096 Dec 30 06:23 minecraft` Owned by user minecraft, group minecraft. Group has read/write/search permissions. I have a user, shelvacu, that is part of the minecraft group:               $ groups shelvacu     shelvacu : shelvacu sudo minecraft      And, as shelvacu, I run `mkdir /srv/minecraft/testdir`:               $ mkdir /srv/minecraft/testdir     mkdir: cannot create directory ‘/srv/minecraft/testdir’: Permission denied      Why? The minecraft group has write permission on the directory, and shelvacu is part of the minecraft group. What am I missing?


title: Added user supplementary group, but 'groups(1)' not showing change

text: I'm trying to add myself to the _fuse_ user group but it doesn't look like the change is taking effect even though _/etc/group_ looks correct after invoking _addgroup_ or _usermod_. I've tried both ...               sudo addgroup fjohnson fuse      and               sudo usermod -a -G fuse fjohnson      _/etc/group_ shows the change               fuse:x:104:fjohnson      but I can't read               -rw-r----- 1 root fuse 215 Oct 16 10:39 /etc/fuse.conf      as               cat: /etc/fuse.conf: Permission denied      and _groups(1)_ returns               fjohnson adm dialout cdrom plugdev lpadmin admin sambashare


title: Why does "logging out" of a session activate a newly added supplementary group?

text: I asked the following question Added user supplementary group, but 'groups(1)' not showing change earlier today. Now I'd like to know why the answer works. After running               adduser user group      Why does _user_ need to log out (I'm not even sure what that means in a context without a window manager), or why does _newgrp(1)_ need to be invoked?


title: As what user does a command end up executing?

text: How can I find out as what user a command executes? (I'm running Ubuntu, but I suspect the answer applies to Unix in general). What I'm trying to do is get `msmtp` running and logging to `/var/log/msmtp`. I've set the owner and group of that file to `mail`, then added my user to the mail group via `sudo adduser dandv mail`:               $ ls -al /var/log/msmtp.log     -rw-rw---- 1 mail mail 0 Jul 24 18:45 /var/log/msmtp.log     $ groups dandv     dandv : dandv mail sudo      Yet when when I run               cat testmail | msmtp dan@example.org -v      I get a permission denied:               msmtp: cannot log to /var/log/msmtp.log: cannot open: Permission denied      What is msmtp's problem?


title: I added a user to a group, but group permissions on files still have no effect

text: I changed permissions of a file (`chmod g+w testfile`) and running `ls -l testfile` gives:               -rwxrwxr-x 1 user1 user1 0 2011-01-24 20:36 testfile      I then added a user to that group (" **/etc/group** " has `user1:x:1000:user2` line), but am failing to edit that file as user2. Why is this so?


title: Troubleshooting joining a group in Mint in VirtualBox

text: I am trying to join my user to the `vboxsf` group to access a VirtualBox shared folder from inside my Linux Mint virtual machine. However I'm encountering a problem that I can't troubleshoot. I've edited `/etc/groups` to add my user to the appropriate group.               user394-VirtualBox media # grep user394 /etc/group     ...     vboxsf:x:108:user394      But I can't access a directory that that group supposedly has permissions to:               user394@user394-VirtualBox /media $ cd sf_Dropbox/     bash: cd: sf_Dropbox/: Permission denied          user394@user394-VirtualBox /media $ ls -lha     total 40K     drwxr-xr-x   5 root root   4.0K Jul 13 12:51 .     drwxr-xr-x  23 root root   4.0K Mar 16 22:04 ..     drwxrwx---   1 root vboxsf  28K Jul 13 12:08 sf_Dropbox     drwxrwx---   1 root vboxsf    0 Jul 13 12:16 sf_mint-shared-folder      The command `groups` shows that I'm not a member, yet `groups {user}` and `id` seem to indicate that I am:               user394@user394-VirtualBox /media $ groups     user394 adm cdrom sudo dip www-data plugdev lpadmin sambashare     user394@user394-VirtualBox /media $ id     uid=1000(user394) gid=1000(user394) groups=1000(user394),4(adm),24(cdrom),27(sudo),30(dip),33(www-data),46(plugdev),112(lpadmin),118(sambashare)     user394@user394-VirtualBox /media $ groups user394     user394 : user394 adm cdrom sudo dip www-data plugdev vboxsf lpadmin sambashare      How can I properly join this group and access these directories?


title: id command doesn't show all user's groups

text: I did a `usermod` to add the current user `user` in a group, but when I run `id -Gn` it only shows the main user's group:               [user@computer ~]$ id -Gn      user      But when I specify the user, it works normally:               [user@computer ~]$ id -Gn user     user newgroup      Do you have an idea why it works like it? Am I missing something concerning the groups management in UNIX?


title: How can I install Gentoo in this situation

text: Why does it nessesary to coincide the release version of stage3 and minimal install CD? Or can I install Gentoo with old minimal CD, but current stage?


title: Script or command to replace default parameters in /etc/user on AIX

text: I wanted to change the parameters settings in `/etc/security/user` file in AIX OS using a script. This is the sample user file.               default:                admin = false               login = true               su = true               daemon = true               rlogin = true               sugroups = ALL               admgroups =               ttys = ALL               auth1 = SYSTEM               auth2 = NONE               tpath = nosak               umask = 022               expires = 0               SYSTEM = "compat"               logintimes =               pwdwarntime = 5               account_locked = false               loginretries = 6               histexpire = 0               histsize = 5               minage = 1               maxage = 12               maxexpired = 5               minalpha = 0               minother = 1               minlen = 8               mindiff = 0               maxrepeats = 2               dictionlist =               pwdchecks =  I would like to replace values of parameters with the values below:               pwdwarntime = 5       loginretries = 6       histsize = 5       minage = 1       maxage = 4       maxexpired = 5       minalpha = 2       minother = 1       minlen = 8       mindiff = 0   I hope someone can help me with this.


title: No Audio Output with X11

text: I have a queer issue with my Arch-Linux System. I am unable to get any Sound Output when playing audio, AFTER starting X Server. The issue is not with Volume Controls or Sound Card Drivers because, if I start any kind of Audio playback BEFORE starting X Server, I have absolutely no issues. The Audio keeps playing even after X Server starts. But if I pause / stop the audio, on restarting playback, I get no audio output. Even terminating X Server does not resolve this issue. Rebooting the system though, helps. I tried with different DE's. Checked with GNOME, XFCE, LXDE, KDE. Same issue everytime. So It's not due to a particular environment, but rather an issue with X. I am not sure what files I should be checking for this. Could any please guide me through?


title: Find if a process terminates in a specific amount of time

text: I am running a program.Inside this program i run a specific command and i use ulimit command to terminate the running of that command if it exceeds an amount of time.To be more clear i run this:               ulimit -t 1800 ./bsolo3.0.17 test.opb      which means that i want to terminate the run of bsolo solver if the time needed exceeds 1800 seconds. What i want is a way to know, after let's say 10 runs of that command,how many times the runtime was below that limit and how many times the runtime of that command was above that limit.I don't have any clue yet.Any tips?


title: Sendmail can't find local users (with uppercase letters)

text: Sendmail works through sending to a smarthost, but can't find local users.               # sendmail -bv  LocalUser@myhost.net     LocalUser@myhost.net... User unknown     # grep LocalUser /var/log/maillog     Sep  8 03:48:30 myhost sendmail[6678]: r887mUs3006678: LocalUser@myhost.net... User unknown      but ...               # ls /home|grep LocalUser     /LocalUser      and ...               # grep LocalUser /etc/passwd     LocalUser:x:1001:1001:LocalUser:/home/LocalUser:/bin/bash      How can I configure sendmail to find localusers? How should I diagnose this?


title: Do mpstat and iostat come standard with Linux RHEL 5.8?

text: Do command line utilities like `mpstat` and `iostat` come standard with the RHEL 5.8 machine? Or are they optional utilities which the user has to install manually, if required? I could find these utilities in my RHEL 5.5 machine but not in RHEL 5.8. So I'm confused.


title: Connect two VirtualBox virtual machines through SSH

text: I have two VirtualBox virtual machines: one with SuSE Enterprise 10 and one with Red Hat Enterprise 5. I want to connect through SSH from RedHat to SuSE. Both are configured to use a bridged adapter with `vnic0` as name and “Allow All” for “Promiscuous Mode”. SuSE has IP 10.211.55.5 and Red Hat has IP 10.211.55.6. I can connect through SSH from SuSE to Red Hat but not vice- versa. What could be the problem? If I ping from Red Hat to SuSE and vice versa, everything is in order and the transmitted packets are received. If I traceroute from SuSE to Red Hat I get               1 10.211.55.6 (10.211.55.6)(H!) 0.509 ms (H!) 14.974 ms (H!) 0.877 ms      which seems in order, but when I traceroute from RedHat to SuSE I get               traceroute to 10.211.55.5 (10.211.55.5), 30 hops max, 40 byte packets     1 * * *     2 * * *     3 * * *     4 * * *     ...      If I do `ssh -l user 10.211.55.6` from the SuSE virtual machine everything connects ok but if I do `ssh -l user 10.211.55.5` from the Red Hat virtual machine I get “Connection timed out”. Both systems are connected to the internet and I can surf the net. What am I doing wrong? Why I can't SSH from Red Hat to the SuSE virtual machine?


title: How to set up "poor man's" Linux desktop cluster?

text: There are several small Linux/Android devices on the market with 1 GHz ARM processor, 512 MByte RAM and cca. 4 Gbyte storage for $35-$40. If I buy 5 pcs, it's only around $200. Let's say, we have 5-10 pcs of them, and we've solved basic things, e.g. they run some not too rare kind of Linux distribution (Debian, say), we have root access, and they are connected on local network, with IP. So, everything is ready for make a cluster (I think). We have a desktop computer or notebook (cca. 2 GHz x86 processor, 1-2 GByte of RAM, several GBytes of HDD/SSD space), which also runs a standard Linux distro. It has keyboard, mouse, monitor, we want to use it as the "frontend" of the cluster. **So, the question is: what's the easiest way to utilize the horsepower of a couple of small computers with a desktop computer?** Desktop programs are not designed to work in that environment, so I don't want to set up a real cluster, the project is about just to push some jobs from the desktop/netbook computer and share it as optimally as possible amongst the small ones. Say, I should start the browser on a small computer, using X11, it will not eat up my desktop machine's memory. If I have many pages open, I can start another one on another small machine. I can also start my text editor on a small computer, I need just share the folder I'm working to it. It has a small problem: I'm using Geany, and I start the compiler by pressing F8, so the small machine should launch the compiler on the desktop machine. I don't mind, if I have to write a small script for it. What's your advice, would it fly?


title: Create files that both www-data and myuser can edit

text: I have a directory to store invoices -               drwxrwxr-x  2 me www-data   49152 Sep  9 13:38 invoices      There are two applications that write files to this dir.   1. PHP web application  > -rw-r--r-- 1 www-data www-data 7681 Sep 9 13:38 invoice_1.html   2. Python script > -rw-rw-r-- 1 me me 8911 Sep 4 06:04 invoice_2.html Now I want to overwrite invoice_2.html from the web application. How do I do that? **I don't want to add`www-data` to `me` group.** I don't know how but that will make my server vulnerable to security threats. Help me out. Thanks.


title: Public-Key Authentication w/ Jailed SFTP User

text: I'm trying to set up a jailed SFTP user account on my own local machine to test an application with libcurl. I used this guide to help me figure out how to set up a jailed SFTP user: http://www.thegeekstuff.com/2012/03/chroot-sftp- setup/ The guide does work, but I'd like to set up public-key authentication to log in to the SFTP user's account instead of using a password. I have some basic understanding of generating and authorizing private and public keys from this guide: http://www.cyberciti.biz/tips/ssh-public-key-based-authentication-how- to.html However, trying to add an authorized_keys2 directory in the sftp user's home directory doesn't seem to work. Any tips or advice would be helpful.


title: How to scroll in a terminal using keyboard?

text: How can I scroll in bash using only the keyboard? If it's not possible in bash, are there any other shells that support this?


title: How can I create a shortcut to resize panes in a tmux window?

text: I am having lots of issues with `tmux` in `mac`.   Another problem I have is that I can not bind a key in my `tmux.conf` to be able to resize my panes.   What I need is the `CTRL-b: resize-pane -U 10` I currently do to increase the size of the pane upwards in 10 cells (or downwards or left or right) to be done by a key shortcut and not to actually have to type this over and over (which I currently do unfortunately).   But I can not find a way to configure this since in mac it seems that `CTRL` and other keys work diffently than linux.   Can anyone please help out? I have been trying too long to figure this out and for my first `Mac` I am really starting to dislike them.....


title: Yum Install Help

text: I am new to the world of yum. I understand that there are repositories from where we can download packages and certain repositories provide only certain packages. I want know how to look for repositories that can provide packages that I require and that are compatible to my version of linux, which currently is RHEL 6.3 I want to install               yum install curl-devel expat-devel gettext-devel \       openssl-devel zlib-devel      How do I locate repositories offering these packages ?


title: unable to launch application in separate X server

text: I am fairly new to Linux, and I am using Manjaro Xfce 0.8.8 right now. I want to launch application in separate X server so I typed in the following command to launch Chromium for example:               xinit /usr/bin/chromium -- :1      but I get this error:               Fatal server error:     Cannot move old log file "/var/log/Xorg.1.log" to "/var/log/Xorg.1.log.old"               Please consult the The X.Org Foundation support           at http://wiki.x.org      for help.


title: terminator ctrl-tab key binding

text: pressing `ctrl-tab` in terminator has the same effect as pressing `tab`, but when I see the key-bindings in the setting, nothing is mapped to `ctrl-tab`, so why is `ctrl-tab` reserved? Now, if I am working with xterm, I know a way around this. So essentially I am trying to see if there is a similar workaround. The solution goes like, Add the following lines to .Xresources:               *vt100.translations: #override \n\         Ctrl ~Shift <Key>Tab: string(0x1b) string("[27;5;9~") \n \         Ctrl Shift <Key>Tab: string(0x1b) string("[27;6;9~") \n      reload               xrdb ~/.Xresources      and add the following lines. Here I am trying to cycle through screen windows with ctrl-tab and ctrl-shift-tab               # Ctrl-Tab     bindkey "^[[27;5;9~" next          # Ctrl-Shift-Tab     bindkey "^[[27;6;9~" prev


title: UBUNTU + extract filesystem.squashfs for editing

text: please advice how to install the squashfs-tools on UBUNTU linux ? I try this                 unsquashfs filesystem.squashfs            The program 'unsquashfs' is currently not installed, You can install it by typing:      . so I want to install as the following:                  sudo apt-get install squashfs-tools             E: Unable to locate package  squashfs-tools


title: Subprocesses of bash/gnome-terminal don't terminate (CentOS/RHEL)

text: today I observed something which probably has an easy explanation, but was quite quite unexpected from my side: I'm running CentOS (and RHEL which behaves same). I open a bash in a terminal and start any subprocess like gedit. The window opens, fine. When I do a 'ps', I can see that gedit has the bash as it's parent process which itself has the gnome-terminal as it's parent. When I then stop bash, I would expect that all child processes stop as well. But gedit keeps running and the parent changed to 1 (init)! I tried to don't stop the shell gracefully, but kill it hard, same result. It tried killing the terminal instead of the shell, still same result. Only when I close the terminal by clicking the X button, then gedit is closed as well. I didn't expect that behaviour. Starting gedit with nohup, I would not be surprised, but even without nohup ... why does it stay alive? Maybe someone can shed some light and knows what's going on there. Thanks in advance!


title: Could not mount UBIFS on SD card

text: I guess this is not a big problem, still I can't see what's the matter. I'm building Images for an Embedded Linux (2.6.39) ARM9 System with Buildroot 2013.11, which is booting from an SD card. I was trying different file system formats, where some of them couldn't manage to boot. **What I did for the working ones** : E.g.: rootfs.cramfs is working, in Linux menuconfig I selected               File Systems     - Miscellaneous filesystems     - - Compressed ROM file system support (cramfs)      Then I put the kernel on the first partition of the sd, and for the second partition I used the `dd` command:               sudo dd if=/[path-to-rootfs]/rootfs.cramfs of=/dev/sdb2 bs=2048      The kernel command line looks like:               console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait      And it's booting the system without any problems. **What I did for the ones that didn't work** : E.g.: rootfs.ubifs (and many others too). Actually I did nearly the same steps as above. The Kernel command line stays the same. The things I canged is in linux-menuconfig:               File Systems     - Miscellaneous filesystems     - - SquashFS 4.0 - Squashed file system support     - - - Squashfs XATTR support     - - - Include support for LZO compressed file systems     - - - Include support for XZ compressed file systems      and dd command:               sudo dd if=/[path-to-rootfs]/rootfs.ubifs of=/dev/sdb2 bs=2048      (btw: after this step the host system isn't able anymore to read the content of the 2 partition). But then It crashes during boot with the message:               No filesystem could mount root      and then a kernel panic occurs (due to the line above). If interested I can put the .config file here. Does anyone see my mistake?


title: Finding a substring in files across subdirectories with a single built-in command?

text: In Windows, if I wanted to find a string across all files in all subdirectories, I would do something like               findstr /C:"the string" /S *.h      However, in Linux (say, Ubuntu) I have found no other way than some piped command involving `find`, `xargs`, and `grep` (an example is at this page: How can I recursively grep through sub-directories?). However, my question is different: is there any _single, built-in command_ that works through this magic, without having to write my shell script?


title: Why does `ESC` move the cursor back in vim?

text: In vim, when I hit `ESC` to return to command mode, the cursor moves one character to the left. This is not what I would hope for, occasional I immediately hit `l` to move back to that spot, perhaps to delete a character. Is there a reason for this behavior? Is this convenient for a pattern of usage that I'm missing? I am new to vim.


title: Shc script size limitation and "_SC_ARG_MAX (see sysconf(2))" parameter

text: shc has a "bug" related to _SC_ARG_MAX. Ref: shc website I wish to change the parameter (which I do not understand exactly what it is and I wish to) and be able to use shc with very long bash scripts. In particular, I am using the command:               shc -v -r -T -f script.sh      There are no compilation errors:               shc shll=bash     shc [-i]=-c     shc [-x]=exec '%s' "$@"     shc [-l]=     shc opts=     shc: cc  script.sh.x.c -o script.sh.x     shc: strip script.sh.x     shc: chmod go-r script.sh.x      When I am running the executable I see:               ./script.sh.x: Argument list too long: /bin/bash      When I cut the script in two pieces everything works fine. Help will be a appreciated.


title: What happens to partition labels after removing a partition?

text: What will happen to all the remaining partition labels if I remove a single partition?   For example if I have a layout that looks like this:               /dev/sda1     /dev/sda2     /dev/sda3     /dev/sda4     /dev/sda5      and if I remove /dev/sda2 will /dev/sda3, /dev/sda4 and /dev/sda5 "shift" their numbers, and am I going to get this:               /dev/sda1     /dev/sda2     /dev/sda3     /dev/sda4      or will the "gap" stay there without any changes for the labels, giving me this:               /dev/sda1     /dev/sda3     /dev/sda4     /dev/sda5


title: Should I upgrade Ubuntu 12.04 kernel

text: I am currently running the 3.5.0.48 kernel on my Ubuntu 12.04.4, and I was wondering whether I should upgrade to 3.8 or 3.11. This makes it seem easy enough. Though I will wait with throwing away my current kernel for now. Can someone list reasons not to upgrade? And potentially other / better ways to do it?


title: Linux boot loaders supporting full disk encryption?

text: Are there any Linux boot loaders supporting full disk encryption (a la TrueCrypt). I know there was work towards adding encryption support to GRUB2, but this does not seem to be ready yet. Any other options? (Note that I am really referring to full disk encryption here -- including /boot) **Update:** Most of the answers describe a setup where /boot is not encrypted, and some of them try to explain why an unencrypted /boot should be OK. Without getting into a discussion on why I actually need /boot to be encrypted, here is an article that describes exactly what I need, based on a modified version of GRUB2:   * http://xercestech.com/full-system-encryption-for-linux.geek The problem with this is that these modifications apparently are not supported in the current GRUB2 codebase (or maybe I am overlooking something). Hope this helps to clarify the question.


title: Login retrieval in osx

text: I got an old Mac G4 (powerPC) from the company who wanted to put it in a bin. The company agreed that I can take it home for private use. It is running an early version of OSX but because it is old and the person in charge no more in the company, I do not have any login/password for entering the system. Is there any procedure to either create a new user or to reset the password of an existing user?


title: bash restart mysql when it gone run well in SSH part, but not in cronjob

text: My system is centos 6.5, I write a simple bash shell to check if mysql is crashed, restart service again. I put it in `/home/myspace/mysql.sh` `chown root:root /home/myspace/mysql.sh` then run every minute by crontab.               #!/bin/bash     mysql --host="localhost" --user="root" --password="password" --database="test" --execute="select id from test limit 1"     if [ $? -eq 0 ]; then echo "";     else      /usr/bin/sudo service mysql stop      pkill mysql      /usr/bin/sudo service mysql start      echo "error $(date)" >> /home/myspace/restart_log.txt     fi      Now I have 2 questions.   1. Why in my code, `if ... else ...` not working? I mean the mysql server has no problem, it can execute `"select id from test limit 1"` and get result, but the script still run the code in `else` case.   2. in `/var/log/sucure`, it show `root : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/root ; USER=root ; COMMAND=/sbin/service mysql stop`. `root : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/root ; USER=root ; COMMAND=/sbin/service mysql start`. And the mysql server is down. **UPDATE:** Now I tried the code @Anthon given:               #!/bin/bash     RESULT=`mysql --host="localhost" --user="root" --password="password" --database="test" --execute="select browser from test limit 1"`     if [ $? -eq 0 ]; then         echo "mysql select ok"     else       /usr/bin/echo "mysql select failed"       sudo service mysql stop       pkill mysql       /usr/bin/sudo service mysql start       echo "error $(date)" >> /home/myspace/restart_log.txt     fi      it works well in `SSH` part (return mysql select ok) but not working in `cronjob`(every minute write error in `/home/myspace/restart_log.txt` and mysql server never start) Is this problem caused by `PATH`? OR `privileges`? How to solve it? thanks. **solve** Thanks for all, finally I solved it. @Sigi's method maybe good, but not working in my situation. @Anthon's answer write better than I, but still not working. @Emmanuel, given the answer is more nearer than other's. After a long time test, I shared final working code to all.               #!/bin/bash     PATH=/bin:/usr/bin:/sbin:/usr/local/bin     # cronjob need clear where is the path     # mysql under path /usr/local/bin     mysql --host="localhost" --user="root" --password="password" --database="test" --execute="select id from test limit 1"     if [ $? -eq 0 ]; then echo "";     # mysql run well nothing to do, make a     else      sudo /etc/init.d/mysql stop      pkill /usr/local/bin/mysql     # It should be pkill /usr/local/bin/mysql, not pkill mysql, wrong write will cause below code not working      sudo /etc/init.d/mysql start      sudo /etc/init.d/httpd restart     # Some strange behave, after mysql restart, apache will die, so should add httpd restart       echo "error $(date)" >> /home/myspace/restart_log.txt     fi


title: Connect to a Bluetooth device via Terminal

text: I'm using Mint 15 w/ cinammon. I bought a set of bluetooth speakers and i'm tring to connect to them via terminal. Via GUI i can see them normally and i am connected to them. I want to make a small script so everytime they are visible i would connect to them automatically. I am trying to scan them with: > hcitool scan But i get > Scanning... and after a few seconds the process dies. The same thing with `hidd --search`. If i run `hciconfig scan` i get:               hci0:   Type: BR/EDR  Bus: USB         BD Address: 40:2C:F4:78:E8:69  ACL MTU: 1021:8  SCO MTU: 64:1         UP RUNNING PSCAN ISCAN          RX bytes:130700 acl:22 sco:0 events:18527 errors:0         TX bytes:31875398 acl:36784 sco:0 commands:75 errors:0      I suppose that is just saying my bluetooth address and that it is turned on. As i said already, via the normal User Interface, i can see the speakers and i am connected to them, but through terminal i get nothing. EDIT: Actually it is quite funny that `hcitool scan` isn't finding anything since my speakers are connected and every time i run the command the sound from the speakers breaks for a couple of seconds.


title: Is there a way to show previous messages in screen?

text: When I use `screen` I can only see the current data on the terminal (commands, messages, etc.). Is there a way, apart from printing anything I want to a file, to see the previous messages (the same way a normal terminal emulator would)?


title: Disable ForwardX11Timeout without ForwardX11Trusted in OpenSSH Client?

text: By default, recent versions of OpenSSH automatically set `ForwardX11Timeout` to 20 minutes if you set `ForwardX11Trusted` to no. This means that 20 minutes after you start your ssh connection, you can't open any more X clients, because the authentication token has expired. Especially bad if you try to use this with long-lived connections and `ControlMaster`. I've tried disabling by setting to 0 (does not work, causes instant expiration) and by setting to a really long value (do _not_ do this, it will crash your X server. Limit is somewhere between 3 and 4 weeks). How can I completely disable the timeout?


title: How I/O channels are implemented in Linux kernel?

text: stdin, stdout, stderr are some integers that index into a data structure which 'knows' which I/O channels are to be used for the process. I understand this data structure is unique to every process. Are I/O channels nothing but some data array structures with dynamic memory allocation ?


title: Debian Sources List

text: Working with Debian here. I'm having trouble with apt-get. I did go into the sources list and comment out anything referring to a CD drive. It no longer points to a CD drive; however, whenever I run apt-get on anything it tells me that the file is not available but referring to another package... something about being obsolete or missing. The problem is it does it for everything. Any idea what I might be missing? I am running under root, and a package example is `sudo apt-get install apache2`.


title: Why temporary lockup of X? Diagnostic suggestions

text: Recently I have bveen experiencing some strange behavior from a machine. Occasionally X just locks up for a short time 3-5 minutes. Then resumes normal behavior. AFAICT while X locks up, the rest of the system is working fine. I can ssh in and out. Background processes keep running. Etc. ATM the only clues that I have seem to be that the lockups seem to predominantly happen while using firefox, though I can't say for sure that the lockups always happen in firefox, and the reason for firefox's predominance may be something as simple as the fact that firefox is the graphics intensive program I spend most of my time in. I spend more time in emacs, but emacs isn't exactly stressing X. I am also experiencing another problem with totem ( which I am not looking to fix ATM ) that after a while totem locks up. I have to kill it. When I restart the audio is fine, but no video, and the screen is unresponsive. It seems like the freezing doesn't happen till after The first totem lockup. Again I don't know if this is symptomatic or just know if this is symptomatic or just a coincident. I suspect that it may have something to do with the Gobject or dbus subsystem. In any case, at the moment I am bereft of qualtiy information about the cause of the lockup. Right now my main concern is that I do not have serious information about what is happwning during the lockup. Hopefully someone can give some suggestions on how to collect data on the lockup.


title: convert soft- to hardlinks with cp

text: The `cp` command's `info`page offers on the option `\--preserve=` the following: > `links`   >  Preserve in the destination files any links between corresponding source > files. Note that _with`-L' or`-H', this option **can** convert symbolic > links to hard links_. followed by an example I don't get [now]; anyhow: **Question** : How to turn soft- into hardlinks with `cp`? And is there a way back too [converting hard- into softlinks]?    _Secondary Issue_ : Where does **can** in the quote above come into play? I understand the purpose of `-L` and `-H`, I'm able to copy fully functional softlinks etc., but so far I didn't manage to turn soft- into hardlinks.


title: log4cxx/logger.h or libcql/cql.hpp fatal error while doing make -j4

text: I am running `make -j4` and I am getting below exception...               userName@phx5qa01c-4e23:~/build$ make -j4     [  1%] [  2%] Building CXX object nda/common/loadtest/CMakeFiles/loadtester.dir/LoadTester.cc.o     make[2]: *** No rule to make target `/usr/include/libcql/lib/libcql.so', needed by `nda/common/client/client'.  Stop.     make[2]: *** Waiting for unfinished jobs....     Building CXX object nda/unittest/common/CMakeFiles/TestRunner.dir/TestRunner.cc.o     [  3%] Building CXX object nda/common/client/CMakeFiles/client.dir/main.cc.o     [  4%] Building CXX object nda/common/CMakeFiles/ndacommon.dir/category_map/CategoryMap.cc.o     In file included from /home/userName/MPL/nda/common/client/main.cc:1:     /home/userName/MPL/nda/common/client/be_cassandra_util.hh:5: fatal error: libcql/cql.hpp: No such file or directory     compilation terminated.     make[2]: *** [nda/common/client/CMakeFiles/client.dir/main.cc.o] Error 1     make[1]: *** [nda/common/client/CMakeFiles/client.dir/all] Error 2     make[1]: *** Waiting for unfinished jobs....     [  5%] Building CXX object nda/common/CMakeFiles/ndacommon.dir/curl_handler/CurlHandler.cc.o     /home/userName/MPL/nda/common/curl_handler/CurlHandler.cc:12: fatal error: log4cxx/logger.h: No such file or directory     compilation terminated.     make[2]: *** [nda/common/CMakeFiles/ndacommon.dir/curl_handler/CurlHandler.cc.o] Error 1     make[2]: *** Waiting for unfinished jobs....     /home/userName/MPL/nda/unittest/common/TestRunner.cc:8: fatal error: log4cxx/logger.h: No such file or directory     compilation terminated.     make[2]: *** [nda/unittest/common/CMakeFiles/TestRunner.dir/TestRunner.cc.o] Error 1     make[1]: *** [nda/unittest/common/CMakeFiles/TestRunner.dir/all] Error 2     /home/userName/MPL/nda/common/category_map/CategoryMap.cc:11: fatal error: log4cxx/logger.h: No such file or directory     compilation terminated.     make[2]: *** [nda/common/CMakeFiles/ndacommon.dir/category_map/CategoryMap.cc.o] Error 1     make[1]: *** [nda/common/CMakeFiles/ndacommon.dir/all] Error 2     Linking CXX executable loadtester     [  5%] Built target loadtester     make: *** [all] Error 2      Below is the exception, I always get - `fatal error: libcql/cql.hpp: No such file or directory` `fatal error: log4cxx/logger.h: No such file or directory` I am not sure what should I do to fix these exceptions? I guess, I might need to add the libraries for these... But I am not sure how should I add these libraries and where to put it then so that while compiling it works fine..


title: Why is my computer trying to send ICMP type 3 to OpenDNS?

text: In my firewall logs I see lots of entries like this. > IN= OUT=eth0 SRC=192.168.1.105 DST=208.67.220.220 LEN=148 TOS=0x00 PREC=0xC0 > TTL=64 ID=55705 PROTO=ICMP TYPE=3 CODE=3 [SRC=208.67.220.220 > DST=192.168.1.105 LEN=120 TOS=0x00 PREC=0x00 TTL=54 ID=0 DF PROTO=UDP SPT=53 > DPT=25566 LEN=100 ] It looks like the OpenDNS server at 208.67.220.220 sent my computer some kind of message by UDP from port 53, and my computer tries to respond with an ICMP code type 3 (which my firewall blocks, because I've configured it to block ICMP out, with a few exceptions.) An ICMP type 3 coming from the OpenDNS servers would make sense, since my computer would try to query their servers, but I don't understand why my computer would try to send this message to their servers, unless their servers were trying to query my own computer for some destination, and I don't understand why their servers would do that. Is that UDP packet coming from their severs some kind of query? What's going on here?


title: Are quotes needed for local variable assignment?

text: Can I safely omit quotes on the right side of a local assignment?               function foo {         local myvar=${bar}         stuff()     }      I'm mainly interested in `bash`, but any info on corner cases in other shells are welcome.


title: Any cd shortcut to switch an intermediate directory in current path?

text: if I have current path as a long one..and I want to switch to a directory with just one word from path replaced by something else..like say when using maven , I want to switch from main path to test path, how do I do it? Some time back, I was able to do it by $ cd main test to replace main by test in the path, but not any more.. Any pointers...?


title: solution to rotate log files

text: I am running a daemon process that will have to run indefinitely (a 'service' so to speak) and wish to log its output. A simple solution like:               ./long-running-process > log.out &      ... fails as the file `log.out`:   * soon exceeds the size that I can easily handle with a text editor like `emacs` or `vi`   * runs the risk of depleting free file system space. To keep the size of the log file manageable I could use the `split` bash command:               ./long-running-process | split -l 30000      This solution keeps the log files it creates manageable in size however it can run out of suffixes (`split: output file suffixes exhausted`) or, if the suffix space is huge, it may also deplete file system space. So I am looking at a solution that will generate a number of log files, with each log file being manageable in size, and will also rotate amongst them so that there is a ceiling on the total disk space that will be claimed. Is there such a solution available or do I have to implement it at the application level?


title: wireless drops after using it

text: Recently, I have installed Linux Mint 10 Julia. Everything worked from the beginning (even the external wifi dongle), but I discovered that the wifi connection gets lost after some time. To solve it, I have to disable networking and re-enable it. Does anybody know what the problem could be? Further details can be found below:               iwconfig wlan0     wlan0     IEEE 802.11bgn  ESSID:"myessid"                 Mode:Managed  Frequency:2.412 GHz  Access Point: 00:22:3F:91:15:89                  Bit Rate=11 Mb/s   Tx-Power=11 dBm                  Retry  long limit:7   RTS thr=512 B   Fragment thr=512 B                  Power Management:on               Link Quality=70/70  Signal level=52 dBm                 Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0               Tx excessive retries:0  Invalid misc:0   Missed beacon:0          iwlist wlan0 scan     wlan0     Scan completed :               Cell 01 - Address: 00:22:3F:91:15:89                         Channel:1                         Frequency:2.412 GHz (Channel 1)                         Quality=70/70  Signal level=51 dBm                           Encryption key:on                         ESSID:"myessid"                         Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s                                   9 Mb/s; 12 Mb/s; 18 Mb/s                         Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s                         Mode:Master                         Extra:tsf=00000000027bf580                         Extra: Last beacon: 6484ms ago                         IE: Unknown: 00087461636B776C616E                         IE: Unknown: 010882848B960C121824                         IE: Unknown: 030101                         IE: Unknown: 2A0100                         IE: Unknown: 32043048606C                         IE: Unknown: DD180050F2020101820003A4000027A4000042435E0062322F00                         IE: Unknown: DD1E00904C334E101BFFFF000000000000000000000000000000000000000000                         IE: Unknown: 2D1A4E101BFFFF000000000000000000000000000000000000000000                         IE: Unknown: DD1A00904C3401051B00000000000000000000000000000000000000                         IE: Unknown: 3D1601051B00000000000000000000000000000000000000                         IE: Unknown: DD0900037F01010000FF7F                         IE: Unknown: DD0A00037F04010000000000                         IE: Unknown: DD820050F204104A000110104400010210570001001041000100103B00010310470010565AA94967C14C0EAA8FF349E6F593111021000D4E6574676561722C20496E632E10230007574E523230303010240007574E523230303010420004353637381054000800060050F204000110110007574E5232303030100800020084103C000103      The wifi hardware I am using is this:               lsusb     Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 001 Device 003: ID 07d1:3c09 D-Link System DWA-140 RangeBooster N Adapter(rev.B1) [Ralink RT2870]     Bus 001 Device 002: ID 1221:3234       Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub      UPDATE: When trying to manually install the driver for the wifi, I got this error while compiling that driver:               make -C tools     make[1]: Entering directory `/home/jean-pierre/Bureaublad/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools'     gcc -g bin2h.c -o bin2h     make[1]: Leaving directory `/home/jean-pierre/Bureaublad/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools'     /home/jean-pierre/Bureaublad/2010_0709_RT2870_Linux_STA_v2.4.0.1/tools/bin2h     cp -f os/linux/Makefile.6 /home/jean-pierre/Bureaublad/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/Makefile     make -C /lib/modules/2.6.31-14-generic/build SUBDIRS=/home/jean-pierre/Bureaublad/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux modules     make[1]: Entering directory `/usr/src/linux-headers-2.6.31-14-generic'       CC [M]  /home/jean-pierre/Bureaublad/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_md5.o     In file included from /home/jean-pierre/Bureaublad/2010_0709_RT2870_Linux_STA_v2.4.0.1/include/rt_config.h:92,                      from /home/jean-pierre/Bureaublad/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_md5.c:28:     /home/jean-pierre/Bureaublad/2010_0709_RT2870_Linux_STA_v2.4.0.1/include/mlme.h:1185: error: ‘MAX_LEN_OF_MLME_QUEUE’ undeclared here (not in a function)     make[2]: *** [/home/jean-pierre/Bureaublad/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/../../common/crypt_md5.o] Error 1     make[1]: *** [_module_/home/jean-pierre/Bureaublad/2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux] Error 2     make[1]: Leaving directory `/usr/src/linux-headers-2.6.31-14-generic'     make: *** [LINUX] Error 2      This could be because I couldn't update my compiler? While I am connected to the internet (I can access the internet through the browser), the terminal always responds with a 404 not found when trying to apt-get update.


title: Messed up bash.bashrc file, commands not working anymore

text: Trying installing Java, I tried to add it to the executable path with the line:                   export PATH=/usr/lib/jvm/jdk1.7.0_60/bin:$PATH      in the system-wide `/etc/bash.bashrc` file. For some reason this wasn't working, so I used:               JAVA_HOME=/usr/lib/jvm/jdk1.7.0_60     PATH=$PATH:$HOME/bin:$JAVA_HOME/bin     export JAVA_HOME     export JRE_HOME     export PATH      Initially this seemed to work fine, except that now `sudo`, `ls`, `find` and everything else aren't working anymore. I then tried to erase those lines and restart the system but the command weren't available; the errors are:               Command 'sudo' is available in '/usr/bin/sudo'     The command could not be located because '/usr/bin' is not included in the PATH  environment variable.     sudo: command not found      To fix this I copied the content of `/etc/environment` in `/etc/bash.bashrc`, added the line `export PATH=$PATH:/usr/lib/jvm/jdk1.7.0_60/bin` and then typed `source /etc/bash.bashrc`. Again, everything was working, but only on a single terminal window and not after a restart. I tried other things and currently at the end of `/etc/bash.bashrc` there are the lines:               export PATH=$PATH:/usr/lib/jvm/jdk1.7.0_60/bin/     export JAVA_HOME=$JAVA_HOME:/usr/lib/jvm/jdk1.7.0_60/bin/java/      But I have to type `source /etc/environment` and `source /etc/bash.bashrc` in all terminal windows to get both `java` and the commands. It's like my changes aren't permanent. Currently the result of `echo $PATH` in a clear terminal window is:               /usr/lib/jvm/jdk1.7.0_60/bin/      after `source /etc/environment` it becomes:               /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games      and eventually, after `source /etc/bash.bashrc` it is:               /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/jdk1.7.0_60/bin/      Full bash.bashrc file:               # System-wide .bashrc file for interactive bash(1) shells.          # To enable the settings / commands in this file for login shells as well,     # this file has to be sourced in /etc/profile.          # If not running interactively, don't do anything     [ -z "$PS1" ] && return          # check the window size after each command and, if necessary,     # update the values of LINES and COLUMNS.     shopt -s checkwinsize          # set variable identifying the chroot you work in (used in the prompt below)     if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then         debian_chroot=$(cat /etc/debian_chroot)     fi          # set a fancy prompt (non-color, overwrite the one in /etc/profile)     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '          # Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.     # If this is an xterm set the title to user@host:dir     #case "$TERM" in     #xterm*|rxvt*)     #    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'     #    ;;     #*)     #    ;;     #esac          # enable bash completion in interactive shells     #if [ -f /etc/bash_completion ] && ! shopt -oq posix; then     #    . /etc/bash_completion     #fi          # sudo hint     if [ ! -e "$HOME/.sudo_as_admin_successful" ] && [ ! -e "$HOME/.hushlogin" ] ; then         case " $(groups) " in *\ admin\ *)         if [ -x /usr/bin/sudo ]; then             cat <<-EOF             To run a command as administrator (user "root"), use "sudo <command>".             See "man sudo_root" for details.                  EOF        fi        esac     fi          # if the command-not-found package is installed, use it     if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then         function command_not_found_handle {                 # check because c-n-f could've been removed in the meantime                 if [ -x /usr/lib/command-not-found ]; then                     /usr/bin/python /usr/lib/command-not-found -- "$1"                     return $?                 elif [ -x /usr/share/command-not-found/command-not-found ]; then                     /usr/bin/python /usr/share/command-not-found/command-not-found -- "$1"                    return $?             else                printf "%s: command not found\n" "$1" >&2                return 127             fi         }     fi          export PATH=$PATH:/usr/lib/jvm/jdk1.7.0_60/bin/     export JAVA_HOME=$JAVA_HOME:/usr/lib/jvm/jdk1.7.0_60/bin/java/      Anyone can help me? I'm under Ubuntu 12.04 LTS


title: How to diagnose the problem when Apache at random times shows "Not Found" on the web?

text: Suppose I reload my web site 100 times by holding down `Ctrl`+`R` on my keyboard. I notice once in a while Apache throws out a               Not Found      error message. If I refresh again, everything works normal again. This makes it difficult to even discuss the issue.   This makes it difficult to even diagnose the issue.   This makes it difficult to even ask questions about the issue. How can one diagnose the issue?


title: /home/user: change directory failed error

text: I just installed Arch reading from the Beginners' Guide on the Arch Wiki. Once I rebooted Arch, I logged into root then I added my own personal account: `useradd fox` then `passwd fox` and set my password for the account. Once I logged in with fox I was prompted with the error `\--fox: /home/fox: change directory failed: No such file or directory. Logging in with home = "/".` I'm new to Linux and I told myself that, no matter how hard Arch is to a new user (from what I heard), it'll be the first one. So could someone tell me why I'm receiving this error and how I can fix it?


title: Which part of this bash PS1 config determine the color?

text: I got my git branch color set by this tutorial:http://www.bramschoenmakers.nl/en/node/624 But recenlty I've reverted my terminal background color, and the yellow branch name is nearly invisible under grey background. So I need to change this config:               export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;33m\]$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] '      The problem is, I can't discern which part determines the color in the above code, thus I ask for help here.


title: Search for files by content only in trunk subdirectories

text: I think its a simple question, but the answer is probably a little more complicated :P **Edit:** Actually, its not complicated at all!^^ So I have a directory with multiple svn projects and I would like to search through all recent files (in trunk folder) by content in all projects. Here is somewhat the folders look like:               Projects     |     ->Project1     |   |     |   ->tags     |   |     |   ->trunk     |     ->Project2     |   |     |   ->tags     |   |     |   ->trunk     ...


title: How do I allow user permissions to data on a Couchpotato and Sickbeard Plugin using Freenas

text: Trying to setup permissions for the plugins sickbeard / couchpotato. I’ve read almost every thread google / the forums have but haven’t really found a solution yet.   I’m assuming it’s the data here: (Jail name)/usr/pbi/xxxxxxxxxx   I tried:               chown -R guest:guest /usr/pbi/sickbeard-amd64/*       chown -R guest:guest /usr/pbi/couchpotato-amd64/*        But I couldn’t get it to work.   Or would I have to `chmod 777` the folders?


title: Should rpc.statd write anything into wtmp?

text: On several linux machines (some old custom variant of gentoo) I have huge wtmp files, up to gigabyte in size. After some experiments I know that there is `rpc.statd` daemon running on all servers and there is monitoring running with `rup` command. Monitoring server runs rup every minute with list of all machines; so statistics are collected. After each run of `rup` the `wtmp` file is getting bit larger. My question: Should rpc.statd update wtmp and what will it write into wtmp? My `last` command does not extract anything about `rup`, `rpc.statd` from wtmp.


title: Linux kernel 2.6 on ARM

text: I have compiled and installed the 2.6 kernel on an ARM board. I am using the ARM mini2440 board. I would like to know if there is already a way to access the General Purpose I/O port pins? Or will I have to do `ioctl()` and access them directly from the memory?


title: How check presence of service if present return status else -1

text: I am bit struggling with following. I would need one line sh command which follows following logic: Check if service present then return service status otherwise -1. I came up with following:               [mon@monitoring ~]# if service --status-all | grep sssd >/dev/null ;then service sssd status > /dev/null; echo $? ;else echo "-1";fi     dnsdomainname: Unknown host     3      I would need to get rid of noisy output and just leave the number. Cannot figure from where that is coming. Any help appreciated.


title: Add Ubuntu to list of Grub boot options

text: I have an old laptop with an old version of Debian. I would like to install Ubuntu as well. Is it possible to install Ubuntu from the HD (not a rescue CD or flash-drive) and have it reside as a Grub boot option?


title: How can I get a formatted date for a UNIX timestamp from the command line

text: I have a UNIX timestamp and I'd like to get a formatted date (like the output of `date`) corresponding to that timestamp. My attempts so far:               $ date +%s     1282367908     $ date -d 1282367908     date: invalid date `1282367908'     $ date -d +1282367908     date: invalid date `+1282367908'     $ date +%s -d +1282367908     date: invalid date `+1282367908'      I'd like to be able to get output like:               $ TZ=UTC somecommand 1282368345     Sat Aug 21 05:25:45 UTC 2010


title: NFS mounting wrong File System

text: I have followed this How To ( https://help.ubuntu.com/community/SettingUpNFSHowTo ). My machine has a file system 30GB and other File System of 1TB mounted on /backup As this How To says to create a /export and mount with --bind the folder you want on it, I did this: Mounted the 1TB FS on /backup, mkdir /export, mounted --bind /backup /export. then went to the client and mounted -nfs nfs_server:/export /nsf-backup. but when I run df -h it says I have 30GB on /nfs-backup insted of 1TB, it is not recognizing that the 1TB FS is mounted on /backup. Am I missing something here? First time working with NFS.               client@host:~$ df -h     Filesystem                   Size  Used Avail Use% Mounted on     /dev/sda2                    138G   20G  112G  15% /     udev                         1.4G  4.0K  1.4G   1% /dev     tmpfs                        577M  1.2M  576M   1% /run     none                         5.0M     0  5.0M   0% /run/lock     none                         1.5G  156K  1.5G   1% /run/shm     /dev/sdb1                    597G  241G  356G  41% /extHD     nfs-server-IP:/export/backup   30G  896M   28G   4% /nfs-backup          root@nfs-server:/backup# df -h     Filesystem      Size  Used Avail Use% Mounted on     /dev/xvda1       30G  896M   28G   4% /     none            4.0K     0  4.0K   0% /sys/fs/cgroup     udev            284M   12K  284M   1% /dev     tmpfs            59M  204K   59M   1% /run     none            5.0M     0  5.0M   0% /run/lock     none            295M     0  295M   0% /run/shm     none            100M     0  100M   0% /run/user     /dev/xvdf1      985G   14G  922G   2% /backup


title: Changing default line discipline at kernel level

text: How to assign line discipline to particular serial port at kernel level?


title: How do I 'unbook' a pdf

text: I have a pdf file that was made into a booklet format. It is meant to print on A4 paper in landscape orientation; here are two pages in the pdf, which should correspond to four pages in the actual book.                -------------------------------     |              |                |     |              |                |     |              |                |     |    (1)       |      (3)       |     |              |                |     |              |                |     |              |                |      -------------------------------            -------------------------------     |              |                |     |              |                |     |              |                |     |    (4)       |      (2)       |     |              |                |     |              |                |     |              |                |      -------------------------------      The bracketed numbers correspond to the order of the individual pages. I know that there are all sorts of commands (pdfbook, pdfnup, etc.) on linux (which was probably used to make this booklet in the first place). How do I 'unbook' it---that is, I'd like to make a pdf document from this where each individual page of the final product is an individual page of the pdf, ordered in the usual way. **Edit** Thanks to Gilles, I managed to use the following code:               import copy, sys     from pyPdf import PdfFileWriter, PdfFileReader     input = PdfFileReader(sys.stdin)     output = PdfFileWriter()     second_half = []     for i in range(0,input.getNumPages()):         p = input.getPage(i)         q = copy.copy(p)              print >> sys.stderr, 'splitting page',i         print >> sys.stderr, '\tlowerLeft:',p.mediaBox.lowerLeft         print >> sys.stderr, '\tupperRight:',p.mediaBox.upperRight              p.mediaBox.upperRight = (ur[0], (bl[1]+ur[1])/2)         p.mediaBox.lowerLeft = bl              q.mediaBox.upperRight = ur         q.mediaBox.lowerLeft = (bl[0], (bl[1]+ur[1])/2)              if i % 2 == 0:             output.addPage(p)             qold = q         else:             output.addPage(q)             output.addPage(qold)             output.addPage(p)     output.write(sys.stdout)


title: Bash script with quotes and spaces

text: I'm trying to get some nice output out of git:               FORMAT='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'     LOG_PARAMS="--color --pretty=format:$FORMAT --abbrev-commit --no-walk"     function gch() {       git log $LOG_PARAMS $(commits)     }      (where commits is a function that collects relevant commits). But I get this instead:               fatal: ambiguous argument '%(s)': unknown revision or path not in the working tree.     Use '--' to separate paths from revisions      Presumably that has something to do with the quoting and spaces, but I'm far from fluent in bash. Any help?


title: mod_python won't "./configure" because it can't determine httpd version

text: I'm trying to install mod_python 3.3.1 on Apache 2.4.3 and whenever I try to run `./configure` (with apxs etc) and instead of configuring correctly, it says that Apache 2.x is required and my current version is . I've tried on two different versions of Apache, and Two different versions of mod_python but always with the same result. I am running as root. Any suggestions?               # ./configure --with-apxs=/wwwroot/bin/apxs     checking for gcc... gcc     checking for C compiler default output file name... a.out     checking whether the C compiler works... yes     checking whether we are cross compiling... no     checking for suffix of executables...     checking for suffix of object files... o     checking whether we are using the GNU C compiler... yes     checking whether gcc accepts -g... yes     checking for gcc option to accept ANSI C... none needed     checking for ar... ar     checking for a BSD-compatible install... /usr/bin/install -c     checking whether make sets $(MAKE)... yes     checking for main in -lm... yes     checking for an ANSI C-conforming const... yes     checking your blood pressure... a bit high, but we can proceed     configure: checking whether apxs is available...     checking for --with-apxs... /wwwroot/bin/apxs executable, good     checking Apache version... ./configure.lineno: /wwwroot/bin/apxs: not found     ./configure.lineno: /wwwroot/bin/apxs: not found     ./configure.lineno: /: permission denied          configure: error: This version of mod_python only works with Apache 2. The one you have     seems to be .     #


title: Easily connecting to the internet with FreeBSD

text: I am a beginner at using UNIX, and I have a small Toshiba notebook computer which I installed FreeBSD 9.x on. I looked at the online handbook to try to find out how to connect to the internet, but it is all really complex. I would prefer a simple way to do this. I have an ethernet connector, so if I really need to, do I just plug it in to the computer and router? Is there any danger of doing anything to the router?


title: For filenames, are underscores or dashes more common in Unix file names?

text: When you are naming files with multiple words in the name, is it more common in Unix systems to use underscores, camel case, or dashes to separate the words?


title: Can I test Debian from its live USB being with Windows installed on my machine?

text: For example, I can run test Ubuntu from USB. They explicitly say in their tutorials that I can do it, that the Windows may be installed on my machine but I safely for my Windows can run and see and basically test Ubuntu from USB. I'm reading now about Debian live USB. But there is no any word if it is possible to run Debian from USB the same way as Ubuntu on machine with Windows XP installed. It it as safe as Ubuntu? Or is it possible only if some Linux is installed on my machine, not Windows? I don't want to install it for now. I just want to run it to see it. I don't want it to damage my current Windows XP.


title: Reverse Loopback

text: How to configure reverse loopback on an ethernet device? In that case, all the traffic received will be sent back to transmitter connected to ethernet port.


title: "Argument list too long": How do I deal with it, without changing my command?

text: When I run a command like `ls */*/*/*/*.jpg`, I get the error               -bash: /bin/ls: Argument list too long      I know why this happens: it is because there is a kernel limit on the amount of space for arguments to a command. The standard advice is to change the command I use, to avoid requiring so much space for arguments (e.g., use `find` and `xargs`). What if I don't want to change the command? What if I want to keep using the same command? How can I make things "just work", without getting this error? What solutions are available?


title: PuTTY can access serial port as /dev/ttyUSB0, but not as named udev device

text: I have multiple USB-to-serial converters. I need to access one of them in particular. I'm using a udev rule to give it a special name. I have rebooted since I last modified it.               SUBSYSTEM=="usb", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", NAME="serial", MODE="0666"      That vendor/product combination is unique among all of my usb devices.               $ ls -l /dev/serial     crw-rw-rw-. 1 root root 189, 133 Feb  8 23:57 /dev/serial     $ ls -l /dev/ttyUSB0     crw-rw----. 1 root dialout 188, 0 Feb  8 23:58 /dev/ttyUSB0      I'm using PuTTY to read them, and it works on `/dev/ttyUSB0`, but not on `/dev/serial` . The error still appears when I am running PuTTY as root. ![The error message I receive](http://i.stack.imgur.com/vYXzk.png)               Unable to open connection to :     Unable to configure serial port      In case it matters, I'm running CentOS 6.               uname -a     Linux xxxxxx 2.6.32-279.22.1.el6.x86_64 #1 SMP Wed Feb 6 03:10:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux      # EDIT: WORKING The following udev rule was what finally worked:               SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="COM1", MODE="0666"      Note that `SUBSYSTEM` is tty, not usb, `NAME` has been changed to `SYMLINK+`, and serial has been changed to COM1 (to not interfere with /dev/serial, as a commenter pointed out.) Thanks for your help, guys!


title: How to match 2 large file and print the difference in shell script

text: I have 2 files. File1 has 400k numerical records. e.g:               1     2     3     4     5     6     .. and so on File 2 also has 420k numerical records. e.g:               1     2     3     4     6      .. and so on Both these file are in unsorted manner. I want to match the 2 file's and print the difference. When I try using `diff`, `comm`, or `grep` it take a long time (more than an hour). This is not feasible for me. How can I do this faster (matching and printing the difference). I use HP -UX.


title: Entry point of linux kernel

text: In the linux kernel is there a file that I can start to add my code, ex. load libraries? thanks


title: Ubuntu Linux and SCO UNIX OpenServer

text: Can Ubuntu Linux run SCO UNIX OpenServer 5.0.7 _applications_ like filePro? Can I use CTAR to copy application directories from a CTAR backup tape to Linux Ubuntu?


title: 'ipkg search xxx' always returns no answer

text: On a Synology NAS (uses a 'home grown' *nix variant (possibly based on Debian?)) I have installed ipkg package manager. When I try a command like               ipkg search shred       or               ipkg search *shred*       it returns only the single line:               Successfully terminated      without any package name. I specifically used shred in my example as I know that shred exists for my platform and is part of the coreutils package (and so should return that answer.) What is going wrong? Is this a bug, an error in my syntax or possibly something else? Edit - I found the answer - filename needed to be enclosed in single quotes like               ipkg search '*shred*'      This returns the correct answer - coretutils. I also found that Pavel is correct, it only returns info on _installed_ packages, which is not what I needed. How would I go about finding what pkg to install if I need a given program/util that is part of a larger collection but don't know what package contains it? (is that permitted or should I start another question?)


title: No /dev/null on Fedora 17

text: I'm running `Fedora 17` and `/dev/null` does not exist, why not? Should I just create it with:               mknod -m 666 /dev/null c 1 3


title: FreeBSD: spdylay build error

text: I try to install the latest curl updates from ports (curl-7.37.1_2) with HTTP/2.0 support enabled and I need to build spdylay for that purpose, but I keep getting the following strange errors and cannot find information about them anywhere:                    spdylay_ssl.o: In function `spdylay::connect_to(std::string const&, unsigned short)':     spdylay_ssl.cc:(.text+0x328): undefined reference to `std::ctype<char>::_M_widen_init() const'     spdylay_ssl.o: In function `spdylay::make_listen_socket(std::string const&, unsigned short, int)':     spdylay_ssl.cc:(.text+0x56e): undefined reference to `std::ctype<char>::_M_widen_init() const'     spdylay_ssl.o: In function `spdylay::ssl_handshake(ssl_st*, int)':     spdylay_ssl.cc:(.text+0xa25): undefined reference to `std::ctype<char>::_M_widen_init() const'     spdylay_ssl.cc:(.text+0xabf): undefined reference to `std::ctype<char>::_M_widen_init() const'     spdylay_ssl.o: In function `spdylay::nonblock_connect_to(std::string const&, unsigned short, int)':     spdylay_ssl.cc:(.text+0x1018): undefined reference to `std::ctype<char>::_M_widen_init() const'     spdylay_ssl.o:spdylay_ssl.cc:(.text+0x1214): more undefined references to `std::ctype<char>::_M_widen_init() const' follow     collect2: error: ld returned 1 exit status     *** [spdycat] Error code 1      How can I resolve this problem?                 FreeBSD 9.2 x86_64     gcc version 4.9.2 20140820     OpenSSL 1.0.1i 6 Aug 2014          CC=gcc49     CXX=g++49     CPP=cpp49     CFLAGS+=-mssse3          WITH_PKGNG=yes     WITH_OPENSSL_PORT=yes


title: PVR meta data viewer for linux

text: I recorded some videos from my DVB-S device and it created some `.mpg` videos and a `.pvr` file for each; Also a `info3.pvr` file for each recording that keeps metadata info (record time,name,...).   I need to read this file (`info3.pvr`) and get those metadata.   The file is a binary file. Is there any viewer application for this type of files for Linux?


title: Is there a way to temporarily change the terminal colour?

text: I use the `gnome-terminal` and most of my editors with a white on black theme as I find its easier on the eyes. One of my labs requires screenshots of the terminal (with the process) to be submitted along with program code. So, is there a way to temporarily change the terminal to a black on white colour scheme, preferably from within the terminal itself ? If not, is there a way to launch a child terminal with the inverted colour scheme, without affecting the parent terminal ?


title: SSH Server on Ubuntu not works

text: I wanted to start SSH server on Ubuntu 14.04 running on VirtualBox. I installed Openssh, sshd, etc., configured sshd_config to listen on ip, which I see in ifconfig and it not working. I'm starting sshd on port 2222. nmap gives:               PORT        STATE        SERVICE     80/tcp        open        http     2222/tcp        open        EtherNet/IP-1     8080/tcp        open        http-proxy      HTTP server started at 8080 works fine, so why SSHD service isn't recognized? When I try to log in by ssh as a client I see "Could not resolve hostname : Name or service not known" Please help


title: Failed installation 32-bit python on 64-bit Linux Mint

text: I basically have two questions:   1. How do you install 32-bit Python alongside 64-bit Python on linux?   2. How do I fix my broken system from the failed attempt below? I just tried to install a 32-bit python alongside my 64-bit python on Linux Mint 16. It's not as straight forward as I hoped for (something like `sudo apt-get install python32` would be nice) but after a bit of googling I downloaded Python 2.7.6 and did the following:               sudo apt-get install ia32-libs gcc-multilib checkinstall     CC="gcc -m32" LDFLAGS="-L/lib32 -L/usr/lib32 -Lpwd/lib32 -Wl,-rpath,/lib32 -Wl,-rpath,/usr/lib32" ./configure --prefix=/opt/pym32     make     sudo checkinstall      The should supposedly make me able to run 32-bit or 64-bit (default) like this:               python -c 'import sys; print sys.maxint'     /opt/pym32/bin/python -c 'import sys; print sys.maxint'      ... but `/opt/pym32/` wasn't even created. Worse, my system now reports 29 broken dependencies, indicating that the new python replaced the old one or something like that. To fix it, aptitude suggests that I remove a whole bunch of packages that I need and install a whole bunch of packages that I don't need. I used checkinstall rather than `make install` to be able to reverse/uninstall if something went wrong, but uninstalling/reinstalling python won't work because of the broken dependencies. Is there a way to get out of this mess?


title: Wifi not working

text: I just dual-booted windows 7 with Debian 7, during the installation it said the wifi firmware was missing so I installed without an internet connection, after the installation I got my LAN cable to install various programs but now i'm having problems configuring the wifi connection, on the windows partition wifi works fine. So first thing I did was install the module for my wifi card, which is:                 Intel Centrino Advanced-N 6205       I did it by installing iwlwifi on apt-get. After that it recognized my card, I think, because I could scan for the network:               root@debian:/home/user# iwlist wlan0 scan     wlan0     Scan completed :               Cell 01 - Address: 7A:B6:86:83:0A:08                         Channel:1                         Frequency:2.412 GHz (Channel 1)                         Quality=48/70  Signal level=-62 dBm                           Encryption key:on                         ESSID:"NETWORK"                         Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 9 Mb/s                                   18 Mb/s; 36 Mb/s; 54 Mb/s                         Bit Rates:6 Mb/s; 12 Mb/s; 24 Mb/s; 48 Mb/s                         Mode:Master                         Extra:tsf=00000008c098b443                         Extra: Last beacon: 2952ms ago                         IE: Unknown: 00074E4554574F524B                         IE: Unknown: 010882848B961224486C                         IE: Unknown: 030101                         IE: Unknown: 2A0100                         IE: Unknown: 32040C183060                         IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00                         IE: Unknown: 0B05010045127A                         IE: Unknown: DD07000C4304000000                         IE: Unknown: 0706434120010D10      I then installed iw to try to connect to the network:               root@debian:/home/user# iw dev wlan0 link     Connected to 7a:b6:86:83:0a:08 (on wlan0)         SSID: NETWORK         freq: 2412         RX: 33045 bytes (536 packets)         TX: 1232 bytes (17 packets)         signal: -59 dBm         tx bitrate: 1.0 MBit/s              bss flags:  short-preamble short-slot-time         dtim period:    0         beacon int: 100      It says i'm connected to the router, but I still don't have internet access. Some more output: ifconfig:               root@debian:/home/user# ifconfig     eth0      Link encap:Ethernet  HWaddr 3c:d9:2b:25:51:cb                 inet addr:192.168.1.72  Bcast:192.168.1.255  Mask:255.255.255.0               inet6 addr: fe80::3ed9:2bff:fe25:51cb/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:101484 errors:0 dropped:0 overruns:0 frame:0               TX packets:59551 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:139315514 (132.8 MiB)  TX bytes:5061083 (4.8 MiB)               Interrupt:20 Memory:d1500000-d1520000           lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:343 errors:0 dropped:0 overruns:0 frame:0               TX packets:343 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:30800 (30.0 KiB)  TX bytes:30800 (30.0 KiB)          wlan0     Link encap:Ethernet  HWaddr a0:88:b4:85:f5:cc                 inet addr:192.168.1.74  Bcast:192.168.1.255  Mask:255.255.255.0               inet6 addr: fe80::a288:b4ff:fe85:f5cc/64 Scope:Link               UP BROADCAST MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:297 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 B)  TX bytes:26754 (26.1 KiB)      EDIT:               root@debian:/home/user# ping 192.168.1.1     PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.     64 bytes from 192.168.1.1: icmp_req=1 ttl=64 time=1884 ms     64 bytes from 192.168.1.1: icmp_req=2 ttl=64 time=876 ms     64 bytes from 192.168.1.1: icmp_req=3 ttl=64 time=0.813 ms     64 bytes from 192.168.1.1: icmp_req=4 ttl=64 time=0.814 ms     64 bytes from 192.168.1.1: icmp_req=5 ttl=64 time=0.845 ms     64 bytes from 192.168.1.1: icmp_req=6 ttl=64 time=0.738 ms     64 bytes from 192.168.1.1: icmp_req=7 ttl=64 time=0.737 ms     64 bytes from 192.168.1.1: icmp_req=8 ttl=64 time=0.752 ms     64 bytes from 192.168.1.1: icmp_req=9 ttl=64 time=0.830 ms     64 bytes from 192.168.1.1: icmp_req=10 ttl=64 time=0.762 ms     64 bytes from 192.168.1.1: icmp_req=11 ttl=64 time=0.768 ms     64 bytes from 192.168.1.1: icmp_req=12 ttl=64 time=0.748 ms     64 bytes from 192.168.1.1: icmp_req=13 ttl=64 time=0.784 ms     64 bytes from 192.168.1.1: icmp_req=14 ttl=64 time=0.743 ms     ^C     --- 192.168.1.1 ping statistics ---     14 packets transmitted, 14 received, 0% packet loss, time 13006ms     rtt min/avg/max/mdev = 0.737/197.826/1884.227/518.915 ms, pipe 2               root@debian:/home/user# ping 8.8.8.8     connect: Network is unreachable      I also noted I'm not getting an inet address when i connect to the router, only after i type dhclient wlan0:               root@debian:/home/user# dhclient wlan0     PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.          --- 192.168.1.1 ping statistics ---     1 packets transmitted, 1 received, 0% packet loss, time 0ms     rtt min/avg/max/mdev = 0.984/0.984/0.984/0.000 ms      I do get an inet address. But still no internet, moreover, after getting the inet address pinging the router will output errors:               root@debian:/home/user# ping 192.168.1.1     PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.     From 192.168.1.74 icmp_seq=2 Destination Host Unreachable     From 192.168.1.74 icmp_seq=5 Destination Host Unreachable     From 192.168.1.74 icmp_seq=8 Destination Host Unreachable     From 192.168.1.74 icmp_seq=17 Destination Host Unreachable     ^C     --- 192.168.1.1 ping statistics ---     20 packets transmitted, 0 received, +4 errors, 100% packet loss, time 19120ms      EDIT 2:               root@debian:/home/user# ip route     192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.72      192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.74      root@debian:/home/user# route     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     192.168.1.0     *               255.255.255.0   U     0      0        0 eth0     192.168.1.0     *               255.255.255.0   U     0      0        0 wlan0      EDIT 3: Currently can't connect to the network at all:               root@debian:/home/user# ifconfig wlan0 up     root@debian:/home/user# iw dev wlan0 connect NETWORK keys 1:password     root@debian:/home/user# iw dev wlan0 link     Not connected.      I can still scan for the network though.


title: RAID configuration file not present

text: I am trying to configure RAID disks in my SUSE machine. I have 2 disks currently. I am trying to configure them as RAID using the below command.               mdadm --create --verbose /dev/md0 --level=stripe --raid-devices=2 /dev/sdb6 /dev/sdc5      However, in this link it is suggested that after using the mdadm command I have to edit the **/etc/mdadm.conf** file. But I do not have a mdadm.conf file currently. My question is, will this file get generated automatically after I run the mdadm command?


title: Bash newline doesn't print

text: I would like to output results in latex table format using a bash script. However, when I want to add a newline symbol, bash either prints it (\n) or doesn't add a newline. I already tried several things (e.g. the ones mentioned http://superuser.com/questions/154936/echo-text-with-new-line-in-bash), but nothing seems to work. What am I doing wrong?               echo "$(cat $outputFile)$latexString" > $outputFile     echo "\\\\" >> $outputFile     echo "" >> $outputFile      `$latexString` is the line of the table I want to save, `\\\` is the EOF for the line in the table, and after that I want to have a newline. EDIT The output file should look like:               res1 & 1 & 2 & 3 & 4 \\     res2 & 5 & 6 & 7 & 8 \\     ...      'latexString' is then e.g.,               res1 & 1 & 2 & 3 & 4


title: How to associate with an EA-N66 (in repeater mode) in Debian Wheezy?

text: I bought an Asus EA-N66 that I want to use in repeater mode to extend the range of my 2.4 GHz wireless network. The setup guide allowed me to associate it to the correct SSID without a hitch, and I configured it (as per Asus' instructions) with a different SSID (but the same network passphrase) to be able to select one of the two networks depending on which one provides the best signal strength. However, I can't seem to get Debian Wheezy to associate with the EA-N66. `iwlist scan` shows it being there, along with my non-repeated wireless network. With the following in `/etc/network/interfaces`, the system connects to the regular wireless network:               auto wlan3     iface wlan3 inet dhcp         wpa-psk <long hex string>         wpa-ssid MySSID         wpa-proto RSN      However, if I change it to the following               auto wlan3     iface wlan3 inet dhcp         wpa-psk <same long hex string>         wpa-ssid MyRepeaterSSID         wpa-proto RSN      then it doesn't seem to want to associate when I do `/etc/init.d/network stop` followed by `start` (indicated by not receiving any DHCP replies). Digging around I came across a wireless security how-to on UbuntuForums, which has some specific suggestions. Based on it, instead I tried:               auto wlan3     iface wlan3 inet dhcp         wpa-psk <still same long hex string>         wpa-ssid MyRepeaterSSID         wpa-proto RSN WPA         wpa-pairwise CCIP TKIP         wpa-group CCIP TKIP         wpa-key-mgmt WPA-PSK         wpa-ap-scan 1      but the system still doesn't seem to want to associate (still no DHCP replies). What further settings do I need to change? **How do I make use of the EA-N66 in repeater mode with Debian Wheezy?** Preferably with a minimum of changes between the regular and the repeated networks while still able to actively pick one over the other. Just in case it matters, the network card is an Atheros AR9287-based TP-LINK TL-WN881ND, run by the `ath9k` kernel module.


title: Synergy: Connection failed to connect to server: incompatible client 1.3

text: I have installed synergy 1.5 on a RHEL6 server (panther) and Xubuntu 13.10 (wolf). My synergy.conf file is               section: options         screenSaverSync = true     end     section: screens         panther:         wolf:     end     section: links         panther:         right = wolf        wolf:            left = panther     end      As a non-root user on panther I start the server               synergys --config /etc/synergy.conf      and get the following message               INFO: Synergy 1.5.0 Server on Linux 2.6.32-358.2.1.el6.x86_64 #1 SMP Wed Feb 20 12:17:37 EST 2013 x86_64      However when I run `synergyc -f panther` on the client machine               NOTE: connecting to panther: 172.31.70.161:24800     WARNING: failed to connect to server: incompatible client 1.3      I get the same error when substituting panther with the ip and also with iptables disabled on the server. Any ideas


title: Rearrange the file content

text: I have a file with content as               123 OneTwoThree     234 TwoThreeFour     345 ThreeFourFive      I want to convert this file into something like this               OneTwoThree  123     TwoThreeFour  234     ThreeFourFive  345      Here the first column entries must get replaced at 25th place. If second column of original file have more letters that 25 then, rest letter must get skipped **that means it should remove all characters after the 25th** e.g. in above sample output file, `1` of first column is at 26th position. Is it possible to do this with the help of awk, sed or any such command line tool ?


title: Network statistics on linux

text: I am trying to write a small script to gather network statistics on my Linux system. Is there any way I can do this? What I'm after is live stats on current network throughput. I have done some reading and found that /proc/net/dev is useful and I can parse in the content of this to work out current network speed. Is this a viable/reliable way of doing this? How do packages like iptraf, iftop calculate speed up and down?


title: /etc/sudoers - Insults - How to add a list of insults?

text: I intend to play with the linux insults and add a few. However, i only could figure how to add a single insult but not a list or the location of the file that contains the insults.


title: Is it alright to have two PATH variables in .bash_profile

text: I am trying to setup Metasploit on osx 10.7, but I need to edit my `.bash_profile` and I noticed something unusual to me. I have been reading about setting the environment variable on http://linux.die.net. I read the `.bash_profile` stuff and the section on invocation. But, I don't understand why my `.bash_profile` file looks like this (these are the only two statements in the file):               PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin :/usr/X11/bin          PATH=/usr/local/opt/ruby193/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/us r/sbin:/sbin:/usr/local/bin:/usr/X11/bin      Why are there two `PATH` statements? I don't understand how bash works, so I read a little bit about that, `.bash_profile`, and setting environment variables in a book by Newham & Rosenblatt called _bash_. I think we are programming the shell's setup environment. But, from my programming experience I would think that the 1st PATH statement is just getting overwritten by the 2nd statement. I think the 2nd statement was created when I used an automated installation for ruby. The 2nd statement is the same as the 1st one, but it has the ruby directory at the beginning. Can I just delete the 1st statement?


title: Why does redirection (>) not work sometimes but appending (>>) does?

text: While studying for the RHCE, I came across a situation where stdin redirection does not work in `bash`:               # file /tmp/users.txt     /tmp/users.txt: cannot open `/tmp/users.txt' (No such file or directory)       # semanage login -l > /tmp/users.txt     # file /tmp/users.txt     /tmp/users.txt: empty      However, this works:               # file /tmp/users.txt     /tmp/users.txt: cannot open `/tmp/users.txt' (No such file or directory)     # semanage login -l >> /tmp/users.txt     # file /tmp/users.txt     /tmp/users.txt: ASCII text      Why is this the case? **1st Update:** Permissions:               # ls -ld /tmp     drwxrwxrwt. 8 root root 4096 Jul 17 15:27 /tmp      ACLs (not an ACL mount but just in case):               # getfacl /tmp     getfacl: Removing leading '/' from absolute path names     # file: tmp     # owner: root     # group: root     # flags: --t     user::rwx     group::rwx     other::rwx      And I'm performing all commands as `root` (hence the bang prompt). **2nd Update** Per Caleb, full permissions listing of `/tmp`:               # ls -al /tmp     total 40     drwxrwxrwt.  8 root    root    4096 Jul 17 15:37 .     dr-xr-xr-x. 26 root    root    4096 Jul 17 15:07 ..     drwx------.  2 melmel  melmel  4096 Jul 16 21:08 .esd-500     drwxrwxrwt.  2 root    root    4096 Jul 17 15:07 .ICE-unix     drwx------.  2 gdm     gdm     4096 Jul 17 15:08 orbit-gdm     drwx------.  2 gdm     gdm     4096 Jul 17 15:07 pulse-5E9i88IGxaNh     drwx------.  2 melmel  melmel  4096 Jul 16 21:08 pulse-329qCo13Xk     -rw-------.  1 root    root       0 Jul 16 14:32 tmpXd9THg     -rw-------.  1 root    root       0 Jul 16 12:55 tmpie0O98     -rw-------.  1 root    root       0 Jul 16 20:23 tmpr10LrK     -r--r--r--.  1 root    root      11 Jul 17 15:07 .X0-lock     drwxrwxrwt.  2 root    root    4096 Jul 17 15:07 .X11-unix     -rw-r--r--.  1 root    root     865 Jul 16 20:20 yum.conf.security     -rw-------.  1 root    root       0 Jul 10 14:57 yum.log      **3rd Update:** _Per Hello71:_               # mount | grep /tmp     # mount | grep -w '/'     /dev/mapper/vg_svr-tap-lv_root on / type ext4 (rw)      _Answers to Gilles' questions:_ > Is this something you read about in a book, or did you reach this situation > on a real machine? Noticed this while performing a lab in a book on a real machine. > Is SELinux in use?               # sestatus      SELinux status:                 enabled     SELinuxfs mount:                /selinux     Current mode:                   enforcing     Mode from config file:          enforcing     Policy version:                 24     Policy from config file:        targeted      > Some Linux-on-Linux virtualisation? Yes. KVM/QEMU guest. > I second Hello71's request, except please grep /tmp /proc/mounts Nothing matches. > Also env | grep '^LD_' please. Nothing matches. > Oh, and can we rule out active attacks Yes we can. I'm the only one that has access to this guest.


title: Only allow ssh/vpn on OpenWRT

text: If I don't want to use wireless encryption, but I still want security and I want to use sshuttle (on the clients, see: https://github.com/apenwarr/sshuttle/) for tunneling everything through an SSH tunnel then what could I do to prevent ANY traffic through the router? OpenWrt 10.04 Backfire. So the wireless clients doesn't get ANY traffic until they OpenVPN'ed or SSH tunneled to the router. So if someone sees the unencrypted wireless connection, and connects to it, then it couldn't surf the net, because it's blocked "somehow" (<- the question is this). And he can't even see the connected wireless clients, e.g.: with using (wifi-iface section):               option 'isolate' '1'      So it could only see that there is the router, e.g.: 192.168.1.1 and has only 1 open port sshd on e.g.: 55555. In this way the "real" (valid) clients could be sure that they connect to the good router & and the traffic would be fully encrrypted?


title: Upgrading ffmpeg

text: How can I upgrade `ffmpeg` to version 0.6 on debian-based operating system? I'm using apt-get for installation and deb packages.


title: Terminal, Prompt changed to "-Bash-4.2" and colors lost

text: Usually my terminal prompt was               username place$      now it only shows               bash-4.2$      and all the color settings have been lost (on the terminal profile I have the same color scheme, but it just don't show colors) I don't have any idea of what happens (and I don't know how to search for this). It changes from nothing, I was working with eclipse and maven, opened a new terminal and the new terminal didn't have colors. Note: I don't have a ~/.bashrc file, but I have a ~/.bash_profile.


title: How do I run a command if my server wakes up from hibernate?

text: How do I get a bash command executed each time when my server wakes up from hibernate? For ex. I want to restart my XBMC on Ubuntu when my PC wakes up with               $ sudo killall xbmc.bin -9      Where should I place that command?


title: Regex doesn't work with grep

text: I have a string like this               TEST="/dev/sda1 on /media/sda1 type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,quiet)"      (Result from `mount | grep sda1`) where I want to match the mount point. My regex (adopted from here) is `(?<=on[ \t])(.*)(?=[ \t]type)` But for some reasons it doesn't work for me with several tools (Busybox ash 1.14.2): `echo $TEST | grep -o -e '(?<=on[ \t])(.*)(?=[ \t]type)'` Gives me no result. `echo $TEST | awk 'match($0, /(?<=on )(.*)(?= type)/){print $0}'` Returns an error `awk: bad regex '(?<=on[ ])(.*)(?=[ ]type)': Invalid preceding regular expression ` `expr match "$TEST" '\\(?<=on[ \t]\\)\\(.*\\)\\(?=[ \t]type\\)'` Also returns an empty result. I feel kinda stupid.


title: Importing CSV contacts into Evolution 3.0.2

text: I'm running Evolution 3.0.2 (stack from a Fedora 15 install). I have a CSV file with a few contacts. This file was created by a Samsung software, when backing up an old telephone I had. If I go to `File` -> `Import...` -> `Import a single file` and select my file I'm giving three options for `File Type`:   1. Evolution CSV or Tab (.csv, .tab)   2. Mozilla CSV or Tab (.csv, .tab)   3. Outlook CSV or Tab (.csv, .tab) I've tried importing using all of the three options but not a single of them seems to work: the destination location is unmodified. The Samsung-generated file is quite verbose. This is it's first line: > "Last name","First name","Display name","Nickname","Reading name (Last > name)","Reading name (First name)","Official title","Company name","Phone > number1 (Type)","Phone number1 (Number)","Phone number1 (Hot key)","Phone > number2 (Type)","Phone number2 (Number)","Phone number2 (Hot key)","Phone > number3 (Type)","Phone number3 (Number)","Phone number3 (Hot key)","Phone > number4 (Type)","Phone number4 (Number)","Phone number4 (Hot key)","Phone > number5 (Type)","Phone number5 (Number)","Phone number5 (Hot key)","Phone > number6 (Type)","Phone number6 (Number)","Phone number6 (Hot key)","Phone > number7 (Type)","Phone number7 (Number)","Phone number7 (Hot key)","Phone > number8 (Type)","Phone number8 (Number)","Phone number8 (Hot key)","Phone > number9 (Type)","Phone number9 (Number)","Phone number9 (Hot key)","Phone > number10 (Type)","Phone number10 (Number)","Phone number10 (Hot key)","Phone > number11 (Type)","Phone number11 (Number)","Phone number11 (Hot key)","Phone > number12 (Type)","Phone number12 (Number)","Phone number12 (Hot key)","Phone > number13 (Type)","Phone number13 (Number)","Phone number13 (Hot key)","Phone > number14 (Type)","Phone number14 (Number)","Phone number14 (Hot > key)","Email1 (Type)","Email1 (Address)","Email2 (Type)","Email2 > (Address)","Email3 (Type)","Email3 (Address)","Email4 (Type)","Email4 > (Address)","Email5 (Type)","Email5 (Address)","Email6 (Type)","Email6 > (Address)","Email7 (Type)","Email7 (Address)","Email8 (Type)","Email8 > (Address)","Email9 (Type)","Email9 (Address)","Email10 (Type)","Email10 > (Address)","Web page1 (Type)","Web page1 (Address)","Web page2 (Type)","Web > page2 (Address)","Web page3 (Type)","Web page3 (Address)","Web page4 > (Type)","Web page4 (Address)","Web page5 (Type)","Web page5 (Address)","Web > page6 (Type)","Web page6 (Address)","Web page7 (Type)","Web page7 > (Address)","Web page8 (Type)","Web page8 (Address)","Web page9 (Type)","Web > page9 (Address)","Web page10 (Type)","Web page10 (Address)","Messenger1 > (Type)","Messenger1 (ID)","Messenger2 (Type)","Messenger2 (ID)","Messenger3 > (Type)","Messenger3 (ID)","Messenger4 (Type)","Messenger4 (ID)","Messenger5 > (Type)","Messenger5 (ID)","Messenger6 (Type)","Messenger6 (ID)","Messenger7 > (Type)","Messenger7 (ID)","Messenger8 (Type)","Messenger8 (ID)","Messenger9 > (Type)","Messenger9 (ID)","Messenger10 (Type)","Messenger10 (ID)","Address1 > (Home/Office)","Address1 (Domestic/Foreign)","Address1 (P.O. box)","Address1 > (Details)","Address1 (Street number)","Address1 (City/Town)","Address1 > (County/Region)","Address1 (Country)","Address1 (Postcode)","Address2 > (Home/Office)","Address2 (Domestic/Foreign)","Address2 (P.O. box)","Address2 > (Details)","Address2 (Street number)","Address2 (City/Town)","Address2 > (County/Region)","Address2 (Country)","Address2 (Postcode)","Address3 > (Home/Office)","Address3 (Domestic/Foreign)","Address3 (P.O. box)","Address3 > (Details)","Address3 (Street number)","Address3 (City/Town)","Address3 > (County/Region)","Address3 (Country)","Address3 (Postcode)","Address4 > (Home/Office)","Address4 (Domestic/Foreign)","Address4 (P.O. box)","Address4 > (Details)","Address4 (Street number)","Address4 (City/Town)","Address4 > (County/Region)","Address4 (Country)","Address4 (Postcode)","Address5 > (Home/Office)","Address5 (Domestic/Foreign)","Address5 (P.O. box)","Address5 > (Details)","Address5 (Street number)","Address5 (City/Town)","Address5 > (County/Region)","Address5 (Country)","Address5 (Postcode)","Address6 > (Home/Office)","Address6 (Domestic/Foreign)","Address6 (P.O. box)","Address6 > (Details)","Address6 (Street number)","Address6 (City/Town)","Address6 > (County/Region)","Address6 (Country)","Address6 (Postcode)","Address7 > (Home/Office)","Address7 (Domestic/Foreign)","Address7 (P.O. box)","Address7 > (Details)","Address7 (Street number)","Address7 (City/Town)","Address7 > (County/Region)","Address7 (Country)","Address7 (Postcode)","Address8 > (Home/Office)","Address8 (Domestic/Foreign)","Address8 (P.O. box)","Address8 > (Details)","Address8 (Street number)","Address8 (City/Town)","Address8 > (County/Region)","Address8 (Country)","Address8 (Postcode)","Address9 > (Home/Office)","Address9 (Domestic/Foreign)","Address9 (P.O. box)","Address9 > (Details)","Address9 (Street number)","Address9 (City/Town)","Address9 > (County/Region)","Address9 (Country)","Address9 (Postcode)","Address10 > (Home/Office)","Address10 (Domestic/Foreign)","Address10 (P.O. > box)","Address10 (Details)","Address10 (Street number)","Address10 > (City/Town)","Address10 (County/Region)","Address10 (Country)","Address10 > (Postcode)","Birthday (Date)","Birthday (Solar/Lunar)","Anniversary1 > (date)","Anniversary1 (solar/lunar)","Anniversary2 (date)","Anniversary2 > (solar/lunar)","Anniversary3 (date)","Anniversary3 (solar/lunar)","Blood > type","Hobby","Ringtone type","Ringtone","Message ringtone type","Message > ringtone","Photo file","Memo","Voice recognition","two-phone > mode","Title","Middle name","Suffix","Department","Assistant > name","Assistant telephone","Manager","Government ID","Account","Customer > ID","Office location","Spouse","Children","Category","Additional > information" I imagine Evolution expects it to be in a different formation. Can someone point me out how Evolution expect this file to be? Then I could adjust it's columns accordingly. Or import it in a more direct way, if it's possible,


title: Can I insert sudo via the ^ command?

text: Sorry if this is a yes/no question.. I am reading this unix tutorial and found the following: > Repeating and Modifying the Previous Command > > [..]   >  If you mistype leavenworth as leaveworth you can correct it with the > following command: % ^leave^leaven Unfortunately I don't have a computer to try this on, but I was wondering: Since some commands require `sudo` to run, could I then write `^^sudo` to "insert" sudo to the previous command?


title: error with slap.d while installing software

text: I am trying to install wireshark (this issue is not specific to wireshark) on my ubuntu box and I keep getting the following error for slap.d:               Setting up slapd (2.4.23-6ubuntu6.1) ...       Creating initial configuration... mkdir: cannot create directory `/etc/ldap/slapd.d': File exists     dpkg: error processing slapd (--configure):      subprocess installed post-installation script returned error exit status 1     Errors were encountered while processing:      slapd      Besides uninstalling or trying to update open LDAP or slap.d, is there any other action that can be taken to resolve this issue? I am trying the install as root user & I have tried moving the slap.d conf file so far but without any luck. Any thoughts on troubleshooting/resolving this issue will be quite welcome. thank in advance


title: Make a computer act as a virtual USB device for other equipments

text: Some applications simulate a virtual USB or CD Rom drive as if a USB drive is attached to the computer. Is there any configuration or application that provides a virtual USB drive, not for the the operating system itself, but for other equipments which accept USB drive, through a USB port. So I'll have a virtual hard disk (e.g. a `*.vdi` file) in the computer, which is connected, through a USB socket, as a USB drive to some other equipment (e.g. a cell phone or a laptop).


title: Create url link in menu

text: How can I create a menu item that points to a URL? I've tried creating a `mylink.desktop` entry like this:               [Desktop Entry]     Encoding=UTF-8     Name=My Link Name     Icon=my-icon     Type=Link     Categories=Office;     URL=http://www.example.com/      then using `xdg-desktop-menu install mylink.desktop` should put this entry in the current user's menu. This does not work however. The file is copied into `~/.local/share/applications/` but the entry doesn't show up in the menu. If I change `Type` to `Application` and define `Exec` instead of `URL` then it works. But I don't want to have menu entry for a local application. I want a default browser to launch on a specified address when the menu entry is selected. How can I do that? Also, by using this command: `xdg-desktop-icon install mylink.desktop` the result is as expected - a new link is created on the desktop. So why doesn't it work in the menu? I tested this on RedHat Enterprise Linux 6 with KDE, but I would like to know how to do it in Gnome as well.