Read what is written to /dev/tty*

How can I read what is written to `/dev/tty*`(`*` = `0` \- number of _tty_ )? I tried `sudo tail -f /dev/tty1` on one terminal(`X`) and then `sudo cp .emacs /dev/tty1` from another. `X` didn't show the the content of `.emacs`but pressing `Ctrl-Alt-F1` I could see the content of the `.emacs`. Background. Is this question of the same category as this?


Mobile Broadband disconnects as soon as connected - Crunchbang

For months now my mobile broadband (GSM) stick has worked with Crunchbang. Yesterday it stopped. When I plug it in, it appears in the network manager and I can connect to it, but as soon as it is connected it disconnects. I switched to Liquorix kernel about 1.5 weeks ago and the stick worked with it as well, until now. Switching back to the original kernel does not fix it. Computer: Lenovo U410 GSM stick: Sierra Wireless USB 308 Has anyone run into this before and knows how to fix it? EDIT: Added dmesg output               usb 1-1: new high-speed USB device number 5 using xhci_hcd     usb 1-1: config 1 has an invalid interface number: 9 but max is 0     usb 1-1: config 1 has no interface number 0     usb 1-1: New USB device found, idVendor=1199, idProduct=0fff     usb 1-1: New USB device strings: Mfr=3, Product=2, SerialNumber=4     usb 1-1: Product: USB MMC Storage     usb 1-1: Manufacturer: Sierra Wireless, Incorporated     usb 1-1: SerialNumber: SWOC22905731     usb-storage 1-1:1.9: USB Mass Storage device detected     usb-storage: probe of 1-1:1.9 failed with error -5     usbcore: registered new interface driver usb-storage     usb 1-1: USB disconnect, device number 5     usb 1-1: new high-speed USB device number 6 using xhci_hcd     usb 1-1: config 1 has an invalid interface number: 7 but max is 4     usb 1-1: config 1 has no interface number 2     usb 1-1: New USB device found, idVendor=1199, idProduct=68a3     usb 1-1: New USB device strings: Mfr=3, Product=2, SerialNumber=4     usb 1-1: Product: USB 308     usb 1-1: Manufacturer: Sierra Wireless, Incorporated     usb 1-1: SerialNumber: 355385035042361     sierra 1-1:1.0: Sierra USB modem converter detected     usb 1-1: Sierra USB modem converter now attached to ttyUSB0     sierra 1-1:1.1: Sierra USB modem converter detected     usb 1-1: Sierra USB modem converter now attached to ttyUSB1     sierra 1-1:1.3: Sierra USB modem converter detected     usb 1-1: Sierra USB modem converter now attached to ttyUSB2     sierra 1-1:1.4: Sierra USB modem converter detected     usb 1-1: Sierra USB modem converter now attached to ttyUSB3     usb 1-1: Incompatible driver and firmware versions     usb 1-1: USB disconnect, device number 6     sierra ttyUSB2: resubmit read urb failed.(-19)     sierra ttyUSB2: resubmit read urb failed.(-19)     sierra ttyUSB2: resubmit read urb failed.(-19)     sierra ttyUSB2: resubmit read urb failed.(-19)     sierra ttyUSB2: resubmit read urb failed.(-19)     sierra ttyUSB2: resubmit read urb failed.(-19)     sierra ttyUSB2: resubmit read urb failed.(-19)     sierra ttyUSB2: resubmit read urb failed.(-19)     sierra ttyUSB0: Sierra USB modem converter now disconnected from ttyUSB0     sierra 1-1:1.0: device disconnected     sierra ttyUSB1: Sierra USB modem converter now disconnected from ttyUSB1     sierra 1-1:1.1: device disconnected     sierra ttyUSB2: Sierra USB modem converter now disconnected from ttyUSB2     sierra 1-1:1.3: device disconnected     sierra ttyUSB3: Sierra USB modem converter now disconnected from ttyUSB3     sierra 1-1:1.4: device disconnected      EDIT: Trying to set usb_modeswitch               sudo usb_modeswitch -v 119 -p 68a3 -S      Output from that:               Looking for default devices ...         No devices in default mode found. Nothing to do. Bye.      EDIT: Fixed typo in the usb_modeswitch command               sudo usb_modeswitch -v 1199 -p 68a3 -S      The command ran properly that time but to no effect. SOLUTION: After testing the device on multiple computers and multiple OS's it would seem that there are hardware problems. I can't add this as an answer yet.


How to remove emacs 23 related packages and leave installed emacs 24

I installed `emacs 24` in `Linux Mint 16`, and want to uninstall `emacs 23`. I thought `sudo apt-get remove emacs23` is enough, but it was not. This is my packages list relating `emacs`.               $ sudo dpkg --get-selections | grep emacs     emacs                       install     emacs23                     deinstall     emacs23-bin-common              install     emacs23-common                  install     emacs23-common-non-dfsg             install     emacs23-lucid                   install     emacs24                     install     emacs24-bin-common              install     emacs24-common                  install     emacs24-common-non-dfsg             install     emacs24-el                  install     emacsen-common                  install      To uninstall `emacs 23`, I tried `$ sudo apt-get remove emacs23*`. But it will also remove `emacs 24` also.               The following packages will be REMOVED:       emacs emacs23-bin-common emacs23-common emacs23-common-non-dfsg emacs23-lucid emacs24 emacs24-bin-common emacs24-common emacs24-common-non-dfsg emacs24-el      Can't use `*` as a `apt-get` argument? How should I remove `emacs 23` correctly?


Pointing domain name to server

I am still a newbie when it comes to Linux, and I recently bought 2 domains from NameCheap. Running a LEMP stack on Debian 7 and want to know how I can create name servers like `ns1.example.com` and `ns2.example.com` on my server, because that's what I need to set in my domain settings for them to point to my server. I am using Google's public DNS name resolver `8.8.8.8` and `8.8.4.4` (in my `resolv.conf` file), if that's of any help. I have found some lengthy tutorials on YT and elsewhere, but to me they weren't so clear because in every one they are setting up some kind of made up local domain (with Bind9). And haven't found anything that handles setting up name servers and making registered domains point to the server. If anybody could explain to me how I could achieve this (so that `example1.com` points to let's say `[ip]/site_dir1`), or tell me what I need to be searching for to get this done, it would be greatly appreciated.


Network issue - only one machine can't access webpage on another machine

I'm trying to figure out why my MacBook is unable to reach the web page served by my Raspberry Pi while other computers on my local network (or on external networks) have no problems seeing the web page. So I set up tcpdump on both the Mac and Pi and captured an attempt from both sides. My first question is the following: (in two parts) A) If an outgoing packet shows up in tcpdump, does that _guarantee_ that the packet was actually transmitted? (i.e. can there be anything downstream of the tap point that could prevent the packet from being sent?) B) If an expected incoming packet doesn't show up in tcpdump, does that _guarantee_ that the packet was never received? (i.e. can there be anything upstream of the tap point that could discard a received packet before tcpdump sees it?) These questions come from my observations of the tcpdump logs:   1. The Mac sends a short packet to the Pi   2. The Pi receives that packet and sends a short packet back to the Mac   3. The Mac receives that packet and sends two packets to the Pi; the 2nd packet has the browser info etc.   4. Neither of those packets is ever received by the Pi. If both my assumptions A & B above are correct, then this means my router is for some reason treating packets for the Mac differently from, e.g., packets for my WinXP machine. (I'm assuming it must be at my router because, outside of there there's no way of knowing what machine on the internal network the packet belongs to and therefore no way to treat different machines differently.) So if all of my assumptions are correct, any ideas on what's going wrong, or what I should look at next?


In Fedora, how do I turn off the automatic dictionary suggestions?

I just installed Fedora 19 in VirtualBox using an image from virtualboxes.org. It suggests words from a dictionary wherever I type. It's slow and it won't let me type what I want, since it automatically inserts the topmost dictionary suggestion. How do I turn it off? ![Terminal](http://i.stack.imgur.com/4hIxQ.png)


clonzilla + what the password for debian linux

Please advice what the password in debian Linux (debian Linux in clonezilla software - disaster recovery tool) Example I use the clonzilla (backup & restore tool) in order to clone Linux systems I boot the clonezilla on machine1 and escape to CMD ( from clonzilla ) in order to get debian Linux Machine1 - Debian Linux network:                192.168.20.100/24      Now I want to copy to my debian Linux some files from other machine - machine2 ( Linux red-hat 6.X) Machine2 network:               192.168.20.10/24      So I do the following on my machine2 in order to copy script.pl to my debian Linux ( machine1 )                 scp –rp  /tmp/script.pl  192.168.200.100:/tmp       root@192.168.20.100's password:      please advice what the password for debian Linux ?


What is the difference between X11R7.7 and X Server 1.14.4?

When I issue the command X -version in terminal window, I get the output: X.Org X Server 1.14.4 On the X.org website, it says that latest release is X11R6.7. I am confused why there are two version of the same thing. Please help!


User Access Permissions

I have recently taken ownership of a (FreeBSD) FileServer and need to identify which shares users have access to on an individual basis. Is there an easy way to achieve this with a single command?


php indent in web-mode with Emacs

I'm using Emacs web-mode and write a setting for it like this.               (require 'web-mode)     (add-to-list 'auto-mode-alist '("\\.php\\'" . web-mode))          (defun web-mode-hook ()       "Hooks for Web mode."       (setq web-mode-markup-indent-offset 2) ;; html indent       (setq web-mode-css-indent-offset 2)    ;; css indent       (setq web-mode-code-indent-offset 2))     (add-hook 'web-mode-hook 'web-mode-hook)      But indent of php code remain 8. (HTML indent is 2 as I expected) Why does not change the offset indention of php?


Wget command that returns [a list of] all webpages on a webserver

Let's say we have a website `www.example.com` with the following pages:               www.example.com/page1     www.example.com/unknown     www.example.com/unknown      Is there a Wget command that would produce the following output:               page1     page2     page3      How would this command change if the website structure was:               www.example.com/xxxx/page1     www.example.com/xxxx/page2     www.example.com/xxxx/page3      Essentially I have a server ip address and would like to be able to list all the pages held on the server, to see if there are any I am interested in to download. For instance I can do `wget -r www.example.com/page1` and I want to know if there are any other directories (`page2`, `page3`, etc) that I might be interested in. I have researched the `--spider` option and others, but with no joy.


tree command for multiple includes and excludes

Could you please give me an example of using the tree command to filter out result as follows:   * to ignore directories (say `bin`, `unitTest`)   * only listing certain files having extensions (say `.cpp`, `.c`, `.hpp`, `.h`)    * providing full path-names of only the resultant files matching the criteria.


Files in RPM packages

