title: Gdm uninstallation fails (“pre-removal script returned error”)

text: I installed gdm on my vps and now I want to remove it but get this error:               root@server2:/etc/init.d# apt-get remove gdm3     Reading package lists... Done     Building dependency tree     Reading state information... Done     The following packages will be REMOVED:       gdm3     0 upgraded, 0 newly installed, 1 to remove and 6 not upgraded.     After this operation, 7066 kB disk space will be freed.     Do you want to continue [Y/n]? y     (Reading database ... 119416 files and directories currently installed.)     Removing gdm3 ...     invoke-rc.d: initscript gdm3, action "stop" failed.     dpkg: error processing gdm3 (--remove):      subprocess installed pre-removal script returned error exit status 127     configured to not write apport reports                                           invoke-rc.d: initscript gdm3, action "reload" failed.     Errors were encountered while processing:      gdm3     E: Sub-process /usr/bin/dpkg returned an error code (1)     root@server2:/etc/init.d#


title: How to calculate per CPU load

text: Is there any C API to calculate per CPU load? `/proc/loadavg` gives the CPU average load for all available CPUs and `/proc/stat` doesn't mention anything about active processes per CPU. How can I obtain the load per CPU?


title: shell script to print rows if there is a value in column 2

text: 1 **2** 3 4     3 1 4 2     1 4 3 2     4 **2** 1 3      How can I print all rows, on which there is a **2** in the second column.


title: How to set up SSH on Ubuntu desktop and bind sub-domain to it for remote access outside network?

text: I am pretty to new to SSH and I have a question regarding access to my machine outside network. I have a Linux machine sitting in my apartment running almost all the time and connect to the network through a router. I want to be able to ssh into it from outside the network on my laptop (can ssh within network using private address already). After some research, it seems like I need to enable port forwarding but I am not sure how to do that. Also, I have a domain myself and I would like to bind a sub-domain (ssh.example.com) to my ip address and have my desktop update the binding everytime it reboots (check if ip changed, if so update the domain). Is there a tutorial online for these?


title: A virtual file containing the concatenation of other files

text: Is there a way of creating a filesystem object akin to this:               mknod files p     cat file1 file2 ... fileN > files      but such that it can be seeked in, as if it were a regular file?


title: Linking /proc/mnt to /proc/mounts

text: I understand that `/proc` filesystem reflects the output of various processes. Unfortunately, I have a propietary (`romdump`) binary that expects the mount table to appear as `/proc/mtd`, while my Android device appears to output it as `/proc/mounts`. I've tried creating a symbolic link, but clearly this only works for actual files or directories. How can I fool this binary to read the output from `/proc/mounts` instead of `/proc/mtd`?


title: How to split a ddrescue disk image and how to use it again?

text: I have a 500GB external HDD that I need to rescue the contents of. Unfortunately I only have two 400GB partitions to save the contents to. Can I split the disk image as:               ~$ cd /mnt/part1/Recovery/     /mnt/part1/Recovery/$ ddrescue -f -n -i0 -s250...00 /dev/disk disk.part1.ddraw disk.part1.log     /mnt/part1/Recovery/$ cd /mnt/part2/Recovery/     /mnt/part2/Recovery/$ ddrescue -f -n -i250...00 /dev/disk disk.part2.ddraw disk.part2.log      (values of numbers are missing a few zeros for convenience). That is, can I just use the `-i` and `-s` flags to split the disk image into two parts manually? Secondly, is there a way I can mount the two parts of the image as one?


title: Some GUI programs hung up

text: Today I decided to migrate to systemd. Everything work quite good, but I have problem with few GUI programs - they hung up after draw window (see img at the end of msg). Program in which I discovered this problem:   * firefox   * chromium   * gimp   * xnmap   * gparted Program without this issue:   * vlc   * virtualbox   * xclock   * xskat :)   * xcalc   * feh I have no idea whats going wrong. I looked at logs in /var/log but there is nothing new after running problematic app. My system is up-to-date Archlinux, and I have awesome wm. ![Firefox-Chromium-Gimp](http://i.stack.imgur.com/xuf12.png)


title: How to set up Kate to use Nautilus as a file manager?

text: I use Gnome-based Ubuntu 10.10 and Kate text editor. If I right-click on a folder in Kate's file system navigation panel and choose to open the folder in a file manager, Filelight (a disk space occupation diagramming tool) pops up (which is far from what was intended). Can I set up Kate to open Nautilus in such a case?


title: Auto mount HP USB Flash drive Error

text: I am using RHEL 5, If i plug my USB Flash drive i'm getting Error message as follows, ![alt text](http://i.stack.imgur.com/N1iKf.png) This much days It work smoothly, And now it working with windows XP well. Where is the problem ? How can i solve it ?


title: Can't access to miniDLNA

text: I wanted to install a dlna server on my asus eeepc, and tried minidlna. My eeepc runs Wheezy, so I just had to run apt-get install to install minidlna on it. The first time I ran it, everything worked fine, but once I restarted the service, I could never access it from VLC (running in Squeeze) again. My config file:               media_dir=V,/home/media/vid     media_dir=P,/home/media/pic     media_dir=A,/home/media/aud          db_dir=/home/user/.minidlna     log_dir=/var/log          network_interface=wlan0     port=8200          inotify=no      Thanks in advance for helping!


title: Can't echo or create a symbolic link to a file with special characters in its name inside bash script

text: I'm trying to create a symbolic link to files with the following naming convention:               .$abc$namehere.zip;1      As can be seen, it has the following special characters in it: . $ ; In my bash script I have the following lines of code:               FILE1=`find /mydir/ -name "\.\$abc\$*namehere*.zip*" | sort -rn | head -1`     ln -s $FILE1 .     echo "$FILE1"      When I issue the `find` command by itself on the command line, I get a result displayed on screen of the file that I am interested in. However, when it is placed in the script above, the symbolic link command returns:               ln: `./.': cannot overwrite directory      And the echo command returns a blank line instead of the file name. May I get some help as to how I can fix this in my script so that I could create a symbolic link to these files with special characters?


title: How do I share applications windows between OS X and Linux?

text: I originally asked this question over on Super User, but I didn't get any answers. I'm trying to set up Xdmx on my Macbook Pro and my Ubuntu 10.04 workstation so that I can share my MBP's keyboard and mouse as well as X applications running on the workstation across the laptop display, a laptop attached monitor, and the workstation's monitor.   1. Where do I find the latest Xdmx? The Sourceforge site says that the code there is unmaintained and the project has been merged into Xserver. I can't find an up to date source or binary distribution.   2. How do I install it? Is there a package file? Do I have to build from source?   3. Are there other options for accomplishing what I've described above?


title: Portable encrypted container

text: I want to store some data encrypted to carry around with me (this includes some scans of relevant paperwork, my TAN List for online banking, my gnupg and ssh keys and stuff like that). So not really a _huge_ amount of data but also more than a little textfile. What I want is a container I can put on my thumbdrive to carry things around in that is fully encrypted. A few more requirements:   1. Strong Encryption, so no ZIP with passwords   2. I want to sync the container to more than one location (in case the thumbdrive breaks or is stolen for example) so I cannot just create another dmcrypt partition on the thumbdrive   3. I want to open the container from my GNOME environment without a lot of terminal fiddling. Not that I don't like terminals, but I want a certain level of convenience. (Right-clicking in nautilus to "mount" is OK, entering 3 commands in a terminal is not)   4. Bonus: Something I can open from Windows and/or OSX as well


title: Can you recommed a discrete simulation modelling system (like GPSS or Rockwell Arena) for Linux?

text: Do you know of a tool for discrete processes (those like production, logistics, client queue service (retail, call center etc.) etc.)) simulation modelling? I am familiar with 2 of such applications for Windows: Rockwell Arena and GPSS World. Are there any free alternatives for Linux? Maybe even standard (BEPL/UML/IDEF0/2/3) aware?


title: Starting firefox on a remote host (over ssh) opens a new window locally: what is happening?

text: I have never noticed this behaviour before, and am a little confused as to what is happening. I have a local copy of firefox running, then ssh (`ssh -X <url>`) into a remote server and start a copy there to use the local display. Turns out the local firefox just opened a new window. I verified with `ps x|grep firefox` that indeed no firefox process is started on the remote server. This same strange behaviour happens in reverse: if I have a remote firefox running and try to start a local one, then the remote one opens a new window. I am on ubuntu 10.4, with a nearly completely fresh install (I just got this computer this afternoon). I was trying to have the two firefoxes running at the same time so that I could easily run down the list of plugins to install. What is happening here, and how can I avoid it from happening?


title: Can I use grep matches to execute command? CentOS

text: I need to upgrade php from 5.3 to 5.4. I've installed it with rpm. I want clean install: delete all 5.3 packages, and install all necessary 5.4. Here is the command to see all installed packages:               rpm -qa |grep php      It prints out a list of packages, and I want to remove all them with:               rpm -e *pakage.name*      Can I iterate over all matches in grep results and use each match in:               rpm -e *grep.match*


title: How to calculate the size of a file list (not a directory)?

text: This command:               $ time (\ls /path/to/lots/of/dir*/*/*/*.ext > inputs.txt )          real    1m9.064s     user    1m3.265s     sys     0m5.993s      Gives me a huge list of file names inside the file "inputs.txt". I need to know the total size of all files described in inputs.txt, preferably without list all of them.


title: How to make an alias active in both current session and in .bashrc at same time?

text: I just found frequently I decide to add an alias for longer time use at the same time use it now. So I have to type the same thing twice, first in current bash session then .bashrc.


title: Why programs often fail to run when started by `daemon`?

text: I do `daemon -f -i ./some_gui_program` - it starts. I do `daemon -i ./some_gui_program` - nothing visible happens. Why I can't start GUI programs detached on Linux this way? What's the use of daemon's `-f` option if it changes behaviour that much?


title: do changes in /etc/security/limits.conf require a reboot?

text: do changes in `/etc/security/limits.conf` require a reboot before taking effect? Like if I have a script that sets the following limits in `/etc/security/limits.conf`, does this require me to reboot the system before those limits will take effect?               * hard nofile 94000     * soft nofile 94000     * hard noproc 64000     * soft noproc 64000


title: Desktop environment agnostic folder backdrop for wmaker

text: I recently stripped down my debian box, abandoning all desktop environments and running just WindowMaker with some self-written startup files. While I love the simplicity and speed of this setup, there is one thing I miss: I can no longer drop files onto my desktop. I am wondering if there is a standalone program, I can just start and which displays a certain directory and accepts drops from filemanagers. I thought I might just use some file-manager, make it sticky and somewhat get rid of the window decorations and menus. I tried Thunar, Pcmanfm and Krusader but drag'n drop did not always work between them.   * Is there a lack of standardization for drag'n drop, so it does not always work, or do you think I missed something?   * Is the window manager involved in drag'n drop and my ancient WindowMaker might be to blame?   * Is there such a thing as a standalone (desktop environment agnostic) desktop backdrop?


