What is the difference between `/sbin/ip route` and `/sbin/route`?

Linux comes with two utilities   * `/sbin/route`   * `/sbin/ip route` What is the difference between the two and what is the rule of thumb to use when you decide which one of the two you should use? I know they're both documented in two separate locations,   * `man 8 route`   * `man 8 ip-route`


What is the architecture of Mac OS X's windowing system?

I am familiar with how the X11 system works, where clients connect via a socket to the server process and send operations to the window server to perform certain operations on their behalf. But I do not understand (and I could not find good documents) describing how a GUI application interacts with the window system on Mac OS X. Some of the questions that I have include:   * How does an app receive events from the windowing system?   * Does the app need to register with the kernel, or some windowing system server?   * How does the windowing system request that an app update its display?   * How does an app trigger a re-display operation?   * Is there a socket-based protocol, or some other RPC system to the windowing system?   * Does the windowing system, or the application, have direct hardware access?    * What are the operations available between client apps and the windowing system?


Unix sed command to find multiple string patterns

Scenario here is I need to replace `"$$file_name="` value.. I have some 150 file names in a file as mentioned below.. Eg: $$file_name=abc.bbb.ccc to_be ---> $$file_name=abc.bbb.cccV1 AS_IS :               $$a=abc.txt     $$file_name=abc.ddd.aaa     $$directory=/uasdua/asdsas          $$a=c.txt     $$file_name=ac.dd.ac     $$directory=/uasdua/asdsas          $$a=b.txt     $$file_name=ee.d.a     $$directory=/uasdua/asdsas     .     .     .     .     .     .     $$a=b.txt     $$directory=/uasdua/asdsas     $$file_name=e.d.a      to_be:               $$a=abc.txt     $$file_name=abc.ddd.aaaV1     $$directory=/uasdua/asdsas          $$a=c.txt     $$file_name=ac.dd.acV1     $$directory=/uasdua/asdsas          $$a=b.txt     $$file_name=ee.d.aV1     $$directory=/uasdua/asdsas     .     .     .     .     .     .     $$a=b.txt     $$directory=/uasdua/asdsas     $$file_name=e.d.aV1      This is what i've tried               select NAME from xxx where DATE='07/12/1999' > Name_file          #version will be same for that day     FILE_VERSION=`db2 -x "select version from xxx where DATE='07/12/1999'"` > version_name     FILE_VER=`cat version_name | head -1`          while read filename      do         FILE_NAME1=`echo ${filename}${FILE_VER}`         sed -f pattern.txt input > output     done < file_name11      * * * pattern.txt               echo "$filename"     echo "$FILE_NAME1"     s/${filename}/${FILE_NAME1}/g ---> If I hardcode this one its not working..the value is not replaced..     s/ee.d.a/ee.d.aV1/g --> this is working      Do i need to explictly pass it..I have 150 such file names in a file ? * * *


PHPStorm Only runs on Gnome or KDE

Does anyone know why it is so? I was using unity... then i switched to LXDE and it wont run. I checked the requirements and it turned out that it requires either GNOME or KDE. So what exactly is it that the 2 DEs offer that LXDE and the others dont? what makes it compatible with gnome and kde but not with the others?


Why beep does not work in Ubuntu?

I've tried the below shell, but nothing happened.               #! /bin/sh           beep -f 500 -l 700      beep -f 480 -l 400      beep -f 470 -l 250      beep -f 530 -l 300 -D 100      beep -f 500 -l 300 -D 100      beep -f 500 -l 300      beep -f 400 -l 600      beep -f 300 -l 500      beep -f 350 -l 700      beep -f 250  -l 600       I issued the following command in terminal, but again nothing happened:               beep      What am I doing wrong? Is there something here that I'm missing? tnx. **EDIT:** Out put of `sudo modprobe pcspkr -vvv`:               libkmod: DEBUG ../libkmod/libkmod-module.c:519 kmod_module_new_from_lookup: input alias=pcspkr, normalized=pcspkr     libkmod: DEBUG ../libkmod/libkmod-module.c:525 kmod_module_new_from_lookup: lookup modules.dep pcspkr     libkmod: DEBUG ../libkmod/libkmod.c:542 kmod_search_moddep: use mmaped index 'modules.dep' modname=pcspkr     libkmod: DEBUG ../libkmod/libkmod.c:390 kmod_pool_get_module: get module name='pcspkr' found=(nil)     libkmod: DEBUG ../libkmod/libkmod.c:398 kmod_pool_add_module: add 0xb8adf2b8 key='pcspkr'     libkmod: DEBUG ../libkmod/libkmod-module.c:184 kmod_module_parse_depline: 0 dependencies for pcspkr     libkmod: DEBUG ../libkmod/libkmod-module.c:546 kmod_module_new_from_lookup: lookup pcspkr=0, list=0xb8adf340     libkmod: DEBUG ../libkmod/libkmod-module.c:435 kmod_module_unref: kmod_module 0xb8adf2b8 released     libkmod: DEBUG ../libkmod/libkmod.c:406 kmod_pool_del_module: del 0xb8adf2b8 key='pcspkr'     libkmod: INFO ../libkmod/libkmod.c:319 kmod_unref: context 0xb8adf140 released


Returning only the portion of a line after a matching pattern (Unix)

I have a parent folder (abeps) which contains several sub folders (1,2,3....25) where output file is located, one in which - all are the same name (opt.out). In this files there is an unpredictable output. This is an example of a line that I need to filter: > A\HF=-1378.9118397\RMSD=4.560e-09\RMSF=1.758e-05\Dipole=0.2110167,0.39 or > 978,3.8529967641,3.6669041122\Version=ES64L-G09RevD.01\State=1-A\HF=- so the thing is I'm interested in getting everything in between \HF= and till \ But they could be on different lines and even HF could be on different lines. So grep wont catch it. Then I tried to write result in a file               grep 'HF=-' abeps/*/opt.out > data      and as result get this > abeps/10/opt.out: 1-A\HF=-1378.9114895\RMSD=5.126e-09\RMSF=5.036 > > abeps/12/opt.out: \State=1-A\HF=-1378.9185518\RMSD=2.940e-09\RMSF > > abeps/13/opt.out: 33413\Version=ES64L-G09RevD.01\State=1-A\HF=-137


XBMC crash after selecting "play". Ubuntu 14.04 and 13.0 gotham. Link to crashlog

I have a brand new machine with fresh install of Ubuntu 14.04 and I'm trying to run Gotham 13.0 on it. I've already added the restricted multimedia codecs (just in case) to Ubuntu.                sudo apt-get install ubuntu-restricted-extras      As well as Unrestricted LibavCodec               sudo apt-get install libavcodec-extra      My graphics is AMD/ATI Tahiti (Radeon HD 7970) with a core i7. Here's the XBMC crashlog: http://xbmclogs.com/show.php?id=209365 Here's what's happening: I just download the appropriate PPA's etc. through the XBMC wiki.               sudo add-apt-repository ppa:team-xbmc          sudo apt-get update          sudo apt-get install xbmc      The first time I installed it on this machine, I went through installed Fusion and ran the Hub wizard Template/Setup. Everythings seems good, but when I select Al Jazeera, for example, I click "watch live", and then I get the "working" scroll in the bottom right for few seconds, and then the entire program force closes. The same happens with " The Daily Show" "Youtube" "UsTv Now" etc. I completly uninstalled XBMC               sudo apt-get purge xbmc xbmc-standalone      and started over. This time only installing one add on and trying it out. Still I get the same results. The music add-ons work though. I have this posted a few days on XBMC forums, and no replies yet. I'm not sure if this is an Ubuntu or XBMC issue ,at this point. ![enter image description here](http://i.stack.imgur.com/7y0qj.png)


hydra verification before stopping

I am getting false positives when I try a penetration test on my local service with `hydra`:               hydra -l admin -x 1:8:1 -t 1 -f -vV 127.0.0.1 http-form-post '/login.php:username=^USER^&password=^PASS^:Bad password'       I guess due to the fast rate of requests sometimes my server doesn't deliver the whole page and the part with "Bad password" is missing, so hydra thinks the password worked. Is there a way to tell hydra to verify the password and try it several times with success before stopping the whole pentest? * * * A solution I could imagine: you could write a loop somehow, that stores away the hydra.restore file often, and then if a solution is found try again with that solution and if it doesn't work start over at the point in the wordlist where you stopped - unfortunately the restore file is gone as soon as a solution seems to be found


Linux ssh launching GUI application and leaving it running?

I have `ssh` access to my own server with Ubuntu 13.10 on it installed. Via `ssh` I can launch GUI applications using this approach:               $ ssh -X my_login@address_of_sever      After that I can start any application by name, e.g. `gedit`, `firefox`, `google-chrome`, and it will be opened on my client machine (just the window, actually application works on the remote machine - i.e. on server). This is all fine. But when I close the GUI application on the client machine it gets closed on the server too (it seems to be legit). I can launch console applications using commands such as:               $ nohup php somefile.php &        and it will continue working after closing the connection. I wonder, is it possible to do the same with GUI application? Ideally it would be if it were possible to move opened window to server and take it back to client when it's necessary to see what is happening there, some kind of switching perhaps?


How to use awk through multiple files?

I want a solution for the general case (N folder) I'm using awk to process a file and extract its content and put it in a variable then echo it: This is the file:               H1 H2 H3 H4 H5 H6 H7 H8 H9     not important     not     not      This is the code:               $value1=awk '/H1/ { print $1}' file     $value2=awk '/H1/ { print $2}' file     $value3=awk '/H1/ { print $3}' file     echo $value1     echo $value2     echo $value3      I get the result:               H1     H2     H3      My question if I have multiple files with the same format (not the exact content, the same format) with the file and which is located in different folders but the same name:               /folder1     file     /folder2     file     /folder3     file      How can I echo the first 3 values of the H1 line but from each file in those folders so I get 9 results?


Automatically detect when a file has reached a size limit

I would like to send an email when a file reach a certain size limit. The only way I thought of doing this is by doing a cronjob which will check the file size and send the email if the file is bigger than the desired size. However, it seems like a bad solution for me to add a cronjob which would check ,for example every 15-30 min, the size of a file? I was wondering if there is a better way of doing this to automatically detect when the file is appended some text (event?) so I could then check the size and do the desired treatment.


Mint 17 boots to Welcome screen, but desktop is blank

I'm running Mint 17 Qiana MATE on a HP250 G laptop with 4GB of RAM and Intel on-board graphics. The host OS is Mint and Windows XP runs as guest using VirtualBox with 1GB RAM and 20GB reserved hard drive space. After working normally for a few days, the final boot process suddenly failed as follows: The laptop boots normally to the login screen, after logging in the Welcome window appears normally but with a blank (grey) desktop behind it. I can start Firefox or HexChat from the Welcome screen and both of these display normally, but I can't see a way to open Terminal. Where should I go from here? Should I boot from the LiveCD and try to fix it from there? I'm not sure what I did last to cause the problem, perhaps a file became corrupted? I don't have any backups as I was still getting started with my new laptop when this happened. Further information: I started Terminal using CTL+ALT+F1 at the login screen. Looking at bash_history shows that I probably killed the desktop with the following commands: sudo apt-get install openbox openbox --reconfigure Typing startx only gets me the blank desktop with the Welcome window again. Is this problem reversable?