There is something strange with RPM packages. The listed contents, enumerated by `rpm -ql` differ from the actually presented files. For instance, I downloaded a `openldap-servers-2.4.26-8.fc16.i686.rpm` and ran the one-liner:               rpmfile=openldap-servers-2.4.26-8.fc16.i686.rpm; diff <(rpm2cpio $rpmfile | cpio -t | sed -e 's!^\.!!g') <(rpm -ql -p $rpmfile)      It compares the contents of the `rpm` unpacked by `rpm2cpio` with output from `rpm -ql` And got:               9122 blocks     20a21,22     > /etc/openldap/slapd.conf     > /etc/openldap/slapd.conf.bak     21a24     > /etc/pki/tls/certs/slapd.pem      `rpm -ql` states that there are 3 files in the package which actually are absent.   Is there an explanation for that?


Make copies of a single directory to multiple directories with different names

I'm trying to replicate a single directory (with sub-directories) to a bunch of new directories based on a list. For example I can: `mkdir Fred Barney Thelma Louise Foo Bar` How would I copy a premade directory (with some empty sub-directories) to the same set of names? For example: `cp -r master_folder/ Fred Barney Thelma Louise Foo Bar` Any suggestions much appreciated!


Merge floppy images in Raspbian

On my Raspberry pi I am trying to install windows 95 in dosbox. I know that it probably won't work, but I want to try. I cannot download the large CD image so I downloaded a set of 13 floppy images. The setup wizard, instead of asking me for the location of the drive that the floppy is in, prompts me to insert the floppy in the same drive, which AFAIK you can't do in Dosbox. TL;DR I would like to know how to merge 13 floppy images into one large image that the setup wizard can read. I am running Rasbpian


Quoting and escaping

I have a shell script, the arguments of which are collected in quote as a single argument and passed to a perl script.               /usr/local/API/check_api.sh "-D x.x.x.x -C Test_Internal_Cluster -u user -p pass  -i 300 -l runtime -s list"      which result to               /usr/bin/perl /usr/local/check_api.pl -D x.x.x.x -C Test_Internal_Cluster -u user -p pass -i 300 -l runtime -s list      I want to give an argument like this:               "Test Internal Cluster"      to the perl script. When I am using               "Test\ Internal\ Cluster"      as the argument to the shell script its parsing as               Test Internal Cluster      to the perl script, but I want that to be in double quotes. If I am using this:               ""\"Test Internal Cluster\"      It converting to: `'"Test' Internal 'Cluster"'` This seems simple but not able to use proper quoting and escaping to achieve. The shell script is:               #!/bin/bash -xv          Perl=/usr/bin/perl     Api=/usr/local/API/check_api.pl          if [ $# -gt 0 ]; then       if [ -x $Api ]        then             output=$($Perl $Api $1)             exitstatus=$?             F1=$(echo $output | awk -F':' '{print $1}')             F2=$(echo $output | awk -F':' '{print $2}' | awk -F'|' '{print $1}')             F3=$(echo $output | awk -F':' '{print $2}' | awk -F'|' '{print $2}')             echo " $F1: $F3 | $F2"       else             echo "check_api.pl not found"      fi      exit $exitstatus     else         echo "Usage : $0 '-D <DC> -C <Cluster> -u <userbame> -p <password> -i <interval> -l <command>  -s <subcommand>'"     fi      Here you can see the whole argument passed to the shell script is collected to `$1` and passed to the `check_api` perl script. The issue is happening with cluster name with space (passed to -C). And the whole argument passed to the shell script should be in single/double quotes. I haven't quoted the variable $1 because the perlscript is not accepting the whole argument as a single as below which I found in debug mode - where the whole argument is quoted if $1 is quoted.               /usr/bin/perl /usr/local/check_api.pl '-D x.x.x.x -C Test_Internal_Cluster -u user -p pass  -i 300 -l runtime -s list'      and throws error as incorrect usage But without quoting the $1 the argument passed to perl script works like this and which gives me the result:               /usr/bin/perl /usr/local/check_api.pl -D x.x.x.x -C Test_Internal_Cluster -u user -p pass -i 300 -l runtime -s list      But I am failed with a cluster with space in its name. In case of a space in cluster name if I am running in the command line directly(not from shell script) it works fine without any issue:               /usr/bin/perl /usr/local/check_api.pl -D x.x.x.x -C "Test Internal Cluster" -u user -p pass -i 300 -l runtime -s list      which I wanted to achieve from shell script.


Keeping xterm terminal alive on crunchbang linux debian wheezy

I like to keep a number of terminals open at different locations on my development VM. For this I use `terminator` because I got a big screen and I can divide the terminals anyway I want. But after some time these terminals close one after another. I don't use ssh so any keepalive options would not work. Is there any place where I can configure the terminal so that it does not timeout or close? I am using `GNU bash, version 4.2.37` as shell and `terminator` on 'xterm`


Making an alias which maps arguments to the middle of the command

I want to alias `killapp X` to `pidof X | xargs kill` or `kill `pidof X``, but I can't think of a way to do this with just an alias on `killapp`. How could I do this so I don't have to do `killapp X` `?


Problem at boot-time: "Loading user-defined modules [FAIL]"

After I updated my Kernel to version 3.0, i always get this line when my Arch- Linux system is booting up:               Loading User-specified Modules    [BUSY]    [FAIL]      I have no idea what could cause this to happen. My `MODULES`-array in the `/etc/rc.conf`-file looks like this:               MODULES=(fuse wl !b43 !ssb !usblp vboxdrv vboxnetflt)      I checked the modules which are loaded (using `modprobe`) and they all load just fine. My idea was, that one of the Blacklisted modules in my `MODULES`-array got kicked out of the kernel or renamed and now the system can't find it (to block it). So i checked all available kernel-modules using:               ls -R /lib/modules/3.0-ARCH/kernel/ | grep <module-name>      I found all of the modules in the array except for the last two (from VirtualBox). However, trying to manually load them with `modprobe` works and `lsmod` shows that they are probably loaded after boot. Also, I checked the `/var/log/kernel.log`-logfile (nothing obvious here). So, I need ideas on what could probably cause this to happen or where I can find the corresponding logfile (since there is a `daemons.log`-file, but no `modules.log`-file).


android partition and kernel 3.14

I mount a cell phone to my debian i can browse android `SD card` and `internal memory`, So i the following output of mount command when i browse android `sd card`:               sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)     proc on /proc type proc (rw,relatime)     udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=207517,mode=755)     devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)     tmpfs on /run type tmpfs (rw,nosuid,relatime,size=1226480k,mode=755)     /dev/disk/by-uuid/a14aae90-33de-4707-afce-9fdfbd6cd7d2 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)     securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)     tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)     tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,mode=755)     cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)     pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)     cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)     cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)     cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)     cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)     cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)     cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)     cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)     systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=34,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)     debugfs on /sys/kernel/debug type debugfs (rw,relatime)     hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)     mqueue on /dev/mqueue type mqueue (rw,relatime)     fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)     tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)     tmpfs on /run/user type tmpfs (rw,nosuid,nodev,noexec,relatime,size=102400k,mode=755)     /dev/sda3 on /archives/ISOs type ext4 (rw,relatime,errors=remount-ro,data=ordered)     rpc_pipefs on /run/rpc_pipefs type rpc_pipefs (rw,relatime)     binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)     nfsd on /proc/fs/nfsd type nfsd (rw,relatime)     gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)      **NOTE:** sda3 is my partition on my laptop. _my question is_ where's mount point of android? **UPDATE:** I can browse with GUI, but can't find its `mount point`, i done the following commands:               root@debian:~# df -a > df.mounted   ##### When cell phone is connected      root@debian:~# df -a > df.unmounted   #### When cell phone is disconnected     diff -u df.mounted df.unmounted      But i didn't any difference between two files. My systesm:               root@debian:~# uname -a     Linux debian 3.14-2-686-pae #1 SMP Debian 3.14.15-2 (2014-08-09) i686 GNU/Linux     root@debian:~# cat /etc/issue     Debian GNU/Linux jessie/sid \n \l


gunzip a folder with many files