title: Python script run while screen is locked

text: I have a python script which seems to be failing to continue running its `while True: ... sleep()` loop my code is at http://github.com/xdaimon/xdaimonConky What happens is I autostart python on system boot by running... start.sh               #! /bin/bash     sleep 120     cd ${0%/*}     conky -d -c ~/.conkyrc2     python profitability.py &      cd ${0%/*} brings me to the correct directory where I eventually start profitability.py profitability.py eventually runs               while True:         ....         time.sleep(2000)      This works out to be about 33.3 minutes. This python script seems to run correctly as long as my screen does not lock. After a screen lock my script ceases to run, although there is still a python process. I'm writing this to be at least somewhat portable to other linux computers and can't have disabling screen lock or keeping a terminal open for python as prerequisites :) There is a lot that I do not understand I am sure, I'm open to many different options here. Any help is appreciated. * * * I ran this script in the terminal until it quit. I had a urllib error due to poor internet connection. I wrapped urllib2 piece of code in a try: except: statement, which fixed this issue. Although this may have been the cause for my script to fail I have confirmed through much testing that my script still fails if I close my terminal and lock my screen. I have implemented the code found at a url posted below, which works awesome while I use my computer but if I decide to lock and walk away scheduled events do not happen. http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ I'm using ubuntu GNOME 13.10 with gnome 3.


title: Fedora 19 xrdp login fails after screen lock

text: I'm using Fedora 19. I've installed xrdp using instructions found here: http://www.scottalanmiller.com/linux/2013/08/18/installing-xrdp-on-fedora-19/ Everything works great until the screen locks. After the screen locks, I can slide the time screen up and the login form appears; it says my user name + "Authentication Error". If I put in my password, a spinner appears and it never logs me back in. Although I can click the "Log in as another user", it doesn't do anything. The only way I've found to clear this is to restart the xrdp service but then all my windows are closed. Is there a way to recover from the lock screen or should I turn it off?


title: Will stat() cause an actual harddisk access or is the information cached?

text: While optimising my PHP opcode caches, I tried alternating the stat setting ( = the opcode cache checks, whether a file was modified via `stat()`, before using the cached results). But I did not see any difference in my application benchmarks. The filesystem in use is `ext4`, mounted with `noatime` option. Is it correct to assume, that the metadata used by stat(), is kept in memory, or is there always some kind of harddisk interaction when `stat()` is used?


title: CUPS remote printer entry is stopped locally

text: My local CUPS daemon on my laptop has an entry for a remote printer on my CUPS server. My local CUPS daemon thinks this printer is stopped, but it's not. The only interface CUPS gives me to manage this remote printer is a hyperlink to the CUPS printer on the server. This tends to happen when something tries to query status on this remote printer when I'm not on my local network. The local CUPS will then permanently mark it stopped and say it couldn't find it. However, once I get back on the local LAN it never removes the `'stopped'` status. (Even rebooting does nothing) The only way I can print again is to stop my local CUPS process, edit the `/etc/cups/printers.conf` file to manually change the status to "Idle", and restart the CUPS server. Surely there's a better way?? **EDIT:** Oh yeah, I previous solved this by creating a new remote printer entry. However, I couldn't find any way to DELETE the old remote printer entry. I had to edit printers.conf for that as well. Is there a way to manage remote printers entries at all? **EDIT:** This is CUPS 1.4.3. I also found a 'cupsenable' command that was only mentioned on the "What's new" page and the printers.conf docs online. I'll try that next time and see if it works.


title: Getting contradictory information regarding the linux distribution