Can the /home folder in Linux contain anything else but user folders?

Can the /home folder contain anything else but user folders? I have a folder I want to share between Windows and Arch - can it go in the home folder under a name not belonging to any existing user? E.g.               /home       |-/james (my home folder)       |-/shared (folder I want to share)


Installing and setting the default desktop environment in Debian

I recently installed Debian wheezy in my laptop using Debian netinst iso image. I would like to install latest gnome desktop environment but mistakenly downloaded the net installation iso and I also installed it in my system. So, is there any way to install and **automatically load gnome** without logging in and typing in the command `startx` each time to start the gnome environment? Or, is it better to download and install a live iso?


Fedora 15: em1 recently dissapeared and hostapd no longer serves internet to wirelessly connected devices

I have a laptop running hostapd, phpd, and mysql. This laptop uses an Ethernet connection to connect to the internet and acts as a wireless access point for my workplace's wifi devices. After installing some software and reconnecting my Ethernet elsewhere, my "em1" device is no longer present and wirelessly connected devices can no longer reach the internet. The software I recently installed is: pptp, pptpd, and updated some fedora libraries. I have also recently moved my desk and laptop to another location and thus had to reconnect the Ethernet elsewhere. Wifi devices no longer have access to the internet. Wirelessly connected devices are able to successfully log into the laptop, showing full strength, correct SSID, and uses the proper password. However, when I tried to connect to a site like google, the request times out. The device "em1" also no longer appears on my machine. Running: `# ifup em1` will give me the following output: `ERROR : [/etc/sysconfig/network- scripts/ifup-eth] Device em1 does not seem to be present, delaying initialization.` And running: `# dhclient em1` has the following output: `Cannot find device "em1"` When I run `# dmesg|grep renamed`, I get the following: `renamed network interface eth0 to p4p1`. I've tried to connect to the internet through p4p1 and was successful. However, my wireless devices connected to my laptop are no longer able to connect to the internet. I have uninstalled pptp and pptpd using `# yum erase ...` but the problem still persists. To install pptp I used: `# yum install pptp` To install pptpd I did the following:               # rpm -Uvh http://poptop.sourceforge.net/yum/stable/fc15/pptp-release-current.noarch.rpm     # yum install pptpd      To update my fedora libraries I used:               # yum check-update     # yum update      EDIT: Running `# route` produces the following results:               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     default         10.11.200.1     0.0.0.0         UG    0      0        0 p4p1     10.11.200.0     *               255.255.252.0   U     0      0        0 p4p1     172.16.100.0    *               255.255.255.0   U     0      0        0 wlan0


Linux reboot out of memory

I have a server with Intel(R) Atom(TM) CPU D525 and 1 GB memory. I noticed the server would shut down and restart automatically about every 7 days. I checked the memory usage and found that when the memory usage reached 90%, the kernel reboots. When I checked the kernel log in `/var/log/messages` file, I didn't find anything about the kernel shutting down, just a message about the kernel start. I checked the file `/proc/sys/vm/min_free_kbytes`, the value is "3765". * * * I guess when the available memory is very low, but doesn't get to the number the system starts reclaiming memory. Then the kernel can't do anything, so it then reboots. Can you give me some insight?


Can rpm handle an install of another OS into another Logical Volume?

I am trying to install fedora as a `domU` under a CentOS `dom0` using the method outlined in The Book of Xen. I have asked another question regarding a consistent error message of cpio: Bad magic when I try to run the rpm command on a fedora-release-15.1 rpm. That tutorial actually goes through an install of CentOS 5.2 into the logical volume. If I run `wget` on a similar CentOS install `rpm` then run the `rpm -i` command (as outlined) it works fine. So what is it about rpm and fedora under CentOS 5.6 that would cause an issue? running the `\--test` option returns the following:               [root@localhost fedRoot]# rpm -ivh --test --root /mnt/fedRoot fedora-release-15-1.noarch.rpm      warning: fedora-release-15-1.noarch.rpm: Header V3 RSA/SHA256 signature: NOKEY, key ID 069c8460     error: Failed dependencies:             fedora-release-rawhide = 15-1 is needed by fedora-release-15-1.noarch             rpmlib(FileDigests) <= 4.6.0-1 is needed by fedora-release-15-1.noarch             rpmlib(PayloadIsXz) <= 5.2-1 is needed by fedora-release-15-1.noarch      What do these failed dependencies mean? Is it even possible to do what I am trying to do (install fedora on a separate LV in an active CentOS system)? Is it possible to update these dependencies in my system? or is it time to call it quits on this particular path...


Is there an easy way to update information in known_hosts when you know that a hosts key has changed?

If a host's operating system has been re-installed and had its public key regenerated sshing to it will of course fail because the new key doesn't match the old one. Is there an easier way to tell ssh that you know that the host's key has changed and that you want it to be updated. I think it feels a bit error-prone to use a text editor or something like sed to remove the offending line.


Distributed package repository for Linux?

Many times I have seen the note telling users not to update their repositories too often (i.e more than once a day) because that will put a stress too large for the servers. Also I understand that it takes monstrous machines for such repositories. I am wondering if there is something like BitTorrent for package management? Or if there isn't, is it feasible to have such a system? (I'm thinking about a system where each user keeps the packages that they have and serve it in the same fashion as BitTorrent.)


What exactly do we mean when we say we are using Linux?

I was going through an article on GNU which goes something like below > There really is a Linux, and these people are using it, but it is just a > part of the system they use. Linux is the kernel: the program in the system > that allocates the machine's resources to the other programs that you run. > The kernel is an essential part of an operating system, but useless by > itself; it can only function in the context of a complete operating system. > Linux is normally used in combination with the GNU operating system: the > whole system is basically GNU with Linux added, or GNU/Linux. All the so- > called “Linux” distributions are really distributions of GNU/Linux. I always thought Linux as a kernel and Operating System but it looks like Linux = Linux kernel and GNU OS. Could someone point out the exact functionality of each in the "Linux" terminology we use in our day to day life. Also, according to the wiki, GNU's design is Unix-like but differs from Unix by being free software and containing no Unix code. I thought Unix is opensource. Isn't it?


gksudo not caching credentials

I've built a shell script for mounting ISO images in Nautilus, and it worked fine in earlier versions of Ubuntu. One of the many problems encountered in 11.04 is that `gksudo` doesn't seem to cache the credentials - There are three commands in the script which need to be run as root, but now for every command I get prompted for a password. Sudo privileges are cached when using plain `sudo`, so why not with `gksudo`?


xorg memory leaks

On my desktop Xorg leaks a lot of memory. I use to let this machine on for days (weeks, months ...), but about once a week I'm forced to restart xorg, because it is taking too much memory. Am I the only one affected by this issue? Why does this is happen?   Is it xorg to be _bugged_ , or is it something else (maybe some xorg modules)?   Can I do anything to avoid it? * * * Some more infos: I'm on ArchLinux, kernel 2.6.36, nvidia drivers 260.19.36, gnome 2.32.1. Anyway I've got this issue from a lot of time, like more than one year. * * * Here is how the Xorg process is shown by top after about 9 days of uptime...                PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND     1591 root      20   0  278m 229m 9364 S    2 11.8 244:38.73 Xorg      I've got only a few open windows. 229MB of resident memory looks like a lot to me (and it will keep growing with time). As soon as I reboot Xorg I'll also add process stats at the beginning of its life. * * * Here is as soon as my Gnome desktop gets up:                PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND      1573 root      20   0 89508  43m  11m S    1  2.2   0:03.53 Xorg


How can I update existing .crt file with new encrypted rsa .key file?

Suppose I have 2 files: an RSA key file `client.key` and a certification file `client.crt`. I have created them without pass-phrase and now I have encrypted `client.key` file with pass-phrase by command:               openssl rsa -des3 -in client.key -out client-enc.key      Now I want to re-create/update `client.crt` file with client-enc.key. How can I do that?


Installing Redmine on openSUSE

I installed `redmine-1.1.3-1.1` on a openSUSE 12.1 using the repositories http://download.opensuse.org/repositories/devel:/tools:/scm/openSUSE_12.1 . Anyway, after the installation: I edited the `database.yml` file to add the mysql location on other server. This way:               production:       adapter: mysql       database: redmine       host: <mysql-host>       username: redmine       password: <redmine.passwd.on.mysql>       encoding: utf8      then I started the redmine (rcredmine start)                # rcredmine start     redirecting to systemctl      an looks like it's working.                # rcredmine status     redirecting to systemctl     redmine.service - LSB: Redmine Web Server               Loaded: loaded (/etc/init.d/redmine)               Active: active (exited) since Mon, 05 Mar 2012 15:32:27 -0200; 9s ago              Process: 4601 ExecStop=/etc/init.d/redmine stop (code=exited, status=0/SUCCESS)              Process: 4683 ExecStart=/etc/init.d/redmine start (code=exited, status=0/SUCCESS)               CGroup: name=systemd:/system/redmine.service      when I watch the logs don't show me anything strange.                # tail -f /var/log/messages     Mar  5 15:32:27 redmine redmine[4683]: Starting Redmine daemon..done      There's no port at all               ~ # netstat -nat | grep 3000     ~ #       What I am missing?


How do I allow non-root access to Nexus 7 2013 LTE (deb) over adb and fastboot?

I need to access my Nexus 7 2013 LTE (deb) over `adb` and `fastboot`, but it seems that it's required to be `root` to be able to run the `adb` server to be able to access the device due to USB rules. How can I configure udev to allow access to this device as a non-root user for `adb` and `fastboot`?


Test for link with trailing slash?

I created in `/tmp/test/`               mkdir somedir     ln -s somedir/ somelink      I want to loop through only directories:               for file in */ ; do        if [[ -d "$file" && ! -L "$file" ]]; then         echo "$file is a directory";       fi;     done      but why does this show `somelink is a directory`? while without the slash it doesent?               for file in * ; do      ...      And is there a difference in zsh?


Rotating iptables logs, strange message about script being converted to upstart job

I use a script `/etc/logrotate.d/iptables` containing entries like:               /var/log/in_iptables.log     {             rotate 4             weekly             missingok             notifempty             compress             delaycompress             sharedscripts             postrotate                     invoke-rc.d rsyslog rotate > /dev/null             endscript     }      to keep my iptables logs rotated. It seems to have been doing its job, but today I got a message from `anacron`:               /etc/cron.daily/logrotate:     The script you are attempting to invoke has been converted to an Upstart     job, but rotate is not supported for Upstart jobs.     invoke-rc.d: initscript rsyslog, action "rotate" failed.     error: error running shared postrotate script for '/var/log/in_iptables.log     run-parts: /etc/cron.daily/logrotate exited with return code 1      Can anyone explain to me what this means exactly? Do I need to be worried or change anything in order for my logs to keep rotating?