I have a folder with 36,348 files gz files. I want to unzip all of them. Running:               gunzip ./*      results in               -bash: /usr/bin/gunzip: Argument list too long      Whats the easiest way to get around this? Thanks!


How to implement a rotation scheme with rsync

I have an ever growing remote directory of files that I'd like to sort and filter before I `rsync` them, with the goal of always keeping only the latest N files in my destination directory (i.e. a rotation scheme, more or less). Since `rsync` doesn't seem to have options for this, I've been using the technique of "inserting an arbitrary remote command", described here: http://stackoverflow.com/q/950062/787842 with which I came up with this command, that I execute as a cron on the destination host:               rsync -vrzO --delete \         -e ssh <remote_host>:'$(cd <remote_dir> && ls -t $PWD/* | head -n 25)' \         <destination_dir>      This works well the first time (i.e. when the dest dir is empty): only the 25 freshest files get copied. But then when the window "slides forward" (i.e. when the arrival of a newer file should push an older one out, locally), the problem is that the `--delete` option doesn't work as I'd expect. My guess is that since the filtered out remote files still exist (i.e. they're just being temporarily hidden by the inserted `'$(..)'` command), then `rsync` simply cannot filter them out locally. Is my understanding correct, and is there a better way?


Running a bash script as a less privileged user with upstart

This is the script, `/home/jack/myscript.sh`, which I want to run:               export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.26/     /home/jack/myapp/apache-tomcat-6.0.32/bin/./catalina.sh run      The upstart file, `/etc/init/myapp.conf`, that I have written:                 description "Myapp Server"       start on runlevel [2345]       stop on runlevel [06]       respawn       respawn limit 10 5       exec `su jack -c /home/jack/myscript.sh`      So, if I want to run the script as user `jack`, would my above configuration work? Is there a better way of doing it?


Download recursively with wget

I have a problem with the following wget command: `wget -nd -r -l 10 http://web.archive.org/web/20110726051510/http://feedparser.org/docs/` It should download recursively all of the linked documents on the original web but it downloads only two files (`index.html` and `robots.txt`). How can I achieve recursive download of this web?


count number of lines, bash grep

Hello I am grepping results to file, and then doing cat to show its content on the screen, I want to know how many lines of results I have in my results file and the += it to some counter. What will be the best way? Any relevant flag to `grep` or `cat`?


Read a variable with "read" and preserve backslashes entered by the user

I'm using `read` to read a path from a user like so:               read -p "Input the file name: " FilePath      The user now enters this string:               \Supernova\projects\ui\nebula      What can I do to replace `\` with `/`. The result I want is:               /Supernova/projects/ui/nebula       By the way, the command:               echo $FilePath      outputs the result:               Supernovaprojectsuinebula      I have no idea what's wrong with it.


How can I get my PS1 prompt to show time, user, host, directories and git branch

I've seen others add all this information to their PS1 prompt. I like the approaches that colorize the elements and also do a carriage return at the end


Why do text editors set the mtime on save when no changes have been made?

When I am using sublime, and I've made no changes then the icon in the editor shows the file is unchanged. However, if I click to save it, it still sets the filesystem mtime time to now. Should a non-changing save really update the "modified" time? * * * Simple example: Create an empty file               $ touch example.file     $ stat -l example.file      -rw-r--r-- 1 matthew staff 0 Jul  9 14:45:41 2013 example.file      Touching it updates the mtime               $ touch example.file     $ stat -l example.file     -rw-r--r-- 1 matthew staff 0 Jul  9 14:45:57 2013 example.file      Editing it, but making no changes, also updates the mtime               $ vim example.file     # :wq # write and quit, making no changes     $ stat -l example.file     -rw-r--r-- 1 matthew staff 0 Jul  9 14:46:10 2013 example.file


How to check if a user can access a given file?

*nix user permissions are really simple, but things can get messy when you have to take in account all the parent directory access before reaching a given file. How can I check if the user has enough privileges? If not, then which directory is denying access? For example, suppose a user `joe`, and the file `/long/path/to/file.txt`. Even if `file.txt` was chmoded to 777, joe still has to be able to access `/long/`, and then `/long/path/` and then `/long/path/to/` before. What I need is a way to automatically check this. If `joe` does not have access, I would also like to know where he has been denied. Maybe he can access `/long/`, but not `/long/path/`.


Copying OS from one drive to another migrating from MBR to GPT - what to watch out for?

I'm looking at replacing my current MBR-partitioned 2 TB system drive with quite possibly a 3 TB drive. Copying the files should not pose a problem, but **are there any gotchas to watch out for** , particularly with regards to the boot loader, keeping in mind that MBR doesn't support anything more than 2 TB so I'll have to move to GPT? Or is it sufficient to partition the new drive, copying all files, update /etc/fstab in its new place, physically replace the old system drive with the new and then re-running grub-install? I'm using Linux with GRUB 2 (specifically 1.99-27+deb7u1 on Debian Wheezy) on a single-boot system (no second OS installed to take into consideration).


Converting an if-else statement into a switch statement

I'm having trouble turning this program from an if-else statement into a switch statement. Any help would be appreciated.               #!/bin/bash          for x in $@     do      array[$i]=$x      i=$((i+1))     done               # initial state     state=S0          for((i=0;i<${#array[@]};i++))     do          if [ $state == S0 ]        then        if [ ${array[$i]} == I0 ]        then          state=S1          output[$i]=O1        elif [ ${array[$i]} ==  I1 ]        then          state=S0          output[$i]=O0        fi          elif [ $state == S1 ]       then       if [ ${array[$i]} == I0 ]        then         state=S1         output[$i]=O1       elif [ ${array[$i]} == I1 ]        then         state=S0         output[$i]=O0       fi          fi          done     echo "final state="$state     echo "output="${output[@]}


How to migrate an IDE VM to a virtio VM?

On my KMS host I installed a windows server 2012 guest a few months ago. The VM runs raw using IDE (HDD). I would like to improve the performance by using virtio. I performed these actions:   * shutdown the VM    * edit the XML config file    * replace the disk tag by:              <disk type='file' device='disk'>       <driver name='qemu' type='raw' cache='none' io='native'/>       <source file='/var/lib/libvirt/images/myvm.img'/>       <target dev='vda' bus='virtio'/>     </disk>        * save the XML config file    * restart the VM with virt-manager    * I have a BSOD and the vm auto reboot    * Auto repair started, asking my keyboard language    * two options: repair or stop the PC    * I tried both but always BSOD after boot. What is missing in my procedure?


Why does printf ignore the IFS when printing out the result of my script?

This is a follow up to a question posted on SO. I've written a script called `except` which should print all filenames / directories except the ones given like so.               $ ls     a b c d     $ rm $(except b d)     $ ls     b d      The script I've written so far looks like this               shopt -s extglob     shopt -s nullglob          old_ifs=$IFS     IFS='|'     matches="!($*)"     IFS=' '          printf '%s' $matches     IFS=$old_ifs      This works more or less but the main problem is that printf doesn't seem to respect `IFS` set to `` (blank). It just prints them without a space between. If I instead use echo, it works (except for the added newline). But for compatibility reasons I want to use printf for this task. How can I achieve this? What am I doing wrong? I also tried using the `%q` modifier which also didn't result in the desired output.               printf '%q' $matches


Run XMonad's startup hook only on initial startup

I have the following `startupHook` in my `xmonad.hs`               , startupHook = spawn "~/.xmonad/autostart"      I am starting many apps and daemons in this script and it is written to run _only_ once on startup. But this is being run everytime I hit `Mod-q`, i.e., to reload and test out my changes to `xmonad.hs`. I could conditionally run the programs in the autostart script but that turned out to be quite flaky. So, I was wondering if there is a way to xmonad to run this startup hook only on the initial startup and not on reloads. I tried googling around but came up empty. Is such a thing possible? Edit: I am running xmonad 0.11 installed from cabal on ubuntu 12.04.


what is OS hardening in linux or unix?

The term **OS hardening** itself is misleading/vague to me as i am reading to understand it online here. It seems to me that its something related to making linux/unix box more secure.


Use PSF font in X11 terminal emulator

I want to use a specific console font (`/usr/share/consolefonts/Uni3-Fixed16.psf.gz`) in a X11 terminal emulator (for example Terminator or gnome-terminal).   * I've stumbled over similar questions, but nothing about PSF, just PCF. How can I install a PSF font, or convert it to something that can be used?   * If this does not work for whatever reason, is there a font that comes close to the font mentioned? I've tried out many and this is the best I've found.   * Of course I have also scanned with Google, finding some good compilations. For me Unifont looks closest.


How to prohibit from changing an owner of modifiable files?

I sometimes need to run a Qt Creator from root. After that, some config files of Qt Creator suddenly have a root as an owner. Therefore when running Qt Creator as user, I am getting nag warnings about impossibility of writing to those files. Is it possible to prohibit from changing owner of those files?


GPT or MBR: How do I know?

How can I tell whether my harddrive is laid out using an MBR or GPT format?


How to group grep results?

I have a file that contains results grouped into categories. For example:               checking results for $var     here are some results1 for $var status ok     here are some results2 for $var status ok     here are some results3 for $var status ok          checking results for $var2     here are some results1 for $var2 status ok          checking results for $var3     here are some results1 for $var3 status ok     here are some results2 for $var3 status ok     here are some results3 for $var3 status critical     here are some results4 for $var3 status ok      I need to check if any of the lines in a given category had status "critical", and display it if so. For example:               Status $var -- OK     Status $var2 -- OK     Status $var3 -- Critical          Note : Critial at $result3 for $var3      Using `grep -A` would not help much because the number of results under a particular variable varies.


Permission Advice for Webserver

The Linux box I'm managing is used mainly as a web server. The owner of a site wants to give a new user access to the site so that they can do some work on it. I've created the user account (`vinod`) and added him to a new group called `developers`. The site name is mobplay, so I need to give the `developer` group (or `vinod`) read/write access, but I'm concerned about adding or removing the current permissions in which the `mobplay` user and `nobody` group have access. What is the best solution to ensure `vinod` gets access and the site continues to run as normal?


UTF8 math symbols & keyboard layout / input

I'd like to use UTF8 math symbols, when typing one list, another list. I've found sth called ComposeKey. Unfortunately it's not covering omega, theta, rightarrow etc. I am using KDE, I've tried global shortcuts, but does not seem to work. How to setup typing utf8 symbols (like: Θ, Ω,∃, ∀,⇒,→) with keyboard combinations (like Meta+S) ?


Ubuntu installed from mini-ISO under VirtualBox doesn't boot

I installed the mini ISO of Ubuntu 11.04 in VirtualBox. After unmounting the ISO image and booting, I can see only black screen for about two hours? Is it normal? What can I do with it in virtual box and proceed with running the system successfully? thank you


Randomly logging out

My Xubuntu 10.04 system logs me out seemingly at random. How can I diagnose why this is happening and correct it?


run file from different directory

I have a directory `mainfolder` with a subdirectory `execution` which contains a `configure` script. I can switch to the `execution` directory and run `./configure` and it works fine. Now I'm trying to figure out how to run the `configure` script when I'm in `mainfolder`. I tried:               ./configure /execution      and:               ./configure execution      but neither worked. I also tried the same thing using the full path either starting from root directory or from user directory like this:               ./configure /home/etc/user/mainfolder/execution     ./configure user/mainfolder/execution      I always got the message: > bash: ./configure: No such file or directory Finally, I tried:               /home/etc/user/mainfolder/execution/configure      . /home/etc/user/mainfolder/execution/configure      Both gave me the error: > sed: can't read makefile.in: No such file or directory How can I do this?


Unable to boot into archlinux -> try hd0 skip ms

I was using Archlinux and Windows 7 together for more than 6 months. But today after I rebooted Archlinux it stuck in the boot screen. When I choose archlinux it will hang and display               try hd0 skip ms     try hd1 EXT2      I was using http://neosmart.net/EasyBCD/ to create the bootloader. I am still able to boot to Windows7.


How to tell where recent ssh sessions originated from?

I know that sometimes when I login to systems they print out where the most recent ssh session originated from (usually an ip address or hostname). How can I lookup where some of the most recent ssh logins from my username originated from?


convert date format in log

I have a log with following date format:               2013-12-14 18:53:33 aaaaaaaaaaaaaaaa     2013-12-14 18:53:33 bbbbbbbbb     2013-12-14 18:53:33 ccccccccccccccccccccc      What would be the simplest solution to convert it to               Dec 14 18:53:33 aaaaaaaaaaaaaaaa     Dec 14 18:53:33 bbbbbbbbb     Dec 14 18:53:33 ccccccccccccccccccccc      preferably in bash (or python)


Shell Script to search for pattern and sending the mail

I want to generate the shellscript. In this i have to search the pattern from the log file which is in another directory and mail if the pattern was found and mail to other address if the pattern was not found.


Make vimdiff display different lines as different lines (not partially different)

vimdiff has an annoying habit of displaying two almost-completely-different lines as the same partially-different line just because they share a character in common at the beginning or end. For example: `foo.txt` contains: `The quick brown fox jumps over the lazy dog`. `bar.txt` contains: `This is a completely different line`. `vimdiff foo.txt bar.txt` displays these two lines side-by-side with everything but the `Th` at the beginning highlighted. Is there a way to disable this behaviour and just display different lines as being different lines?


VIM: folding bullet points

I'm quite new to VIM, but have been trying to teach myself over the past week, yet I'm encountering a problem which has proven to be quite frustrating: Currently I'm mostly using VIM to take notes, and use the folding capabilty of VIM to make my work less cluttered. Yet I've encountered a problem, where every bullet point, which goes beyond my set linebreak, folds in itself. To be more clear: ![VIM I](http://i.stack.imgur.com/Hy1j3.jpg) ![enter image description here](http://i.stack.imgur.com/27a97.jpg) I would like to not have single bullet points fold. I seem to have traced the problem to the way my text is indented: since folding seems to happen on an indent-level by default, my bullet points fold due to the second line being 'indented' more. So I gather there are probably to vague ways of solving this issue: telling VIM to fold if the indent on the next line is greater 1, or handle the way bullet points are wrapped completely differently. How can these solutions be implemented? * * * I use a plugin called Workflowish, so here is my vimrc:               set tw=100     set formatoptions=tcq     set com=fb:*     set spell     set spelllang=de     colorscheme synic     set fileencoding=utf8     execute pathogen#infect()     syntax on     filetype plugin indent on      And here is what the plugin itsself sets:               setlocal foldlevel=1     setlocal foldenable     setlocal sw=2 sts=2     setlocal expandtab     setlocal foldtext=WorkflowishFoldText()     setlocal foldmethod=expr     setlocal foldexpr=WorkflowishCompactFoldLevel(v:lnum)     setlocal autoindent


Is there an online/web interface to search and list apt-get packages and see summaries and recommendations?

I'm looking for sort of an 'app-store' or Google Play store type functionality for apt-get packages. What I'd really like to do is select a category, like 'Music' or 'Internet' and see the list of available packages in that category with their summaries. It'd be even better if the packages had ratings or reviews. Does anything like this exist?


Combining Centos 6 ISO images

I was wondering if I can create a single ISO image by `cat`ing two DVD ISO images together. I have heard that this only works if the ISO is split into different parts and not two distinct ISO images, is this true? I'm looking to combine both DVD 1 and 2 for the CentOS 6 install since they don't provide a single file


Using shell script to select static IPv4 configuration according to router address

I have Linux Mint 15, I live in a university where the hostel and lab have separate static IP settings. Is there a way to set up the connection mechanism so that my laptop will automatically select the correct configuration according to which router is serving it? EDIT: My question is actually case specific to wired connection, but would be interested to know about both.


Can not change to a static IP in Fedora 19

I'm having a bit of a weird situation. I've installed Fedora Linux 19 onto a virtual machine with no GUI. Initially eth0 does not show up when I perform `ifconfig`.   When I run `dmesg | grep eth`, I see the adapter but it says it changed names to p2p1. Once I perform the `ifconfig p2p1 up` command it shows up. Now when I try to edit the `/etc/sysconfig/network-scripts/ifcfg-p2p1`, it does not exist. The only scripts that are there lo and enp0s3. If I try to create the `ifcfg-p2p1` file with the correct settings, I cannot restart the network service. I tried editing the `enp0s3` file, but that did not work. I'm fairly new to linux and not sure what else to put in here. So if you need any more information just let me know and I'll put it in here.


Terminate/skip SysV service during boot

I seem to remember that since SysV init runs services in a serial (not parallel) fashion, you can kill whatever's currently in the foreground with some key combination -- apparently not ctrl-c/z/d though. Searching online has not been fruitful. Does anyone know whether such a key combo really exists (and if so, what is it)?


sending & receiving files with windows

I have some movie files on my Ubuntu computer that I would like to send to my XP laptop. Using a USB is too much hassle. Is there any other way of achieving this? Something like the `scp` command would great.


How to check which GPU is active

I have 2 GPU's in my netbook. How do I know which one I'm actually using at any given moment?


Backing up hard links (rsync)?

My question begins with: Do I actually have hard links on my disk at all (except for "." and ".." of course)? I'm not sure how I would find that out? If no, the question is already answered. If yes, I'd like to adjust my backup routine (currently using `rsync -a`) to preserve my hard links. I've seen the option `-H`, but the man page worries me with a few statements, e.g.:               -a, --archive         ...         Note that  -a  does not preserve hardlinks, because finding          multiply-linked files is expensive...          -H, --hard-links          ...         It does NOT currently endeavor to break already existing hard links          on the destination that do not exist between the source files. ...              Note that rsync can only detect hard links between files that are          inside the transfer set...      So what should I do, if I have hard links on my disk?


Forcing GNU make to run commands in order

With the following Makefile, GNU make runs the two commands in parallel. Since the first one takes time to finish, `rm *.log` is run before the `log` file is created, and fails.               dummy.pdf: dummy.tex         tex dummy.tex &> /dev/null;         rm *.log      The file `dummy.tex` one line: `\bye` (a short empty file for TeX). Replacing `tex dummy.tex` by any other command shows the same behaviour. Removing `&> /dev/null` would of course solve the problem, but it is not a very good option in my case, since the Makefile is provided by a third party. Is it possible to prevent GNU make from doing anything in parallel? (the flag `-j 1` does not help). EDIT: output to the terminal:               bruno@bruno-laptop:~/LaTeX/make-experiment$ make     tex dummy.tex &> /dev/null;     rm *.log     rm: cannot remove `*.log': No such file or directory     make: *** [dummy.pdf] Error 1     bruno@bruno-laptop:~/LaTeX/make-experiment$ This is TeX, Version 3.1415926 (TeX Live 2009/Debian)     (./dummy.tex )     No pages of output.     Transcript written on dummy.log.


How to suspend and resume processes like bash does

this question is a follow-up to: How to suspend and resume processes I have started firefox from a bash session in gnome-terminal. The process tree looks like this:               $ ps -e -o pid,ppid,cmd -H      1828     1   gnome-terminal     26677  1828     bash     27980 26677       /bin/sh /usr/lib/firefox-3.6.15/firefox     27985 27980         /bin/sh /usr/lib/firefox-3.6.15/run-mozilla.sh /usr/lib/firefox-3.6.15/firefox-bin     27989 27985           /usr/lib/firefox-3.6.15/firefox-bin     28012 27989             /usr/lib/firefox-3.6.15/plugin-container /usr/lib/adobe-flashplugin/libflashplayer.so 27989 plugin true      When I hit `CTRL+Z` in bash, it will suspend firefox. When I issue the command `bg` (or `fg`) it will resume firefox. This is as expected. When I issue the command `kill -s SIGTSTP 27980` in another terminal, it will print the line `[1]+ Stopped firefox` in the first terminal (just like when i hit `CTRL+Z`), but it does not suspend firefox. I asume it only suspends the shell script. When I issue the command `kill -s SIGTSTP 27989` (note the PID) in another terminal, it will suspend firefox. The first terminal does not take note of this. How does bash suspend the entire process tree? does it just traverse the tree and SIGTSTP all of the children?


Do I Need Nullmailer-send running?

Further to my posting here: Why does my CMS run extremely slow in my workstation (Ubuntu) I now ask "Do I need Nullmailer-Send" running? The reason I ask, is that earlier this year (2013) I had issues regarding large .log files being created in /var/log which result in some .logs being some 1GB and I had to manually delete them. My machine (a Ubuntu 12.10 and very nice it is too!) is only a home office 'desktop' work-station and used for the normal daily things (inc LAMP WebDev) but mainly Office, Web-browsing, FTP and I don't use it as a server, as my email is collected either by Evolution Client or via GoogleMail.com. I would like to reduce any system 'bloat' and hence my OP here about Nullmailer.


Proper menu.lst entry for custum install CD?

Trying to generate a custom boot CD, I find these proposed changes for `menu.lst` file               timeout 8     default 0     gfxmenu (cd)/boot/message     title Linux         root (cd)                  kernel /boot/vmlinuz root=/dev/sda5 vga=794 resume=/dev/sda1 \             splash=verbose showopts             initrd /boot/initrd      So, what about the line in kernel indicating **`root=/dev/sda5`** and **`resume=/dev/sda1`**. I think this won't work for all cases, as long as I know, it's a mapping of devices. Will it really work this way? Is there any _generic_ way to set it?


Ubuntu online installer?

Is it possible to install ubuntu (or preferably mint 9) on my toshiba notebook, using an online installer like the one on mintPPC? The one I am referring to is found here, but many can not access it. http://mintppc.org/content/installation-mintppc-92#4 So I have copied it below I am most interested in number 4 where it says               wget http://mintppc.org/files/mintppc9/mint-installer         chmod +x mint-installer         sudo passwd      But this is for mintPPC?!?! I want this for mint on PC **1\. USB base system installation** Download the official Debian Squeeze netinstaller iso here (around 180 Mb). You can also opt for the smaller businesscard iso (around 40Mb). If prefer the business card iso as it faster to copy onto a USB stick. Both installation methods require a working internet connection, preferably a wired connection. If you don't have a working internet connection you cannot install MintPPC as the MintPPC specific packages are downloaded over the internet. If you are running a Classic MacOS partition you should read the Release Notes. In Gparted make the USB stick empty. Find also out here what the device name is for your stick (in my case /dev/sda but it could be different). Then copy the content of the iso to the stick. It's important to do this from a PowerPC based Mac as otherwise the dd process goes too fast and your PPC based Mac won't be able to boot from it:               `sudo dd if=/path/to/mini.iso of=/dev/sda`      Then boot from the USB if your Mac is capable of doing this. One of my Pismo is, the other not, don't ask me why. They are both the same. Boot in open firmware by holding option+command+o+f. Then find out which is the device:               dev / ls      You should see somewhere usb with an extra entry disk, write that number down usb19 or something in my case. Then have a look at the devalias:               devalias      Now it's either usb0 or usb1 which is associated with usb19. This is your boot device, in my case usb1. Then boot:               boot usb1/disk@1:2,\\yaboot      (or)         boot usb0/disk@1:2,\\yaboot      Continue with Debian Squeeze base system installation. **3\. Debian Squeeze base system installation** Install a Debian Squeeze base system without a GUI. It's important not to install a GUI as we will be installing one of our own and we don't want to end up with a real Debian GUI. Somewhere during the installatiion process you will be asked which predefined collections of software you want to install. Untick the graphical desktop environment (there should be no asterisk in front of the Graphical desktop environent, you can untick with the space bar). We will only install "Standard system utilities" and "Laptop", in case you are installing MintPPC on a laptop. If you feel like you need more help, you can have a look at the old instructions (which does not completely apply to this type of installation as those instructions were written for an expert installation). You can alo have a look at the official instructions from Debian. **4\. MintPPC installation**               wget http://mintppc.org/files/mintppc9/mint-installer         chmod +x mint-installer         sudo passwd      'Sudo passwd' we use to create a password for the root account. Login as root (su) with your root password: su hit enter and give your newly created root password. First we need to install sudo as it's not in the base install:               apt-get install sudo      Then add yourself to the sudoers list.               nano /etc/sudoers      then add your own username under root and copy it like it is:               root   ALL=(ALL) ALL         jeroen ALL=(ALL) ALL      CTRL-x and y to save. You can now logout of the root shell (CTRL-d). Start the installer as sudo.               sudo ./mint-installer      This will install all the required packages for Linux MintPPC using a prompt. In this way you have some control over what you install. If you just accept the default MintPPC settings (which are good of course!) you might want to do the following: sudo ./mint-installer -y The latter -y will take care that no questions are asked. If something freezes, during installation using the script you can always reboot and run the installer again. Just make sure that the system is 'clean', by doing:               sudo dpkg --configure -a      Make sure that everything is installed. You might break the installer with CTRL-C before the MintPPC specific programs are going to be installed. Just run the installer again from the start. It might add other programs. If nothing changes anymore, continue with installation of the MintPPC specific programs. When everything is installed, just before rebooting, you could stop the installation here to adjust the X settings, if you know of a working xorg.conf file for your type of Mac. There are a few examples here. If you don't know what to do, type "y" for reboot. After this: reboot...


NFS sharing is read only

I have problem with NFS sharing. See my exports:               /export 192.168.1.11(rw,fsid=0,insecure,no_subtree_check,sync)     /export/share 192.168.1.12(rw,nohide,insecure,no_subtree_check,sync)      From a client (192.168.1.12) I'm trying to connect server with this command in terminal:               mount -t nfs -o rw 192.168.1.11:/export/share /mnt      When mounting `/export` from `192.168.1.11` (server) everything works fine, but whatever am I mounting from a client, it works but it's read only. Does anybody know where can be the problem? Please help. NOTE: rights are on `rwxrwxrwx`


Can e2fsck be suspended?

I have a large hard disk partition. I would like to launch e2fsck on it so that i shall suspend its progress, be able to reboot and resume e2fsck from where it was suspended.


How to prevent a mistaken rm -rf for specific folders?

I think pretty much people here mistakenly '`rm -rf`'ed the wrong directory, and hopefully it did not cause a huge damage.. Is there any way to prevent users from doing a similar unix horror story?? Someone mentioned (in the comments section of the previous link) that > ... I am pretty sure now every unix course or company using unix sets rm -fr > to disable accounts of people trying to run it or stop them from running it > ... Is there any implementation of that in any current Unix or Linux distro? And what is the common practice to prevent that error even from a sysadmin (with root access)? **EDIT:** It seems that there was some protection for the root directory (`/`) in Solaris (since 2005) and GNU (since 2006). Is there anyway to implement the same protection way to some other folders as well?? **EDIT** : To give it more clarity, I was not asking about general advice about `rm` usage (and I've updated the title to indicate that more), I want something more like the root folder protection: in order to `rm -rf /` you have to pass a specific parameter: `rm -rf --no-preserve-root /`.. Is there similar implementations for customized set of directories? Or can I specify files in addition to `/` to be protected by the **preserve-root** option?


How can I show the number of positions lines have moved in diff output?

## top1               1,facebook.com     2,google.com     3,youtube.com     4,yahoo.com     5,wikipedia.org     6,baidu.com     7,live.com     8,amazon.com     9,qq.com     10,twitter.com      ## top2               1,facebook.com     2,google.com     3,youtube.com     4,yahoo.com     5,baidu.com     6,wikipedia.org     7,live.com     8,qq.com     9,amazon.com     10,twitter.com          diff -u  /Users/stofke/Desktop/top2a.csv /Users/stofke/Desktop/top1a.csv |       sed -n '1,2d;/^[-+]/p' |       sort --field-separator=',' --key=2           +9,amazon.com     -8,amazon.com     +5,baidu.com     -6,baidu.com     +8,qq.com     -9,qq.com     +6,wikipedia.org     -5,wikipedia.org      But I actually need this:                +1, amazon.com      -1  baidu.com      -1  qq.com      +1  wikipedia.org      I don't know how to do that last step (I would also need to calculate the % wise decline or raise) Adding `| paste -d, - -` gets me this               +9,amazon.com,-8,amazon.com     +5,baidu.com,-6,baidu.com     +8,qq.com,-9,qq.com     +6,wikipedia.org,-5,wikipedia.org


Unable to mount usb drive, but computer sees that it's there.. PNY (MIPS Lemote)

The computer being used is a Lemote Yeeloong, and the OS is currently Debian Wheezy (mipsel) with no X windows system. So the computer can only be operated with unix commands right now (until I configure an X system).   I plug in the USB, which is formatted with a FAT32 filesystem, and the syslog says to after a few nanoseconds:               [sdc] No caching page mode present     [sdc] Assuming drive cache: write through      Then I type `mount /dev/sdc` and press ENTER but the computer tells me that it cannot find such a `/dev/sdc` in `/etc/fstab` or `/etc/mtab`.   After which I type `df` to see if the drive shows up anywhere mounted already or represented in /dev somewhere. But I see nothing. What should I do? Ultimately I am going to put a new filesystem on this thing so that I can use it to netboot. But I am stuck in this place where I am unable to even mount the device.


Equivalent for netsh start network on linux

I recenty read about the Windows option for creating an access point, that will run on the same physical device, as the machine. So that I can connect my other devices to that network, and have access to internet as well. I know that I can use 2 wifi cards to do the trick, by configuring dhcp and creating a bridge, but how can I accomplish this with one card?


Cannot get ccache to work with ports in FreeBSD

I'm new to FreeBSD (9.1) and I'm just setting up the system. One problem that I could not solve yet is to get `ccache` working. I installed it from ports and followed the guidelines in the documentation (modify `/etc/make.conf`). Compile new packages from ports works without errors but the cache is never filled, so it seems that `ccache` is simply not used. Here is the content of my `/etc/make.conf` file:               WITH_PKGNG= yes     # added by use.perl 2013-01-20 01:08:34     PERL_VERSION=5.14.2          # the rest here is copied from /usr/local/share/doc/ccache/ccache-howto-freebsd.txt     .if (!empty(.CURDIR:M/usr/src*) || !empty(.CURDIR:M/usr/obj*))     .if !defined(NOCCACHE)     CC:=${CC:C,^cc,/usr/local/libexec/ccache/world/cc,1}     CXX:=${CXX:C,^c\+\+,/usr/local/libexec/ccache/world/c++,1}     .endif     .endif      I also tried to follow the other guidelines in `ccache-howto-freebsd.txt` and added the following lines to `/etc/csh.cshrc`, which is the default shell used by root:               setenv PATH /usr/local/libexec/ccache:$PATH     setenv CCACHE_PATH /usr/bin:/usr/local/bin      Still no difference. `ccache -s` shows that the cache is still not filled during compilation. Do you have any ideas?


Can you use LXC through C?

I want to use LXC to 'container' plugins my application is loading. Am I able to do this through C? I have been Googling a lot about it, but there don't seem to be any headers, only scripts that can be called through the terminal. I know I can execute the scripts inside C, but I'd rather use the headers if there are any.


Applications running under SELinux that access NonPosix drives

I am looking to use either AppArmor or SELinux. Of what I've seen so far I think I prefer SELinux, but there is one thing that does concern me, that is accessing NonPosix partitions. Let us look at a specific exmple: Suppose I want okular to read and write ( and only to read and write ) from an sdcard which is likely formatted in FAT32. Is there some work around or some policy that will allow me to do that?


FTP 550 error when trying to copy file

For just a few seconds I had a strange experience on my simple home server (QNAP TS-210). I was copying many files and when I wanted to copy just another one (text file with `.srt` extension), I got an error `550 Function not implemented`. First, what I would like to ask is _what exactly does this error message mean_ , because as I searched the Internet, I found two different error messages bound to one _FTP 550 Error Code_ :   1. Given by my server and for example here says " _550 Function not implemented_ ".   2. Second (for example here) is " _550 Requested action not taken. File unavailable (e.g., file not found, no access)_ ". That's quite two different meanings. How two error descriptions can be bound to one error code? I have _NASFTPD Turbo station 1.3.2e Server (ProFTPD)_ on server side and _Total Commander_ on Windows 7, on client side. I wasn't able to copy / download this file neither in Total Commander nor directly in Windows. I SSHed to my server using PuTTy, located this file, copied it to another directory, deleted it and then copied back to original place. After that I was able to copy this file to my local computer, without any problems, even using the same FTP session I left open in Total Commander. So, second question is, what actually happend?


zsh history - full path

Suppose I do the following in zsh               cd ~     cd dir1     cd dir2     cd dir3     evince foo.pdf      zsh writes exactly the same in its history file. Now my question is whether it is possible to have               cd ~     cd ~/dir1     cd ~/dir1/dir2     cd ~/dir1/dir2/dir3     evince ~/dir1/dir2/dir3/foo.pdf      in zsh history instead. I.e. that zsh remembers only full paths.


liferea: change default link color

Liferea (Linux Feed Reader) uses per default a dark blue color for hyperlinks. I am using a dark desktop theme (white text on dark background) and these default colors are very difficult to read. I am wondering whether there is a way to change the default color to something else, presumably by editing some `.css` file as can be done in Thunderbird.


Privoxy redirect rule for Wikipedia

I have a few Privoxy rules, that can redirect HTTP Wikipedia [en,de] traffic to HTTPS: (a little part from the "user.action" file)               { +redirect{s@http://en.wikipedia.org/wiki/@https://secure.wikimedia.org/wikipedia/en/wiki/@} }     .en.wikipedia.org          { +redirect{s@http://de.wikipedia.org/wiki/@https://secure.wikimedia.org/wikipedia/de/wiki/@} }     .de.wikipedia.org      So you get the problem: is there any way to put a "regexp" or something to: "en", "de"? There are hundreds of other languages, i think it's a bad solution to write down them all.< There is another question: is my solution good so far? I'm asking that because if i visit https://secure.wikimedia.org/wikipedia/en/wiki/File:Nokota_Horses_cropped.jpg that's ok, it's using HTTPS. BUT if i click on the picture: http://upload.wikimedia.org/wikipedia/commons/d/de/Nokota_Horses_cropped.jpg it's using HTTP! So this is not good. Are the pictures on a HTTP-only server, or i can write another redirect rule to view the pictures in HTTPS?


Shell script to list locked packages in FreeBSD

I'm trying to make a oneliner to be able to list all locked (forbidden to upgrade) packages in FreeBSD. Normally, you issue this command:               pkg info -ak      It outputs list of all packages in system including locked and unlocked which isn't working for me as I only want locked ones. If I grep 'yes' it does exactly what I want:               pkg info -ak | grep yes      It outputs following:               nginx-devel-1.5.10             yes     php5-extensions-1.7            yes     php55-5.5.8                    yes      Now, what I want is to be able to edit that output a little bit by changing string 'yes' for following ( _adding package name w/ version omitted_ ):               nginx-devel-1.5.10             locked, run: sudo pkg unlock nginx-devel     php5-extensions-1.7            locked, run: sudo pkg unlock php5-extensions     php55-5.5.8                    locked, run: sudo pkg unlock php55      I tried following unsuccessfully ( _newb here_ ):               pkg info -ak | grep yes | sed s/yes/"locked - run: sudo pkg unlock $(pkg info -ak | grep yes | cut -d - f1-2)"/      While what I've tried isn't working I posted it just for you to get the idea what I'm trying to achieve.


Is there a user interface in Emacs allowing one to "grab" the buffer's filename conveniently?

It happens quite often that I want to use the path of the file opened in a certain buffer in Emacs (either the full path or the basename) in another place (a buffer or a different X program, say, a terminal). I wonder whether there is some pre-defined subsystem in the Emacs "user interface" that would copy the filename of the current buffer (`(buffer-file-name)`) to the kill- ring. Related things: There is a simple command in emacs-w3m that does an analoguos thing (`y` \-- `w3m-print-current-url`): it prints the URL and copies it to the kill-ring. Of course, I could simply define the command I want, but I'm asking this question because I hope to learn some user interface subsystem of Emacs that includes such a possibility among other features. (Perhaps, some buffer and path manipulation interfaces.) So that I will know more useful features of Emacs.


How do I explain to this website team that they need to support Linux?

A Linux advocacy question. Here is my draft reply to someone from the UK Government's Driving Standards Agency (DSA) website who says they don't test their website on Linux. Can you improve on it, make it more persuasive for this team which "does not have any equipment which has Linux installed" ? > Dear XXXXXXXX, > > Thank you for your reply. > > I'm surprised to hear that you do not test the website on Linux. Roughly 70 > million people use Linux, and it accounts for 5% of web traffic. How many > users does your website have? Take 5% of that, I bet it's still a lot. All > those people may be encountering bugs, errors and frustration with the > website, generating untold amounts of bad will. As you stated you have not > tested the website using Linux, you don't know whether it works as desired > or not on Linux. > > When you say the problem might be unique to my system setup you may well be > correct, however you don't know how many other users of your website use the > same or similar enough system setup to encounter the same problem. The > answer may surprise you. Check your website logs. > > The fact that no-one else has reported the problem does not mean it does not > exist. I'm sure you would feel happier and more confident in your website if > you attempted to reproduce the problem using Ubuntu Linux and Chrome, two > pieces of software which are freely available and in use daily by millions > of people across the country. > > Thank you > > \- XXXXXXXXXXXX > > Sources: > > http://hothardware.com/cs/forums/p/54435/390170.aspx > > http://www.w3schools.com/browsers/browsers_os.asp > > http://linuxcounter.net/ > > On 05/02/14 15:51, XXXXXXXXXXX wrote: > > >> Dear XXXXXXXXX >> >> Thank you for your email of 23 January about the internet booking system. >> >> I should explain that the operating system and browser that you are using is not a combination that is supported as we do not have any equipment which has Linux installed. >> >> We will however run test against the equipment that we do have to see if this problem occurs. >> >> Might I also explain that we have received no other reports from customers who have stated that pages do not load after clicking continue. It therefore maybe a fault that is unique to your system setup. >> >> Yours sincerely >> >> XXXXXXXXXXXX >> >> Customer Support Correspondence >> >> Customer Operations >> >> XXXXXXXXXXX@dsa.gsi.gov.uk >> >>> Date: 23 January 2014 15:46 >>> >>> Subject: Website buttons do not work 100% correctly >>> >>> To: XXXXXXXXXXX@dsa.gsi.gov.uk >>> >>> Please forward this onto the technical website team who can try to reproduce it on Linux. >>> >>> I tried to book a practical test today and the big green "continue" buttons did not work correctly. Half the time I clicked one with the mouse, nothing would happen. And by that I mean that no new page would load. Even after I clicked it, waited several seconds to see if a page was loading (the browser said it wasn't), and tried again. I can tell in my web browser whether or not a new page is loading, because when a page is loading, the status bar tells me it's waiting for the page to load, and the page icon at the top change to a rotating circle, and then the page loads. None of that happened. >>> >>> Then I clicked it one more time, and the next page did load. >>> >>> This happened many times on different pages. Eventually I got through to the end of the process and booked the driving test successfully. >>> >>> Operating System: Ubuntu 12.04.04 (Linux) Browser: Chrome, version 31.0.1650.63 Ubuntu 12.04 (31.0.1650.63-0ubuntu0.12.04.1~20131204.1) >>> >>> I'm a software developer by profession and I would be happy to provide any more detailed technical information you require to investigate this problem. >>> >>> Thank you.


LVM with SSD and SATA hard disks

Is it possible to create LVM partitions for both SSD and SATA hard disks? I mean if there isn't any conflicts.


Why CentOS 6 adjusts console width when running screen?

I run a console window through my PuTTY session. That console windows has a column width of 140. When I start the screen session, the console shrinks to 80 columns. I do not see this behavior on CentOS 5, only on CentOS 6. Does anybody know what has to be tweaked?


Why kernel 3.6.2 is so much less energy efficient than 3.6.1 on Mint 13?

I noticed, that the power consumption in my ASUS P53E notebook is doubled (from 10W to 20W) when I change from kernel 3.6.1 to 3.6.2 (or later). I use Ubuntu Quantal mainline kernel from kernel-ppa/mainline - Kernel Ubuntu on Mint 13 Maya (which is based on Ubuntu Precise 12.04). Please advise me, what additional information I should post, to help you answer. The power measurements agree with the significant difference in processor temperature (ca. 45 C on 10W and ca. 65 C on 20W), so it is not a glitch of the power meter.


Seeking alternative GUI File editor with large file support

Can anyone recommend a file editor, preferably free, that handles large files as well as EmEditor on Windows? I'm on Ubuntu, but other people reading this might not be, so suggestions for other Unix operating systems are welcome, too.


How do I customize the bash prompt on centos?

I've altered the `/etc/bashrc` file. I commented out the previous definition and inserted my own:               PS1="--bash: (\u@\h:\w) $"      This is not having any affect. When I make this change at the command prompt, it works great, but then it's not permanent.


How do I leave a message for another (local) user?

I know you can use `write` to send a message to a currently logged in user, but how do you leave a message for a user who is not logged in? The solution I have seen is modify the motd, but that will be displayed to all users. How can I leave a message for individual users to read when they login?


How do I cause a watchdog reset of my embedded Linux device

Is there a command like               vi > out     vi | out      That I could use to cause a watchdog reset of my embedded linux device?


Quickly check whether many network hosts are up-and-running

Objective: check if a host is up-and-running on the network,   with a method that can be efficiently parallelized over many hosts. Emphasis on a QUICK turnaround of the check. Reason to emphasise speed: multiple checks (in the hundreds) need to be performed in rapid succession and return results reasonably quickly. * * * ### Current method The current script uses a simple `ping` command. The choice is not obligatory, on the contrary _any_ suitable tool with equal or better reliability and speed may be used as replacement. ### Current script Something along these lines:               ping -c 1 -W 100 -q "$NETWORK_HOST" &> /dev/null      Obvious deficiency of this approach: responses are needed with a sub-second turn-around and this can wait up to a second, from experience. ### Alternative considered Forget about speed of sequential execution, run many `ping` commands in parallel using GNU `parallel` and collate the results at the end. This has been experimented with but seems even worse in practice. ### Intuition about a better solution It seems like `ping` _may_ work just fine as a "polling health check", all it needs to be tweaked to do is to wait very little time and time-out in case of no response. Assumption: the network is considered reliable and FAST, the hosts don't have either of the qualities necessarily. * * * ### Question How would you solve this? Which tool(s) would you use? Is this the right approach? Could you provide a code snippet? * * *   * Environment: OS X + Ubuntu hosts   * Scripting shell: Bash   * Can install additional software if needed.   * Can compile/install new code for an application not in the repository and use that.


live bootable tiny distro for burn-in testing of LCDs?

I'd like to stress test used LCD monitors for problems that may become apparent after they've been in use for a while. I'm looking for those with components that fail because of heat. To those ends I'd like to set up a workstation that has a live bootable CD that will do something that's someone intensive as far as the screen is concerned. I've found distros that have LCD test patterns, but those are static images. I want something that will show me that a monitor will flake out after an hour of use. Also, it would be nice if this could be a simple command. This workstation will be used by people who aren't linux savvy.


How to convert tar file from gnu format to pax format

On the one hand I have a lot of tar files created with _gnu_ format, and on the other hand I have a tool that only supports _pax_ (aka _posix_ ) format. I am looking for an easy way to convert the existing tar files to pax format - without extracting them to the file system and re-create the archives. GNU tar supports both formats. However, I haven't found an easy way to the conversion. How can I convert the existing _gnu_ tar files to _pax_? [I asked the same question on superuser.com, and a commenter recommended to migrate the question to unix.stackexchange.com.]


Convert pdf file to epub

Is to possible to convert pdf file to epub format without errors? Is there some application in Linux that can do it? I found only Ecub and Calibre which give bad results or fail. A command-line application is sufficient. It's an ordinary pdf (not scanned), so OCR is not needed.


List mount points owner and group

I'm running HPUX 11.x and I was wondering if there's a command that would list all the mount point owner and group. I want a listing like `df` or `bdf` but with ownership information.


Installing Ruby on Mac OS X

I had _ruby_ installed in `/usr/local/bin/` but it was outdated, so I installed newer version using `brew`. Now I have two installations of _ruby_ in different dirs. Should I remove one? And how do I update pre-shipped ruby to the latest version?


Application for Facebook Chat

Is there a native Linux application which allows chatting on Facebook Chat? A feature which I particularly require is being able to chat in conversations which include multiple people.


Highlight the three last updated files in ls output

Is there any way to overload or wrap the `ls` command so that it will highlight / underline / otherwise make obvious the last three modified files? I know that I can simply `ls -rtl` to order by reverse modification time, but I usually do need an _alphabetical_ list of files despite the fact that I would like to quickly identify the last file that myself or another dev modified.


is there a way to list all 'indexes IDs' (keys) on a bash associative array variable?

I have this array:               declare -A astr      I add elements to it:               astr[elemA]=123     astr[elemB]=199      But later on I need to know what are the indexes IDs (elemA and elemB) and list them.               echo "${astr[@]}" #this only get me the values...


Will autologin create remote security problems?

In Debian, I setup `nodm`, such that my computer logs in automatically when it is turned on. I am not concerned about thieves accessing the computer directly, but compared to a setup using GDM, can such a setup make the system less secure through the Internet?


How to shutdown the computer from Openbox as a menu item?

How can I add a menu item to Openbox which launches a prompt to cancel or provide a root password, then shuts down X and the computer if the correct password was given? The question Shutting the computer down from Openbox is related, but the answer involved typing, not clicking through them menus. The documentation suggests that one add a `systemctl poweroff` menu like this, but the menus do not appear to work:               <item label="Shutdown">         <action name="Execute">             <command>systemctl poweroff</command>         </action>     </item>      I am using Debian 7.0.


path_helper and zsh

I read that Apple, instead of jamming more and more `PATH` variable variations to the end of shell profile file, created `path_helper` binary so that it could expand `PATH` variable automatically by reading path lists from `/etc/paths.d/` directory. Also - this file generates output only for csh and bash (`-c` and `-s` flags accordingly). There is no output for `zsh` (although zsh being somewhat bash compatible - I understand that). I am using zsh. I have `/etc/zshenv` file which contains following lines:               # system-wide environment settings for zsh(1)     if [ -x /usr/libexec/path_helper ]; then         eval `/usr/libexec/path_helper -s`     fi      It takes about half a second when I open terminal or its new tab for that process to complete. There is only one file with single path (`/usr/X11/bin`). How much am I risking if I remove `/etc/zshenv` at all? Would it be enough to put aforementioned path to my `.zshrc` or `.zshenv` files?


What should I expect if I switch from Ubuntu to openSuse

As probably most of you I have been long using Ubuntu. I'm not an expert, but I have been using different distros until I settled with Ubuntu. I started using SuSE 5.x, Conectiva (that later became Mandriva, so it seems), RedHat, Mac OS X (yeah, I know, not Linux) and Ubuntu running mostly as a VM in the last couple of years. But ever since SUSE released the SUSE Studio I was tempted to switch back to it. It is way too convenient to keep your installation in the cloud and download your system ready to go. Here is my question. What to expect from the switch. I know that SUSE uses RPM as its package manager, and I have no idea of the completeness of its repository compared to Ubuntu. When trying openSUSE on a VM I also miss the _sudo_ command, but I am sure that it must have been some lack of configuration on my part. So, what else would be different? My main use for Linux is as a desktop and a bit of Java and Ruby programming.


Find duplicate file names with specific matching pattern

I have a folder with some files (snippet of the contents of the folder)               PAT1.URGRSVP.50.WR786842JOB11632.WRS20140.FILE0005.DAT     PAT1.URGRSVP.50.WR786842JOB11643.WRS20140.FILE0003.DAT     PAT1.URGRSVP.51.WR786842JOB11643.WRS29232.FILE0003.DAT     PAT1.URGRSVP.50.WR786842JOB11694.WRS20140.FILE0002.DAT     ...     ...     ...      My focus is on the 3rd (50,50,51,50) and the 5th (WRS20140,WRS20140,WRS29232,WRS20140) blocks. How can I write a script that displays the duplicate filenames with the same 3rd block AND 5th block (The duplicates of the combination of the 3rd and the 5th block strings)? So the output should list the following in the above example               PAT1.URGRSVP.50.WR786842JOB11643.WRS20140.FILE0003.DAT     PAT1.URGRSVP.50.WR786842JOB11694.WRS20140.FILE0002.DAT


Symlink to part of the file?

Is there possible to create file that is just a sub-sequence of bytes from another file, like a symlink, but referencing only part of the file?


yum no longer able to detect/access repository

Yum was working fine until I tried to install google chrome and used the `--add-repo` command with which I added chrome's repository. Ever since then, whenever I do a `sudo yum install`, yum only searched on chrome's repository. So I removed the repo file of chrome. But even after restarting the system, yum is not accessing any repository. A `sudo yum search gtk+` turned up results for gtk+, but trying to install it with `sudo yum install gtk2.x86_64` didn't work. It gave the output:               Loaded plugins: langpacks     Nothing to do      How can I fix this? I'm using Fedora 20, 64 bit version. `ls -l /etc/yum.repos.d` shows me the following output: > -rw-r--r--. 1 root root 183 Jan 26 19:03 adobe-linux-x86_64.repo   >  -rw-r--r--. 1 root root 0 Feb 2 09:34 fedora.repo   >  -rw-r--r--. 1 root root 0 Feb 2 09:34 fedora-updates.repo   >  -rw-r--r--. 1 root root 0 Feb 2 09:34 fedora-updates-testing.repo   >  -rw-r--r--. 1 root root 75 Jan 26 11:52 jenkins.repo   >  -rw-r--r--. 1 root root 76 Jan 26 11:51 jenkins.repo.rpmnew   >  -rw-r--r--. 1 root root 1241 Mar 14 2013 rpmfusion-free-rawhide.repo   >  -rw-r--r--. 1 root root 1172 Jan 26 19:04 rpmfusion-free.repo   >  -rw-r--r--. 1 root root 1170 Jan 26 19:03 rpmfusion-free-updates.repo   >  -rw-r--r--. 1 root root 1230 Jun 29 2013 rpmfusion-free-updates- > testing.repo


Combine unallocated space using KDE partition manager?

See below screenshot and see that there are 2 unknown unallocated blocks. How to combine the unallocated space using KDE partition manager? ![enter image description here](http://i.stack.imgur.com/sUzAE.png) @ktf, as requested:               Disk /dev/sda: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x823df1e4             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT     /dev/sda2          206848  1186215955   593004554    7  HPFS/NTFS/exFAT     /dev/sda3      1195208704  1945712639   375251968   83  Linux


smbpasswd failed for new Samba install on fresh Ubuntu 11.04

I've installed Samba on a fresh Ubuntu install. I run the command               sudo smbpasswd -a someuser     New SMB password:     Retype new SMB password:     Failed to add entry for user someuser.      I've read that you need to setup a system user, or setup a normal user for `someuser` first. I have two questions. What is a system user? What the correct way to setup a vanilla smb only user with either a system user, or for someuser?


How can I find where LANG, LANGUAGE and MAIL environmental variables are set?

I've had a few issues with environmental variables not set correctly in my Raspbmc Raspberry Pi. Specifically, I've had to manually specify the following in `~/.bashrc`.               export LANG='en_AU.UTF-8"     export LANGUAGE='en_AU:en'     export MAIL='/var/mail/pi'      However, in another Pi running vanilla Raspbian, these environmental variables _are_ set correctly. I wanted to see what file specified these, but couldn't find it. I tested the files that I know of that run when logging in to a terminal. These gave no hits.               grep LANG -r /etc/profile /etc/profile.d/ /etc/bash.bashrc ~/.profile ~/.bashrc /etc/environment     grep MAIL -r /etc/profile /etc/profile.d/ /etc/bash.bashrc ~/.profile ~/.bashrc /etc/environment      Conversely, on my laptop running Arch, `/etc/profile.d/locale.sh` appears to set `LANG`, and `~/.profile` specifies `LANGUAGE`. However, I could find no mention of `MAIL`. How can I find where these environmental variables are set? * * * ## EDIT I searched the whole of `/etc` and `~` for these strings in the working system (Raspbian).               grep "\bMAIL=" -r /etc 2>/dev/null     grep "\bMAIL=" -r ~ 2>/dev/null      Searching for MAIL gave no hits.               grep "\bLANG=" -r /etc 2>/dev/null     grep "\bLANG=" -r ~ 2>/dev/null      This strategy gave only a few hits for LANG in `/etc`, and none for LANGUAGE. There were a few false hits in `/etc` with `LANG=C`, and one true hit (as mentioned by vinc17) at `/etc/default/locale:LANG=en_AU.UTF-8`. However (as per a previous question by me), this file at `/etc/default/locale` is not sourced on my Raspbmc machine, so I presume that the situation is a bit more complicated than the mere presence of this file.


Write lines to a file from less

While in `vim` I can write a range of lines from the file I'm viewing to another file. For example,               :1,10 w outfile.txt      will write lines 1 through 10 to outfile.txt. Can I do the same while I'm viewing a file using `less`?


undefined symbol in /usr/lib64/libGL.so.1 when using ssh

I frequently use ssh to a computer with redhat using the Y option so I can forward the windows. I always saw errors like this one               /usr/lib64/firefox/firefox: symbol lookup error: /usr/lib64/libGL.so.1: undefined symbol: _XGetRequest      This wasn't a problem since everything was working anyway. Now I'm trying to solve it since it's causing troubles with some other program called abaqus. this is the error message.               /usr/local/Abaqus/6.11-1/exec/ABQcaeK.exe: symbol lookup error: /usr/lib64/libGL.so.1: undefined symbol: _XGetRequest     terminate called after throwing an instance of 'nex_PrimException<ipc_IPCMsgErrorTypeEnm, 1>'      My knowledge of linux is just basic so I know how to use the terminal and the basic commands, but I have no clue about this kind of things. Is it possible to solve this problem?


PulseAudio server on Android

I want to stream audio from my Linux box to an Android device, with smallest delay possible, so I thought about using PulseAudio with `module-opensl-sink` (found here). I _don't want to_ replace AudioFlinger with PA, because I want to use it's effects API. I've managed to compile PulseAudio using Google's Android NDK somehow, but everytime I try to start it, it throws an error, no matter which module I try to load.               $ ./pulseaudio -C --loglevel=4     W: [pulseaudio] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.     I: [pulseaudio] main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted     D: [pulseaudio] core-util.c: setpriority() worked.     I: [pulseaudio] core-util.c: Successfully gained nice level -11.     I: [pulseaudio] main.c: This is PulseAudio 5.0-121-g38c5d-dirty     D: [pulseaudio] main.c: Compilation host: arm-unknown-linux-androideabi     D: [pulseaudio] main.c: Compilation CFLAGS: -mfpu=neon -mfloat-abi=softfp -Wall -W -Wextra -pipe -Wno-long-long -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-parameter -ffast-math -fno-common -fdiagnostics-show-option     D: [pulseaudio] main.c: Running on host: Linux armv7l 3.4.0-cyanogenmod-g8a32cd7 #1 SMP PREEMPT Sun Jun 8 19:40:15 PDT 2014     D: [pulseaudio] main.c: Found 4 CPUs.     I: [pulseaudio] main.c: Page size is 4096 bytes     D: [pulseaudio] main.c: Compiled with Valgrind support: no     D: [pulseaudio] main.c: Running in valgrind mode: no     D: [pulseaudio] main.c: Running in VM: no     D: [pulseaudio] main.c: Optimized build: no     D: [pulseaudio] main.c: FASTPATH defined, only fast path asserts disabled.     I: [pulseaudio] main.c: Machine ID is localhost.     I: [pulseaudio] main.c: Using runtime directory /data/data/jackpal.androidterm/app_HOME/.config/pulse/localhost-runtime.     I: [pulseaudio] main.c: Using state directory /data/data/jackpal.androidterm/app_HOME/.config/pulse.     I: [pulseaudio] main.c: Using modules directory /data/local/pa/lib/pulse-5.0/modules.     I: [pulseaudio] main.c: Running in system mode: no     I: [pulseaudio] main.c: Fresh high-resolution timers available! Bon appetit!     W: [pulseaudio] core.c: failed to allocate shared memory pool. Falling back to a normal memory pool.     D: [pulseaudio] memblock.c: Using private memory pool with 1024 slots of size 64.0 KiB each, total size is 64.0 MiB, maximum usable slot size is 65496     I: [pulseaudio] cpu-arm.c: CPU flags: V6 V7 VFP EDSP NEON VFPV3      I: [pulseaudio] sconv_neon.c: Initialising ARM NEON optimized conversions.     I: [pulseaudio] mix_neon.c: Initialising ARM NEON optimized mixing functions.     I: [pulseaudio] remap_neon.c: Initialising ARM NEON optimized remappers.     E: [pulseaudio] module.c: Failed to open module "module-cli".     E: [pulseaudio] main.c: Module load failed.     E: [pulseaudio] main.c: Failed to initialize daemon.     I: [pulseaudio] main.c: Daemon terminated.      I configured PA with these arguments:               ./configure --prefix="/data/local/pa" --host arm-linux-androideabi --enable-neon-opt --with-sysroot='/data/local/pa' --without-caps --disable-shared --enable-static --disable-avahi --disable-alsa --disable-jack --disable-gconf --disable-esound --disable-openssl --disable-dbus --disable-glib2 --disable-orc --disable-adrian-aec --disable-rpath --enable-static-bins --disable-ipv6 --enable-force-preopen      Why does it fail to find these modules, even if it reports correct modules directory?


I want to expose "easy" URL's for machines on a home network. Is custom DNS/BIND the answer?

I recently convinced my room mates to cut the cord and go cable free, and they've found it pretty great so far. I'm in the process of setting up a pretty sweet, mostly automated home theater setup that revolves around an Apple TV, and part of this automation uses stuff like Sick Beard, Couch Potato, and the Transmission daemon. I've got everything mostly working, including the web interfaces for all of the above services, but I'd like to make the URL's more friendly than `<ip address>:<port number>` so that my room mates, who are _not_ technical in the slightest, can access these services (especially Couch Potato and Sick Beard). I'd like for them to be able to go to a url like `movies.home` or `tv.home` (I know that collides with a proposed TLD, if you have suggestions on this front as well I'm open) and be able to add shows to Sick Beard or put a movie on Couch Potato's watch list since those UI's are fairly straight forward to use. I'd like for this name resolution to be done at a network wide level, so that all of our phones and laptops and whatnot can get to the web interfaces without much work or me having to go around and editing everybody's hosts file. I don't care about accessing the stuff from outside of the home network, I only want it usable from our internal network. I'm not completely sure where to start, and I wanted to make sure I wasn't missing a simpler solution before pursuing a custom DNS server with `BIND` since I've never used it before and I wasn't sure if it would do what I want it to do; I was thinking that I'd set up BIND on a box somewhere in the house and then have my wireless router point to that local box as its DNS server then figure out some way to have the BIND box forward all non-home-media related requests to OpenDNS or something. Can BIND even do resolution based on different ports instead of different logical addresses? Anyway. Help is greatly appreciated.


Killing tcp connection in linux

I have some dead connection in one application which is in hanged state if client machine is dead.               ->192.168.1.214:49029 (ESTABLISHED)      Is there a way to terminate these option from linux command line without restarting the server? After search I found solution called as tcpkill. But it will not work for me. As it permanently blocks that ip.


is free command displaying all physical memory or there is some RAM reserved and hidden?

I am supposed to have 512MB of ram on my VM, however I see 495mb of total ram when I do free command. I would like to know if in case my system really had "precisely" 512MB of physical ram, if in free I would see 512MB as well, or if kernel takes some ram and reserves it for itself, therefore it looks like the system has less actual memory. I am aware that if my memory was over ~3.5 GB I would need to use PAE on 32bit kernel, but this is not the case. The reason why I am asking is that I am paying for this VM to have 512MB and even if 17MB of ram doesn't seem to be much, I would like to get what I pay for... (it shouldn't be problem to increase ram of virtual machine by 17mb even if it require reboot).


what are the techniques to extract files safely?

Yesterday I was making some experiments on Slitaz. It uses multiple initrd.img's to store files/changes. I wanted to extract one of its initrd.gz images (which is a cpio archive) to a folder, edit/remove them, repack again. I used this code:               cat rootfs.img | cpio -idvm      Then all files are extracted to my root filesystem. My whole OS is corrupted. (What an emberrasing situation...) What should I do to make such operations safely but in an easy way? Chroot? LXC? (VirtualBox is the last resort)


Execution order with multiple commands

I'm relatively new to Linux and I'm working on a CronTab for scheduled backups. I figured out how to do multiple sequential jobs with `;` and `&&`, but I'm unsure how the dependency affects the sequence. My cron job looks like this:               # Every day at 0:00 (reboot server and do the hourly backup procedure).     0 0 * * * sh shutdown.sh && sh backup.sh ; sh nas.sh ; sh ftp.sh ; sh startup.sh              What I want to happen is to run shutdown.sh and continue the sequence if it's successful, but cancel it if it fails. My fear is it will only skip `sh backup.sh` but then continue the sequence. Will it work as intended? If not, would something like `shutdown && (backup ; nas ; ftp ; startup)` be possible?


Installing as 'root' is not currently supported - what should I do?

I finally got root access to one of the nodes which incredibly helped me to get most of my software installed. But now, for the first time, I got into issues for actually being root :-))               We recommend running this script as a designated SMRT Analysis user     (e.g. smrtanalysis) who will own all smrtpipe jobs and daemon      processes.            Current user is 'root' (primary group: root)          Installing as 'root' is not currently supported     Switch to the desired user and restart the install.     Aborting installation...      I therefore tried to create new user, but I don't have enough privileges to do that:               /usr/local/bin$ sudo adduser smrtanalysis     Adding user `smrtanalysis' ...     Adding new group `smrtanalysis' (1001) ...     Adding new user `smrtanalysis' (1001) with group `smrtanalysis' ...     Creating home directory `/home/smrtanalysis' ...     Stopped: Couldn't create home directory `/home/smrtanalysis': Permission denied.          Removing directory `/home/smrtanalysis' ...     Removing user `smrtanalysis' ...     Removing group `smrtanalysis' ...     groupdel: group 'smrtanalysis' does not exist     adduser: `groupdel smrtanalysis' returned error code 6. Exiting.      Can I somehow use my own user - which is root - to install this software? How?


Permissions changing on few files under /etc/

It appears that new permissions on `/etc/issue` and `/etc/motd` are reverting back to the original even if we change them. This is on systems running RHEL 5 and RHEL 6. Is there any rc script which controls the permissions on `/etc` files?


If I have X11 forwarding turned on. How do I run a program without it in the same terminal?

Obviously I'm not looking to open another terminal and `ssh` without `-X`. I'm actually doing this with running Matlab on another server. So after ssh'ing into my remote server with the `-X` option, I type `matlab` and the graphics forward in as expected. How do I run `matlab` with X11 forwarding enabled but without graphics?


Can't push data to some websites / Older Linux do fine

**UPDATE:** _Another possible cause is that all the browser fail at POSTing data. Most of Google's stuff is Ajax over GET; Just an approach, I'm not sure about that..._ **UPDATE 2** Here's an overview of what works: **openSUSE 12.2** , _Kernel 3.4.63-2.44-desktop_ , Firefox 26, Chrome, Opera **Windows 7** , Firefox 26, Chrome, Opera And this does _not_ work (What I tried): **Linux Mint 16** , _Kernel 3.11_ , Firefox 26 **openSUSE 13.1** , _Kernel 3.11.6_ , Firefox 26 **Fedora 20** , _Kernel 3.12.9_ , Firefox 26 and Firefox 27, Opera and Chrome I recently installed Fedora 20 KDE on my XPS17, I have an openSUSE 12.2 KDE, a Debian Lenny KDE, Windows 7 (not KDE :D), parallel to the Fedora installation. (All operating systems are of the amd64 architecture.) _My problem also exists in Linux Mint 16 and openSUSE 13.1_ , but I finally installed and wanted to work it in Fedora, because I wanted this to be my "real" Linux distribution. However, after installing, I successfully connected to the wireless network here, and I started surfing the internet. Most of the pages loaded fast and appeared in Firefox, but when I tried to login to Gmail, it failed after I entered my username/password and had to enter my phone code. (I enabled 2-factor-authentication). Gmail doesn't load in Konqueror or Chrome, but it **does** load in Opera, after several hours, (I already forgot that Opera was running somewhere), the loading screen appeared. All other browser try to load the new page (screenshot below), and a response never comes back, so the browsers stop loading there. (See the answer in the network console of Firefox, screenshot 2) Screenshot 1: ![screenshot 1](http://img1.picload.org/image/lriapld/ff.png) Screenshot 2: ![screenshot 2](http://img1.picload.org/image/lriaplo/ff1.png) The same happens after pushing the download button, if I try to download the latest Adobe Flash Player for Fedora on the Abobe Download site. The browser stop loading something after some minutes, only opera tries and tries and tries... However, **I don't expect this to be a problem of the Gmail/Adobe Website or a network problem** , since the problem doesn't exist in the exactly same version of Firefox/Chrome in openSUSE 12.2 or Windows. I found some entries in forums, where a similar problem could be fixed, but this doesn't work for me. This is what I tried so far: **1\. Installed Fedora and installed Firefox 26 with yum.** 1.1 Tried to load Gmail in private mode [FAIL] 1.2 Resetted Firefox and tried to load Gmail [FAIL] 1.3 Created some new profiles and tried it there [FAIL] 1.4 Started Firefox in safe mode and tried it again [FAIL] **2\. ReInstalled Fedora and downloaded Firefox 26 / Firefox 27 beta (without yum)** 2.1 I did steps 1.1 to 1.4 again [4x FAIL] **3\. Installed Linux Mint 16 KDE** 3.1 Repeated 1.1 to 1.4 [4x FAIL] **4\. Installed openSUSE 13.1 KDE** 4.1 Repeated 1.1 to 1.4 [4x FAIL] **5\. Reinstalled Fedora and downloaded Firefox again from the Mozilla site.** 5.1. Pings to website are very successfull (as expected) 5.2. Tried surfing the internet again, (I write this in Firefox under Fedora it works very well BUT I had to save this text and post it in openSUSE... Gmail/Adobe also don't work) 5.3 Disabled spdy in about::config [FAIL] 5.4 Disabled DNS prefetch in about::config [FAIL] 5.5 Disabled ipv6 in about::config [FAIL] Did anybody experienced this problem, too? I would be very, very glad if someone could give me a hint, or even a solution to this problem.


Are there any utilities to quickly add, list and remove command aliases?

I'd like to be able to quickly, on-the-fly add (and list/remove) command aliases so that they persist between shell restarts (as if they were added to `.bashrc`). Are there any ready utilities/scripts/whatever that can help me with that? Ideally the uses case would look like:               aliasutil add "gcm" "git checkout master"     aliasutil add "gfp %1" "git push --force %1"     aliasutil list     aliasutil remove "gcm"


Command to re-enable decoration on windows

I'm running openbox, I have accidentally undecorated a window (By clicking on `Un/Decorate`) Now is it possible to restore the decoration? Since the title is "invisible" now, I have no where to click on. Perhaps there's a Xorg command to do so?