text: I wanted to check which linux distribution is running on a remote linux box given to me .i have see this answer on super user which says that > LSB tools provide this information And then it goes on to say that on systems where LSB is not installed for most popular distros the following will do the trick :               cat /etc/*{release,version}      Now here is what I saw using these two techniques :               [subhrcho@slc04lyo pcbpel]$ lsb_release -irc     Distributor ID: EnterpriseEnterpriseServer     Release:        5.8     Codename:       Carthage     [subhrcho@slc04lyo pcbpel]$ cat /etc/redhat-release     Red Hat Enterprise Linux Server release 5.8 (Tikanga)      My question why am I getting contradictory information from running these commands ? What am I missing here ? Additional information : When issuing uname -or command I get the following :               2.6.18-308.4.1.0.1.el5xen GNU/Linux


title: Missing Firmware for Wired NIC on Debian

text: I'm trying to install debian 64bit from a debian live image using YUMI on my usb drive. I'm installing it on an Inspiron 6400, and there is missing firmware. I can't connect to the internet whatsoever, and am at a loss. I've tried configuring it myself to no avail. I downloaded the drivers, transferred them to the laptop, and it wouldn't run the install file because none of the networking directories seemed to exist. Does anybody have experience with this, or could anybody nudge me in the right direction? Thanks. EDIT: So guys, here's what I did. I figured it out eventually. What I did was download the firmware for the wireless card, put it on a usb drive, bring it to my laptop, and install it. Then I painstakingly downloaded every package and every dependency for wicd-curses, and installed that. Then I connected to my wireless with that, and got internet at this point. I tried getting the wired card to work but after many days I gave up and settled for wireless.


title: Understanding the output of the "who -a" command

text: I ask this question because, while there are many answers on the internet showing that "who -a" is an option, nobody explains how to read the output. If you can provide a link to an online site that explains this, that would also be an awesome answer. Here is an example that I want to decipher:               [bo@hostname ~]$ who -a                             Jun 17 03:47               590 id=si    term=0 exit=0                system boot  Jun 17 03:47                run-level 3  Jun 17 03:47                   last=S                             Jun 17 03:48              4424 id=l3    term=0 exit=0     LOGIN      tty1         Jun 17 03:48              5503 id=1     LOGIN      tty2         Jun 17 03:48              5504 id=2     LOGIN      tty3         Jun 17 03:48              5505 id=3     LOGIN      tty4         Jun 17 03:48              5506 id=4     LOGIN      tty5         Jun 17 03:48              5507 id=5     LOGIN      tty6         Jun 17 03:48              5508 id=6                pts/0        Oct 19 16:27             15250 id=ts/0  term=0 exit=0     bo       + pts/1        Oct 23 12:24   .         19776 (10.10.10.93)                pts/2        Oct 23 13:07              8551 id=ts/2  term=0 exit=0                pts/3        Oct 22 10:36              5813 id=ts/3  term=0 exit=0                pts/4        Oct 10 09:06             13002 id=ts/4  term=0 exit=0


title: building my own initrd, how to populate dev directory

text: I am trying to learn stuff about initrd. I have followed this tutorial to build my own initrd from scratch, and I installed busybox on it. Then I made an .iso from it with isolinux, so I could test it in virtualbox. It works great! I have the basic commands from busybox, so I wanted to mount a filesystem. But the /dev directory is almost empty (no sda), except for some files I created while following the tutorial. I learned about udev and I think this is what I need. However I am not sure how to go on this. Should I just grab the latest source code from udev, compile it and add it to my initrd? And then call /bin/udev or something like that in my init script? Or is there an other/better way to populate the /dev directory? **Edit:** Some additional info and updates on what I have done already.   * I test everything in virtual box. I just installed ubuntu minimal in virtual box, made an .iso from my initrd, and then boot from the iso in virtualbox.   * I used the vmlinuz and `/lib/modules` that were present on a debian-businesscard.iso and copied those over to my initrd which I created by following the tutorial I linked earlier.   * Kernel has `CONFIG_DEVTMPFS=y`   * Some devices show up in `/dev`, like tty0-tty63 and some others, but no sda/hda.   * Ran `lspci -k` in my currently running OS and in a virtual box to check which modules are in use. `SATA Controller` says it uses `ahci` as module.   * When I execute `modprobe -v ahci` it complains a lot about "unknown symbol: ata_some_stuff", but after that it returns something like `SCSI Subsystem initialized`, `ATA-6: VBOX HARDDISK` and `Direct-Access ATA VBOX HARDDISK`. However, still no harddrive devices found in `/dev`. My current `/init/` script is as follows:               #!/bin/ash     mount -t devtmpfs none /dev     mount -t proc /proc /proc     mount -t sysfs none /sys     modprobe -v ahci     echo "Hello world"     exec /bin/ash --login      Does anyone has any idea what I am doing wrong and what I should be doing instead?


title: Portforwarding on LAN

text: I have a server with Zentyal 3.0 (Ubuntu 12.04 LTS). I have 2 lancard (`eth0 - internet, eth1 - LAN`), a DNS (`sz**.myftp.org`). The portforward works, but when I aks a request for DNS address or outer IP address from LAN, it can't contact the server. (when I do it from outside it can contact.) Ask for anything that I used or I have, I will tell you about it.


title: xmllint display values of more than 1 attributes in single execution

text: I am using xmllint to parse xml file which has several tags and each tag has several attributes. Sample structure as shown below:               <root>        <child attr1="abc" attr2="def" attr3="ghi" />        ...        ...     </root>      I need to fetch the values from the attributes `attr1`,`attr2` and `attr3`. So far, I have tried the following which is giving the data of one attribute perfectly               echo 'cat //root/child/@attr1' | xmllint --shell data.xml       This output               attr1="abc"      So, my question is, how can we specify more than one attributes in the string to get the required output as               attr1="abc"     attr2="def"     attr3="ghi"      I tried the following for this, but no good result:               echo 'cat //root/child/@*[attr1|attr2|attr3]' | xmllint --shell data.xml      echo 'cat //root/child/@*[attr1 or attr2 or attr3]' | xmllint --shell data.xml       output for above was that the echo statement was re-echoed again that means, the xmllint didn't accept it as input. Any ideas on how to go about this?


title: rpm query does not give complete provided capabilities (commands)

text: For example, I know /usr/sbin/agetty is provided by the `util-linux` package with the following command:               $ rpm -q --whatprovides /usr/sbin/agetty     util-linux-2.24.1-1.fc20.x86_64      Then I would like to know what commands are provided by `util-linux`:               $ rpm -q --provides util-linux     /bin/dmesg     /bin/kill     /bin/more     /bin/mount     /bin/umount     /sbin/blkid     /sbin/blockdev     /sbin/findfs     /sbin/fsck     /sbin/nologin     config(util-linux) = 2.24.1-1.fc20     eject = 2.1.6     util-linux = 2.24.1-1.fc20     util-linux(x86-64) = 2.24.1-1.fc20     util-linux-ng = 2.24.1-1.fc20      As you can see, the output does not contain agetty. I was wondering if this is an exhaustive list. Any ideas how to get the complete list?


title: Used xrandr to rotate monitor but cannot reverse it after deleting script

text: I following a guide to have my tablet (Samsung ativ 700t running ubuntu 12.10 Gnome3) invert the screen 180 on login I place a script file in `/etc/X11/Session.d/45custom-script`. Contents of file: (going by memory)                 # I cannot remember if I had #!/bin/bash here at first but I'm betting no       xrandr -o half       xsetwacom set-prop 9 rotate 2       xsetwacom set-prop 9 area 100 200 25000 14000 # numbers approximated         On the next boot this rotated the monitor correctly but not the stylus input (device 9). I then delete the xrandr line to just test the xsetwacom but on the next boot it was still flipped (login screen was normal). Then I did a bunch of things to attempt to fix it   * changed the xrandr to `xrandr -o none`   * changed the file name to `95custom-script` and `invert-screen` removed the file completely   * made sure to delete the 'filename~' files that gedit created   * removed the xsetwacom lines   * removed and added `#!/bin/bash` and `#!/bin/sh` to the top My only theory is that the command was copied somewhere else and will not change again.


title: Linux Ubuntu from one architecture to another

text: I have an ubuntu installation (amd64) on a SSD "A" and I copied the whole harddisk to another SSD "B" , (GPT, sda1=BIOS Boot partion , sda2 = ntfs (windows) sda2=ext4 (ubuntu), sda3 = linux swap) I wrote the grub bootloader to the disk (on System with i7 970 CPU) with               grub-install /dev/sda      everything worked fine! On the i7 architecture I can now boot from the copied SSD "B". But how can I use the copied SSD "B" on another architecture like the i5 LGA1150. Booting on this architecture does not work, the bootloader is not found somehow (black screen with one underline). Do I need to install the grub bootloader on the new architecture first, and will the copied ubuntu installation work then or is there still some inconsistencies? Thanks a lot for the dumb question :-) **UPDATE:** Using Drive "B" : GPT Formated SSD **I have the following motherboard with the i5 CPU (does not work so far):http://www.asus.com/Motherboards/Z87PRO/** **For the i7 I have the Asus P6T7 (boots successfully):http://www.asus.com/Motherboards/P6T7_WS_SuperComputer** Might that be the reason? **UPDATE2:** So far, i disabled secure boot and turned on legacy boot in the bios of the Z87PRO, and changed the SSD "B" back to an MBR format, i installed grub on the i5 platform with the live cd (chroot method) and when trying to boot from "B" I could not boot into the bootloader, just black screen and returning to BIOS, i am a bit desperate... any ideas? **My Boot Repair Dum is here, the correct one now>http://paste.ubuntu.com/7185224/** **Solution:** Finally I was able to boot the SSD "B" drive (architecture was no problem) but I still had a GPT partition table, which was a problem: I Changed the GPT to MBR (here: http://askubuntu.com/questions/84501/how-can-i- change-convert-a-ubuntu-mbr-drive-to-a-gpt-and-make-ubuntu-boot-from) then I reinstalled Grub from a Live CD Ubuntu 13.10 , (SSD "B" system is 13.04) from here: http://ubuntuforums.org/showthread.php?t=1581099 (with the chroot method!) rebooted, and finally the Grub worked! and also I could boot the kernels on the i5 architecture! :-) Thanks a lot all for the kind support!!!


title: Mounting a network drive automatically when needed and unmount it again after some time with inactivity

text: I have a somewhat old NAS hosting my music collection. It is not capable of running a DAAP media server so I have mounted the music folder on my Sheevaplug (a tiny headless server running Debian) which then runs the DAAP media server. It works perfectly, but the problem is that the mounting of the samba share prevents the NAS from going into hibernation when there is no activity. If I unmount the share manually, the NAS will hibernate after some time. Because of that I am looking after a way to automatically mount the network drive when needed (ie. accessed) and unmount it again after a period with inactivy. I have tried `inotifywait` to monitor read access in the mount point, but unfortunately that does not catch reading from files not found which is what happens when the DAAP server tries to stream a music file in the empty folder. Then I have googled more and have found `autofs` which seems to be able to do exactly what I need. But unfortunately, even after reading a guide like this, I still don't understand how to use it. EDIT: I was confused by the small differences between Debian and Gentoo. In Gentoo the config file is /etc/autofs/auto.misc whereas Debian uses /etc/auto.misc and so on. Adjusting for those subtle differences, autofs works perfectly. It mounts the samba share when needed and unmouns it again after the timeout period given in auto.master


title: Make Completion Progress Script

text: Any time I'm executing a build process that takes several hours, I inevitably stare at my terminal and wonder, "how much longer?" Sometimes, I manually pick up on some pathname echoed to the terminal and then go into the maze of makefiles to determine where in the build process I am. This is obviously an imperfect, tedious process, so I was wondering, does any program out there do this automatically? I can imagine a script that goes through the make dependencies and constructs a dependency tree, and then, using some heuristic, estimates how much of the tree has been "completed" or "built." Has anyone ever heard of something like this?


title: Compare all text files in a directory, and sort by similarity

text: In Unix, is there any way to compare every text file in a directory to every other text file in the directory, and then sort each pair of files by similarity (using the `diff` utility)? There are already some command-line Unix programs (such as fdupes) that can find duplicate files in a directory, but I'm wondering if it's possible to find similar files using a shell script as well.


title: How to decode cmd = 3222823425 in ioctl in Linux 2.6.29

text: I am just confused like how can I break `cmd=3222823425` value into different parts to figure out what this command means actually in the Linux kernel. I know, some functions are making `ioctl` command with following parameters but I want to know what these parameter values mean.               fd=21, cmd=3222823425 and arg=3203118816       I have been looking into various forums, man pages and other links to figure this out like what does it mean when a `cmd` in an `ioctl` system call has value of `3222823425`. I have found that cmd is a command number which consists of `type`, `number` and `data_type` and first twos are `8-bit` integers (0-255). So my question is how to decode these parameter values to find out what this call is trying to do?


title: vim how to configure backspace and delete key's both as normal

text: How to configure following keys in `vim`?   * `Backspace` key to delete a character backwards.   * `Delete` key to delete a character forwards. After reading some posts, I got to know that only one of those can be used to delete a character. But I guess the above behavior would be achievable. ### Current scenario   1. `Backspace` working as said above.   2. `Delete` key is however acting weird. On pressing it, the character under the cursor get's replaced by `~`, and later 5-6 keystrokes changes it to aplahabet and also change the case. `Vim` comes back to normal mode after that, leaving messed-up text. ### Details               $ bash --version     GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)     Copyright (C) 2005 Free Software Foundation, Inc.     $ vim --version     VIM - Vi IMproved 7.0 (2006 May 7, compiled Jun 12 2009 07:08:36)      If the above is not configurable, Please let me know, How I can at-least map `Delete` key to nothing, so that above weird behavior doesn't take place ?


title: Will kjournald takes too much space?

text: I am changing my hard disk to ext3 because journalling got so much write my server crash. Well, now I use SSD. Journalling is no longer the issue. But SSD are small. Will journaling takes so much space? kjournald writes 5MB-10MB of data all the time. However, there is no file that's bigger than 2MB. So I wonder what it actually writes. We don't have this in windows right?


title: Syslinux 4.03 Stuck

text: I installed android 4.0 X86 in my HP Mini 110-4100LA (1.6GHZ and 1GB RAM, 298GB hard disk). I used LILI and unetbooting to create a pendrive, I used a Kingston USB 8GB, when I reboot my computer and press F9 I choose USB boot and instead of appear LIVECD. or install, or anything that I know that had to appear, I see a black screen with this               SYSLINUX 4.03 2010-10-22 EDD Copyright (c) 1994-2010, H. Peter Anvin et al      Why does this happen? What can I do to fix that?


title: Use awk to split line into array and use that array's values in calling shell

text: First of all, my apologies for the somewhat clumsily worded title. If you can think of a better one, please feel free to edit. [EDIT: done] What I am trying to do is use `awk` inside a `bash` script and do a rather common task: iterate well structured file lines and split them by a delimiter into an array. Here is a sample from the file:               Joe:Johnson:25     Sue:Miller:27      There are numerous examples how this can be done on a single line in the interactive mode, however, I am doing it in a script in which I would like to use that array manipulated by awk outside the awk subshell in bash itself:               cat ${smryfile} | while read smryline; do              echo ${smryline}              #now i want to split the line into array 'linearray' in awk but have it usable when i get back to bash         echo ${smryline} | awk '{split($0,$linearray,":")}'              varX=$linearray[2]         echo $varX         #do something with $varX          done      I get an error:               awk: syntax error at source line 1      context is          >>> {split($0,$linearray <<< ,":")}     awk: illegal statement at source line 1      Is it possible to do what I am trying to do (use arrays that are defined in awk outside of its scope) and how should I do it?


title: Nested loops, if conditions, and background jobs in bash

text: I have a bash extraction function that I am trying to parallelize. Its job is to find and extract nested archives. Ideally, I want the if evaluation and all of its actions to be sent to the background. The catch is that the action items of the if evaluation need to be done in order, so I can't just add an "&". to the commands in the if. Is there a way to encapsulate the entire if evaluation into a single background job and have the commands execute in order? Here is the current working function:               extract () {     IFS=$'\n'     trap exit SIGINT SIGTERM     for ext in zip rar tar.gz tar.bz2 tbz tgz 7z tar; do         while [ "`find . -type f -iname "*.$ext" | wc -l`" -gt 0 ]; do             for z in `find . -type f -iname "*.$ext"`; do                 if [ ! -d "`echo "$z" | rev | cut -c$(expr ${#ext} + 2)- | rev`" ]; then                     echo "Extracting `basename "$z"` ..."                     mkdir -p `echo "$z" | rev | cut -c$(expr ${#ext} + 2)- | rev`                     if [[ "$z" =~ ^.*\.7z$ ]]; then 7z x "$z" -o"`echo "$z" | rev | cut -c$(expr ${#ext} + 2)- | rev`" > /dev/null                     elif [[ "$z" =~ ^.*\.zip$ ]]; then unzip -uoLq "$z" -d `echo "$z" | rev | cut -c$(expr ${#ext} + 2)- | rev` 2>&1 | grep -ive warning                     elif [[ "$z" =~ ^.*\.tar\.xz$ ]] || [[ "$z" =~ ^.*\.tar\.gz$ ]] || [[ "$z" =~ ^.*\.tar\.bz2$ ]] || [[ "$z" =~ ^.*\.tgz$ ]] || [[ "$z" =~ ^.*\.tbz$ ]] || [[ "$z" =~ ^.*\.tar$ ]] ; then tar -xaf "$z" -C `echo "$z" | rev | cut -c$(expr ${#ext} + 2)- | rev`                      elif [[ "$z" =~ ^.*\.rar$ ]]; then unrar x -y -o+ "$z" `echo "$z" | rev | cut -c$(expr ${#ext} + 2)- | rev`                     fi                     rm -f "$z"                 else echo "Omitting `basename "$z"`, directory with that name already exists."; rm -f "$z"                 fi              done         done     done      }      Also, I am curious if there is any way to perform the extraction without deleting the source archives. I currently do this to prevent an endless loop. For now, the function is reliable enough to not loose any data, but I would like to avoid deleting anything for safety.


title: How can I read line by line from a variable in bash?

text: I have a variable which contains multiline output of a command. What's the most effecient way to read the output line by line from the variable? For example:               jobs="$(jobs)"     if [ "$jobs" ]; then         # read lines from $jobs     fi


title: Allow user1 to "su - user2" without password

text: I need to allow user `martin` to switch to user `martin-test` without password               su - martin-test      I think this can be configured in `/etc/pam.d/su`. There are already some lines in that file which can be uncommented. However, I don't like the idea of adding user `martin` to group `wheel`. I don't want to give `martin` any more privileges than to be able to switch to `martin-test`. I also do not want to use `sudo`. What would be the best way to do it, while keeping the privileges of user `martin` minimal?


title: Isn't /boot a separate mount?

text: My understanding is that `/boot` is being accessed by lower level tools (e.g. grub) during system startup and so it is formatted specially in a simpler format than the rest of the disk.   But when I do:               ~$ df       Filesystem     1K-blocks    Used Available Use% Mounted on       /dev/sdb1      230693004 4764776 214186584   3% /       none                   4       0         4   0% /sys/fs/cgroup       udev             3008452       4   3008448   1% /dev       tmpfs             611080    1220    609860   1% /run       none                5120       0      5120   0% /run/lock       none             3055384     368   3055016   1% /run/shm       none              102400      20    102380   1% /run/user       /dev/sdb5      368970628 1623180 348581216   1% /home        I don't see `/boot` mounted in Kubuntu. Shouldn't it be in this list as a separate mount?   I am using the latest Kubuntu


title: Let remote ssh session know about tmux?

text: Assume I run a `tmux` session on machine A and from it I start an interactive shell via `ssh` to machine B. I'd like to change machine B's `PS1` to better suit the use from under `tmux`; for instance, I'd include different things into the XTerm title string. I would rather not edit machine B's settings to always show a tmux-optimized prompt. Sometimes I `ssh` to machine B from a plain terminal (not `tmux`) and would like it to use my regular `PS1` in that case. Is there a standard / accepted best way to achieve this? All I came up with so far is setting `AcceptEnviron` in machine B's `sshd` config and pass a custom signal variable at `ssh` connection time.


title: Providing ftp access (of selected files) to users from a hashed repository of unique files

text: We have a portal where each user has an account and a file repository that goes with it. Whenever any user uploads a file using a form, the php app hashes the file contents first and checks to see if the file already exists in the system (even if uploaded by a different user). If the file exists, no new file is stored, instead the system only saves a row with the details of the uploading user and links to the original file. This method eliminates file duplicates and saves space . But we are encountering a problem now; every user also gets an ftp account, which can be utilized to download his repository files. Since only unique files are stored, we need a way to show to every user all files from his repository. Since this isn't a simple ftp folder it requires tinkering around. We have seen symlinks and file mounts, both are not practicable because the former blocks access on permission grounds and latter requires thousands of files to be mounted individually at runtime.


title: how to determine the permissions of groups?

text: When you invoke sudo, it prompts for password and then checks the /etc/sudoers configuration file to see if the user is permitted access to run the command. /etc/sudoers is the sudo configuration file that enables certain users or groups to run certain commands. For example, below we make the user called john, from any terminal, run the command power off:               john ALL= /sbin/poweroff      Obviously the root user can do anything:               root    ALL=(ALL) ALL      Since root can do anything, we often want to use the sudo program to elevate ourselves to root (with a password prompt) to perform some system level commands. If we enter the right password for our user, then we can perform the command. But we need a way to make sure this user can be elevated to root in the first place. Hence, the purpose of /etc/group.               sudo:x:27:myuser      /etc/group is a text file which defines the groups to which users belong. File system permissions are organized into user, group, and others. The use of groups allows additional abilities to be delegated in an organized fashion, such as access to disks, printers, and other peripherals. When reading over some articles of how to use gammu-smsd daemon http://www.techytalk.info/send-receive-sms-using-gsm-modem-phone-ubuntu/ I came across this line: > We don't really want to enter our administration password every time we want > to send SMS message, so first thing we must do is to add our selves to the > dialout user group. All members of this group have permission to use modem- > like devices on Ubuntu system. And where is it defined that grants dialout group such privilege? I look in my etc/sudoers file and I find no mention of dialout:               $ sudo cat /etc/sudoers     # /etc/sudoers     #     # This file MUST be edited with the 'visudo' command as root.     #     # See the man page for details on how to write a sudoers file.     #          Defaults    env_reset          # Host alias specification          # User alias specification          # Cmnd alias specification          # User privilege specification     root    ALL=(ALL) ALL      I think there is a key element I am missing about groups.


title: How do I switch to vi editing mode in readline?

text: I want to switch to vi editing mode in a readline environment. But I don't want to use 'set -o vi'. I want to temporarily switch using a keyboard shortcut. The man page says I can do this with `M-C-j`. But that doesn't work for me. I'm using Ubuntu and an xterm. Doesn't work under gnome-terminal either.


title: Regarding separate a single file into multiple files according to line separation

text: Currently, I have a plain text file, A, such as               lowest priority     very high significance.     outstanding     very novel      In this file, every line contains a sentence. I want to separate this file into multiple files, and each file is composed of a single line of the original file, A. For instance, with respect to the example file A, I want to generate four files:   * A1, which has single line, `lowest priority`   * A2, which has single line, `very high significance`   * A3, which has single line, `outstanding`   * A4, which has single line, `very novel`. How to do that under linux?


title: Email sent from web server using PHP does not arrive

text: I am trying to send email via my web server using PHP but for some reason the email never arrives. According to PHP the email was sucessfully sent but I never receive the email. I know its not a spam problem as the web server used to be able to successfully send email until I reinstalled it last week. It has been installed with exactly the same OS and configuration except now it doesn't work. It is using the default PHP settings for sending email and I have enabled SMTP in the firewall but this doesn't seem to be working. Are there any logs for the PHP email sending that may be able to help me trouble shoot why it isn't working?


title: Shell scripts for the database logs

text: The actual log file will be like this               $ cat file1.log     time=2014-07-23 23:56:28 GMT, user=[unknown], db=[unknown], host= pid=28254 LOG:      time=2014-07-23 23:56:28 GMT, user=portalman, db=ss, host=172.18.183.45 pid=28254 LOG:  connection authorized: user=portalman database=ss     time=2014-07-23 23:57:28 GMT, user=[unknown], db=[unknown], host= pid=28269 LOG:  connection received: host=172.18.183.45 port=14493     time=2014-07-23 23:57:28 GMT, user=portalman, db=ss, host=172.18.183.45 pid=28269 LOG:  connection authorized: user=portalman database=ss     time=2014-07-23 23:57:28 GMT, user=[unknown], db=[unknown], host= pid=28270 LOG:  connection received: host=172.18.183.45 port=14494     time=2014-07-23 23:57:28 GMT, user=portalman, db=ss, host=172.18.183.45 pid=28270 LOG:  connection authorized: user=portalman database=ss     time=2014-07-23 23:57:58 GMT, user=[unknown], db=[unknown], host= pid=28273 LOG:  connection received: host=172.18.183.45 port=14495                                                 column "actice" does not exist at character 17     .     .     .      The total lines will be around 20,000. In this log file I need to fetch the unique errors, which I got through this command:               $ find file1.log | xargs grep -e ERROR -e FATAL | cut -d ":" -f4,5 |sort |uniq      Following is the result set and it not constant, it varies               syntax error at or near "?" at character 1     syntax error at or near "[" at character 1     syntax error at or near "desc" at character 1     syntax error at or near "describtion" at character 1      For getting the process id (pid) of each error I used:               $ find file1.log | xargs grep 'syntax error at or near "?" at character 1' | cut -d " " -f8 | tail -1     pid=25997      Now I got the process id,then I need to fetch the entire information of that process id               $ find file1.log  | xargs grep pid=25997     time=2014-07-23 23:10:02 GMT, user=[unknown], db=[unknown], host= pid=25997 LOG:  connection received: host=[local]     time=2014-07-23 23:10:02 GMT, user=dbman, db=ss, host=[local] pid=25997 LOG:  connection authorized: user=dbman database=ss     time=2014-07-23 23:10:02 GMT, user=dbman, db=ss, host=[local] pid=25997 ERROR:  syntax error at or near "?" at character 1     time=2014-07-23 23:10:02 GMT, user=dbman, db=ss, host=[local] pid=25997 STATEMENT:  ?column?         How to put all the 3 find commands in a shell script & do the process automatically? The errors & number of lines varies. Nothing is constant.


title: How to fix "ambiguous package name 'libglib2.0-0'" problem?

text: Using Ubuntu 11.10 64 bit, whenever I try `apt-get [anything]` or `dpkg [anything]` I get this error:               dpkg: error: el fichero de registros de disparadores menciona un            nombre de paquete ilegal `libglib2.0-0' (en el fichero           `/usr/lib/x86_64-linux-gnu/gio/modules'):           ambiguous package name 'libglib2.0-0' with more than one installed instance      Any ideas for this?


title: Can sources.list only be updated by hand?

text: I'm currently running Linux Mint. I remember that under Ubuntu, whenever a new release comes out, it prompts you with a choice of whether to upgrade or not. It seems like this is not happening in Mint, so I decided to do it myself since Lisa came out in December. My /etc/apt/sources.list currently has links to older versions, and there are several of them, some Mint, some Ubuntu, some mediubuntu, etc. Is there a way to update this list automatically? Is there perhaps at least an official sources.list posted somewhere that I can simply get for upgrading to the new Mint version (I'm using `apt-get dist-upgrade`)? Am I missing the point entirely?


title: aptitude remove pkg_name* not working like apt-get

text: I have uninstalled (aptitude purge) the `qt-sdk` package but there is still a lot of `qt4*` and `libqt*` packages on my system. Is there a way to remove all these packages with `aptitude remove/purge beginning_of_pkg_name*` like we can do with `apt-get`? Maybe with bash `${}` syntax? I don't understand why we can't do that with aptitude, it really sucks if you have to remove all this packages manually, one by one. PS: shouldn't `aptitude purge package_name` remove all dependencies it has downloaded?


title: Killing multiple GNU screen sessions with the same name

text: Sometimes my script bugs out and multiple screen sessions with the same name get created. Is there a way to kill all of these with this name in one command?               Rx:/scripts# screen -S haydoz-script -X quit     There are several suitable screens on:             13372.haydoz-script     (09/10/11 07:44:05)     (Detached)             12287.haydoz-script     (09/10/11 07:30:45)     (Detached)             12230.haydoz-script     (09/10/11 07:17:42)     (Detached)             7824.haydoz-script      (09/09/11 11:42:26)     (Detached)             7764.haydoz-script      (09/09/11 11:35:40)     (Detached)             15753.haydoz-script     (09/04/11 15:00:27)     (Detached)             15744.haydoz-script     (09/04/11 15:00:26)     (Detached)      There are other screens running besides these ones that I do not want to kill.


title: DTrace to trap any chmod applied to certain files

text: Underneath the Mac OS X directory /audit I have certain files which users can access and chmod to their liking. I need to audit any chmod done on any files by recording the time, user and file being chmod, especially the latter. I can dtrace -n 'syscall::chmod:entry' and detect the events, how do I read the first argument to chmod? man 2 chmod tells me the path is in the first argument:               chmod(const char *path, mode_t mode);      but how can I read args[0]? I think I am doing this the wrong way around.. perhaps entry doesn't correspond to the actual syscall? If I have a probe I can monitor, how can I check which parameters it offers for access and what types they are? I am assuming some pointers will need to be dereferenced based on their data layout..


title: How to check if the system is ready for mounting NTFS by user?

text: There are (too) many posts already on the subject, yet I am stuck. I found very relevant post here: Unable to mount NTFS partition from user account and I also read FAQ here: http://www.tuxera.com/community/ntfs-3g-faq/#useroption and I still have problem mounting NTFS partition as user. Mounting as root (or mounting with sudo) works. So now I am wondering if my system is ready for mounting with user at all. My fstab entry options for the volume are:               noatime,     noauto,     noexec,     rw,     users,     shortname=lower,     uid=MY_USER,     gid=100,     fmask=111,     dmask=000       and when mounting I get error: > Error opening '/dev/sdc1': Permission denied > > Failed to mount '/dev/sdc1': Permission denied > > Please check '/dev/sdc1' and the ntfs-3g binary permissions, and the > mounting user ID. The requirements are (taken from FAQ):   1. ntfs-3g is compiled with integrated FUSE support   2. the ntfs-3g binary is at least version 1.2506   3. the ntfs-3g binary is set to setuid-root   4. the user has access right to the volume   5. the user has access right to the mount point 5 -- done, 4 - done, 3 -- done, 2 -- ntfs-3g-2010.10.2-2.1.x86_64 1 -- ? I have no clue how to check if FUSE is compiled within ntfs3g, and how to compare 1.206 version to 2010.10.2 version. So -- how should I check if it is possible at all to make things work for me? Because maybe my all struggle to mount it from user account are futile, because at my system it is simply not possible. openSUSE 11.4.


title: piping pwd to an executable as an argument

text: So I have an alias for "sublime text" http://www.sublimetext.com/docs/2/osx_command_line.html and very often I need to open a file or a folder right from the terminal, easy for a file:               subl myfile.html      and for a folder               subl /Users/me      But how can I use 'pwd' command to open current directory in sublime? Is there a way to pipe it in?


title: The result of ls * , ls ** and ls ***

text: I know using the command `ls` will list all the directories. But what does the `ls *` command do ? I used it and it just lists the directories. Is the star in front of `ls` means how deep it can list the directories?


title: Why do I not seem to have hidraw options on my system, and how can I fix my usb devices?

text: Starting today, I noticed a few problems with my system. USB devices, including the internal ones such as microphones, don't seem to be working at all. I first noticed when my keyboard and mouse weren't responding - however, checking dmesg, both the logitech unifying receiver and my external mics usb connections where being recognized. Thinking at first that the receiver may have simply stopped recognizing the input devices, I figured I'd resync them and I'd be good to go - except, that when I went to reference the needed hidraw device, I didn't have any. There is no dev/hidraw, no sys/class/hidraw, no anything it seems. (except a hidraw header under usr/include and some hidraw files under usr/src) So that /seems/ to be at least part of the problem - udev seems to be failing to do its job somewhere. But I've got no idea where to go next. Here's relevant bits that might be useful:   From dmesg:               [  178.045682] usb 3-4: SerialNumber: 201203     [  970.636450] usb 1-1.2: new full-speed USB device number 5 using ehci_hcd     [  970.731693] usb 1-1.2: New USB device found, idVendor=046d, idProduct=c52b     [  970.731698] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0     [  970.731701] usb 1-1.2: Product: USB Receiver     [  970.731704] usb 1-1.2: Manufacturer: Logitech      From lsusb:               Bus 001 Device 005: ID 046d:c52b Logitech, Inc. Unifying Receiver      From the udev monitor (udevadm monitor):               KERNEL[1111.431718] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2 (usb)     KERNEL[1111.432374] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0 (usb)     KERNEL[1111.432430] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.1 (usb)     KERNEL[1111.432495] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.2 (usb)     UDEV  [1111.438072] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2 (usb)     UDEV  [1111.441642] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0 (usb)     UDEV  [1111.442308] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.1 (usb)     UDEV  [1111.442924] add      /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.2 (usb)


title: Are there terminal emulators that support bi-directional text?

text: I tried searching for this but came out empty-handed. Is it possible for me to get my terminal emulator to display right-to-left Unicode grapheme clusters properly? Use case: I'm writing a script that outputs Arabic letters to the terminal and it's currently outputting the glyphs in reverse order, which messes up the way they're supposed to connect, making them visually difficult to read.


title: Create a new link to access all files and folders

text: I get stuck to create a shell script for a new link something like that               link linkPathName orginalPathName      I want to create a link between a new link and original path; however, both can access together. For example, if orignialPathName was a directory, it also creates a link to access all files and folders for a new link


title: Select between given characters in vim

text: Given three sample lines:               some('lorem _ ipsum');     $some['lorem _ ipsum'];     <span class="some _ class">      (cursor is in `_` position) Which is the fastest way to select (for pasting in other place):   * text between `'` quotes   * expand the selection to include the parenthesis   * text between parenthesis   * text between `<` and `>`


title: How to build a new OS on top of a Linux OS

text: I'd like to build my own operating system (really just the Ubuntu distro as I know the task is difficult) But what I mean by this is I wish to build atop of the Ubuntu operating system as like Apple has done with OS X building it atop of UNIX. I would like to do the same thing with a distribution of Ubuntu Linux except my business would be in control of everything, instead of Canonical Ltd. This question is different from just an Ubuntu Live CD because I don't want to create an almost entirely different OS then Ubuntu. In fact that is why I say that "I'd like to build my own operating system".


title: Linux shell - unexpected error

text: I'm new to the linux & command world. I have two directories, one called `pasta` (which contains 3 files) and another one called `pasta2` (with nothing inside). I'm trying to move all 3 files from `pasta` to `pasta2` with the command find. But i get the error bellow. Any suggestion? Command:               find pasta -type f -exec mv pasta2 {} \;      and i get this output:               mv: cannot overwrite non-directory `pasta/tmp3' with directory `pasta2'     mv: cannot overwrite non-directory `pasta/tmp1' with directory `pasta2'     mv: cannot overwrite non-directory `pasta/tmp2' with directory `pasta2'


title: Pipe assigns variable

text: For simplicity I would like to do ` echo cart | assign spo; echo $spo ` Output: cart Does such an appliance exist such as assign? I am aware of all the ways to do this using substitution.


title: Remove duplicates values within a field

text: How to remove duplicate (or more) values within a selected field in a file, keeping only one copy? Exemple Input file:               A    1,2,3,45,1,8,2,3     B    5,6,6,6,6,6,2,3,7      Expected output:               A    1,2,3,45,8     B    5,6,2,3,7


title: Problems connecting to IRC server from VPS

text: So I'm running a CentOS 6 VPS that I've got irssi installed on. I'd like to run irssi as a permanent connection to an IRC server so I can log in from anywhere and not lose my conversations. Irssi installed fine, and everything looks fine as far as I can tell (no expert). But when I try connecting to the IRC server, it just fails to get a connection every time. There's no firewall blocking as far as I know, and I've tried using iptables to open up the port without success. Any ideas on how I can sort this?


title: I'm trying to install my public key manually w/ scp

text: I'm following a tutorial and it's going along well. I used ssh to connect fine. Then I created a private and public key. Which leads me to my first question it says that the keys have been saved to > Your identification has been saved in /home/localuser/.ssh/id_dsa. > > Your public key has been saved in /home/localuser/.ssh/id_dsa.pub. But when I look in that folder I don't see the _.ssh_ folder. Is this done for security reasons and it's supposed to be hidden? Next the tutorial instructs to manually copy the public key to the remote machine using this command: > scp ~/.ssh/id_dsa.pub username@mywebpage.com:.ssh/authorized_keys When I run that command I get this response. > ssh: connect to host mywebpage.com port 22: Connection refused lost > connection So, like I do when I first connected by ssh, I add _-p 2222_ at the end of _scp_ command. I then get this response: > 2222: No such file or directory I've also tried uppercase _-P 2222_ What am I doing wrong? PS I'm using Linux Mint 15 and Cinnamon **EDIT** OK. Adding `-p 2222` right after `ssh` worked. However I've ran into another issue. It then transferred the file. However I had to create the directory myself before it would transfer. Now it's supposed to ask my for my passphrase instead of my password. It didn't do this so then the tutorial said to run these commands. `chmod 700 ~/.ssh` & `chmod 600 ~/.ssh/authorized_keys`. But when I login it still asks for my password and not my passphrase. Why is it not working? **EDIT: I ran`ssh` with `-v` these are the mentions of `public key`:**               debug1: Authentications that can continue: publickey,password,keyboard-interactive     debug1: Next authentication method: publickey     debug1: Offering DSA public key: /home/localusername/.ssh/id_dsa     debug1: Authentications that can continue: publickey,password,keyboard-interactive     debug1: Trying private key: /home/localusername/.ssh/id_rsa     debug1: Trying private key: /home/localusername/.ssh/id_ecdsa     debug1: Next authentication method: keyboard-interactive      I'll note this is prior to logging in.


title: Unable to delete files to trash in a binded filesystem

text: I'm trying to set up shared home directory for two Linux installations and thus I'm using bind-mounts. My user is named `dbz` and his home directory is `/home/dbz`. I also have shared directory `/home/shared` where I store my shared files (this folder is also owned by user `dbz`). I mount another directories from this shared directory into my home directory using binding:               mount -B /home/shared/work /home/dbz/work      This solution solves my needs and the only issue I have and don't know how to resolve is - when I'm trying to delete a file or directory from mounted directory I cannot delete it to trash, only permanent deletion is possible. For example:   * deleting file `/home/shared/work/test.txt`: OK, because deleting right from the directory where the file `test.txt` resides;     * deleting file `/home/dbz/work/test.txt`: CAN'T, because... by the way, because what? do bind-mounts have some restrictions on file deletion? Finally an issue submitted to bugzilla.kernel.org


title: paste command: setting (multiple) delimiters

text: In Linux, I have the following problem with `paste` from (GNU coreutils) 8.13: Trying to set another delimiter than the default (TAB) results in either just printing the first character of the defined delimiter or perfectly ignoring it. **Question** : _How does one define (multiple) delimiters when using_ `paste`? Simply using, e.g. _abc-123_ as delimiter would be nice. With "multiple" I mean e.g. 2 TABS instead of one. * * * The patterns enclosing the delimiter(s) I've tried so far were   * `\--delimiters="\delimiter"`   * `\--delimiters='\delimiter'`   * `\--delimiters=$"\delimiter"`   * `\--delimiters=$'\delimiter'` All with the same result: Only the first character is accepted or perfectly ignored. I've also tried the short version `-d"\"` and multiple instances &ndahs; nothing. Also:   * `\--delimiters="\\\"` -> Error message What works perfectly, though not what I want:   * `\--delimiters="\n"` -> newline   * `\--delimiters="\0"` -> nothing inbetween   * `\--delimiters="\t"`-> `TAB`, the default. Great.


title: ssh ubuntu to android : No route to host

text: I am trying to log into my android phone (running sshdroid), using my laptop (ubuntu 12.04). I am on a university sub-network (on wifi), and so is my phone. I tried the following command:               ssh root@my_phone_ip -p 2222      But the laptop fires back a               ssh: connect to host 172.20.27.169 port 2222: No route to host      I cannot even ping to my phone, it gives a destination host unreachable error. I looked for the route information on my laptop which is               root@abadmin-Vostro-3500:~# route     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface          default         eduspot-berlioz 0.0.0.0         UG    0      0        0 wlan0          link-local      *               255.255.0.0     U     1000   0        0 wlan0          172.16.185.0    *               255.255.255.0   U     0      0        0 vmnet1          172.20.0.0      *               255.255.0.0     U     2      0        0 wlan0          192.168.248.0   *               255.255.255.0   U     0      0        0 vmnet8      To check what packets were going through I have tried a tcpdump -i wlan0, but I could not find any interesting packets. I'm inserting the dump here for further info.               root@abadmin-Vostro-3500:~# tcpdump -i wlan0      tcpdump: verbose output suppressed, use -v or -vv for full protocol decode     listening on wlan0, link-type EN10MB (Ethernet), capture size 65535 bytes     19:45:12.354445 IP6 fe80::1416:f700:ff98:a65 > ff02::1:ff3a:6694: ICMP6, neighbor solicitation, who has fe80::51e2:6e29:ff3a:6694, length 32     19:45:12.355303 IP abadmin-Vostro-3500.local.54924 > eduspot-berlioz.crous- grenoble.fr.domain: 44239+ PTR?       4.9.6.6.a.3.f.f.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.f.f.ip6.arpa. (90)     19:45:12.364296 IP eduspot-berlioz.crous-grenoble.fr.domain > abadmin-Vostro-3500.local.54924: 44239 NXDomain 0/0/0 (90)     19:45:12.364742 IP abadmin-Vostro-3500.local.53789 > eduspot-berlioz.crous-grenoble.fr.domain: 29641+ PTR? 5.6.a.0.8.9.f.f.0.0.7.f.6.1.4.1.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (90)     19:45:12.368422 IP eduspot-berlioz.crous-grenoble.fr.domain > abadmin-Vostro-3500.local.53789: 29641 NXDomain 0/0/0 (90)     19:45:12.368740 IP abadmin-Vostro-3500.local.2590 > eduspot-berlioz.crous-grenoble.fr.domain: 39336+ PTR? 4.9.6.6.a.3.f.f.9.2.e.6.2.e.1.5.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa. (90)     19:45:12.373988 IP eduspot-berlioz.crous-grenoble.fr.domain > abadmin-Vostro-3500.local.2590: 39336 NXDomain 0/0/0 (90)     19:45:12.374372 IP abadmin-Vostro-3500.local.5879 > eduspot-berlioz.crous-grenoble.fr.domain: 3348+ PTR? 254.255.20.172.in-addr.arpa. (45)     19:45:12.389099 IP eduspot-berlioz.crous-grenoble.fr.domain > abadmin-Vostro-3500.local.5879: 3348* 1/0/0 PTR eduspot-berlioz.crous-grenoble.fr. (92)     19:45:12.389455 IP abadmin-Vostro-3500.local.30761 > eduspot-berlioz.crous-grenoble.fr.domain: 14063+ PTR? 186.27.20.172.in-addr.arpa. (44)     19:45:12.393315 IP eduspot-berlioz.crous-grenoble.fr.domain > abadmin-Vostro-3500.local.30761: 14063 NXDomain 0/0/0 (44)     ^C  19:45:12.411446 IP 172.20.18.214.netbios-ns > 172.20.255.255.netbios-ns: NBT UDP   PACKET(137): QUERY; REQUEST; BROADCAST          12 packets captured     525 packets received by filter     483 packets dropped by kernel      iptables output:               Chain INPUT (policy ACCEPT) target prot opt source destination      ACCEPT 47 -- 0.0.0.0/0 0.0.0.0/0      Chain FORWARD (policy ACCEPT) target prot opt source destination      Chain OUTPUT (policy ACCEPT) target prot opt source destination'       Please help me log into my phone.. its been frustrating me for 2 days now. Thanks ahead of time


title: netstat command doesnt work anymore on the new dedicated server

text: I was using the following command on my previous dedicated server with the same version of the FreeBSD installation:               # uname -a     FreeBSD 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 UTC 2013     root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64      The command is following:               netstat -ntu -f inet      Output:               netstat: illegal option -- t      Why doesn't it work anymore? I dont have an access to my previous dedicated server so I can't use the `man` to check the differences...


title: Is there some way I can start a (repeating) ping while the network is unreachable?

text: My ping command (on Debian 6 or 7) will repeatedly attempt to ping a server even while the network is down, **if** the network was up when it was started. Is there some way to start ping while the network is down and get this same behavior? Here's an example. If I start a repeating ping while the network is up, and while the ping is running, the network goes down, the ping continues to repeat. If the network comes back up, it will continue pinging:               me@here:~$ ping -n 8.8.8.8     PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.     64 bytes from 8.8.8.8: icmp_req=1 ttl=46 time=117 ms     ...     64 bytes from 8.8.8.8: icmp_req=6 ttl=46 time=116 ms     ping: sendmsg: Network is unreachable     ...     ping: sendmsg: Network is unreachable     64 bytes from 8.8.8.8: icmp_req=108 ttl=46 time=694 ms     ...      However, if the network is down when I run ping:               me@here:~$ ping -n 8.8.8.8     connect: Network is unreachable     me@here:~$      This is the same unreachable network problem, but ping doesn't keep trying until the network is up again, like it had before.


title: Burn fedora to DVD, but hash is incorrect

text: I downloaded Fedora-20-x86_64-DVD.iso from mirro site, and I checked the Sha256 with HashMyFiles, they are the same. But when I burned it to DVD, and checked the hash of DVD with Hash Codes, they are DIFFERENT! (I burned 3 DVDs, they are the same different from website) Next I booted this DVD, test this media, and it PASSED! ### Questions   * Is that OK? The hash of this DVD is incorrect, but it can pass the test.   * What if I install with this DVD?    * Will it make problems with my computer?


title: No syntax highlighting when editing crontab

text: I am trying to figure out why I don't have syntax highlighting when editing my crontab. I have both `$EDITOR` and `$VISUAL` set to `/usr/bin/vim`:               > echo $EDITOR     /usr/bin/vim     > echo $VISUAL     /usr/bin/vim      If I save the crontab to a file and edit it with vim syntax highlighting is enabled.               > crontab -l > saved_cronab     > /usr/bin/vim saved_crontab      And if I use `:syntax on` while editing the crotab nothing changes How can I enable highlighting when editing crontab with `crontab -e`?


title: Need help to combine 3 split lines of bash script into one single line

text: The following is what I found after googling:               dpkg --list 'linux-image-*' \         | perl -ane 'BEGIN { $r = `uname -r` or die; chomp $r } print $F[1], "\n" if $F[0] eq "ii" && $F[1] !~ /\Q$r\E\b/' \         | xargs -r aptitude purge -y      Could someone combine the above 3 lines into one? I find it easier to copy and paste a single line into a sudo command than three lines, one at a time. Thanks in advance for your help. _For Hauke Laging_ : I have edited this original post to include the error message when I tried to copy the three split lines at once following the sudo command:               username@hostname:~$ sudo -i     [sudo] password for username:      root@hostname:~# dpkg --list 'linux-image-*' \     >      Desired=Unknown/Install/Remove/Purge/Hold     | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend     |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)     ||/ Name           Version      Architecture Description     +++-==============-============-============-=================================     un  linux-image-2. <none>                    (no description available)     un  linux-image-2. <none>                    (no description available)     un  linux-image-2. <none>                    (no description available)     un  linux-image-2. <none>                    (no description available)     ii  linux-image-3. 3.14.4-1~bpo amd64        Linux 3.14 for 64-bit PCs     ii  linux-image-3. 3.2.57-3+deb amd64        Linux 3.2 for 64-bit PCs     ii  linux-image-am 3.14+57~bpo7 amd64        Linux for 64-bit PCs (meta-packag     root@hostname:~#     | perl -ane 'BEGIN { $r = `uname -r` or die; chomp $r } print $F[1], "\n" if $F[0] eq "ii" && $F[1] !~ /\Q$r\E\b/' \     -bash: syntax error near unexpected token `|'     root@hostname:~#      root@hostname:~#     | xargs -r aptitude purge -y


title: decreasing "reserved block count" does not show up in df output

text: By default my ext3 file system had 122060 blocks(5%) reserved. I decreased this to 24412(1%), but there were no changes in `df` output:               root@t60:~# df -P     Filesystem         1024-blocks      Used Available Capacity Mounted on     /dev/sda1              9611492   9611492         0     100% /     tmpfs                  1032740         0   1032740       0% /lib/init/rw     udev                   1028300       212   1028088       1% /dev     tmpfs                  1032740       272   1032468       1% /dev/shm     /dev/sda6            294079488  84665932 194475140      31% /home     root@t60:~# tune2fs -m 1 /dev/sda1     tune2fs 1.41.12 (17-May-2010)     Setting reserved blocks percentage to 1% (24412 blocks)     root@t60:~# df -P     Filesystem         1024-blocks      Used Available Capacity Mounted on     /dev/sda1              9611492   9611492         0     100% /     tmpfs                  1032740         0   1032740       0% /lib/init/rw     udev                   1028300       212   1028088       1% /dev     tmpfs                  1032740       272   1032468       1% /dev/shm     /dev/sda6            294079488  84665932 194475140      31% /home     root@t60:~#       Any ideas why is this so?


title: I can't install Mono because something's wrong with the kernel (I think)

text: $ sudo apt-get install mono-runtime     Reading package lists... Done     Building dependency tree            Reading state information... Done     You might want to run 'apt-get -f install' to correct these:     The following packages have unmet dependencies:      linux-image-generic-pae : Depends: linux-image-3.2.0-38-generic-pae but it is not going to be installed      mono-runtime : Depends: mono-gac (= 2.10.8.1-1ubuntu2.2) but it is not going to be installed                     Recommends: binfmt-support (>= 1.1.2) but it is not going to be installed     E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).      I'm trying to install McMyAdmin on Ubuntu 12.04, but I can't install `mono`. What's the problem? Should I backup the server files and reinstall? Edit: Here's `sources.list`; `sources.list.d` is empty.


title: Opening lid results in black screen (Dell Laptop with ATI Graphics, Ubuntu 12.04, 3.2 kernel, GNOME 3)

text: For the past few weeks, when opening the lid my laptop often fails to recover from suspension leaving me with a blank screen. Further, when this bug occurs, the laptop fans continue to run while the lid is closed, causing my laptop to quickly overheat in my bag. I have read various different questions on here that had similar symptoms but none of the solutions worked in my case. Disabling suspension on gnome seemed to reduce the frequency of this issue, but it still occurs with some frequency. It only seems to occur if I do not lock the computer before closing the lid or I am in a different desktop manager (such as dwm). I currently have the ATI graphics drivers enabled (not sure on the specific driver, but it is whatever driver that Jockey installed).


title: How can we know who's at the other end of a pseudo-terminal device?

text: If I do a:               echo foo > /dev/pts/12      Some process will read that `foo\n` from its file descriptor to the master side. Is there a way to find out what that(those) process(es) is(are)? Or in other words, how could I find out which xterm/sshd/script/screen/tmux/expect/socat... is at the other end of `/dev/pts/12`? `lsof /dev/ptmx` will tell me the processes that have file descriptors on the master side of any pty. A process itself can use `ptsname()` (`TIOCGPTN` ioctl) to find out the slave device based on its own fd to the master side, so I could use:               gdb --batch --pid "$the_pid" -ex "print ptsname($the_fd)"      for each of the pid/fd returned by `lsof` to build up that mapping, but is there a more direct, reliable and less intrusive way to get that information?


title: How to Calculate the Total size of file searched using Find command

text: Actually there are tow questions. First I have to search the files using FIND command that will show only the files for December 2012 And Secondly I need to see the Total size of files searched I used this command               find /storage/backup/rman/ -mtime +90 -mtime -120 -exec ls -lrth {} \;      But it also gave me the Files of November which I dont want               -rw-r--r-- 1 oraprod dba 8.7K Dec  1 22:40 /storage/backup/rman/full_011212.log     -rw-r----- 1 oraprod dba 3.3G Dec 11 22:34 /storage/backup/rman/BKPPROD_aknskgvb.F_bkp     -rw-r----- 1 oraprod dba 34M Dec  1 22:40 /storage/backup/rman/ctrl_011223     -rw-r----- 1 oraprod dba 1.3M Dec  1 22:33 /storage/backup/rman/BKPPROD_8lnrq765.F_bkp     -rw-r--r-- 1 oraprod dba 8.0K Dec 20 22:45 /storage/backup/rman/full_201212.log     -rw-r----- 1 oraprod dba 34M Dec  2 22:42 /storage/backup/rman/ctrl_021223     -rw-r----- 1 oraprod dba 2.5G Dec 11 22:38 /storage/backup/rman/BKPPROD_ajnskgvb.F_bkp     -rw-r----- 1 oraprod dba 34M Dec 13 22:46 /storage/backup/rman/ctrl_131223     -rw-r--r-- 1 oraprod dba 8.0K Dec 17 22:44 /storage/backup/rman/full_171212.log     -rw-r--r-- 1 oraprod dba 8.0K Dec 10 22:38 /storage/backup/rman/full_101212.log     -rw-r--r-- 1 oraprod dba 8.0K Dec 13 22:46 /storage/backup/rman/full_131212.log     -rw-r--r-- 1 oraprod dba 1.4K Nov 30 22:00 /storage/backup/rman/full_301112.log     -rw-r----- 1 oraprod dba 34M Dec  8 22:46 /storage/backup/rman/ctrl_081223     -rw-r--r-- 1 oraprod dba 9.2K Dec 12 22:43 /storage/backup/rman/full_121212.log      when i pass the du -ch at the end of command this is the result               8.0K    ./.gnome/gnome-vfs     12K     ./.gnome     24K     ./lsat-0.9.7.1/changelog     920K    ./lsat-0.9.7.1     8.0K    ./.gconf/desktop/gnome/accessibility/keyboard     12K     ./.gconf/desktop/gnome/accessibility     8.0K    ./.gconf/desktop/gnome/peripherals/keyboard/host-mdfr-prod/0     12K     ./.gconf/desktop/gnome/peripherals/keyboard/host-mdfr-prod     16K     ./.gconf/desktop/gnome/peripherals/keyboard     20K     ./.gconf/desktop/gnome/peripherals     36K     ./.gconf/desktop/gnome     40K     ./.gconf/desktop     8.0K    ./.gconf/apps/panel/applets/clock/prefs     12K     ./.gconf/apps/panel/applets/clock     8.0K    ./.gconf/apps/panel/applets/workspace_switcher/prefs     12K     ./.gconf/apps/panel/applets/workspace_switcher     8.0K    ./.gconf/apps/panel/applets/window_list/prefs     12K     ./.gconf/apps/panel/applets/window_list     40K     ./.gconf/apps/panel/applets     44K     ./.gconf/apps/panel     8.0K    ./.gconf/apps/puplet     56K     ./.gconf/apps     100K    ./.gconf     8.0K    ./.nautilus/metafiles     12K     ./.nautilus     4.0K    ./.eggcups     196K    ./.gstreamer-0.10     4.0K    ./.redhat/esc     8.0K    ./.redhat     8.0K    ./.gnome2/share/cursor-fonts     8.0K    ./.gnome2/share/fonts     20K     ./.gnome2/share     4.0K    ./.gnome2/keyrings     4.0K    ./.gnome2/accels     4.0K    ./.gnome2/nautilus-scripts     36K     ./.gnome2     12K     ./.metacity/sessions     16K     ./.metacity     4.0K    ./.Trash     4.0K    ./.gnome2_private     68K     ./.gconfd     4.0K    ./.mozilla/extensions     4.0K    ./.mozilla/plugins     12K     ./.mozilla     4.0K    ./Desktop     2.5M    .     2.5M    total


title: Apache server: permission and symbolic link problem

text: I am using CentOS(Linux 2.6.32-431.11.2.el6.x86_64). I am trying to create an Apache2.2.15 web server. Every thing configured very well. My DocumentRoot is the default location i.e. `/var/www/html`. I am able to create symbolic link which works perfectly. for example I can create a link for the configuration directory i.e. `ln -s /etc/httpd/conf/ /var/www/html/conf`, and it work perfectly fine. I also made a symbolic link to the home directory but it is not working. When I test my web-server it gave me the following error(403)               Forbidden          You don't have permission to access /test1/home/ on this server.          Apache/2.2.15 (CentOS) Server at my-PC Port 80      the web-server is running as an abc user (abc is a regular user and has home directory access). The permission of the home directory is               drwxr-xr-x.   6 abc abc  4096 May 29 14:47 home      The concerning part of httpd.conf is given below               <Directory "/">     Options Indexes FollowSymLinks Includes ExecCGI     AllowOverride All     Allow from all     </Directory>     <Directory "/var/www/html/">      Options Indexes FollowSymLinks Includes ExecCGI      AllowOverride All      Allow from all     </Directory>      SELINUX is disabled. The error_log tell me the following thing                [client ########] (13)Permission denied: Can't open directory for index: /var/www/html/test1/home/, referer: http://YYYYYYYYYY/test1/      Can any body suggest me how can I create a symbolic link for the home directory or for the `/home/abc/Download` directory?


title: Remote Desktop with a twist

text: I am looking for a remote desktop client with the following properties :   1. Preferrablly QT based, than GTK, but not a must.   2. I should be able to do all usual remote desktop as Teamviewer for example   3. However, I want to specifically let the remote user access the executables in a particualr folder (or symbolic links to other executables created in the same aprticular folder - this time the executables may reside somewhere else) and read write permission to the same folder. Does there exist any such software?


title: Spamassassin blacklist_subject not translating UTF8 characters

text: I am using spamassassin version 3.3.1 in conjunction with amavisd on Centos 6.5 64bit. It appears that when I use the whitelist subject plugin (actually using it to blacklist subjects, ie "blacklist_subject spammy subject") it does not translate UTF8 encoded subject lines and is allowing spam through that contain blacklisted subjects. Does anyone know how to handle this problem?


title: Disk full on a server with a large /home partition

text: I've just got this CentOS Server but I think I've set it up wrong as I can only upload a few GB then I start getting errors, It should have ~1TB. this is the results of lsblk               [root@ns4005990 ~]# lsblk     NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sda      8:0    0 931.5G  0 disk     ├─sda1   8:1    0  19.5G  0 part /     ├─sda2   8:2    0 911.5G  0 part /home     └─sda3   8:3    0   511M  0 part [SWAP]      I'm guessing its using sda1 as the main storage but should be using sda 2? I know very little about linux, Any ideas how i can fix it so its using sda2?               [root@ns4005990 ~]# df -h /home     Filesystem      Size  Used Avail Use% Mounted on     /dev/sda2       905G  200M  859G   1% /home


title: Shell script to wait for a packet from a certain port

text: I want to start my minecraft server when someone tries to connect to it on port 25565. I have a plugin for the server which shuts it down after x amount of minutes without players online. With a shell script I created a loop that starts the server when it shuts down:               #!/bin/bash     while true     do         # run server         java -Xms2048M -Xmx2048M -Djava.awt.headless=true -jar "craftbukkit.jar"         # server shut down              # run MCSignOnDoor         java -jar MCSignOnDoor.jar --sentrymode -m "Gone Fishin' Back in Five Minutes!"         # McSignOnDoor shut down              # stop loop if error code is not 12         # so only restart the server when the program ended because of a packet         if [ "$?" -ne "12" ]; then             break         fi     done      McSignOnDoor was a java program someone made that emulates an active server, and exits as soon as someone pings it on port 25565 with exit code 12. Sadly, this does not work since a protocol update, so I'm looking for an alternative. Is there a way to wait until it receives a packet on port 25565 (or any other port) and then continue the script?


title: How to configure DHCP so that hostname is not sent?

text: A simialr question Host name on terminal changes when I connect internet : why? But since it was not resolved in my case so I am putting it here and asking in a different way. The answer given here by chaos did not help me as I could not find the file mentioned in RHEL 6.0 64 bit `/etc/dhcp/dhclient.conf` The content of the file:               /etc/sysconfig/network-scripts/ifcfg-eth0      is               DEVICE="eth0"     HWADDR=70:54:D2:22:FA:A6     NM_CONTROLLED="yes"     ONBOOT="no"      . I can see there is no `DHCP_HOSTNAME`. But Still I am seeing a strange issue here. And the issue is that when I am not connected to internet:               [acme@localhost ~]$      But when I connect to internet:                [acme@dhcppc9 ~]$      Why it is happening?


How can I paste something to the VIM from the clipboard? In Windows "*p works as expected but in Debian both "*p and "+p doesn't work with both clipboard=unnamed and clipboard=unnamedplus.


title: Strange fcitx-mozc behavior with ArchLinux

text: I use ArchLinux and I have problem with Japanese IME. When I write by Japanese IME, a character can't be in text area with Skype, Android Studio etc.(Maybe those aren't gtk and qt apps) ![enter image description here](http://i.stack.imgur.com/evkBk.png) It works for Chromium, gnome-terminal. Do you have solution of this problem?


title: Make error while installing wifi driver offline

text: I need to install Kali Linux updates without Internet access on my laptop. I think I need to do this because I'm trying to install the wifi driver but I get an error when I try to make:               make ARCH=x86_64 CROSS COMPILTE= -C /lib/modules/3.7-trunk-amd64/build M=/root/Desktop/rtl8723A_WiFi_linux_v4.1.3_6044.20121224      modules make: *** /lib/modules/3.7-trunk-amd64/build: No such file or directory. Stop.      make: *** [modules] Error 2      Trying to install the Realtek rtl8723au wireless driver wifi driver: github.com/lwfinger/rtl8723au (from http://askubuntu.com/questions/318608/…) It's for the Yoga13, I can cd /root/blah/driver, but when I make it just spits out the aforementioned error message, that was the entire error message. When using "dpkg -l | grep linux-" command, it yields this: ii firmware-linux-free 3.2 all Binary firmware for various drivers in the Linux kernel ii firmware-linux-nonfree 0.37 all Binary firmware for various drivers in the Linux kernel ii kali-linux-full 1.35 amd64 Penetration testing and security auditing distribution, full system ii kali-linux-sdr 1.35 amd64 Penetration testing and security auditing distribution, SDR tools ii linux- base 3.5 all Linux image base package ii linux-image-3.7-trunk-amd64 3.7.2-0+kali8 amd64 Linux 3.7 for 64-bit PCs ii linux-image-amd64 3.7+46+kali1 amd64 Linux for 64-bit PCs (meta-package) ii linux-libc-dev:amd64 3.7.2-0+kali8 amd64 Linux support headers for userspace development The OS is a fresh install.


title: Problem creating a bootable USB stick

text: I have tried to make a bootable USB stick on my netbook using Universal USB Installer for Fedora Desktop. But it can't find my pendrive. I thought the problem is my pendrive, so I change it. Unfortunately,the problem still the same. Whats wrong exactly?   I am using Zorin 8 OS on my netbook.


title: Show in folder does not select file

text: In various applications when I do "show file in folder" it simply open the file-manager (nemo) but does not select the actual file. How can I make show in folder also select the file?


title: nmcli freedesktop DBus warnings and errors

text: As soon as I do `nmcli con up id <ESSID>`, I experience some warnings/errors: > ** (process:4841): WARNING **: async_got_type: could not read properties for > /org/freedesktop/NetworkManager/ActiveConnection/5: Method "Get" with > signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist > > ** (process:4841): WARNING **: async_got_type: could not read properties for > /org/freedesktop/NetworkManager/ActiveConnection/5: Method "Get" with > signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist > > ** (process:4841): WARNING **: async_got_type: could not read properties for > /org/freedesktop/NetworkManager/ActiveConnection/5: Method "Get" with > signature "ss" on interface "org.freedesktop.DBus.Properties" doesn't exist > > Error: Connection activation failed: Creating object for path > '/org/freedesktop/NetworkManager/ActiveConnection/5' failed in libnm-glib.   * How can I fix this error?   * What causes this? I have (X)Ubuntu 13.10. This might have to do something with some `freedesktop` related issues, I have with recently. Please have a look at it, too: Gnome programs (eog/gnome- terminal) have a slow start and produce a DBus.Error.NoReply Warning.


title: Multiple root options in Linux command line

text: My kernel command line looks like this:               root=31:0 ro noinitrd console=ttyS0,115200 root=/dev/mtdblock2 rootfstype=squashfs      I think the first `root` entry identifies a disk by its major and minor device number and the second entry identifies it by its name. I can confirm that the `rootfs` is indeed on `/dev/mtdblock2` but I don't know how to interpret `31:0`.


title: Prelink warning in output of rpm -Va

text: I have run the following as root on a RHEL 4 box to get a list of the modified files:               rpm -Va      The output includes lines such as:               prelink: /tmp/#prelink#.60m2Jq: Recorded 2 dependencies, now seeing -1          S.?.....    /usr/bin/gencat     prelink: /tmp/#prelink#.2izAsr: Recorded 2 dependencies, now seeing -1          S.?.....    /usr/bin/getconf     prelink: /tmp/#prelink#.QIPLxn: Recorded 2 dependencies, now seeing -1          S.?.....    /usr/bin/getent      Are the prelink warnings anything to worry about? Secondly, the question mark in the MD5 sum column means that the value could not be calculated. Any theories as to why? I can do `md5sum filename` without any problem.


title: bash function to find a directory recursively

text: How can I write a bash-function that finds a specific parent directory. Here's my setup:               /home/user/dev/project1/branch1/deeply/nested/module/structure      The app-server used for devs is located at:               /home/user/dev/project1/branch1/apps/someappserver      I'd like to have a bash function that goes up recursively to the branch's root to quickly copy compiled modules to the appserver, run/stop the appserver, call specific maven goals etc. Any ideas? Each branch has a maven pom.xml which contains exact information about the version


title: some shared libs in /usr/local/lib aren't found but they are in /usr/lib

text: I can successfully run an executable using a symlink'd shared library in /usr/lib like so - `sudo ln -s /lib/i386-linux-gnu/libcrypto.so.0.9.8 /usr/lib/libcrypto.so.4` In the interest of making this easier to maintain I'd like to move this to /usr/local/lib - `sudo ln -s /lib/i386-linux-gnu/libcrypto.so.0.9.8 /usr/local/lib/libcrypto.so.4` But my system seems to ignore this specific sym link. /usr/local/lib is in relevant ld.so.conf settings and indeed is included in the output of `ldconfig -v`.               /usr/local/lib:             libcrypto.so.0.9.8 -> libcrypto.so.4      My only clue so far is that ldconfig creates an additional sym link back to the actual file name...               /usr/local/lib $ ls -l *so*     lrwxrwxrwx 1 root root 14 Aug 26 22:53 libcrypto.so.0.9.8 -> libcrypto.so.4     lrwxrwxrwx 1 root root 38 Aug 26 22:36 libcrypto.so.4 -> /lib/i386-linux-gnu/libcrypto.so.0.9.8     lrwxrwxrwx 1 root root 49 Aug 26 22:36 libiniparser.so.0 -> /usr/lib/x86_64-linux-gnu/samba/libiniparser.so.0      In the output above, for example, the lib and link to libiniparser.so.0 works perfectly fine whether included in /usr/lib or /usr/local/lib. The simplest explanation would be that ldconfig specifically avoids entries that switch the file name of the library, but that theory doesn't explain why this works from /usr/lib. Any insight would be appreciated, thanks.


title: How to enable an federated storage engine in the Debian MySQL package?

text: How would I enable an extra (in this case `FEDERATED`) storage engine in the `mysql-server-5.1` package from Debian? I've installed `mysql-server-5.1` via apt-get. But the `SHOW ENGINES` shows that federated is not enabled.               mysql> show engines;     +------------+---------+----------------------------------------------------------------+--------------+------+------------+     | Engine     | Support | Comment                                                        | Transactions | XA   | Savepoints |     +------------+---------+----------------------------------------------------------------+--------------+------+------------+     | InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        |     | MRG_MYISAM | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         |     | BLACKHOLE  | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |     | CSV        | YES     | CSV storage engine                                             | NO           | NO   | NO         |     | MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |     | FEDERATED  | NO      | Federated MySQL storage engine                                 | NULL         | NULL | NULL       |     | ARCHIVE    | YES     | Archive storage engine                                         | NO           | NO   | NO         |     | MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance         | NO           | NO   | NO         |     +------------+---------+----------------------------------------------------------------+--------------+------+------------+     8 rows in set (0.00 sec)


title: Cobbler+Kickstart $basearch problems

text: I'm using CentOS 6.5 with Cobbler 2.4 (from EPEL). I'm trying to use a heredoc comment to create a repo file (which works) without the `$basearch` being interpreted. What happens is the file is created except `$basearch` is replaced with nothing (e.g. it's removed). What I have:               %post     #raw     cat > /etc/yum.repos.d/blah.repo <<REPO     [repo]     name=repo     baseurl=http://repo.local/repo/$basearch     enabled=1     priority=99     gpgcheck=0     REPO     #end raw     %end      What actually gets put in `/etc/yum.repos.d/blah.repo` (`$basearch` is missing):               [repo]     name=repo     baseurl=http://repo.local/repo/     enabled=1     priority=99     gpgcheck=0      Things I have have verified:   * I know it's not Cobbler or Cheetah because `cobbler validateks` and `cobbler profile getks ...` reports back to me the kickstart script unmodified (when using `#raw` and `#end raw`.   * I created a sample of the template within Cheetah and it properly showed the un-escaped string. I was doing some further research and found this, from the first bullet it looks like `$basearch` is a special variable within kickstart. Are there any suggestions on how to get around this without using `curl` to get the file or explicitly defining the architecture? I want to keep this within the kickstart file for simplicity sake.