How to turn my linux laptop into wireless repeater?

**I need to use my laptop to extend the range of my wireless router.** I have a Samsung laptop with FEdora19 installed (but those should be irrelevant for a good answer). My wireless card supports master mode (`iw list` listing includes `AP` mode). The card is:               01:00.0 Network controller: Qualcomm Atheros AR9485 Wireless Network Adapter (rev 01)      I am trying to follow this resource link, but am getting errors, and my knowledge is too limited to get me through the errors.               [sci@localhost ~]$ su -c "iwconfig wlp1s0 mode master"     Password:      Error for wireless request "Set Mode" (8B06) :         SET failed on device wlp1s0 ; Invalid argument.      Following the Atheros specific advice at the middle of the page:               modprobe: FATAL: Module ath_pci not found.      I am very surprised that the procedure is not trivial, and that a dedicated application doesn't exist. How should I approach this? Further reading is in order, if it is focused on the problem at hand!


using find, exec, sed to manipulate strings as args to another program

I can use find like this   `find -type f -path "./src*" -name "*.php"`   to find a list of files. For example ./src/Superuseradmin/Model/Mapper/UUID.php What I need to do is manipulate each string in the list like this:   file from find command: ./src/Superuseradmin/Model/Mapper/Mapper/UUID.php   manipulate into class: Superuseradmin\Model\Mapper\UUID   manipulate into test file: ./test/Superuseradmin/Model/Mapper/UUIDTest.php So that I can run this command for each one.   ` phpunit-skelgen.phar --test -- Superuseradmin\Model\Mapper\MyMapper ./src/Superuseradmin/Model/Mapper/MyMapper.php ./test/Superuseradmin/Model/Mapper/MyMapperTest.php ` Would really appreciate the help.


script started in .xinitrc stays in processes

I have made a little startup bash-script to run before my wm starts. Unfortunately after X and WM is started this script is still listed in the in `htop` and I don't have a clue why... this is the startup-script               #!/bin/bash          #Bind Multimedia Keys with xbindkeys     xbindkeys          #Turn X-Screensaver off     xset -dpms; xset s off          #Set Cursor to Arrow-Shape     xsetroot -cursor_name left_ptr          # Start Compton for compositing     compton --config ~/.config/compton.conf -b          # Set Wallpaper     feh --bg-fill ~/pictures/makoto-shinkai_00412767.jpg          # Start Dropbox     [ -e /usr/bin/dropboxd ] && /usr/bin/dropboxd &          # Start Emacs-Daemon     #/usr/bin/emacs --daemon          exit       and this is my .xinitrc               #!/bin/sh     #     # ~/.xinitrc     #     # Executed by startx (run your window manager from here)          if [ -d /etc/X11/xinit/xinitrc.d ]; then       for f in /etc/X11/xinit/xinitrc.d/*; do         [ -x "$f" ] && . "$f"       done       unset f     fi          $HOME/bin/xstartup          # i3 is kept as default     session=${1:-i3}          case $session in         bspwm             ) exec bspwm;;         i3|i3wm           ) exec i3;;         hlwm              ) exec herbstluftwm;;         # No known session, try to run it as command         *) exec $1;;     esac


Display ONLY IP addresses of currently logged users

I want to get a list of the currently logged users and their respective IP addresses.   I tried the following command line:               w -s      However, the TTY, IDLE and WHAT columns are also displayed. I don't want those columns to be displayed as I plan to use only the needed information as an input to a script. Is there any way to filter those columns out? Any way of getting a list with just the users and their IPs?


installing centOS as second OS on laptop

I am going to install CentOS 5.6 by bootable dvd and I arrive at the Installation Method stage that forces me to choose one item to identify CentOS packages. My CentOS iso file exists on my hard drive and I dont know which one to choose?


Show "last login" information when "su"

I'm trying to configure the PAM modules working with `su` command. I want to `su` shows the "last login" information, as `ssh` or `login` do. I find, on `/etc/pam.d/login` a PAM module called `pam_lastlog` that does exactly what I want. I simply copy the line from `login` to `su` configuration file, but when I run `su` I didn't get the expected behavior. This is the content of my `/etc/pam.d/su`:               #%PAM-1.0     auth     sufficient     pam_rootok.so     auth     include        common-auth     account  sufficient     pam_rootok.so     account  include        common-account     password include        common-password     session  include        common-session     session  optional   pam_lastlog.so  nowtmp     session  optional       pam_xauth.so      This is the default GNU/Linux distribution's file, only adding the `session optional pam_lastlog.so nowtmp` line commented above. Why is this not working?


CentOS 5.8 with gcc 4.4.7 links against libstdc++ 6.0.8. How is it possible?

According to the gcc ABI policy, gcc 4.4.7 should depend on libstdc++ 6.0.13. As far as I understood, the compiler version and the libstdc++ version are deeply interrelated and can't be swapped, so it came to me as a surprise to discover the following facts:   * CentOS 5.8 somehow manages to have a gcc44 package that links against 6.0.8, apparently coming with the default system (which is based on gcc-4.1.2)   * that the libstdc++.so in the compiler directory (/usr/lib/gcc/x86_64-redhat-linux6E/4.4.7, where I expected to find a libstdc++-6.0.13) is not a link to a shared object of any sort, but a text file containing `INPUT ( -lstdc++_nonshared /usr/lib64/libstdc++.so.6 )` What kind of magic is going on here? Specifically:   * How could they provide a gcc 4.4.7 that links against an older version of libstdc++? I thought it was not possible.   * what is this stdc++_nonshared library?   * I didn't know a .so file could contain that text. Who parses it (dynamic linker I guess) and what are its specifications and consequences?   * How far can this magic go? Can I use gcc4.7 with libstdc++ 6.0.3? What is the spectrum of compatibility


Where can you host a custom Linux Distribution?

I've recently been creating a custom Linux distribution based on Gentoo that includes a custom installer, artwork, development tools, and desktop environment. I have an ISO image and a local mirror for packages, however I am currently running a mirror privately on a home network with a residential Internet connection. I was wondering what the next step is to make my distribution public? Where can I host my distribution ISO files, as well as my source code and update files?


Lightweight Debian based distro?

Can anyone recommend an lightweight debian based distribution working on an PC with 800 MHZ CPU and 64 MB RAM? Also, would some old games like Worms Armageddon or Diablo 2 work on the lightweight distro with wine? (these two games, for example, work fine on the computer, running windows) Are the minimum requirements different for games running over wine, than the ones for windows.


How can I hook on to one terminal's output from another terminal?

I need to hook onto output of currently running terminal (tty1) from virtual terminal and capture it (running X server). I'm pretty sure such a thing is possible by simpler means than debugging (result of my Google searches). Can anyone help?


Pre-specifying a default GNU Stow target-directory

**TLDR:** Can I pre-define a stow folder other than `/usr/local` with GNU Stow? I do not have admin privileges on the machine I use for work, and I was told that I could use GNU Stow to manage my installations. The tool looks great, but everywhere in the documentation I read that stow uses `/usr/local` as the installation directory where it builds the symlink farm. Unfortunately this folder was already populated by `root`, and I do not have write privileges on anything under `/usr/local`. There is a flag `-t` that I can use in the command line to specify the target directory, but since I will always be using the same (I want my installations to consistently be under the same target directory), I was wondering if there is a way to use a default path of my choice.


Difference between eval and alias commands

what are the differences between `eval` and `alias` commands? Examples:               x=‘ls -d -l $HOME’     $x     eval $x          alias y=‘ls -l -d $HOME’     y


from a laptop with CentOS 6.3 what is the command line to talk mysql server on my pc?

I have CentOS 6.3 running on my laptop which is already connected to the net. What is the command line to talk to MySQL server on my PC? Both devices are connected via my router and they can talk to each other.


How to list existing alias for a certain linux user?

Does anyone know how do I list existing alias for a certain Unix/Linux user on Debian? For example I have an Unix/Linux user 1001 and want to know which alias for login it has?


how to concatenate strings in bash?

I need to concatenate 2 strings in bash, so that:               string1=hello     string2=world          mystring=string1+string2      `echo mystring` should produce > helloworld


How to get list of urls from a URL recursively with filtering

I want to get list of URLs that contains `vimeo.com` from a web site recursively by a command , so that I can pipe it to vimeo_downloader.sh. I prefer to use `wget`, but also I'm happy with other options. ### Example `index.html`               01     02     03     04     05     06      `01.html`               ...     ... src="//player.vimeo.com/video/xxxxxxxxxx?api=1" ...     ...      Likewise `02.html` to `06.html` have a vimeo's URL. How to get all vimeo URLs from `01~06.html`?


Is it possible to inject newlines in the ouput of cowsay/cowthink while preserving the "bubble"?

I keep a printed version of the `Bash` manual handy so I'm curious about any changes made to it - especially since I don't always pay attention to the packages I update. Usually locally you have the version of the manual related to the version of the software you have, and you can track changes easily. I built this to check some sources and have a summary:               #!/usr/bin/env bash     ## bashmancheck - Check different sources for date of the last updates          header="BASH manual -- Local BASH manual -- BASH repo /doc -- BASH Reference man(www)"     data="$(links -dump 'http://git.savannah.gnu.org/cgit/bash.git/tree/doc/bash.1' | grep -om 1 'Last Change.*' | cut -d ' ' -f 4,6,9) -- $(zcat /usr/share/man/man1/bash.1.gz | grep -om 1 'Last Change.*' | cut -d ' ' -f 4,6,9) -- $(links -dump 'http://git.savannah.gnu.org/cgit/bash.git/log/doc' | grep -Eom 1 '[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}') -- $(links -dump 'http://www.gnu.org/software/bash/manual' | grep -om 1 'last updated.*' | cut -d ' ' -f 3-)"          cowthink -W80 -f bud-frogs --  $header $data      It uses `links` and `zcat` to look at a specific string in the manpages source online and locally, as well as in the /doc section of the Bash repository and finally in the online reference manual. And the output looks like this:               ( BASH manual -- Local BASH manual -- BASH repo /doc -- BASH Reference man(www) )     ( Feb 2 2014 -- Feb 2 2014 -- 2014-02-26 -- August 22, 2012                     )      -------------------------------------------------------------------------------           o           o               oO)-.                       .-(Oo              /__  _\                     /_  __\              \  \(  |     ()~()         |  )/  /               \__|\ |    (-___-)        | /|__/               '  '--'    ==`-'==        '--'  '      Yet I wish I had pairs of item and date each on a line, like so:               BASH manual: Feb 2 2014     Local BASH manual: Feb 2 2014     BASH repo /doc: 2014-02-26     BASH Reference man(www): August 22, 2012      But for that I would need to change line after I concatenate the item and its date - and I can't make happen it with `cowsay/cowthink`. And this explains why I have designed the script like it is. The two variables are just there to help me out with formatting but have no bearing on it at execution. It just so happens that the header and data variables are less than 80 columns wide each and the command ouput is set to 80 columns for that purpose. I also used `cut` to shorten the dates for them to display on one line instead of just using `grep -o` like I was initially doing. I arbitrarily used some characters(double dashes) for formatting - which is just crude. Can you use newlines with something like cowsay? Is there a (better) way to do this?


Send a command with password in upstart script

CentOS 6.5 The server is an AWS AMI, specifically this one I'm trying to use upstart to start a process on boot On this particular box, the `root` login is disabled, and every time I need to run something with `sudo` it asks for my password So simply putting my command in the script won't work. I tried to follow this answer, with no success I've got this rio.conf file in the /ect/init directory:               start on runlevel [2345]     stop on runlevel [!2345]          exec echo Password! | sudo -s /usr/bin/riofs --fuse-options="allow_other" --fmode=0777 --dmode=0777 xx.xxxxxx /mnt/applications/recorder/streams/_definst_/s3      And whenever I run this, nothing seems to happen. `Password!` is just an example password. ## EDIT: If I type `exec /usr/bin/riofs` my SSH window will close, and then when I go back in, I can see that it's working. I don't know what that means, or how to automate that.


copying specific files in directory

I am trying to copy some of the files in a directory. The directory contains following files my current directory is ~/certificate/               drwxrwxr-x 2 ubuntu ubuntu     4096 Oct 16 11:58 apache     -rw-rw-r-- 1 ubuntu ubuntu     5812 Oct 16 11:20 apache.keystore     -rw-rw-r-- 1 ubuntu ubuntu     1079 Oct 16 08:31 csr.txt     -rwxr-xr-x 1 ubuntu ubuntu 36626564 Oct 16 10:08 my.war     drwxrwxr-x 2 ubuntu ubuntu     4096 Oct 16 09:39 tomcat     -rw-rw-r-- 1 ubuntu ubuntu     6164 Oct 16 09:31 tomcat.keystore      I want to copy all files to ~/certs/ except my.war. I have tried following command without success. I do not want to move my.war out of the folder even temporarily.               cp -r ~/certificate/(?!m)* ~/cert/.       Please help me with suitable regular expression or any other tool.


What is the optimum swap size on Linux for a heavily threaded program?

I using an Amazon EC2 server small instance and by default it allows 382 threads per process. However, I wish to run 10,000 threads in a single process. Recently, I learned that this can be done by either reducing the stack limit or increasing virtual memory. To the best of my knowledge, virtual memory can be increased by increasing RAM or swap space in Linux. Increasing RAM is not an option. I know how to increase swap space, but I am not sure what the optimum size I should go for is. What I am not clear on is, how do swap space and RAM work when I run threads? Is there some specific limit after which swap memory makes the threads slow? Is there an optimal amount of swap space I should use?:


Recommended location of node.js applications in linux filesystem?

Where is the conventionally accepted location of node.js/express web apps, in a linux file system? Currently I've got a subdirectory in `/opt/` but I'd like to hear other people's view on this...


Use of sed in perl?

I want to re-use the code given here, but I'm stuck in understanding the use of `sed`               print "Sending to QRadar...\n";     # SSH To QRadar's Console and push out file + trigger update     `scp -i $qradar_ssh_key -o UserKnownHostsFile=$qradar_ssh_knownhosts -o StrictHostKeyChecking=no root\@$qradar_console:/store/configservices/staging/globalconfig/remotenet.conf .`;     `sed -i -e '/^SECULERT/d' remotenet.conf`;     `cat $seculert_qradar_list >> remotenet.conf`;     `scp -i $qradar_ssh_key -o UserKnownHostsFile=$qradar_ssh_knownhosts -o StrictHostKeyChecking=no remotenet.conf root\@$qradar_console:/store/configservices/staging/globalconfig/remotenet.conf`;      I like to know what `sed` is doing over here.


Delete 100 lines from vi editor using single command

I am using Ubuntu and trying to delete all 100 lines from `vi` editor but I got interview question of doing this in one command.


SNAT with network alias IP RHEL 5.5

I have Rehat Enterprise Linux Server Release 5.5(Tikanga) with two interfaces as below   * eth0: with public IP as xxx.xx.64.118   * eth0:0: with public IP as xxx.xx.116.19   * eth1: with private IP as 172.16.23.2 By default my iptable POSTROUTING chain rule is as below:               Chain POSTROUTING (policy ACCEPT)     target      prot  opt source              destination     MASQUERADE  all  --  0.0.0.0/0            0.0.0.0/0      which means it has NAT IP as IP of eth0. Now I want a specific host computer(172.16.23.6), connected to eth1, to have source IP as that of eth0:0 (ie. xxx.xx.116.19) while connecting to internet. So I added a rule as below               iptables  -t nat -A POSTROUTING -s 172.16.23.6 -o eth0 -j SNAT --to-source xxx.xx.116.19      Which added new rule above MASQUERADE as show :               Chain POSTROUTING (policy ACCEPT)     target     prot opt source               destination     SNAT       all  --  172.16.23.6       0.0.0.0/0           to:xxx.xx.116.19     MASQUERADE  all  --  0.0.0.0/0            0.0.0.0/0      After what I supposed was that the host having IP 172.16.23.6 would have public IP xxx.xx.116.19 when connecting to the internet(checked via whatismyip.com). But it still shows the public IP of eth0(xxx.xx.64.118). The same worked well for Ubuntu. Can anybody please suggest what is the problem ?


how to enable root user in linux(Ubuntu)?

In Linux (Ubuntu),I am going through with a lot of problems. In ubuntu, I haven't got any root user. So, I have to apply `sudo` bash at every Instance. I just want to create a root user, from which I can login and have all the privileges.


cygwin, tail -F and rapidly filling/rotatinglogs

I'm using cygwin tail to follow busy java web application logs, on a windows server, generating roughly 16Gb worth of logs a day. I"m constrained to 10MB log sizes, so the files roll very often. The command line I'm using is :               /usr/bin/tail -n 1000 -F //applicationserver/logs/logs.log      It survives 2-4 rolls of the file, about 4-6 minutes, but eventually, usually reports: "File truncated" and then echos the name of the file every second. the file is busily filling and rotating. Am I exceeding the capability of tail?


Printer is not recognized by CUPS

I have a printer (Product code: PRP-085, Vendor BIRCH), I'm using Fedora 20 KDE (also tested on Ubuntu 13. 10) and CUPS 1. 7. 2 My issue is printer is not recognized by CUPS, the output of `lpinfo -v` is:               network ipps     network lpd     network beh     direct hp     network http     network https     network ipp     network socket     network smb     direct hpfax     network bjnp      I have tried some guides in https://wiki.archlinux.org/index.php/CUPS#Device_node_permissions. I can not find anyways to recognize this device.


Impossible to send mail to microsoft (hotmail, live ...)

I cannot send mail to hotmail with my postfix server. I can send and receive mail from gmail and others, but not hotmail. I made an "Authentication Report" on `auth-results@verifier.port25.com`:               ==========================================================     Summary of Results     ==========================================================     SPF check:          pass     DomainKeys check:   neutral     DKIM check:         neutral     Sender-ID check:    pass     SpamAssassin check: ham          ==========================================================     Details:     ==========================================================          HELO hostname:  bart.localdomain     Source IP:      62.210.240.55     mail-from:      contact@dimsolution.com          ----------------------------------------------------------     SPF check details:     ----------------------------------------------------------     Result:         pass      ID(s) verified: smtp.mailfrom=contact@dimsolution.com     DNS record(s):         dimsolution.com. SPF (no records)         dimsolution.com. 3522 IN TXT "1|www.dimsolution.com"         dimsolution.com. 3522 IN TXT "v=spf1 a mx ip4:62.210.240.55 -all"         dimsolution.com. 3522 IN A 62.210.240.55          ----------------------------------------------------------     DomainKeys check details:     ----------------------------------------------------------     Result:         neutral (message not signed)     ID(s) verified: header.From=contact@dimsolution.com     DNS record(s):          ----------------------------------------------------------     DKIM check details:     ----------------------------------------------------------     Result:         neutral (message not signed)     ID(s) verified:           NOTE: DKIM checking has been performed based on the latest DKIM specs     (RFC 4871 or draft-ietf-dkim-base-10) and verification may fail for     older versions.  If you are using Port25's PowerMTA, you need to use     version 3.2r11 or later to get a compatible version of DKIM.          ----------------------------------------------------------     Sender-ID check details:     ----------------------------------------------------------     Result:         pass      ID(s) verified: header.From=contact@dimsolution.com     DNS record(s):         dimsolution.com. SPF (no records)         dimsolution.com. 3522 IN TXT "1|www.dimsolution.com"         dimsolution.com. 3522 IN TXT "v=spf1 a mx ip4:62.210.240.55 -all"         dimsolution.com. 3522 IN A 62.210.240.55          ----------------------------------------------------------     SpamAssassin check details:     ----------------------------------------------------------     SpamAssassin v3.3.1 (2010-03-16)          Result:         ham  (-0.2 points, 5.0 required)           pts rule name              description     ---- ---------------------- --------------------------------------------------     -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%                                 [score: 0.0000]      0.0 HTML_MESSAGE           BODY: HTML included in message      1.7 HTML_IMAGE_ONLY_08     BODY: HTML: images with 400-800 bytes of words          ==========================================================     Explanation of the possible results (from RFC 5451)     ==========================================================          SPF and Sender-ID Results     =========================          "none"           No policy records were published at the sender's DNS domain.          "neutral"           The sender's ADMD has asserted that it cannot or does not           want to assert whether or not the sending IP address is authorized           to send mail using the sender's DNS domain.          "pass"           The client is authorized by the sender's ADMD to inject or           relay mail on behalf of the sender's DNS domain.          "policy"          The client is authorized to inject or relay mail on behalf           of the sender's DNS domain according to the authentication           method's algorithm, but local policy dictates that the result is           unacceptable.          "fail"           This client is explicitly not authorized to inject or           relay mail using the sender's DNS domain.          "softfail"           The sender's ADMD believes the client was not authorized           to inject or relay mail using the sender's DNS domain, but is           unwilling to make a strong assertion to that effect.          "temperror"           The message could not be verified due to some error that           is likely transient in nature, such as a temporary inability to           retrieve a policy record from DNS.  A later attempt may produce a           final result.          "permerror"           The message could not be verified due to some error that           is unrecoverable, such as a required header field being absent or           a syntax error in a retrieved DNS TXT record.  A later attempt is           unlikely to produce a final result.               DKIM and DomainKeys Results     ===========================          "none"           The message was not signed.          "pass"           The message was signed, the signature or signatures were           acceptable to the verifier, and the signature(s) passed           verification tests.          "fail"           The message was signed and the signature or signatures were           acceptable to the verifier, but they failed the verification           test(s).          "policy"           The message was signed but the signature or signatures were           not acceptable to the verifier.          "neutral"           The message was signed but the signature or signatures           contained syntax errors or were not otherwise able to be           processed.  This result SHOULD also be used for other           failures not covered elsewhere in this list.          "temperror"           The message could not be verified due to some error that           is likely transient in nature, such as a temporary inability           to retrieve a public key.  A later attempt may produce a           final result.          "permerror"           The message could not be verified due to some error that           is unrecoverable, such as a required header field being           absent. A later attempt is unlikely to produce a final result.               ==========================================================     Original Email     ==========================================================          Return-Path: <contact@dimsolution.com>     Received: from bart.localdomain (62.210.240.55) by verifier.port25.com id hfnbc211u9cn for <check-auth@verifier.port25.com>; Thu, 22 May 2014 06:51:45 -0400 (envelope-from <contact@dimsolution.com>)     Authentication-Results: verifier.port25.com; spf=pass smtp.mailfrom=contact@dimsolution.com     Authentication-Results: verifier.port25.com; domainkeys=neutral (message not signed) header.From=contact@dimsolution.com     Authentication-Results: verifier.port25.com; dkim=neutral (message not signed)     Authentication-Results: verifier.port25.com; sender-id=pass header.From=contact@dimsolution.com     Received: by bart.localdomain (Postfix, from userid 33)         id 58E2FF401AB; Thu, 22 May 2014 12:51:45 +0200 (CEST)     To: check-auth@verifier.port25.com     Subject: fsdfg     X-PHP-Originating-Script: 501:rcube.php     MIME-Version: 1.0     Content-Type: multipart/alternative;      boundary="=_b148f0ac1d5edc2ff6cb8772d93c5c22"     Date: Thu, 22 May 2014 12:51:45 +0200     From: Agence web Dim'Solution <contact@dimsolution.com>     Organization: Dim'Solution     Message-ID: <1e17adc6630c90ded8b6bf2b80596ac4@dimsolution.com>     X-Sender: contact@dimsolution.com     User-Agent: Roundcube Webmail/1.0.0          --=_b148f0ac1d5edc2ff6cb8772d93c5c22     Content-Transfer-Encoding: 8bit     Content-Type: text/plain; charset=UTF-8      Error from /var/log/mail.log:               May 18 17:50:32 sd-45290 postfix/smtp[12608]: D1487F40CB0: lost connection with mx4.hotmail.com[65.55.92.152] while performing the HELO handshake     May 18 17:50:32 sd-45290 postfix/smtp[12607]: 766E8F40C92: lost connection with mx4.hotmail.com[207.46.8.199] while performing the HELO handshake     May 18 17:50:32 sd-45290 postfix/smtp[12610]: E4F64F40AB5: lost connection with mx3.hotmail.com[207.46.8.199] while performing the HELO handshake     May 18 17:50:32 sd-45290 postfix/smtp[12612]: 2BBBAF40AB4: lost connection with mx4.hotmail.com[65.55.33.119] while performing the HELO handshake     May 18 17:50:33 sd-45290 postfix/smtp[12608]: D1487F40CB0: lost connection with mx2.hotmail.com[65.55.92.168] while performing the HELO handshake     May 18 17:50:33 sd-45290 postfix/smtp[12610]: E4F64F40AB5: lost connection with mx1.hotmail.com[65.55.92.136] while performing the HELO handshake     May 18 17:50:33 sd-45290 postfix/smtp[12607]: 766E8F40C92: lost connection with mx4.hotmail.com[65.55.37.104] while performing the HELO handshake     May 18 17:50:33 sd-45290 postfix/smtp[12612]: 2BBBAF40AB4: lost connection with mx3.hotmail.com[207.46.8.167] while performing the HELO handshake     May 18 17:50:33 sd-45290 postfix/smtp[12608]: D1487F40CB0: lost connection with mx1.hotmail.com[65.55.92.168] while performing the HELO handshake     May 18 17:50:33 sd-45290 postfix/smtp[12610]: E4F64F40AB5: lost connection with mx1.hotmail.com[65.55.92.168] while performing the HELO handshake     May 18 17:50:33 sd-45290 postfix/smtp[12607]: 766E8F40C92: lost connection with mx2.hotmail.com[65.55.92.152] while performing the HELO handshake     May 18 17:50:33 sd-45290 postfix/smtp[12612]: 2BBBAF40AB4: lost connection with mx3.hotmail.com[65.55.92.136] while performing the HELO handshake     May 18 17:50:34 sd-45290 postfix/smtp[12608]: D1487F40CB0: lost connection with mx3.hotmail.com[65.54.188.94] while performing the HELO handshake     May 18 17:50:34 sd-45290 postfix/smtp[12607]: 766E8F40C92: lost connection with mx3.hotmail.com[65.55.92.168] while performing the HELO handshake     May 18 17:50:34 sd-45290 postfix/smtp[12610]: E4F64F40AB5: lost connection with mx1.hotmail.com[65.55.37.88] while performing the HELO handshake     May 18 17:50:34 sd-45290 postfix/smtp[12612]: 2BBBAF40AB4: lost connection with mx1.hotmail.com[65.55.37.104] while performing the HELO handshake     May 18 17:50:34 sd-45290 postfix/smtp[12608]: D1487F40CB0: to=<jeftiy@hotmail.fr>, relay=mx1.hotmail.com[65.55.92.184]:25, delay=21407, delays=21405/0.05/2/0, dsn=4.4.2, status=deferred (lost connection with mx1.hotmail.com[65.55.92.184] while performing the HELO handshake)     May 18 17:50:34 sd-45290 postfix/smtp[12610]: E4F64F40AB5: to=<daisy11@hotmail.fr>, relay=mx2.hotmail.com[65.55.92.136]:25, delay=332155, delays=332152/0.06/2.2/0, dsn=4.4.2, status=deferred (lost connection with mx2.hotmail.com[65.55.92.136] while performing the HELO handshake)      What could be wrong?


Run a script at startup

I am using Ubuntu 14.04. I wrote a small script named trial. The contents of the script are as follows:                #!/bin/sh     SHELL=/bin/sh     PATH=/bin:/sbin:/usr/bin:/usr/sbin          sh -c firefox      I copied the script to `/etc/init.d`, modified permission using `chmod +x trial` and used `update-rc.d trial defaults`. The file made link but when I rebooted the machine. It did not run firefox. I tried cron @reboot but with no success. I tried rc.local too again failure. I think something is wrong in my script. I am new to linux so can some one point out my mistake?


How to sync terminal session command history in bash?

I've tried to search in `~/.bash_history` for my recent commands while in a terminal session but they just weren't there. I guess this is because I have multiple terminal sessions open. Is there a way that I can sync (ie. sync-push or sync-write-out) the current terminal session's command history into the bash_history file (without closing the session and losing that environment)? (It would be remotely similar in idea to how the `sync` command stores the file-system modifications on some embedded systems.) I imagine I could set up bash to preserve multiple session history but the ability to push the current history buffer would still be useful in scenarios when you are working on a new machine and you accidentally forgot to set up bash the way you may would have wanted.


How to set sctp_nodelay to enable piggybacking while replying back

**Problem:** We are hosting a telecom application that receives traffic from the network at > 500 TPS. The packets are piggybacked so each sctp packet contains multiple application layer packets lets say 10. Our interface to the network is a SG(signalling gateway) which routes the packets to our internal node in the cluster. But since our sctp library (the native lkstp lib) doesnt support the piggybacking or **sctp_nodelay** is set to true, it splits the packets and sends them to the internal node as multiple packets thereby yielding congestion in the network. **What we want** We want to check for any option at kernel or the sctp library level to be able to turn off sctp_nodelay (Im assuming this option works in the same manner as tcp_nodelay does). So that multiple packets are sent out in one sctp message. **Server specification:** CentOS: 5.8 kernel: 2.6.18-308.el5 sctplibrary: lksctp-tools-1.0.10! In the following image it shows the piggybacked packets comming from network and the routed packets being sent as individual packets. Here is the sample packet EDIT: yes I have tried the following code, it still doesnt work:               private void doInitiateConnectionSctp() throws IOException {         this.socketChannelSctp.setOption(SctpStandardSocketOptions.SCTP_NODELAY, true);             // Create a non-blocking socket channel             this.socketChannelSctp = SctpChannel.open();             this.socketChannelSctp.configureBlocking(false);                  // bind to host address:port             this.socketChannelSctp.bind(new InetSocketAddress(this.hostAddress, this.hostPort));             if (this.extraHostAddresses != null) {                 for (String s : extraHostAddresses) {                     this.socketChannelSctp.bindAddress(InetAddress.getByName(s));                 }             }                  // Kick off connection establishment             this.socketChannelSctp.connect(new InetSocketAddress(this.peerAddress, this.peerPort), 32, 32);         }


How to know how long will my simulation run in UNIX?

![enter image description here](http://i.stack.imgur.com/5oHEB.jpg) I am new in using Unix, I want to know what command can display how long will my simulation run. I am using windows but running cygwin to get the UNIX environment. I am running a discrete dipole approximation simulation. This is my simulation, I don't know if it worked or not that is why I want to see the remaining time to ensure it is really running, or is there any way to know if it is really running?


How a piped shell programs balance their output/input rates?

> **Possible Duplicate:**   >  Bash while loop and reading from pipe I come from web programming background, and find myself interested in one peculiarity of using a local shell. I understand that when a program reads from file, it can read at whatever rate's necessary. But I'm curious to know, how does it work when a program gets other program's input piped in and can't process it in realtime? A good example would be video encoding. Suppose I point a decoder to video file, then it's output gets piped in as encoder's input. The total size of decoded video is more than ram+swap, so I guess there's no way to have it buffered altogether. I found about read and write calls to stdin and stdout, but I'm interested to know what actually happens when this example's encoder can't cope with all the data at once. Does it somehow informs the decoder about desired rate? Does decoder program needs to be specifically prepared for such a signal and modify it's processing speed accordingly? If not, how does it all gets balanced in the end?


Rearrange text file by prepending data rows with header row

I have a file whose content looks like this:               2009 150  0  0  0     0000     75.316   0.0400390625  0.00007        0.00000 0.8980     76.216   0.0400390625  0.00007        1.00000 0.9046     77.217   0.0400390625  0.00009        2.00000 0.9113     78.341   0.0400390625  0.00010        3.00000 0.9183     2009 150  2  0  0     0000     75.316   0.0400390625  0.00007        0.00000 0.8980     76.216   0.0400390625  0.00007        1.00000 0.9046     77.217   0.0400390625  0.00009        2.00000 0.9113     78.341   0.0400390625  0.00010        3.00000 0.9183     79.616   0.0400390625  0.00013        4.00000 0.9255      I would like to:   1. Find all lines that start with keyword 2009.   2. Pre-pend those lines to all following ones until another occurrence of line that starts with 2009 is found, and so on until EOF. In essence I am looking for an output like this:               2009 150  0  0  0     0000 75.316   0.0400390625  0.00007        0.00000 0.8980     2009 150  0  0  0     0000 76.216   0.0400390625  0.00007        1.00000 0.9046     2009 150  0  0  0     0000 77.217   0.0400390625  0.00009        2.00000 0.9113     2009 150  0  0  0     0000 78.341   0.0400390625  0.00010        3.00000 0.9183     2009 150  2  0  0     0000 75.316   0.0400390625  0.00007        0.00000 0.8980     2009 150  2  0  0     0000 76.216   0.0400390625  0.00007        1.00000 0.9046      ....... I have been scratching my head on this for quite a while and cannot come up with a solution. Help would be appreciated. I know how to extract the text between keywords using flags but I am not sure if that is the right direction.


yum install mod_auth_token not working on CentOS

On CentOS 6.5 how do I make `yum install mod_auth_token` work these days? According to my own HOWTO I wrote 12 months back, you used to be able to just type it now you have to DIY it, which is bad because my DIY is bad, and I get this:               # cd        # wget http://dl.fedoraproject.org/pub/epel/6/i386/mod_auth_token-1.0.5-2.el6.i686.rpm     # rpm -Uvh mod_auth_token-1.0.5-2.el6.i686.rpm     error: Failed dependencies:        libc.so.6 is needed by mod_auth_token-1.0.5-2.el6.i686        libc.so.6(GLIBC_2.0) is needed by mod_auth_token-1.0.5-2.el6.i686        libc.so.6(GLIBC_2.1.3) is needed by mod_auth_token-1.0.5-2.el6.i686        libc.so.6(GLIBC_2.3) is needed by mod_auth_token-1.0.5-2.el6.i686        libc.so.6(GLIBC_2.4) is needed by mod_auth_token-1.0.5-2.el6.i686     # yum whatprovides libc.so.6     # yum install glibc-2.12-1.132.el6.i686     # rpm -Uvh mod_auth_token-1.0.5-2.el6.i686.rpm     # yum install mod_auth_token-1.0.5-2.el6.i686.rpm     # rpm -ql mod_auth_token     /usr/lib/httpd/modules/mod_auth_token.so     ls -l /etc/httpd/modules/     cp /usr/lib/httpd/modules/mod_auth_token.so /etc/httpd/modules/      but then I get this                Starting httpd: httpd: Syntax error on line 202 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_auth_token.so into server: /etc/httpd/modules/mod_auth_token.so: wrong ELF class: ELFCLASS32      so obviously I have somehow got a 64 bit/32 bit error. A year ago (I wrote to myself that) you could simply do               yum install mod_auth_token      is there a way to do this so it works? the `mod_auth_toekn.so` needs to be in `/etc/httpd/modules/`


How to find files with names having a long string after the first dot

My Samsung Galaxy S doesn't like files where the name contains a long string after the first dot. I guess some part of the software has a too short buffer for the file extension. How can I find all files on my Micro-SD-Card mounted at /media/sd where the filename has more than five characters after the first dot? Reading the find manpage, I thought `find . -regex '.*\\..\\{5,\\}'` would work, but it doesn't give any hits, so I somehow don't get my regular expression right.


OpenBSD: 32 bit or 64 bit

I would like to use the 64 bit version of OpenBSD, but I'm not really sure how good it works. Are there any known problems? Is the 32 bit version more recommended for productive environment?


Where should I keep personal files so they are safe across system re-installs?

I want to make sure that at the next system installation/restoration my files are not lost. Using tweakers I can change Window's default folders (e.g. move "My documents" from C: drive to D:). Right now I have Linux Mint 15 Mate installed on partition `/` and the rest of HDD mounted to `/home`. Is this right approach? If yes, how can I move default folders to this partition? If no, what is the best approach?


Network Manager error

When I run NetworkManager's applet, `nm-applet`, on my Scientific Linux 6.4, I get:               [root@computer]# nm-applet      > ** (nm-applet:4157): WARNING **: bus_init(): Could not get the session bus. > Make sure the message bus daemon is running! Message: Did not receive a > reply. Possible causes include: the remote application did not send a reply, > the message bus security policy blocked the reply, the reply timeout > expired, or the network connection was broken. > > GConf Error: Failed to contact configuration server; some possible causes > are that you need to enable TCP/IP networking for ORBit, or you have stale > NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for > information. (Details - 1: Failed to get connection to session: Did not > receive a reply. Possible causes include: the remote application did not > send a reply, the message bus security policy blocked the reply, the reply > timeout expired, or the network connection was broken.) > > An instance of nm-applet is already running. > > (nm-applet:4157): GConf-WARNING **: Directory > `/system/networking/connections' was not being monitored by GConfClient > 0x9cac60 When I pass the command `lspci -v` I get:               0c:00.0 Network controller: Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01)     Subsystem: Dell Wireless 1397 WLAN Mini-Card     Flags: bus master, fast devsel, latency 0, IRQ 17     Memory at f69fc000 (64-bit, non-prefetchable) [size=16K]     Capabilities: [40] Power Management version 3     Capabilities: [58] Vendor Specific Information: Len=78 <?>     Capabilities: [e8] MSI: Enable- Count=1/1 Maskable- 64bit+     Capabilities: [d0] Express Endpoint, MSI 00     Capabilities: [100] Advanced Error Reporting     Capabilities: [13c] Virtual Channel     Capabilities: [160] Device Serial Number 18-6d-04-ff-ff-2c-70-1a     Capabilities: [16c] Power Budgeting <?>     Kernel driver in use: b43-pci-bridge     Kernel modules: ssb      How can I fix this problem?


Log-me-in on Angstrom

Has anyone got Log-me-in Hamachi running on the Angstrom distribution? When I attempt to install it, it tells me I need the lsb package. I googled it and found that it is a package you can get rpm packages for. I tried to install the rpm packages, but obviously on Angstrom they don't work. I then tried to install `rpm2cpio` by installing `busybox` using `opkg`, but `busybox` on `opkg` does not have the program!


Quick and dirty way to edit scans

I've got a lot of documents that I want to scan that require only modest editing. Mainly trimming the edges, splitting in two (when I scan two pages in one scan), and possibly adjust the perspective like camscanner. **NOTE:** (You layout a quadrilangle, camscanner then adjusts the perspective so the quadriangle becomes a square). Gimp and a couple of other programs can do this, but it seems to me to be significant overkill. What other options are there for doing these tasks?


How to know why server keeps restarting?

It seems that my server keeps restarting. I want to know why. How can I know when the last time server was rebooted and why?               root     pts/0        139.193.156.125  Thu Aug  8 21:10   still logged in     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 20:38 - 21:11  (00:33)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 20:15 - 21:11  (00:56)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 19:16 - 21:11  (01:55)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 18:56 - 21:11  (02:14)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 18:24 - 21:11  (02:47)     root     pts/1        139.193.156.125  Thu Aug  8 18:16 - crash  (00:07)     root     pts/0        195.254.135.181  Thu Aug  8 18:10 - crash  (00:13)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 17:52 - 21:11  (03:19)     root     pts/0        195.254.135.181  Thu Aug  8 17:38 - crash  (00:13)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 17:08 - 21:11  (04:02)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 16:58 - 21:11  (04:12)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 16:45 - 21:11  (04:26)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 16:35 - 21:11  (04:36)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 16:27 - 21:11  (04:44)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 15:59 - 21:11  (05:12)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 06:15 - 21:11  (14:56)     root     pts/1        208.74.121.102   Wed Aug  7 06:03 - 06:04  (00:00)     root     pts/1        208.74.121.102   Tue Aug  6 15:34 - 17:40  (02:05)     root     pts/0        139.193.156.125  Tue Aug  6 11:28 - 04:40 (1+17:11)      In Linux is there ANY WAY to know why the system rebooted? Specifically did high load cause it? If not that then What?


Mail queue keep growing

My server keeps running short on inodes due the mail queue getting crazy. First, I assumed I had `postfix` not configured properly, so I switched it off. But, it happened again, last time I did it I had :                 # postsuper -d ALL     postsuper: Deleted: 375122 messages      While I could put a cron to run this every morning, that does not seem to be the optimal solution. What could be the cause of such a behaviour? How can I prevent this too happen?


Landscape Printing in Linux

I'm having trouble printing in landscape mode in a Gentoo (AMD64) installation. The setup:               CUPS-1.7.5     CUPS-Filters-1.0.54     ghostscript-gpl-9.14     proprietary brother drivers          Printer: Brother DCP 7065dn      It will not print in landscape in any application (LO, acroread, evince etc..), instead it is printing the proper image (e.g multiple pages are ordered as I would expect them to be in this mode) but in the wrong orientation. Brlaser (an alt. driver) doesn't offer duplex printing; and the printer works fine from a windows machine. In most applications I have no option of printer language, and in the ones which I do (namely acroread) it makes no difference. This seems to be something of an ongoing problem in Linux, not just with this setup. Has anyone been able to overcome the problem?


Pipeline each line of a file to a specific variable in a second command

I want to execute the following instruction:               basex -bword=ENTRY consulta.xq      But for every line of a SampleText file (plain text mainly). The SampleText contains the following lines:               hello     evening     courageous     ...     happy      So more or less what I want to do is to execute a instruction in a one liner recipe similar to this:               cat SampleText | basex -bword=EACHLINE searchquery.xq


GTK Frontend for locate

I am a heavy user of the `locate` tool, which is part of the `findutils` package. It's fine to use it on command line, but sometimes I would also like to search for a file (as fast as with `locate`) within my Xfce 4.10 desktop. Is there any nice GTK frontend (or a panel applet) for the `locate` command?


Switch between tabs (panels) in Mint

How to switch between tabs (panels) in any window (i.e. setting windows for keyboard) in Linux Mint? I use `Ctrl`+`Tab` in Windows.


Munin Server not making Graphs

On my Central Monitoring Server previously Munin 1.2.5 Server was installed. So now I update the server with latest Munin 2.0.21 and moved the files for `/var/www/html/munin` to new directory `/var/www/html/oldmunin` and did same for `/var/lib/munin/`. But the server is not generating any files, and this is the error I'm getting when I run `/usr/bin/munin-cron`. > Can't load '/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread- > multi/auto/RRDs/RRDs.so' for module RRDs: librrd.so.2: cannot open shared > object file: No such file or directory at > /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230. at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/UpdateWorker.pm line 19 > Compilation failed in require at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/UpdateWorker.pm line 19. BEGIN > failed--compilation aborted at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/UpdateWorker.pm line 19. > Compilation failed in require at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/Update.pm line 17. BEGIN > failed--compilation aborted at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/Update.pm line 17. Compilation > failed in require at /usr/share/munin/munin-update line 14. BEGIN failed-- > compilation aborted at /usr/share/munin/munin-update line 14.


ATI graphics card: Is proprietary firmware needed in any case?

I am trying for days now to enable 3d of my ATI X 1900 under Debian GNU/Linux 7.6. I installed the xserver-xorg-drivers-radeon package, however this does not work. Specifically, I receive a similar error message as the user here: How to configure FOSS ATI drivers on Debian Wheezy and ATI RS880 [Radeon HD 4250]? This is (drivers names etc. below are not mine, but similar):               [    8.121829] [drm] Loading RS780 Microcode     [    8.156063] r600_cp: Failed to load firmware "radeon/RS780_pfp.bin"     [    8.156092] [drm:r600_startup] *ERROR* Failed to load firmware!      The hint usually given in the internet is to install the firmware-linux- nonfree package. So my question is: Do you in any case have to install proprietary firmware, even when using free dirvers? Isn't it possible to stay completely free?


Where is the ability to hibernate exposed on Linux?

When I boot with a `resume=..` option to the kernel and an `initrd` built with a `-h` option, userland tools (say, `batti`) offer me the choice of hibernation; when I boot without them it does not. Where is the fact that I have a system capable of hibernate/resume exposed for these tools to find that out? (This is on Slackware, in case this is init- specific.)


Ubuntu completely freezes, suspecting IDLE

Relatively inexperienced with both programming and linux so hopefully I'm missing something obvious. Running Ubuntu 12.04 on a Dell Latitude E5530 and haven't had any particular problems so far, but lately it has started freezing completely, forcing me to manually reset power. The only half-way demanding stuff I've done lately is some Python programming in IDLE, but nothing crazy at all (a single Selenium- operated Firefox instance basically). What do I do when this happens in Ubuntu?


Double rm verification in zsh

When I do a rm * in zsh, I get something like this:               2014-06-08 10:14:23 $ rm *     zsh: sure you want to delete all the files in /home/assay/assay/log [yn]? y     rm: remove regular file `development.log'? y      First zsh asks me if I am sure I want to delete all, and then rm asks for for each specific file. How can I just have the zsh verification?


How do you implement totals from usage output generated by a program in a script so that they carry on sanely through repeated execution?

I have a script with a pipeline where the data is throttled by a program. Every 20 minutes, a throughput status is sent on _stderr_ , and I simply redirect this to a file:               command | cstream -t -512k -T 1200 -B 64m 2>>/home/user/totals.log | command      I could also send a SIGUSR1 signal to _cstream_ (`kill -s 10 PID`) and it would produce exactly the same output as when I set an interval like I did, and a line is added to the file. The idea is that you can set the interval and also query a status on demand. The output is formatted like this with a single whitespace character all over and terminated with a newline:               ...     1931255808 B 1.8 GB 3683.6 s (1:01 h) 524289 B/s 512.00 KB/s     2560401408 B 2.4 GB 4883.6 s (1:21 h) 524289 B/s 512.00 KB/s     3189547008 B 3.0 GB 6083.6 s (1:41 h) 524289 B/s 512.00 KB/s     3818692608 B 3.6 GB 7283.6 s (2:01 h) 524289 B/s 512.00 KB/s     4447838208 B 4.1 GB 8483.6 s (2:21 h) 524289 B/s 512.00 KB/s     10829824 B 10.3 MB 20.65 s 524487 B/s 512.19 KB/s      You can see the data progress but you couldn't just sum(or average) each column. There are just 2 events in this sample(lines 1-5, 6) i.e. I used the script twice. It just so happens here that we could add the two last lines - because I restarted it and we have a snapshot of that moment but that's arbitrary. Which leads to what happens when I exit the command and restart it, as you can see happening on the last line - the counter is of course reset. The objective is to have a cumulative total of the status output for all the instances of the script I launch over time. I usually never launch more than one instance of it at a time. So I'm thinking of adding to my script("sane" for one instance of the script only):   * First delete all but the last line of my log   * Last, when the script exits, make it write its status to the log      * Sum/avg each column of the first and last line     * Delete all intermediary lines I'm afraid I can't connect the dots. What is the simplest and best way to design and implement what I want? Does the complexity overwhelm the benefit and should I just focus on manipulating the log data with a simple command as it fills up?


Dual monitor setup on a laptop: internal monitor peeking through on external display

Recently I began to use my laptop (Dell Inspiron N5020) with an external display. I use the displays side-by-side, internal on the left, external on the right. The problem is, however, that the display on the external monitor seems to be shifted to the right by a few pixels, and at the same time a few pixel wide column from the right edge of the internal display is duplicated on the left edge of the external. On a screenshot this is not visible. I illustrated what I'm actually talking about on this image: ![Illustration of the problem](http://i.imgur.com/pacMnzt.png) The type of the external monitor doesn't seem to matter. Same thing with a Medion 1680x1050 monitor with VGA connector, and a Dell U2311H through HDMI. Also I tried to set various resolution combinations, and it seems to only happen when the internal monitor is at its native resolution (which is 1366x768) (I have Linux Mint 15 x64 with Cinnamon.)


How does reverse SSH tunneling work?

As I understand this, firewalls (assuming default settings) deny all incoming traffic that has no prior corresponding outgoing traffic. Based on Reversing an ssh connection and SSH Tunneling Made Easy, reverse SSH tunneling can be used to get around pesky firewall restrictions. I would like to execute shell commands on a remote machine. The remote machine has its own firewall and is behind an additional firewall (router). It has an IP address like 192.168.1.126 (or something similar). I am not behind a firewall and I know the remote machine's IP address as seen from the Internet (not the 192.168.... address). Additionally, I can ask someone to execute `ssh (something)` as root on the remote machine first. Could anyone explain me, step by step, how reverse SSH tunneling works to get around the firewalls (local and remote machines' firewalls and the additional firewall between them)?   What is the role of the switches (-R, -f, -L, -N)?


SSH: connect through intermediary server in just one step (through forwarded port)

Related question: initiate ssh connection from server to client I have intermediary server with public IP (let it be `SERVER`), and I need to establish connection between two computers (`A` and `B`) without public IP, through this intermediary server. So, to connect from `A` to `B`, I can now do this:               B$ ssh -N -R 2222:localhost:22 server_user@SERVER      and now, from `A`, I can connect to `B` in two steps:               A$ ssh server_user@SERVER     SERVER$ ssh -p 2222 b_user@localhost      Or in one line, but there are two steps anyway:               A$ ssh -t server_user@SERVER "ssh -p 2222 b_user@localhost"      But, I can't connect in just one step, like this:               A$ ssh -p 2222 b_user@SERVER     ssh: connect to host SERVER port 2222: Connection refused      Why is this, and how to make it work? Note: I don't have any firewall at the `SERVER`, so it should accept incoming connection at port `2222`, it seems.


ssh port forward to access my home machine from anywhere

http://serverfault.com/questions/303937/how-to-make-freebsd-box-accessible- from-internet I want to understand this whole process of `port forwarding`. I read so many things but failing to understand the very basic concept of port forwarding it self. What I have: > a freebsd server sitting at my home.   >  netgear router This is what I am trying to achieve:   > to be able to access freebsd server from a windows machine over internet to > be able to open a webbrowser and access internet.   > > > I also want to access this freebsd box from a ubuntu machine that I have. It will be great if someone can please help me. **Edit:0** here is the netgear router setup that I did for portforwarding. ![netgear port forwarding](http://i.stack.imgur.com/KiPhu.png)


Accessing Apache server over the Internet

I'm trying to access my Apache server over the Internet. When I use my external IP to connect from a different system, my router's welcome page is displayed. How can I access the server?


Reverse connection to SSH server

Machine A is connected to the internet and is behind firewall so it cannot receive incoming connections. Machine B is open to the internet. I want to be able to type commands into B and have them execute on A. Except it is A that has to reach out to B to establish the connection before B can send it commands. Can this be done running SSHd on A and plain SSH client on B or do I need a combination of SSHd and SSH client on A (client to establish reverse tunnel pointing to SSHd).


What's ssh port forwarding and what's the difference between ssh local and remote port forwarding

I feel confused about ssh port forwarding and the difference between ssh local and remote port forwarding. Could you please explain them in detail and with examples? Thanks!


Socks5 server on Debian

I would like to setup socks proxy on my Debian VPS. I try to use squid but its to hard for me. I saw a Dante software and think about it. I would like to setup dante to work with the web browser and plug FoxyProxy. So on server (vps-> dante server) and on the client (Firefox + FoxyProxy-> socks5 (user + password)) It should be public access to the socks but allowed to use it with atentication. If not Dante, what other program? I need complete instructions on how to set up a publicly accessible server socks5 with authentication to works fine with the browser with the addition of FoxyProxy Can anyone help?


Unix without a GUI for old machine

I have been given my father's old computer, which currently runs Windows 95 and has a 133-MHz processor, a Pentium(r) according to "My Computer". It seems a shame to recycle it when it works so well (considering what it is), so I'd like to load some variant of Unix on it and learn some stuff. I happen to have a copy of "Unix for Dummies" 4th edition (copyright 1998), but it assumes someone has already set up Unix on the computer in question, so I need another source for this step. There are several existing questions on here about the Unix-on-old-computer thing (typically Linux), except for one major issue: I specifically want a Unix system **without a GUI** and I cannot for the life of me find simple instructions for getting that. There's people looking for GUIs for their Linux servers and people looking to temporarily remove the GUI, but nothing whatsoever about how to get an **old-school, pre-GUI Unix**. It's not going to be used as a server, but to pretend I'm in a long-gone decade doing programming, file-editing, etc. on my desktop with just text. So, **what Unix should I use, and how do I get it?** The very fact that I have to ask may mean I'm in over my head, but I have to start somewhere. P.S. The computer has an ethernet card but I'm fairly certain it has no means of using wifi, so it may remain disconnected from the Internet unless it becomes necessary to connect it. Edit: It has a CD-ROM drive, as well as a floppy drive, tape drive, and apparently one USB port. 96 MB of RAM. Total capacity of C drive is 1 GB.


Why rootfs is mounted multiple times?

Here you can see two devices are mounted as root:               $ df     Filesystem                                             1K-blocks      Used Available Use% Mounted on     rootfs                                                  29221788  18995764   8761244  69% /     udev                                                       10240         0     10240   0% /dev     tmpfs                                                     203260      2192    201068   2% /run     /dev/disk/by-uuid/1d8879f2-9c47-4a72-9ef4-a6ecdd7a8735  29221788  18995764   8761244  69% /     tmpfs                                                       5120         0      5120   0% /run/lock     tmpfs                                                     406516       376    406140   1% /tmp     tmpfs                                                     406516        72    406444   1% /run/shm     /dev/sda2                                               29225884  15019636  12741264  55% /home     /dev/sda3                                              226881528 191247596  24275680  89% /opt     ...      However, I didn't specify UUID in /etc/fstab:               proc            /proc           proc    defaults        0       0     LABEL=debian    /               ext4    errors=remount-ro 0       1     LABEL=istore    /mnt/istore ext4    defaults    0   0     LABEL=home  /home           ext4    defaults        0       2     ...      I'd like to see mount info in "/dev/xxx" rather then "/dev/disk/by-uuid/...". Though mount by UUIDs have many advantages, but I prefer to the old style... It's also weired why there are two rootfs mount?


Boot Menu Fedora and Window 7

I have install Fedora 20 before, a few days ago , I just install Window 7, and now I can not boot to Fedora because I don't have a boot menu. Is there anyway to recover the Fedora boot menu, is there any free software to do it without using the Fedora CD to recover it.


"tar (child): Cannot connect to https: resolve failed" when installing Bitmask

I am trying to install Bitmask on my system to get the riseup VPN running(https://help.riseup.net/en/vpn/how-to/linux), but as you can see, there are no packages for Fedora. I tried the compressed files you get by using curl as well as the direct download from the Bitmask site, but both give me this output while unpacking:               tar xfj https://dl.bitmask.net/client/GNU/Linux/Bitmask-GNU/Linux64-latest.tar.bz2     tar (child): Cannot connect to https: resolve failed          bzip2: Compressed file ends unexpectedly;         perhaps it is corrupted?  *Possible* reason follows.     bzip2: Inappropriate ioctl for device         Input file = (stdin), output file = (stdout)          It is possible that the compressed file(s) have become corrupted.     You can use the -tvv option to test integrity of such files.          You can use the `bzip2recover' program to attempt to recover     data from undamaged sections of corrupted files.          tar: Child returned status 128     tar: Error is not recoverable: exiting now


Running F.lux (Flux) or Redshift with Multiple Monitors with Nvidia Optimus

I have tried installing F.lux and then Redshift, and configured them to run on multiple monitors with no success. I wonder if my setup, which includes Nvidia Optimus setup using Bumblebee could be the cause for this failure. Both programs seems to run fine on my laptop screen, but my external monitor via VGA does not adjust its color with my laptop screen. Has anyone had a similar experience, or been able to get a color adjustment program working on an external monitor using a Nvidia Optimus laptop? The Optimus situation has me configured to run the external monitor using `intel-virtual-output` and Xrandr on Nvidia's drivers, so I wonder if this situation has an effect on my ability to run the F.lux or Redshift programs. Here are some of the guides I followed: https://github.com/Kilian/f.lux-indicator-applet/issues/18 http://justgetflux.com/linux.html http://jonls.dk/redshift/ https://gist.github.com/bcomnes/4243805 I have a W520 ThinkPad with Intel 3000HD and Nvidia Quadro 1000M chipsets, running Ubuntu 13.10 (Saucy Salamander) and Windows 7 dual-boot.


wget files by pattern only from specified directories recursively

I need to download on an hourly basis (sometimes more frequently), files which are being written in segments of 24 hours. The files I am interested in are in specific subdirectories which I am trying to specify with `-I list` but this doesn't work for some reason. If I don't specify directories the files I need download fine with the `-A acclist` option but I end up with lots of empty directories that are being created because they exist on the host. my current line reads:               wget -np -nH --cut-dirs=X -c -N -r -l 0 \          -I /dir1,/dir2,...,/some_dir -A acclist \          http://hostname/X_sub_directories/      How do I download **only** the files I want and create **only** the directory hierarchy for those files?


Linux equivalent for Windows Startup

**Is there any way to add an application/script to the Linux startup so every time the system is on it executes** [i'm looking for some automated way, user should not add this by cron job or something like that].   Yeah you are right, i want to create a little cute virus :) and also want to know if it is possible.


Is this what it looks like in the terminal on the client side when you are blocked out via fail2ban?

I am a new server admin. I just setup fail2ban on an ubuntu 12.04 VPS. I used this tutorial. Then I tried to login to the system via ssh from a friend's machine. It is showing "operation timed out." It seems like this means fail2ban is working -- but I want to double check to be certain. Is this what it looks like on the client side when fail2ban has blocked your IP? Your SSH login times out because fail2ban/iptables does not allow it to initiate on the server side?               $ ssh -p# user@IP     user@IP's password:      Permission denied, please try again.     user@IP's password:      Permission denied, please try again.     user@IP's password:      ^C     $ ssh -p# user@IP     ssh: connect to host IP port #: Operation timed out     $ ssh -p# user@IP     ssh: connect to host IP port #: Operation timed out


Linux Mint 14 system language turns into chinese. How can I switch back to English?

Today for testing purpose I installed KDE alongside Cinnamon in Linux Mint 14. Unfortunately, after that my system language switch to Chinese!!! All the menus and notification is in Chinese now!! How can I switch back to English?


Unable to login to Linux box running Xfce using LXDM login manager

I am running a Linux box with the `LXDM` login manager and Xfce as my desktop environment. Every time I login, this is the screen I get: ![enter image description here](http://i.stack.imgur.com/mh0Nh.png) If I enter the right password, the system logs me in without any problems. But if I enter the wrong password, after a few seconds, this is what I get: ![enter image description here](http://i.stack.imgur.com/78GEG.png) Because of this, I end up rebooting the whole machine so that I can get the input box to enter the correct password. Could someone please tell me how I might solve this issue? Or at least point me in the right direction?


LAMP Server setup for personal development

I am setting up a LAMP server in VirtualBox for personal development. This will be an Ubuntu Server 12.04 install, and I will be using Virtual Hosts for Drupal, Yii, and other small PHP apps. Ideally I'd like to avoid creating new Virtual Hosts in `/var/www` and instead opt for creating these under a `public_html` folder in my user's _home_ directory. Please bear in mind that this isn't a " _Need Your Advice_ " style question - instead I would like to know the following in helping me set this up properly: Is there any benefit in creating another user (non-root) that will "host" these apps in their home directory, or will the root user created in the setup process suffice? I realise I'm being a bit pedantic by asking this, but its based on a recommendation I saw on another site (can't remember the URL) for setting up a LAMP server for personal development. I imagine this is only critical in a production environment. I'm thinking in terms of permissions, security, etc. **EDIT** : Will I run into any issues using the root user to this end, or would I be safer creating a new non-root user? **EDIT2** : Please don't down-vote this post! I would really like some clarity on this as I'm still walking the Linux learning path :)


Which header defines the macro that specifies the machine architecture?

_Shorter version of question:_ Which C header contains the macro that corresponds to the machine architecture of the system (e.g., `__x86_64__`, `__ia64__`, `__mips__`?) _Longer version of question:_ I'd like to run the ganglia monitoring tools on a Tilera-based system that runs Linux. Ganglia doesn't currently have support for Tilera. To get this to work, I ned to modify a C function called machine_type_func that returns the machine architecture. The body of this function is determined at compile-time, it looks like this:               g_val_t     machine_type_func ( void )     {        g_val_t val;          #ifdef __i386__        snprintf(val.str, MAX_G_STRING_SIZE, "x86");     #endif     #ifdef __x86_64__        snprintf(val.str, MAX_G_STRING_SIZE, "x86_64");     #endif     ...        return val;     }      I need to add the appropriate line for Tilera, but I don't know the name of the macro that specifies a Tilera-based system. I'm guessing this macro is defined in one of the standard Linux headers, but I don't know which one to look in.


Vim markers and macros

Is there a way to make a macro operate up to a marker? I know if I do `5@a` my macro will operate on 5 lines. Example:               set marker with `mc`     record a macro with `qa`     ... now what?      Obviously `'c@a` just moves the cursor to the marker at c. I've tried buffers, `"b'c`, but that just goes to the marker. I'm probably missing something very basic or just looking in the wrong places.


What's the difference between tar.gz and tar.Z?

The downloads on this page, e.g. of NetCDF C/C++/Fortran 4.1.3, show `tar.Z` and `tar.gz` formats. The `tar.Z` doesn't even have a configure file in it. What is it used for?


What is the interaction of the rsync --size-only and --sparse options?

If I use `rsync` with the `\--size-only` and `\--sparse` options together, if a file already exists at the destination as a full file (otherwise the same) it's not overwritten. If I omit the `\--size-only` option, the non-sparse file is overwritten with the sparse version. I _do_ want the file to be overwritten and I want to keep the `\--size-only` option (unless I can be convinced that I don't). This is part of a script that gets run periodically. In the past, the `\--sparse` option was not used and a lot of space has been wasted. How can I continue to use `\--space-only` (and other options I haven't included here) and have the large files overwritten as the script does its work? A search-and-destroy mission would be too "expensive". I have tested this with `rsync` 3 in Ubuntu with ext3 and CentOS with ext4. The actual `rsync` is performed over an `ssh` connection. Note that in the following demonstration nothing changes about the source or destination files (size, times or contents) between runs of `rsync`. Demonstration:               $ dd if=/dev/zero of=sparse.out bs=1 seek=1M count=1     1+0 records in     1+0 records out     1 byte (1 B) copied, 0.000307332 s, 3.3 kB/s          $ stat sparse.out       File: `sparse.out'       Size: 1048577         Blocks: 16         IO Block: 4096   regular file     Device: 802h/2050d      Inode: 2377326     Links: 1     Access: (0644/-rw-r--r--)  Uid: ( 1000/  dennis)   Gid: ( 1000/  dennis)     Access: 2011-07-28 22:06:52.000000000 -0500     Modify: 2011-07-28 22:06:52.000000000 -0500     Change: 2011-07-28 22:06:52.000000000 -0500          $ du -h sparse.out     8.0K    sparse.out          $ rsync --size-only sparse.out sparse.out.rsync          $ stat sparse.out.rsync       File: `sparse.out.rsync'       Size: 1048577         Blocks: 2064       IO Block: 4096   regular file     Device: 802h/2050d      Inode: 2377329     Links: 1     Access: (0644/-rw-r--r--)  Uid: ( 1000/  dennis)   Gid: ( 1000/  dennis)     Access: 2011-07-28 22:09:19.000000000 -0500     Modify: 2011-07-28 22:09:20.000000000 -0500     Change: 2011-07-28 22:09:20.000000000 -0500          $ du -h sparse.out.rsync     1.1M    sparse.out.rsync          $ rsync --size-only --sparse sparse.out sparse.out.rsync          $ stat sparse.out.rsync       File: `sparse.out.rsync'       Size: 1048577         Blocks: 2064       IO Block: 4096   regular file     Device: 802h/2050d      Inode: 2377329     Links: 1     Access: (0644/-rw-r--r--)  Uid: ( 1000/  dennis)   Gid: ( 1000/  dennis)     Access: 2011-07-28 22:09:19.000000000 -0500     Modify: 2011-07-28 22:09:20.000000000 -0500     Change: 2011-07-28 22:09:20.000000000 -0500          $ du -h sparse.out.rsync     1.1M    sparse.out.rsync          $ rsync --sparse sparse.out sparse.out.rsync          $ stat sparse.out.rsync       File: `sparse.out.rsync'       Size: 1048577         Blocks: 16         IO Block: 4096   regular file     Device: 802h/2050d      Inode: 2377330     Links: 1     Access: (0644/-rw-r--r--)  Uid: ( 1000/  dennis)   Gid: ( 1000/  dennis)     Access: 2011-07-28 22:11:23.000000000 -0500     Modify: 2011-07-28 22:11:23.000000000 -0500     Change: 2011-07-28 22:11:23.000000000 -0500          $ du -h sparse.out.rsync     8.0K    sparse.out.rsync          $ stat -c '%b %B %o %s' sparse.out sparse.out.rsync     16 512 4096 1048577     16 512 4096 1048577          $ cmp sparse5.out sparse5.out.rsync     $