Desktop background appears black when using XFCE

I've installed Xfce4 on my laptop which runs Linux Mint 17 with Cinamon default desktop. Everything works OK and I customized my lightweight Xfce, like change menu location and desktop background that it is similar to my Cinamon desktop and used it for a while. Suddenly after last restart my desktop background becomes black and there is no option for desktop background change when I right click on desktop. I should mention that               xfdesktop &       didn't help, which tells it's already running. Some icons like **Computer** , **Home** and **Oracle VM** that was already there is showing, but my **Trash** or other icons did not. I've tried everywhere in               xfce4-settings-manager      but could not get my desktop background back running xfdesktop cause this message:               ** (xfdesktop:3068): WARNING **: xfdesktop: another desktop manager is running.      running               killall xfdesktop      results               xfdesktop: no process found      It seems to me another process takes place of xfdesktop I don't know how can I find and replace it


IP to Country console command

Is there a console command that takes an IP address as an input and shows its geographical information like city, country, ISP, etc.?


Is there a tool for summarizing what all commands do?

So I understand that there are `man` pages for getting the documentation when the internet is unavailable, or when you need advanced uses, but what if I'm offline and I don't even know what tool I need for the job? Is there a command that lets me see each program/command and a short description?


How can I use nested [] to replace a if-then-fi ? ("[: -f: binary operator expected")

In my .bashrc file I have:               if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion; fi      I wanted to use `[]` around it instead of `if then fi` I already have               [ -f ~/.bash_aliases ] && source ~/.bash_aliases     [ "${BASH_VERSINFO[0]}" -ge 4 ] && shopt -s autocd     [ -f ~/.git-completion.bash ] && source ~/.git-completion.bash      so I thought maybe I could use               [ [ -f /etc/bash_completion ] && [! shopt -oq posix] ] && . /etc/bash_completion      but I get               -bash: [: -f: binary operator expected


Paradox about a-z vs A-Z

I wrote a shell script to recognize the type of character               printf "Enter a character: "     read var     case "$var" in     [a-z])             echo "You entered a lower case alphabet."             ;;     [A-Z])             echo "You entered an upper case alphabet."             ;;     [0-9])             echo "You entered a digit."             ;;     ?)             echo "You entered a special simbol."             ;;     *)             echo "You entered more then one character."             ;;     esac      But if input letter is whether lower-case or upper-case the output is: > You entered a lower case alphabet. The output is correct if I write it this way:               printf "Enter a character: "     read var     case "$var" in     [A-Z])             echo "You entered a upper case alphabet."             ;;     [a-z])             echo "You entered an lower case alphabet."             ;;     [0-9])             echo "You entered a digit."             ;;     ?)             echo "You entered a special simbol."             ;;     *)             echo "You entered more then one character."             ;;     esac      Can't figure out why. The only logical answer is `[a-z]` includes lower-case and upper-case characters.


Regular expression find 3 or 4 numbers

So, I have 50+ words and I have to match the numbers in them. These numbers can be 3 or 4 digit numbers. I think I tried every way there is, but nothing seems to work (I need to remember the number as a pattern). My attempts:               '/\(.*\)\([0-9][0-9]?[0-9][0-9]\)\(.*\)/'     '/\(.*\)\([0-9]\{3,4\}\)\(.*\)/'     '/\(.*\)\(([0-9][0-9][0-9][0-9]|[0-9][0-9][0-9])\)\(.*\)/'     ...      It always matches only 3 numbers, or the whole word. **INPUT:**               1844-PAL.Bak      IMG_1959.bak       ZER_1940.BAK       PEN225.bak     word-1943.BAK      **NEED TO REMEMBER AS A PATTERN:**               1844     1959     1940     225     1943


How do I change my pacman root so that it downloads packages elsewhere?

My `/root` is full to the brim and I can't install new packages. My `/home` has 8 times the space of my `/root`, but pacman is set to install new packages on `/root`. Is there a safe way that I can change where pacman permanently installs new packages?


Crontab in Daylight Savings

This weekend with daylight savings, we had a situation that when the system clock hit 3:00am from the jump, we had hundreds of processes fire off out of the crontab. Everything I'm reading says that if you schedule processes during this time and you're running the system in the local timezone, then you may have scripts not run at all (since you skip over the 2:00 hour). However, in this situation, we had several processes spawn 50+ times out of the cron. Has anyone experienced why several processes would be executed so many times? Again, I've read that they may run twice, or not at all (depending on fall/spring), but 50+ times? If it helps, each script that ran was scheduled at the top of the hour of 3:00, and not again for at least an hour. Here are a few:               0  3  * * *     0 0-6 * * *


"NFS <server> not responding still trying" error timestamp

Sometime while my putty session is connected to server, it gets this NFS error. Note the server is Solaris 11 based.               NFS server <server> not responding still trying     NFS server <server> not responding still trying     NFS server <server> not responding still trying     NFS server <server> not responding still trying      . . After some tries it becomes ok.               NFS server <server> ok     NFS server <server> ok     NFS server <server> ok      Is there a way by which I can get to know the exact timestamp when this error occurs? I am quite new to Unix and could not find a way to get the timestamp. Regards Jim


Get running status of mongodb

Having a script where I start/stop various services depending on what I need. For example Apache, BIND, MySQL, PostFix, Memcached, Tomcat, ... and so on. Depending on status options to script etc. various actions are taken. For most this works fine: (example with Apache)               if service apache2 status >/dev/null; then         # ... do some action     fi      For others one have to use other tricks like `mysqladmin ping`. However I'm not able to find any good way to check status for `mongodb`.               service mongodb status      It has the same _"sickness"_ as MySQL and yield `mongodb stop/waiting` and also evaluates to true, even if service is not up and running. Have looked at `mongod`, `mongostat` etc. but not found any option for this. One way could be to use `ps` or perhaps better `netstat` and combine either with `grep` or the like, but wondering if there is a better (more native/targeted) way to check status. Could also grep for `stop/waiting`, but not sure how reliable this is, and guess it could likely break in a future upgrade.


GPU computation on Linux using open source kernel drivers

Assuming freedom to choose whichever currently available GPU is most suited for the job, is it currently feasible to do GPU computation (either CUDA or OpenCL) on Linux using one of the _open source_ GPU kernel drivers (i.e. not fgrlx or nvidia's binary driver)?


Wpa-supplicant overriding iwconfig

`Wpa-supplicant` is not clearing its settings when I disconnect, and is overriding `iwconfig` on my next connection. These settings are persisting even through reboot - the only way to get back online is to take wpa- supplicant out of the pipeline. I disconnect using a script which includes everything I could think of:               sudo dhcpcd --release "$INTERFACE"     sudo iwconfig "$INTERFACE" essid off     sudo iwconfig "$INTERFACE" ap off     sudo ifconfig "$INTERFACE" down      This worked well until I tried to integrate `wpa-supplicant` in it. My "connect" script includes these lines, which I thought would clear out any remaining settings:               sudo killall wpa_supplicant 2>/dev/null     sudo rm "/var/run/wpa_supplicant/$INTERFACE" 2>/dev/null     sudo killall dhcpcd 2>/dev/null     sudo rm "/var/lib/dhcpcd/$INTERFACE" 2>/dev/null      How do I "reset" `wpa-supplicant`? [edit] I tried               wpa_cli -i "$INTERFACE" reconfigure      but that gave me               Failed to connect to non-global ctrl_ifname: wlp2s3  error: No such file or directory


Can't find a way to customize Mutter under Elementary-OS

I just installed Elementary OS, even if it's still buggy and not even in beta version I am very satisfied of the look, but I would like to have some option to customize the effects and settings like I could do with Compiz but I couldn't find any settings panel related to Mutter! Is there any GUI utility I should install ?


VirtualBox with aMule - How to configure network, port forwarding... properly?

for security reasons I am running aMule inside VirtualBox.   * Guest and Host systems are Linux (to be more specific Arch 64 distro)   * Host system has public ip directly connected to internet (no router)   * Guest System I almost pure after installation (no iptables, etc only VirtualBox addons)   * I'd like to setup three ports for aMule: 4884, 4885, 4887   * I'd love to use NAT VirtualBox interface, if possible For this case I've made following forwarding rules:               VBoxManage modifyvm "$vm" --natpf1 "amule_u4,udp,,4884,,4884"     VBoxManage modifyvm "$vm" --natpf1 "amule_u5,udp,,4885,,4885"     VBoxManage modifyvm "$vm" --natpf1 "amule_u7,udp,,4887,,4887"     VBoxManage modifyvm "$vm" --natpf1 "amule_t4,tcp,,4884,,4884"     VBoxManage modifyvm "$vm" --natpf1 "amule_t5,tcp,,4885,,4885"     VBoxManage modifyvm "$vm" --natpf1 "amule_t7,tcp,,4887,,4887"      On Host I've added to `/etc/hosts.allow` :               # amule     4884: ALL     4885: ALL     4887: ALL      Sanity check made with `netcat` works:               netcat -l -p 4885 # inside VM     netcat $ip 4885  # from "outside world"      To ensure:               aMule standard TCP Port: 4884     UDP port for server requests (TCP+3): 4887     Extended UDP port (Kad/global search): 4885      But aMule gets only **"Low-ID"** and **"Kad: Firewalled"**. Is it possible to configure VM's Nat interface and aMule to cooperate nicely ? If yes, how ? If it is not possible, why? And how to do this other way?


Redirect requests to my external IP/port to an internal IP/port?

I have a dedicated server running KVM virtualization with n public IP addresses dedicated to n-1 web-facing virtual machines. Now I'd like to set up some web-facing VM's that don't have a dedicated address, but instead will have 2 or 3 ports forwarded for them from the host machine. Bridge configuration is:               brctl show      ![enter image description here](http://i.stack.imgur.com/Z9nf4.jpg) Let's say I would like to forward   * 178.126.193.153:201 to 192.168.1.101:22   * 178.126.193.153:801 to 192.168.1.101:80 First, I have enabled port forwarding on a host machine by uncommenting               # net.ipv4.ip_forward=1      in `/etc/sysctl.conf`, then I did               sysctl -p /etc/sysctl.conf     service network restart      Then, similar to the recipe in this question, I did:               iptables -t nat -A PREROUTING -p tcp -i br0 --dport 201 -j DNAT --to-destination 192.168.1.101:22     iptables -A FORWARD -p tcp -d 192.168.1.101 --dport 201 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT     iptables -t nat -A PREROUTING -p tcp -i br0 --dport 801 -j DNAT --to-destination 192.168.1.101:80     iptables -A FORWARD -p tcp -d 192.168.1.101 --dport 801 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT      I ran `ifconfig` on a guest machine and checked that its interface eth0, indeed, has the IP address 192.168.1.101. The interface inside of virtual machine is called `eth0`, is this right? But it doesn't work: `nmap 178.126.193.153` doesn't show an open port 201 nor 801, and `ssh -l root -p 201 178.126.193.153` gets me               ssh: connect to host 178.126.193.153 port 201: Connection refused      `ip route` on a host machine returns               178.126.193.128/26 dev br0  proto kernel  scope link  src 178.162.193.153      192.168.122.0/24 dev virbr0  proto kernel  scope link  src 192.168.122.1      169.254.0.0/16 dev br0  scope link  metric 1004      default via 178.126.193.190 dev br0       What am I doing wrong?


How to undo `set -x`?

I typed `set -x` in terminal. Now the terminal keeps printing the last command run on top of my output so the command               ~]$echo "this is what I see"      returns               + echo 'this is what I see'     this is what I see      There is no man page for `set`, how do I turn `set -x` off?


Nvidia 9800GT and HP w1907v resolution woes

I was happily dual-booting Windows 7 and Ubuntu 10.10 a year or two ago, with, as in the title, an Nvidia GeForce 9800 GT graphics card (on a Gigabyte GA- MA790XT-UD4P) outputting VGA to an HP w1907v monitor (1440x900). I then put my PC in storage for a month or so, all peripherals disconnected, and when I reassembled it and booted it up again, both Windows and Linux failed to allow me to use a 1440x900 resolution. I managed to fix Windows, though I don't remember how - it was all within the regular graphics interface as far as I remember, maybe installing updated drivers. However, to this day I've not been able to make Linux recognise resolutions larger than 1024x768. I went through several versions of Ubuntu and many different guides, played with my `xorg.conf` file, and most recently installed Fedora 17, with the same results - no resolutions greater than 1024x768. I followed this guide in particular to install Nvidia drivers, but no luck. I then tried installing the drivers from Nvidia's website (it was necessary to stop X using `init 3`, install the drivers, then `startx`), but the only outcome of that was removing all options except 640x480. After playing around with drivers for so long, I'm beginning to wonder if the problem isn't with the video card/drivers, but with the monitor. To that end, I have a few questions:   1. Are there known issues with Nvidia drivers in Linux, especially for the 9800 GT? I've seen comments indicating varying levels of success with any guide I've tried.   2. Would I see better support for a different series of Nvidia card, or an AMD card? (I've been thinking of upgrading.)   3. Could this sort of issue be caused by the monitor, and not a fault with the graphics card?   4. Might the monitor need drivers of its own? Thanks for anything you can tell me! I really want to be Linux-ing it up, and I'm coming to a point where I really need it for university and non-university work, but I just can't seem to deal with this issue. EDIT: Contents of /var/log/Xorg.0.log `xrandr` output:               xrandr: Failed to get size of gamma for output default     Screen 0: minimum 320 x 240, current 640 x 480, maximum 640 x 480     default connected 640x480+0+0 0mm x 0mm        640x480        50.0*         320x240        51.0


machine hardware name, processor type and hardware platform

The followings are the machine hardware names, processor types and hardware platforms returned by `uname`: on a server (with some 64-bit Linux distribution)               -bash-4.1$ uname -m     x86_64     -bash-4.1$ uname -p     x86_64     -bash-4.1$ uname -i     x86_64      on my laptop (Thinkpad T400 with 32-bit Ubuntu 12.04)               $ uname -m     i686     $ uname -p     i686     $ uname -i     i386      I wonder if machine hardware name and processor type are always the same thing? What is hardware platform? Why does it seem to indicate something about the OS? Thanks!


How to change desktop enviroment in Raspbian?

I'm running Raspbian “wheezy”, a Debian based Linux distribution for the Raspberry Pi and I would like to know where I can change the desktop environment that boots with the OS. In particular, how can I replace LXDE with an custom QT or Java program? Could you please point me in the right direction? Thank you.


Why can't anonymous users delete files via ftp?

I've created a new directory "uploads" in `/var/ftp`. The owner and group of this directory is "ftp" and the permissions are set to 777. Content of my `vsftpd.conf` file:               anonymous_enable=YES          local_enable=YES         write_enable=YES         local_umask=022          anon_upload_enable=YES         anon_mkdir_write_enable=YES          xferlog_enable=YES         xferlog_file=/var/log/xferlog         xferlog_std_format=YES          nopriv_user=ftpsecure          ascii_upload_enable=YES     ascii_download_enable=YES          listen=YES          pam_service_name=vsftpd     userlist_enable=YES     tcp_wrappers=YES      SELINUX permissions are:               allow_ftpd_anon_write --> on     allow_ftpd_full_access --> on      I can upload files to the directory, but can't delete files through FTP. Can anyone suggest me what to do?


Un-mount active partition

Is it possible to umount the partition, whose files/directories are in use? **The underlying files and directories are in memory so un-mounting the partition is technically safe (I guess).** But `umount` is not allowing me to un-mount it. (Who is denying this operation: umount or kernel?)


Why do I need the double dash before argument passed to sh by xargs -I for it to work properly?

Sorry for the mouthful title. Here is the command in question                find . -name "*.txt" | xargs -Ifile sh -c 'echo $(basename $1) ' -- file      So without the double dash the `file` is not passed to `sh` and then get recognized as `$1`. Why is that? I know that `--` prevents the consequent argument from being recognized as command line options. But since `file` is not prepended with a dash, it seems as though there is no reason for it to get recognized as a command line option.


Add file to deep inside a zip file

Say I want to add the file `file.txt` to `foo.zip`, I could just do `zip -u foo.zip file.txt`. However inside the zip-file there already exist a folder with the path `foo.zip/very/many/paths/` (relatively to the zip-file). How would I add `file.txt` to the zip-file so it's location inside the zip- file would be `foo.zip/very/many/paths/file.txt`? I could create the directory structure needed first, but isn't there an easier way? I would normally do it like this:               $ ls     file.txt     foo.zip     $ mkdir very     $ mkdir very/many     $ mkdir very/many/paths     $ cp file.txt very/many/paths     $ zip -u foo.zip very/many/paths/file.txt     $ rm -rf very


Write a script to create users with pre-defined passwords

I need a simple script. One file named `userID` consists of 10 unixID and another file with name `passwd` consists of 10 password for those 10 unixID in file `userID`. The first word of each file represents unixID and the corresponding passwd for that unixID. I think it would need to execute two for loop or something to assign password for that specific userID Does anyone have any suggestions?


Directory size as reported by stat on NTFS

We all have seen gazillions of directory size reports from ls or stat. We know they don't mean real size of the content, but they do have meaning, but since the meaning is not very useful for normal situations, we learned to ignore them. (And it's so often 4,0K that it's actually easy to learn to ignore them _visually_.) Now I just `ll` a directory on my NTFS volume and I see:   * couple of "4,0K" folders   * a just-created folder with a bunch of Unicode-named files, showing "664   * on old folder showing zero, while still having subdirectories So I wonder: How directory size works with Linux and ntfs-3g? How does stat or kernel count it? How do records added to the directory influence this number?


Using setuid Properly

I've been scared too much by the warning about setuid. However I cannot find a way around using it. I want to be able to run: `arp -s 198.51.100.1 00:53:00:12:34:56` as the user `steven` but arp -s requires root. Would this be the correct way to do it?               sudo nano example.sh     sudo chmod u+s example.sh     sudo chmod og-w example.sh     sudo chmod o+x example.sh     ./example.sh


Copying a file on a JFS filesystem, does not follow ACL guidelines

I have a JFS filesystem               /dev/md2 on /mnt/hd2 type jfs (rw)      to which I'm trying to copy some folders into target folder `/mnt/hd2/videos/movies/`. NOTE: I'm actually not using this target folder directly, but a symbolic link in my home folder that points to the target folder. Now, the folder `/mnt/hd2/videos/movies/` has default group ACL enabled:               nass@stargaze:/mnt/hd2/videos$ getfacl Movies/     # file: Movies/     # owner: nass     # group: shares     # flags: -s-     user::rwx     group::rwx     other::r-x     default:user::rwx     default:group::rwx     default:group:shares:rwx     default:mask::rwx     default:other::r-x      I copied the folders from a temporary folder and expected to get the group write permission to be set as well, instead the folder looks like this:               drwxr-sr-x+ 2 nass shares        24 Aug  6 01:12 The_Movie/      I had set ACLs on the "videos" folder initially, and all the sub-folders have inherited the default from that top folder. What have I missed? EDIT: JFS ACL support is indeed compiled in the kernel. EDIT2: getfacl on `The_Movie/` looks like               nass@stargaze:/mnt/hd2/videos/Movies$ getfacl The_Movie/     # file: The_Movie/     # owner: nass     # group: shares     # flags: -s-     user::rwx     group::rwx                      #effective:r-x     group:shares:rwx                #effective:r-x     mask::r-x     other::r-x     default:user::rwx     default:group::rwx     default:group:shares:rwx     default:mask::rwx     default:other::r-x      the source folder is on another jfs disk. the folder was transferred to that source location through a cifs share and, i think it was given initial permissions 755.


How to colorize output of git?

Is there a way to color output for git (or any command)? Consider:               baller@Laptop:~/rails/spunky-monkey$ git status     # On branch new-message-types     # Changes not staged for commit:     #   (use "git add <file>..." to update what will be committed)     #   (use "git checkout -- <file>..." to discard changes in working directory)     #     #       modified:   app/models/message_type.rb     #     no changes added to commit (use "git add" and/or "git commit -a")     baller@Laptop:~/rails/spunky-monkey$ git add app/models      And               baller@Laptop:~/rails/spunky-monkey$ git status     # On branch new-message-types     # Changes to be committed:     #   (use "git reset HEAD <file>..." to unstage)     #     #       modified:   app/models/message_type.rb     #      The output looks the same, but the information is totally different: the file has gone from unstaged to staged for commit. Is there a way to colorize the output? For example, files that are unstaged are red, staged are green? Or even `Changes not staged for commit:` to red and `# Changes to be committed:` to green? Working in Ubuntu. EDIT: Googling found this answer which works great: `git config --global --add color.ui true`. However, is there any more general solution for adding color to a command output?


How do I keep KDE from asking new users for a password when I use /etc/skel to set up their enviroment?

I made this nice custom KDE setup on Arch Linux with customised settings like desktop background, panel settings, kwin settings, etc. I heard that if you copy all the hidden files from your `/home/"dummy user"/` to `/etc/skel` it would copy my settings exactly the way they are from "dummy user" to all newly created users created after this procedure. I got what I wanted, which is copying my desktop interface to all newly created users on the system. But it keeps giving me all these password windows saying I need permission from "dummy user" to use certain files and apps like Nepomuk. How do I get these prompts to go away so the next user I make doesn't see them? or what files do i stay away from to avoid hitting user spesific data.


chown not permitted, but I have write access. How can I take recursive ownership?

Consider the following scenario:   1. I have `rwx` access to a directory as a member of the group id of the directory.    2. The system admin does not let users run `chown` (see this thread for details) **How can I take recursive ownership of the directory?** I believe I can do the following, assuming that I want to own `A`               cp -R A B     rm -R A     mv B A      but this is tedious and can require a large amount of space if `A` is large.


Automatically open a remote desktop connection upon login

I have installed Linux Mint to one of my desktop PCs. I have downloaded and installed Freerdp-x11 for me to connect into my Windows Terminal Server. I want the terminal command line to connect automatically to the Windows terminal server, so that every time I boot my Linux Mint PC, I wouldn't have to keep typing `xfreerdp 000.000.0.000` on the terminal command line. Is there a script for it?


How can I convert a PNG to a PDF in high quality so it's not blurry or fuzzy?

There are a lot of questions out there about how to convert a PDF file to a PNG image, but I'm looking to take a nice sharp PNG file and just basically wrap it or embed it in a PDF file without having it look blurry or fuzzy. I realize with imagemagic installed I can do a simple conversion like:               convert sample.png sample.pdf      I've also tried a lot of the switches to set the depth, and also the quality setting:               convert -quality 100 sample.png sample.pdf      However the PDF still comes out looking blurry / fuzzy. Here's a sample image: ![](http://img406.imageshack.us/img406/6461/picture3mu.png) As a png it's crisp and clean. When I convert it to a PDF, even at the same size it looks blurry: ![Picture 4.png](http://img803.imageshack.us/img803/9969/picture4at.png) How can I convert PNG to a PDF in high quality?


How to extend CentOS 5 partition on VMware?

I have a CentOS 5 virtual machine and I added 20GB more to disk size. How do I initialize and extend the available space? I'm new to Linux, so what should I do? I tried loading GParted as well, but the drive is locked; how do I unlock it? ![enter image description here](http://i.stack.imgur.com/vB3og.jpg) ![enter image description here](http://i.stack.imgur.com/u5bfi.jpg)


How to install subversion 1.6.x on SLE11?

I need specific version of subversion 1.6.x on my SLE11 (SUSE Linux Enterprise Server 11 (x86_64)) but I do not know how to install it. If I follow the instructions on http://software.opensuse.org/download.html?project=devel:tools:scm:svn&package=subversion I get subversion 1.7.x installed.


Arch Linux netinstall - conflicting packages on install

I'm using the latest Arch Netinstall image. I just went through and selected about 150 packages to download and install. However, when I get to the "Install Packges" step, I get an error saying that I have two conflicting packages (openjdk6 and jre7-openjdk) and the install fails and sends me back to the menu. The problem is, I don't know how to remove the conflicting package from my install list. If I go back to the list of packages, it erases the selections I made previously and I have to reselect each package all over again (I've done it twice already, no fun). Is there a way to omit a package without having to reselect all of them?


How do I make a shell script that sends output to a process

I'm currently running a server console program in a screen because I need to both read it and occasionally send commands. I'd like to run the app as a deamon in the background (start/stop it with init). I could tail -f the log, but that won't let me send input to the process. Is there any way to set this up so I can both read and send input, but still have it running in the background? I'd also like to be able to send input to the deamon from different processes as well (a shell script that could send a "Stop\n" command, for instance)


Bundle my scripts to make an installer in Unix?

We've got a PHP script running MongoDB in the background. I want to make it a bundle (Installer) for Unix. I will use it to install the following on any machines:   1. Install Apache, PHP + MongoDB    2. Setup the PHP + MongoDB project Can anyone direct me to an appropriate resources to achieve this? What are your suggestions? What is the best solution if you want to deploy a package to a client?


How do I install drivers for AR9271 on Centos 6?

I'm trying to get a USB wireless card that runs off of the AR9271 chipset to work with Centos 6.2. I read this description for compat-wireless and wanted to use a package manager (i.e. yum) because I wanted a relatively easy uninstall if it didn't work. I found a package on ELRepo. I installed kmod-compat-wireless.i686 via `yum install` as root. After rebooting and sticking the USB wireless card in, I didn't see anything that indicated that wireless was working. What should I be looking for? How can I make sure that this driver is loaded?


How to find the cause of an ssh-scan exploit?

One customer emailed my about their provider about to shut down a server because ssh attacks. I logged in to the server and found a lot of ssh-scan processes, and some strange files in /tmp. I had to shut it down, since I didn't know what to do. Before rebuilding the server, is there a way I can find out how this happened in order to prevent it from happening again?


Solaris: how to forward cron e-mails?

If a **cron** job produces output it is e-mailed to the user's account. I would like to redirect this e-mail to another e-mail account. Preferably on a user-by-user basis. I've looked into some options that are often mentioned in other postings:   1. Using the cron `MAILTO` variable. Won't work. That one is not supported on Solaris. It is a Linux thing, potentially also a BSD thing, but certainly doesn't exist on Solaris.   2. Using the `~/.forward` file. Can't make that work. I suspect it is because this file is really related to `sendmail` universe and I'm not sure Solaris cron actually uses `sendmail` to send its e-mails. To get to the bottom of this I guess I need to understand exactly by which mechanism Solaris cron sends e-mails. Anyone ?


Linux: create list of text with multiple operators

I want to make a list like this:               7785237_770x770_de3b540dc13ed50023d17854513b40aa07e50a6a     732308_770x770_ec5c344c0114011a5306b31142ff9b001813f6d6     7430796_800x800_ec0f2e614e2dc460fca7e626d83073c827dc9130     7431018_800x800_7caa40b85c21485c64f2ad509a0d9cc1ed3ba526      So to explain: First block before the first "_" is just a number between 0 and 9500000 - second block varies between two variables: "770x770" and "800x800"   Last block is a 40 character long HEX block. So what I want to do, is to generate all possible combinations of these, and combine it into one line. How do I do this? Don't know if it can be done in BASH, or it should be done in perl/something similar.


apt-get purge does not uninstall completely

I have installed emacs with `apt-get`. I tried to remove it later on, but the binary is left.               root@ionian:/home/gauthier# apt-get --purge remove emacs     Reading package lists... Done     Building dependency tree            Reading state information... Done     Package 'emacs' is not installed, so not removed     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     root@ionian:/home/gauthier# which emacs     /usr/bin/emacs     root@ionian:/home/gauthier#       (the purge shown above is not the first attempt, this is just to show that the package was already removed.) emacs was not installed before I did `apt-get install emacs`. Any idea what is going on? Why doesn't apt-get see the binary, why does it think emacs is already uninstalled? What would have been a clean way to uninstall emacs completely?


How does one atomically change a symlink to a directory in busybox?

I am trying to (as close as possibly) atomically change a symlink. I've tried:               ln -sf other_dir existing_symlink      That just put the new symlink in the directory that existing_symlink pointed to.               ln -sf other_dir new_symlink     mv -f new_symlink existing_symlink      That did the same thing: it moved the symlink into the directory.               cp -s other_dir existing_symlink      It refuses because it's a directory. I've read that `mv -T` is was made for this, but busybox doesn't have the `-T` flag.


Buffers or tabs in vim? What are advantages/disadvantages of each approach?

I'm used to _modeless_ editors. Only the past year I've been using vim/gvim, which has a _modal_ approach. I'm used to tabs in all editors, since before vim all of them are used to it. In gvim, you don't necessarily need to use tabs: you can just use buffers. My question is: what are the advantages/disadvantages between these two approaches (buffers vs tabs)? Why do these both options exist?


How can I solve wifi connection problems between Arch Linux and a WPA2 network?

My home network uses WPA2 for encryption. To connect to it from my Arch Linux insallation, I first tried using NetworkManager, however, that only managed to connect for a minute at most before dropping the connection. I replaced it with wicd, which worked satisfactorily until somewhat recently. Since then, if it fails to establish the connection at startup, or if it loses connection, it will be unable to establish a connection. Attempting to reconnect with the GUI slows the system down so much that I have to switch from X to a tty and kill the process. The curses interface is unable to establish a connection in these circumstances, but doesn't impair system performance. Restarting the daemon is not enough to fix it from the bugged state. I need to power the system off and on again. The windows installation on the same laptop does suffer some intermittent connectivity problems (it's a crappy ISP router powering the network), but recovers from them, only requiring reconnecting to the network. Prior to using Arch Linux, I used to use Ubuntu as the Linux distro on the laptop, and that had the same results as Windows. What could be causing this problem (which I suspect may be related to the earlier NetworkManager problem), and how can I resolve it? For what it's worth, my wireless network card is a broadcom BCM4312, and it is using the b43 drivers. **EDIT** : Attempting to run wpa_supplicant while wicd is unable to connect produces this output: > ioctl[SIOCSIWSCAN]: Device or resource busy   >  Failed to initiate AP scan.   >  ioctl[SIOCSIWSCAN]: Device or resource busy   >  Failed to initiate AP scan.   >  No network configuration found for the current AP   >  CTRL-EVENT-DISCONNECTED bssid=00:00:00:00:00:00 reason=0   >  ioctl[SIOCSIWSCAN]: Device or resource busy   >  Failed to initiate AP scan. **Further edit** : The problem is significantly more likely to occur when the system is running on battery power, but can still occur while it is plugged in. **EDIT 3** : This is almost certainly related to power saving options. Paying more attention, this always occurs when either the system is running on battery power, when it has been left alone for a significant period of time, or when the lid is closed.


What is the purpose of patches of the linux kernel?

For each Linux kernel version, there is a patch file available for download. For instance, _linux-3.12.22_ has a corresponding _patch-3.12.22_. What is the purpose of that patch? To always patch the corresponding kernel before compiling it, or to bring a former kernel version up-to-date with the kernel that the patch matches (3.12.22, in this case)?


Multiple X sessions with VNC

I have two separate X Sessions.   * One is unity Ubuntu Desktop   * The Second one is XBMC. I use the built-in remote desktop sharing `vino` of ubuntu for VNC. When the Ubuntu Desktop is up on the server screen, the VNC works perfectly. But when the second XBMC is up on the server screen `CTRL`+`ALT`+`F8`, the VNC shows a Blank screen and not the ubuntu desktop. what is the problem?


Why is there no graphical.target listed by "systemctl list-units --type=target"?

According to Fedora documentation, graphical.target is the default. And,               # systemctl list-units --type=target      will list all available targets. However, the command above outputs as follows without graphical.target:               [root@host ~]# systemctl list-units --type=target     UNIT                LOAD   ACTIVE SUB    DESCRIPTION     basic.target        loaded active active Basic System     cryptsetup.target   loaded active active Encrypted Volumes     getty.target        loaded active active Login Prompts     UNIT                LOAD   ACTIVE SUB    DESCRIPTION     basic.target        loaded active active Basic System     cryptsetup.target   loaded active active Encrypted Volumes     getty.target        loaded active active Login Prompts     UNIT                LOAD   ACTIVE SUB    DESCRIPTION     basic.target        loaded active active Basic System     cryptsetup.target   loaded active active Encrypted Volumes     getty.target        loaded active active Login Prompts     local-fs-pre.target loaded active active Local File Systems (Pre)     local-fs.target     loaded active active Local File Systems     multi-user.target   loaded active active Multi-User System     network.target      loaded active active Network     nfs.target          loaded active active Network File System Server     paths.target        loaded active active Paths     remote-fs.target    loaded active active Remote File Systems     slices.target       loaded active active Slices     sockets.target      loaded active active Sockets     swap.target         loaded active active Swap     sysinit.target      loaded active active System Initialization     timers.target       loaded active active Timers          LOAD   = Reflects whether the unit definition was properly loaded.     ACTIVE = The high-level unit activation state, i.e. generalization of SUB.      My Linux distro is Fedora 20 KDE spin. I run the command under an X terminal, that is to say, I am already in a graphical environment.


Is it possible to support multiple processes without support for Virtual memory?

Is it possible to support multiple processes without support for virtual memory? I would like to know more about it if so.


I know that Linux OS's are typically multi-programmed, which means that multiple processes can be active at the same time. Can there be multiple kernels executing at the same time?


block specific user to send mail

I am using `sendmail` in RHEL 5. I have three mail accounts for the users jack, bob and alice. I want to make sure that user bob can send mail to alice but jack can't send mail to alice. But user jack can send mail to bob. How can i do this?


How to add an item to the Applications menu?

How can I add an application to _Applications > Internet_ in Gnome Desktop running on CentOS 6.4? Per this old Docs link, it suggests to edit `/etc/xdg/menus/applications.menu`. How can I add `/home/danny/some/path/myprog/prog` (executable) to my Gnome Applications menu?


linux + lib/ld-linux.so.2: bad ELF interpreter + cisco VPN client

I have Linux red-hat machine - kernel 2.6.32 64 BIT I installed the Cisco VPNC client on my Linux machine according to the instruction in the following site: http://wiki.deimos.fr/Cisco_VPN_Client_:_Installation_sur_une_Red_Hat_6 Installation ended without error except single warning about WARNING: could not find /etc/opt/vpnclient/.libdriver64.so.cmd for /etc/opt/vpnclient/libdriver64.so finally installation ended and I run the vpnclient connect ... ( with the following errors )                   bash: ./vpnclient: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory      please advice how to solve the problem what is missing here?   * short details about my installation: first I download the --> vpnclient-linux-x86_64-4.8.02.0030-k9.tar.gz                  tar -xzvf vpnclient-linux-x86_64-4.8.02.0030-k9.tar.gz        cd vpnclient       .                patch < vpnclient-linux-4.8.02-64bit.patch       patch < vpnclient-linux-2.6.31-final.diff       .                 sed -i 's/^CFLAGS/EXTRA_CFLAGS/' Makefile       sed -i 's/const\ struct\ net_device_ops\ \*netdev_ops;/struct\ net_device_ops\ \*netdev_ops;/' `find /usr/src -name netdevice.h`       .               ./vpn_install      .                vpnclient connect .....              bash: ./vpnclient: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory


Setting up init.d service daemon priority (with or without monit)

Does anyone know how to change the process priority with monit? I want a high one. Monit config file for my service so far:               check process RPiQuadroServer pidfile /var/run/RPiQuadroServer.pid       start program = "/etc/init.d/RPiQuadroServer.sh start"       stop program = "/etc/init.d/RPiQuadroServer.sh stop"       Daemon:               #!/bin/bash          ### BEGIN INIT INFO     # Provides:          RPiQuadroServer     # Required-Start:    $remote_fs $syslog     # Required-Stop:     $remote_fs $syslog     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: Put a short description of the service here     # Description:       Put a long description of the service here     ### END INIT INFO          WORK_DIR="/var/lib/RPiQuadroServer"     DAEMON="/usr/bin/python"     ARGS="/usr/local/bin/RPiQuadroServer.py"     PIDFILE="/var/run/RPiQuadroServer.pid"     USER="root"          . /lib/lsb/init-functions          do_start() {       log_daemon_msg "Starting system $DAEMON $ARGS daemon"       mkdir -p "$WORK_DIR"       /sbin/start-stop-daemon --start --pidfile $PIDFILE \         --user $USER --group $USER \         -b --make-pidfile \         --chuid $USER \         --exec $DAEMON $ARGS       log_end_msg $?     }          do_stop() {       log_daemon_msg "Stopping system $DAEMON $ARGS daemon"       /sbin/start-stop-daemon --stop --pidfile $PIDFILE --verbose       log_end_msg $?     }          case "$1" in       start)         do_start         ;;       stop)         log_daemon_msg "Stopping system $DAEMON $ARGS daemon"         do_stop         ;;       restart|reload|force-reload)         do_stop         do_start         ;;       status)         status_of_proc "$DAEMON $ARGS" "$DAEMON $ARGS" && exit 0 || exit $?         ;;       *)         echo "Usage: /etc/init.d/$USER {start|stop|restart|status}"         exit 1         ;;     esac


Deciphering sed commands

I just run across the following `sed` command:               sed "s|^/samba|\\|;s|/|\\|g"      I have seen `sed` substitute commands before. I also know sed allows the usage of any character as a delimeter (`|` in this case) and that `g` means global substitution. However, I am not sure what the rest of the command does. Perhaps more generally, how can I **quickly** find information on what a `sed` pattern like the one above does? (other than obviously reading the documentation, which is always recommended)


How to get CPU Percentage as a Counter?

I would like to monitor total CPU utilization percentage as a counter. The reason I would like it as a counter is that data won't be lost between samples (and I can have the graphing side calculate the rate). My initial approach was to use `/proc/uptime` with the formula `(uptime-(idle_time/num_core))*100`. This generally seems to be accurate across a large number of servers (something like 98% of the time), but sometimes I seem to get erroneous results. For example the following seems to suggest that there was negative CPU usage, which doesn't really make sense:               [root@ny-lb05 ~]# echo -e "scale=10\n ($(cut -f1 -d' ' /proc/uptime)-($(cut -f2 -d' ' /proc/uptime)/16))*100" | bc     5646895.3750000000     [root@ny-lb05 ~]# echo -e "scale=10\n ($(cut -f1 -d' ' /proc/uptime)-($(cut -f2 -d' ' /proc/uptime)/16))*100" | bc     5646891.5625000000      On this server I'm running: `Linux ny-lb05.ds.stackexchange.com 2.6.32-431.11.2.el6.x86_64 #1 SMP Tue Mar 25 19:59:55 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux` Does someone see an error in this method of calculation? Is there a better way to get CPU utilization as a counter? **Update:**   So what I'm after is the total utilization time as a monotonically increasing counter. I would expect that total utilization should never _decrease_. But that seems to be the case with the following: ` [root@ny-lb05 ~]# read uptime idle </proc/uptime; echo -e "scale=1000\n ($uptime*16-($idle))" | bc 903874.23 [root@ny-lb05 ~]# read uptime idle </proc/uptime; echo -e "scale=1000\n ($uptime*16-($idle))" | bc 903870.29 ` Also, according to /proc/cpuinfo, cores=siblings so I believe HT is not enabled. **Update 2:**   TLDR; /proc/uptime is bugged, use /proc/stat instead.


How to make a bitmap font for *nix environments?

I have been softy on windows as a font tool to make a bitmap font, it's essentially a modified version of profont I keep using, mostly because the original version is not perfect to me. I also made a proportional narrower version of profont, which I find extremely readable. I want to do the same for my Mac and I also want it to work on any *nix, so I'm opting for a way to make it work for *nix first. I can't understand why fontforge only allows you to make vectorized fonts, I want to make it pixel by pixel...


Using qemu to boot OpenSUSE (or any other OS) with custom kernel

I want to run OpenSUSE as guest with a custom kernel image which is on my host machine. I'm trying:               $ qemu-system-x86_64 -hda opensuse.img -m 512 -kernel \         ~/kernel/linux-git/arch/x86_64/boot/bzImage -initrd \         ~/kernel/linux-git/arch/x86_64/boot/initrd.img -boot c      But it boots into BusyBox instead. Using `uname -a` shows `Linux (none)`. How do I tell the kernel image to boot with OpenSUSE? I have OpenSUSE installed into`opensuse.img`, and:               $ qemu-system-x86_64 -hda opensuse.img -m 512 -boot c       boots it with the stock kernel.


Behavior of ping with partial packet loss on Ubuntu

I am specifically looking on the return variables of running ping on my Ubuntu server, the variables I am looking for is: error status, output on stdout, output on stderr. When pinging a host the following three scenarios can happen:   1. The host answers on ALL packets (No error)   2. The host answers on ZERO packets (Error)   3. The host answers on SOME packets (Unspecified behavior) I have read through `man ping`, a couple of times and can't seem to find what I should expect in that situation. I have no way to test this, the only machines I have access to is a Linode virtual server running Ubuntu, and my Macbook running Snow Leopard (Probably not with the same PING program as my server) What should I expect as return variables from the third scenario?


How to start graphical interface before login?

I've installed Oracle Linux 6.4 (x86_64) on a server as a database server, the packages installed by default didn't include the graphical interface. Following this article, I installed the referred packages and thereafter I could launch the graphical interface using `startx` **after** login. Can I make the server start the graphical server before login and actually login using a graphical greeter (if the term was correct!), or I have to log in first then `startx` after (automatically or manually)?


Preventing deletion of system/shell aliased folders

Is there a way to prevent deletion of system/shell aliased folders? I want these commands to fail. My shell is bash. Such as:               $rm -rf .     $rm -rf ..     $rm -rf ~     $rm -rf *


Running a Script as Soon as a Network Interface is Detected as Active

I was just wondering if it was possible to run a script as soon as a test to see if a network interface is up (like a `ping` or something)? I think it would be pretty awesome to update my `yum` when I login, but I want to make sure that I have internet access first. Any ideas?


Permissions of webserver's root directory

I've had this issue on several setups, and I'm unsure of how to handle it. At first, all of `/var` is owned by `root:root`. Clearly I don't want the web directory to be owned by root, so I do `chown apache:apache /var/www`. However, when someone is `ssh`'d in as root, if they do something like an `svn update` or edit a file, it's going to change the ownership back to root. Is there any way to fix this? I've heard of using something with suPhp, but I'm unsure if it's necessary.


Duplicity and GPG: charset conversion

I'm using duplicity on OS X Mavericks. If I run my duplicity command, I get the following error:               ===== Begin GnuPG log =====     gpg: conversion from `US-ASCII' to `utf-8' failed: Illegal byte sequence     gpg: “0DB243EE”: skipped: public key not found     gpg: [stdin]: encryption failed: public key not found     ===== End GnuPG log =====      The strange thing is that the backup command worked until recently. How can I fix this?


Screen - inherit current window's environment

In GNU Screen, how can I create a new window whose shell inherits the environment of the shell in the current window? The usual `Ctrl`+`A` `C` doesn't seem to do this.


Cron task in graphic interface

I need to open one (or more) browser tab periodically and I decided to use cron. The command in the shell (bash) that correctly executes this task is `chromium-browser http://mysite.com`. If I type it, the browser opens the site in a tab. But the same command inserted as a task in the crontable doesn't work. If I redirect the output of other simple commands in the crontable in a file they work correctly, say               echo "hello world" > /home/user/file      So, shall I redirect the output of the command `chromium-browser http://mysite.com` to my graphic interface? If yes, which would be the device?


iKVM: return to graphic mode

In iKVM (Supermicro) I have switched to text console mode using `<Ctrl>+<Alt>+<F1>`. How I can switch again to graphic mode? (the same keyshortcut pressing again doesn't do anything).


Script to find files with a specific extension but NOT containing specific text

I am trying to write a script that basically searches recursively using find (or another method to) to find all files ending with *.p or *.w but does not contain sysvars.i or preprocess.i I am new to scripting and welcome any help, is find the best command to use etc?


xorg.conf XkbOption ignored for terminate:ctrl_alt_bksp to restart X

I want Ctrl+Alt+Bksp to restart X, so I created an xorg.conf rule: /usr/share/X11/xorg.conf.d/53-zap.conf:               Section "ServerFlags"         Option "DontZap" "false"     EndSection          Section "InputClass"         Identifier      "Keyboard Defaults"         MatchIsKeyboard "yes"         Option          "XkbOptions" "terminate:ctrl_alt_bksp"     EndSection      And checking /var/log/Xorg.0.log:               [  1023.598] (II) XINPUT: Adding extended input device "Asus WMI hotkeys" (type: KEYBOARD, id 11)     [  1023.598] (**) Option "xkb_rules" "evdev"     [  1023.598] (**) Option "xkb_model" "pc105"     [  1023.598] (**) Option "xkb_layout" "us"     [  1023.598] (**) Option "xkb_options" "terminate:ctrl_alt_bksp"     [  1023.598] (II) config/udev: Adding input device AT Translated Set 2 keyboard (/dev/input/event3)     [  1023.598] (**) AT Translated Set 2 keyboard: Applying InputClass "evdev keyboard catchall"     [  1023.598] (**) AT Translated Set 2 keyboard: Applying InputClass "Keyboard Defaults"     [  1023.598] (II) Using input driver 'evdev' for 'AT Translated Set 2 keyboard'     [  1023.598] (**) AT Translated Set 2 keyboard: always reports core events     [  1023.598] (**) evdev: AT Translated Set 2 keyboard: Device: "/dev/input/event3"     [  1023.598] (--) evdev: AT Translated Set 2 keyboard: Vendor 0x1 Product 0x1     [  1023.598] (--) evdev: AT Translated Set 2 keyboard: Found keys     [  1023.598] (II) evdev: AT Translated Set 2 keyboard: Configuring as keyboard     [  1023.598] (**) Option "config_info" "udev:/sys/devices/platform/i8042/serio0/input/input3/event3"     [  1023.598] (II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD, id      12)     [  1023.598] (**) Option "xkb_rules" "evdev"     [  1023.598] (**) Option "xkb_model" "pc105"     [  1023.598] (**) Option "xkb_layout" "us"     [  1023.598] (**) Option "xkb_options" "terminate:ctrl_alt_bksp"      The last line shows that it sees the directive. And yet, when I open a terminal and type `setxkbmap -print -verbose 10`               Setting verbose level to 10     locale is C     Trying to load rules file ./rules/evdev...     Trying to load rules file /usr/share/X11/xkb/rules/evdev...     Success.     Applied rules from evdev:     rules:      evdev     model:      pc105     layout:     us     Trying to build keymap using the following components:     keycodes:   evdev+aliases(qwerty)     types:      complete     compat:     complete     symbols:    pc+us+inet(evdev)     geometry:   pc(pc105)     xkb_keymap {         xkb_keycodes  { include "evdev+aliases(qwerty)" };         xkb_types     { include "complete"  };         xkb_compat    { include "complete"  };         xkb_symbols   { include "pc+us+inet(evdev)" };         xkb_geometry  { include "pc(pc105)" };     };      I _can_ force the option, `setxkbmap -option terminate:ctrl_alt_bksp`, giving me:               ...     model:      pc105     layout:     us     options:    terminate:ctrl_alt_bksp     Trying to build keymap using the following components:     ...      And I test it and it restarts X correctly. I don't understand. I had this working last week, but now it doesn't load the XkbOption from the xorg.conf file. Is there another layer that sets XKB settings that I don't know about? I'm using Ubuntu 13.10, but with xmonad. I load some gnome utilities (gnome- panel, gnome-screensaver, gnome-keyring-demon), but not gnome-settings-daemon.


what does it mean by cold cache and warm cache concept?

I read a paper and it used terms “cold cache” and “warm cache”. What does it mean by cold cache and warm cache concept? I visit this but I need something more.


What's the difference between shells and xshells?

In the KDE menu in Knoppix live CD I saw there is a submenu somewhere with the title 'shells' and another with the title 'xshells'. So seemed to me they are two seperate family of shells. What is the difference between them?


Autostart all LightDM seats and show one as default

I configured a media-center server running Debian with LightDM, Leapcast and Plex. What I want to accomplish is the following. There should be three LightDM seats, one default seat on which I can login; one seat that runs Leapcast (Chromecast emulator); and one seat that runs Plex Media Center. The last seat should show up as default. Below you can find the relevant part of my lightdm.conf:               [Seat:0]     vt=7          [Seat:1]     allow-guests=false     autologin-user=media-center     autologin-timeout=0     greeter-hide-users=true     session-setup-script=start-chromecast     vt=8          [Seat:2]     allow-guests=false     autologin-user=media-center     autologin-timeout=0     greeter-hide-users=true     session-setup-script=start-media-center     vt=9      This configuration file enables the three seats, as intended. The problem I am facing now is that the default seat (the seat that is shown after booting) seems to be random, sometimes `tty7` show up at boot time (showing the login screen) and sometimes `tty8` shows up (which auto-logins and runs Leapcast). Another problem is that when `tty7` shows up as default, `tty8` is not started automatically. So what I want is   1. to be able to choose the default virtual terminal and   2. make virtual terminal 8 and 9 (Leapcast and Plex) start automatically.


How to monitor directory/file changes to rebuild index?

Just moved to Ubuntu 12.04 from Windows 7. Under Win 7 I use "Everything" to search files and directories, it can build the index database and update it once any file or directory changes. I'm very used to it so I want know if there is something similar under Ubuntu 12.04. Now my workaround is `updatedb` and `locate`, but I have to `updatedb` every time I want to search something. Also, the results are the absolute file paths, what if I want to know the details of the files?（Say, what should I do if I want to sort the results by created_time?） Is there any way that `updatedb` is automatically executed once I added a file on my disk? If not, are there any tools that can function like "Everything"?


Changing the disk scheduler on the fly

Can the Linux disk scheduler be changed on the fly by writing to `/sys/block/sda/queue/scheduler`? Should applications (e.g. Mysql) be stopped / started when changing?


How to directly read keyboard input in real-time?

I am not certain if this is ultimately the correct place to ask this but I am developing a program which requires real-time input from the user. That is; it needs to be able to read the keys being pressed(and optionally held down and released) in real time. What makes this issue a bit troublesome is that I absolutely can not use any kinds of libraries for this; not even the standard C library. So this needs to be handled with raw kernel syscalls and `int 0x80`. I thought I would set stdin to non-blocking mode with `fcntl` and `O_NONBLOCK` and then read the input data from stdin. However, to my surprise my code seems not to be working correctly. Right now it seems that the input gets to be read from stdin _after_ the Enter key is being pressed. The tricky part is that I am finding it troublesome to figure out whether it is the fault of:   * My code not behaving right(most probable)   * My terminal/user/process(whatever handles it?) not having non-blocking write access to stdin(not probable).    * Me assuming wrongly that I can read direct keyboard input from stdin. So my question is that what is the best/usual way of reading direct keyboard interaction **if not** by setting the stdin to non-blocking mode and reading the keyboard input data from there? Or am I correct and should just fix my code? :) (And for the curious, no, it's not a keylogger. It is for a very size limited(executable size <= 256 bytes) demoscene product which requires user to be able to ESC out from the intro.)


How do I find out what file Apache is serving when a port is hit?

I'm working on a server someone else set up. The server is CentOS 4.6 running Apache/2.0.59 (httpd). They have an update service setup on port 8443. I know it is working but I need to find out what files Apache is serving when someone hits that port. I looked in the httpd.conf file to see if there was anything in there but there was nothing there. I tried using `nmap` too but that only showed me which ports are currently open. If it helps the output of `nmap` was:               8443/tcp open https-alt      So how can I find out what files are served when someone connects to that port?


Unprettyfied SSL error message?

I am trying to **authenticate** using my **USB smartcard reader** to a website. I am running **Ubuntu 10.04 LTS** , with its most up to date **Firefox browser 3.6.24**. I get the following error message: > Secure Connection Failed > > An error occurred during a connection to www.socialsecurity.be. > > SSL peer was **unable to negotiate** an acceptable set of security > parameters. > > (Error code: **ssl_error_handshake_failure_alert** ) > >   * The page you are trying to view can not be shown because the > **authenticity** of the received data **could not be verified**. >   * Please contact the web site owners to inform them of this problem. > Alternatively, use the command found in the help menu to report this broken > site. > FUBAR Now of course there are multiple potential problems, so I looked them up to try different configurations and settings (at a certain point SSL was modified due to a previously unknown attack) Note that the error message seems selfcontradicting: either there was a mismatch between security parameters acceptable to the server and those acceptable to my setup, or data was sent but I miss a certificate or data was corrupted such that the hash is not the same as the one in the signature,... Is it possible to **display the mismatch** of security parrameters? Is it possible to **display the signature and the entity it refers to** such that I can check if I have the certificate or if there's a new one or ...? In theory I could start to debug mozilla, but I am not in the mood to start debugging a huge complex software like mozilla if somebody else can give me a tip on how to identify the real problem (other than that the error message has been standardized and **prettyfied beyond all recognition** ). Authentication is supposed to rely on the **Belgian eID add-on (1.0.14)** for FireFox. I have **openjre** and **icedtea**. Since this is more of a question about mozilla firefox I thought unix/linux was more suitable than Ubuntu, mod's feel free to move if necessary.


Thread id on different linux distros

We have a server application which runs fine on ubuntu and the old Mandrake linux, but it consistently fails on Redhat Enterprise Linux (to be precise RHEL 4 Update 8, kernel 2.6.9-89). On RHEL the server usually runs for 40 or more days and after that it stops responding to the incoming connections. We've noticed that on ubuntu for about 5000 incoming connections the server creates only about 50 unique thread ids. At the same time on RHEL for the same amount of incoming connections there are thousands of thread ids. I think that this might be a reason behinds these server hangs. Is there any way that i can check if this is the reason? Maybe some tool which can show the number of "free" threads in the system or a tool which can show "thread leak" in the server? Is there a system setting that controls how threads are allocated and freed? Maybe there's some setting which "bind" a particular thread to an incoming TCP connection and this works differently in ubuntu and RHEL? **PS** I forgot to mention that on RHEL a thread id usually looks like this xxxx004 or xxxx005, where x is some hex digit, e.g. 1E8004 and 750005, and they are always increasing over time.


Sort in Linux for column, keeping other values intact

NODE_154_length  847 2997     NODE_154_length 3283    4509     NODE_154_length 4672    5715     NODE_154_length 6977    7768     NODE_29_length  3790    4317     NODE_29_length  4356    4712     NODE_29_length  4356    4712     NODE_29_length  158 319     NODE_29_length  1   97     NODE_29_length  1   96 I want the output like:               NODE_154_length  847 2997     NODE_154_length 3283    4509     NODE_154_length 4672    5715     NODE_154_length 6977    7768     NODE_29_length  1   97     NODE_29_length  1   96     NODE_29_length  158 319     NODE_29_length  4356    4712     NODE_29_length  4356    4712     NODE_29_length  3790    4317 **OR**               NODE_29_length   1   97     NODE_29_length  1   96     NODE_29_length  158 319     NODE_154_length 847 2997     NODE_154_length 3283    4509     NODE_29_length  3790    4317     NODE_29_length  4356    4712     NODE_29_length  4356    4712     NODE_154_length 4672    5715     NODE_154_length 6977    7768 `sort -k2,2 file` This sorts all column 2 and gives:               NODE_100_length_46867_cov_66.420166  1   50     NODE_104_length_141_cov_120.127663  1   210     NODE_104_length_141_cov_120.127663  1   210     NODE_104_length_141_cov_120.127663  1   225 This disturbs the complete coordinates for each node. If I try `sort -k2 file` This again gives me weird output, not in sorted manner. I am not able to understand how to use -k option in Linux. I am using bash, Linux 13.10


Trigger job only once and only when load is low

I'd like have automatic update of my gtags, but only when the system is idle. To achieve this, I'm using `iupdate` to watch over the interesting parts of my source folder. But I have a problem with the "idle" part: I know that the `batch` command can run jobs when the load drops below 1.5 (or a configured value). But it may happen that `iupdate` runs `batch` multiple times before the job is executed which would lead to multiple gtags updates. Of course I could create some lockfile and start `batch` only if it wasn't called before. But is there some more standard method? I'm hoping for something like `batch_only_once` ...


ssh login in Bash script

I've been working on a series of scripts to perform tasks on my remote server, but have gotten stuck at how to log in via ssh mid script, as I cannot enter the password automatically. Is there a way to do so? echo "logging in.. \n" ssh username@IP somehow hardcode in password nextCommand


How to generate just a key with openssl

I run this command to generate a CSR and a new key with openssl:               openssl req -new -nodes -days 9000 -config /etc/ssl/openssl.cnf -out /etc/ssl/certs/mycompany.com.csr -keyout /etc/ssl/private/mycompany.com.key      I can't figure out what command I can run to generate just the key and not the CSR?


Time out logs in apache

Can anyone please help me in debugging the below logs from apache mainly timeout error. I have configured self signed ssl certificate for my abc.com website. But I am getting below logs in my sslerror log file.               [Thu May 15 12:54:21.769257 2014] [ssl:info] [pid 21027:tid 139646052787968] (70007)The timeout specified has expired: [client 192.168.0.136:51377] AH01991: SSL input filter read failed.     [Thu May 15 12:54:21.769332 2014] [ssl:debug] [pid 21027:tid 139646052787968] ssl_engine_io.c(988): [remote 192.168.0.136:51377] AH02001: Connection closed to child 148 with standard shutdown (server xplic8.com:443)     [Thu May 15 12:54:32.971133 2014] [ssl:info] [pid 21027:tid 139646042298112] [client 192.168.0.136:51390] AH01964: Connection to child 149 established (server xplic8.com:443)     [Thu May 15 12:54:32.971399 2014] [ssl:debug] [pid 21027:tid 139646042298112] ssl_engine_kernel.c(1966): [client 192.168.0.136:51390] AH02043: SSL virtual host for servername xplic8.com found     [Thu May 15 12:54:32.973733 2014] [ssl:debug] [pid 21027:tid 139646042298112] ssl_engine_kernel.c(1899): [client 192.168.0.136:51390] AH02041: Protocol: TLSv1.2, Cipher: ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)     [Thu May 15 12:54:32.973834 2014] [ssl:info] [pid 21027:tid 139646042298112] (70014)End of file found: [client 192.168.0.136:51390] AH01991: SSL input filter read failed.


Installing iPython3 Fedora 20

It was very easy to install `ipython` and upgrade it to the newest version (2.0) using pip. However, I want to set up `ipython3`, which uses Python 3, and found it more difficult. I finally installed it using `yum`, but I can't figure out how to upgrade to the recent version. Any advice? I am not completely proficient with Linux by the way. I read about pip3 being used but couldn't figure out how to use that.


system monitoring tools

What command line utilities come standard with sunos to do system monitoring? I've been able to find `prstat`, but I would like something that will tell me memory usage and IOWAIT as well. It looks like this particular machine uses sunos 5.8


Debian Wheezy and perl modules installed into /root not system

I have small problem cause everytime i issue               cpan YAML      or try to install any perl module it install's it inito `/root/perl5` and with this any other user cannot use modules that I've installed as a root. Even if I do               rm -frv /root/perl5 /root/.cpan      and rerun `cpan YAML` it still installs into root home dir. How can i change this ?


Which is a better way to search- find with regex or find with grep?

Of these two ways of searching a file recursively in all the subdirectories, which is faster / better ?               find . -regex ".*/.*abc.*"      or               find . | grep ".*abc.*"


On Ubuntu Linux, is it normal for mandb to run continuously (apparently in the background)?

I have access to a Ubuntu Linux node at my institution. The nodes are shared among the group, but typically I am the only person who uses this particular node. I am running a calculation in parallel on all 8 CPUs on this node. My calculation runs, but when I view the active processes using `top`, I see an additional process that says user `man` and command `mandb`. This `mandb` command seems to be running every time I look at `top`, and it appears to take up a fairly appreciable amount of CPU power (`6 %CPU`) and memory (`2.5 %MEM`), according to `top`. When I look around on the internet, it seems that: > `mandb` is used to initialise or manually update index database caches that > are usually maintained by man. Why, then, does `mandb` run all the time on this node? (I don't have this problem on other nodes within my institution's cluster, according to `top` on other nodes.) Why would `mandb` need to run all the time, since I am _not_ currently looking at manuals? Is this process likely to be a phantom process that I can safely terminate using `kill`?


Are there any source APT repositories for Debian Lenny?

Debian Lenny, the current oldstable, ceased receiving security updates early in February, and now seems to no longer be hosted at the usual FTP mirrors (see, e.g., `curl http://ftp.nl.debian.org/debian/dists/lenny/ | less`). Are there any surviving FTP repositories of Lenny that can be used via APT?


How to find out why a Java process died without a trace in Linux

A java process running in our SUSE Linux machine died without leaving a trace as to why it died. If it was killed with kill , it would have been logged and we would have known because the process intercepts that signal. If it crashed, we would have seen a core dump. If it died due to an exception, we would have known due to exception logging. However, the process simply disappeared. I know it was running and then it was not running. I have checked the bash history of all users, and there is no indication of a `kill -KILL` being performed (this is the only way I can think of that this process can die without a trace). I suspect that `kill -KILL` or `kill -9` caused the process to die without a trace. My questions:   1. Is there any way that Linux would kill a process silently?    2. Is there any way to figure out if a process died in the past with a kill -KILL?


How to tell which files have been created by an application?

I want to find out what files an application has created or modified. In the old days it was easy. `cc foo.c` created `a.out`, `cc -o foo foo.c` created foo, `cc -c foo.x` created `foo.o`. Now applications create files in `/var`, in `/tmp`, in some dotted directory in your home folder... At last count I have more then 1.6 million files on my computer, so I can't just go searching for the files. So is there a way to find out. Assuming you want to know before running an application. **PS** It looks like writing a ( hopefully ) small program using ptrace to trap the calls to write comes close. I would have to figure out the filename given the handle, which I can do. But before I can do that I must figure out a way whether a handle is associated with "a real file" or a system artifact such as a socket.


`ls` command does not list latest directory contents

The Linux shell does not print up-to-date information when it comes to ls. For example I use my other processes (IDEs etc) to create some directories. However when I run an ls command I don't see these directories. It normally takes a few seconds sometimes minutes for that directory to appear in the ls output. What is happening? Can I force a refresh? Ideally when I say "ls" I want to see the status when I typed the command not some cached result. The file system is not an NFS share. The only other thing I can think of is the directory was created by a program when run from Eclipse (and the display was routed to my local windows box) I don't know how this can affect things though?


I want to install a library which requires a python version and, having two installed, finds the wrong one

I want to install a library on my debian machine and it requires a python version above 2.6.6-7. The machine had installed the version 2.5.2-3, so I installed python 2.7. When I run python -V, the output is "Python 2.7", but when I try to install the library, it outputs "Version of python on system is 2.5.2-3.". How can I solve this? The library I'm using is paramiko, in order to use ssh communication. If, instead of solving the above, you could suggest another library which works with python 2.5, it would be apreciated as well. Thanks


CONFIG_PPP_MPPE=m vs CONFIG_PPP_MPPE=y

What is the difference between 'm' and 'y'? I am reading a guide, and the first step is to make sure that my kernel supports PPP and MPPE. It should be:               # cat /boot/config-`uname -r` | grep G_PPP=     CONFIG_PPP=y     # cat /boot/config-`uname -r` | grep MPPE     CONFIG_PPP_MPPE=y      I get:               root@N550JV:~# cat /boot/config-`uname -r` | grep G_PPP=     CONFIG_PPP=y     root@N550JV:~# cat /boot/config-`uname -r` | grep MPPE     CONFIG_PPP_MPPE=m     root@N550JV:~#       My `uname -r`:               3.8.0-39-generic


Iinstallation of Kali linux under dual boot in Win-7

I am completely new to Linux and its related distributions and I am trying to install the Kali-Linux in Wind 7 64 bit OS through dual boot option. I have downloaded the kali-64 bit mini.iso and after a restart my latop shows the installation progress and later displays the Installation box with several options to install(graphics, network,language etc.). Now my problem is after selecting the default and the secondary language gives me a dialog box with network configuration . For which when I click configure it takes a while and later it says network configuration not completed. I tried different options but stuck at the same network configuration option . For which I finally removed the installer. I am ready to start from scratch. A step by step help guide would be helpful.


truecrypt 1: Syntax error: “(” unexpected

I want to use truecrypt on a Linux machine. It is CLI mode only. So I downloaded the x64 and x86 and tried or run the extracted executable file for each version (x64 & x86), but it doesn't work. It gives me:               ./truecrypt          ./truecrypt: 1: Syntax error: "(" unexpected      I'm running MontaVista Linux Professional Edition 4.0 (0501140) `Linux/armv5tejl 2.6.10_mvl401-davinci_102_mw`. It's 2.6.10 kernel. Truecrypt supports 2.6 kernels. So what is wrong here?


Domain has exceeded the max defers and failures per hour - No Cpanel

I am receiving the following error with for most emails that are sent:               Domain *** has exceeded the max defers and failures per hour (5/5 (100%)) allowed. Message discarded.      I am using PHPMailer to send emails and my software is sending quite a lot of emails per hour. I have read about changing settings in cpanel to fix this but I do not have cpanel installed on this box. Is there a way of editing the deferred/failed settings without cpanel? I am running CentOS 6.4 x32_64 and php v5.3.3


How to embed a shell command into a sed expression?

I have a text file with the following format:               keyword value     keyword value     ...      Where keyword is a single word and value is everything else until the end of line. I want to read the file from a shell script, in a way that the values (but not the keywords) undergo shell expansion. With sed it's easy to match the keywords and value parts               input='     keyword value value     keyword "value  value"     keyword `uname`     '          echo "$input"|sed -e 's/^\([^[:space:]]*\)[[:space:]]\(.*\)$/k=<\1> v=<\2>/'      which produces               k=<keyword> v=<value value>     k=<keyword> v=<"value  value">     k=<keyword> v=<`uname`>      but then the question is how can I embed a shell command into the replacement part of the sed expression. In this case I would like the replacement to be `\1 `echo \2``.


Hotplug area too small error

I have VM running under RHEL6, which is running under HyperV. It has a lot of important soft installed, but does not have suffocating workload (~10% CPU is used). It's been really unstable recently unexpectedly showing different I/O errors:               ps aux | grep httpd     -bash: /bin/ps: Input/output error     -bash: /bin/grep: Input/output error      I tried to fix drives by running `fsck`, but I've got following error:               /dev/mapper/vg_vm-lv_root: recovering journal     fsck.ext4: Bad magic number in super-block while trying to re-opoen /dev/mapper/vg_vm-lv_root     Warning... fsck.ext4 for device /dev/mapper/vg_vm-lv_root exited with signal 11.      And now it's being rebooted unexpectedly showing following error:               SRAT: Hotplug area too small offline device     ..MP-BIOS bug: 8254 timer not connected to IO-APIC     Kernel panic - not syncing: IO-APIC + timer doesn't work! Boot with apic=debug and send a report. Then try booting with the 'noapic' option.      I made snapshots, but rolling back to any of them does not help. As it turns out, this problem existed all the time, but it has become apparent only recently with more frequent rebooting and I/O errors. I do not have official Red Hat support as it is the evaluation installation - I wanted to see how it works, test it and prove management I really need this OS. But all I want now is to save configuration of installed software in order to be able to move all data to another server. I cannot do this now - server is being rebooted 2 minutes after is has been started. No chance to export any data. It seems that I'm stuck, I can't figure out what is the problem. Can someone explain what is happening? Maybe it was not configured properly on the HyperV virtual server? Can I fix it without OS reinstallation?


show filesystem instead of "places" in gtk file chooser

In almost any program, when I click on `open`, a file chooser dialog opens as shown below. This dialog shows `recently used` files `Desktop` and so on. ![file chooser](http://i.stack.imgur.com/8pMij.png) This is extremely annoying. I would like to see my directory tree instead. I know I can get the directory tree when I click on `File System`, but I would like to have that selected by default. I understand this is a `gtk2` issue and there are several questions on stack regarding this problem. But I have found no real solution. I am not asking how to disable the `recently used` files. I have already done that. The list is empty, but `recently used` still shows in the file chooser window. I am using `LXDE` desktop environment on Debian Wheezy.


What's the difference between Linux and Linux LVM?

If I want to install new hard drive should I make the file system Linux or Linux LVM? Also after that I've got to format again with `mkfs.ext4`. Actually what are we doing? The first one is formatting and the second one is formatting again? Why doesn't Windows have this issue?


configure allowed_tcp_congestion_control via config files in linux kernel

I am trying to come up with a custom set of TCP congestion control variants as part of the `tcp_allowed_congestion_control`. I do have multiple variants on my `tcp_available_congestion_control` list but not sure how I would add some of them to my allowed list. I am aware we are able to change it in our installed kernel via `echo variant1 variant2 > /proc/sys/net/ipv4/tcp_allowed_congestion_control` but is there a way I could directly change this via the config files in the linux kernel source code.


Error while installing perl-DBD-mysql

When I want to install perl-DBD-MySQL I get this error: `yum install perl-DBD-MySQL.x86_64`               Setting up Install Process     Resolving Dependencies     --> Running transaction check     ---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed     --> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64     --> Processing Dependency: libmysqlclient.so.16()(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64     --> Finished Dependency Resolution     Error: Package: perl-DBD-MySQL-4.013-3.el6.x86_64 (base)                Requires: libmysqlclient.so.16()(64bit)     Error: Package: perl-DBD-MySQL-4.013-3.el6.x86_64 (base)                Requires: libmysqlclient.so.16(libmysqlclient_16)(64bit)      You could try using --skip-broken to work around the problem      You could try running: rpm -Va --nofiles --nodigest      Using `--skip-broken` :               Setting up Install Process     Resolving Dependencies     --> Running transaction check     ---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed     --> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64     --> Processing Dependency: libmysqlclient.so.16()(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64     --> Finished Dependency Resolution          Packages skipped because of dependency problems:         perl-DBD-MySQL-4.013-3.el6.x86_64 from base      What package should I install?


Can I setup a loopback audio device?

If I can send audio to the output devices, then I can record the same audio as a wave. With filesystems, you can just setup a loopback filesystem and write binary data on a file instead of a device. My question is: Can I send the audio signal to a (for instance) WAV file instead of my audio devices? How?


Keychain SSH Key Manager prevents SFTP login on CentOS

I installed `keychain` and added this to my `.bashrc` in CentOs to help manage my SSH Keys:               /usr/bin/keychain --clear $HOME/.ssh/id_rsa     source $HOME/.keychain/$HOSTNAME-sh      So on SSH login I am prompted to enter the key's password which will endure until reboot or session termination. While this is enabled any SFTP login attempts are then halted at authentication. How can I leave keychain support enabled while disregarding for SFTP logins? Is this possible? I don't want to have to enable/disable when I need to do things.


/dev/tcp listen instead of nc listen

With a netcat listener like:               nc -l <port> < ~/.bashrc      I can grab my .bashrc on a new machine (doesn't have `nc` or LDAP) with:               cat < /dev/tcp/<ip>/<port> > ~/.bashrc      My question is: Is there a way to mimic the capabilities of `nc -l <port>` in my first line with /dev/tcp instead of `nc`? The machines I'm working on are extremely hardened lab/sandbox environment RHEL (no ssh, no nc, no LDAP, no yum, I cant install new software, and they are not connected to the internet)


Configure Client Computers to Transfer Data Through a Proxy Server

what is the equal of below text in linux. i read that doesn't have registry. please asnwer only if you know not for post growth. Start the Windows Registry Editor on the local mode client system. expand the registry path.Processor Description 64-bit HKEY_LOCAL_MACHINE, SOFTWARE, Wow6432Node, VMware Inc., VMware VDM 32-bit HKEY_LOCAL_MACHINE, SOFTWARE, VMware Inc., VMware VDM Edit > New > String Value and type useProxyForTransfer in the new value entry. Right-click the useProxyForTransfer entry, click Modify, type true, and click OK. Thank you very much.


Remove BS and ESC from Log files

Whenever I use the `script` command to record the keys I type or when I activate the logging mode in `screen`, all BS (Backspace) and ESC (Escape) key presses are also included in the file. e.g: `cd ~/foo/tpBSBStmp`. Is there a way to auto remove the BS or the ESC from the file so the final recorded command included in the file would be `cd ~/foo/tmp`? Btw, this also happens in the logging feature of Putty. I'm open to any scripts that remove the unwanted characters or even another commands that do the same job


ext4 formatting weirdness

Just got a new 2TB hardrive for my Debian Squeeze Box. Trying to format it in ext4 after creating a Primary partition using cfdisk. I just did this exact process with a 120GB drive on the same system with no problems. After searching for the returned error on Google, it seems that it usually comes up when people are trying to format an Extended partition, not a Primary. Mine is a primary and is still showing the error. See my shell output below for the details. Any idea why this is giving so much trouble? Output of `fdisk -l`:               Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes       255 heads, 63 sectors/track, 243201 cylinders       Units = cylinders of 16065 * 512 = 8225280 bytes       Sector size (logical/physical): 512 bytes / 512 bytes       I/O size (minimum/optimal): 512 bytes / 512 bytes       Disk identifier: 0x00000000                    Device Boot      Start         End      Blocks   Id  System       /dev/sdb1               1      243201  1953512001   83  Linux      And then:               :~# mkfs.ext4 /dev/sdb1       mke2fs 1.41.12 (17-May-2010)       **mkfs.ext4: inode_size (128) * inodes_count (0) too big for a               filesystem with 0 blocks, specify higher inode_ratio (-i)               or lower inode count (-N).**      tried again using `/dev/sdb`:               :~# mkfs.ext4 /dev/sdb       mke2fs 1.41.12 (17-May-2010)       /dev/sdb is entire device, not just one partition!       Proceed anyway? (y,n) y       /dev/sdb is apparently in use by the system; will not make a filesystem here!       :~#


How would I use sed to detect a certain amount of numbers before it inserts a character? ###-###-####

I need to format phone numbers in a text file. They appear as (example) `8014516912` How would I format it so that I can insert a `-` after the first 3 numbers, and then another `-` after another 3 numbers, so it would appear as `801-451-6912` How would I do this for all lines that contain a phone number? Keep in mind that the phone numbers are between text, so the numbers aren't always at the same index. For example it can be like:               atewfnwieug 8204919561     adw 8915617141


How would I use sed to insert a character at a certain character position on only ONE line?

I am aware that this will do what I want on all lines:               sed 's/^\(.\{4\}\)/\1-/' textFile      But how would I enter a - after the 4th character slot on ONLY the 5th line? Or even better, on a range of lines, like from 5-7?


Fix for: /usr/lib/libnssutil3.so: undefined reference to `PL_ClearArenaPool'

Error occurs during attempt to make via:               cc -m32 -s -o ford_check_password ford_check_pws.o wsl4_cookie_auth.o fds_auth.o -L. -L/ford/thishost/proj/dmadmin/ford/lib -lcrypto -lldap50 -lssldap50 -lprldap50 -lnss3 -lssl3 -lnspr4 -lvalidate4          Error:  /usr/lib/libnssutil3.so: undefined reference to `PL_ClearArenaPool'


How Do I Set Up Multiple NIS Servers For CentOS 6 Clients?

What is the correct `/etc/yp.conf` format for indicating a NIS domain has more than one NIS server available to it? Also, how does the client decide to look for another server? I've tried this:               domain NIS server nis1     domain NIS server nis2      ...but everything binds to nis1. If I reboot nis1, everything just hangs until nis1 comes back, I don't see them seeking new servers. For security reasons, broadcast definitions are not acceptable. **Edit:** perhaps I'm unclear. My question is: I have two nis servers, one master and one slave. How do I configure CentOS client X such that it has access to both nis servers?


Is fsck -N mounted file system dangerous

I've read to never run fsck when the file system is mounted. What about running fsck -N to only identify but not repair the file system when mounted? Is that dangerous? Is fsck -N known to overload a system and slow it down?


GTK Icons for special files

Does named pipe for instance have it's icon, I have a theme for GTK and when I've create named pipe it give icon from `gtk-file.svg` file or symlinks that point to that:   * application-x-empty.svg   * empty.svg   * gnome-fs-regular.svg Is there a place where I can find a list of those types? I can't find them in `/usr/share/mime`. I found this 2 links:   * https://developer.gnome.org/icon-naming-spec/   * http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html but there is no `gnome-fs`


What would stop a task from being run in the background?

I have a script I'm trying to launch with               php ./Script.php &      The task goes into the background but it is stopped. When I try to run it with bg it simply stays stopped.               $ jobs     [1]+  Stopped                 php ./Script.php     $ bg     [1]+ php ./Script.php &          [1]+  Stopped                 php ./Script.php     $      ps shows the job state as T               $ ps ax | grep Script     951 pts/5    T      0:00 php ./Script.php      cat /proc/PID/wchan shows "pipe_wait" Update: This happens with any PHP script, even `<?php sleep(1000)`; Update: Thanks for all the great answers and comments. I understand why this is happening on a technical level now, but I'm not sure what about some versions of PHP are causing this. But, that is not a *nix question.


How can I make chrome (stop asking to be) the default browser?

I am running Linux Mint Debian edition (essentially Debian testing) and the Cinnamon desktop environment. Every time I launch `google-chrome` it asks to become the default browser. I have told it to do so in all ways I can think of but I still get this pop-up: ![enter image description here](http://i.stack.imgur.com/OUO8V.png) What I have tried:   * Clicking on "Set as default" in the pop-up.   * Making chrome the default in it's settings: ![enter image description here](http://i.stack.imgur.com/mvQfu.png)   * Using my desktop environment's (cinnamon) settings app to set it as default: ![enter image description here](http://i.stack.imgur.com/SOHtK.png)   * Associating it with all relevant mimetypes in the various ways and files where such things are defined:              $ xdg-mime query default text/html      chrome.desktop          $ grep chrome .local/share/applications/mimeapps.list     text/html=chrome.desktop     x-scheme-handler/http=chrome.desktop     x-scheme-handler/https=chrome.desktop     x-scheme-handler/about=google-chrome.desktop     x-scheme-handler/about=google-chrome.desktop;     text/html=emacs.desktop;google-chrome.desktop;firefox.desktop;     x-scheme-handler/http=chrome.desktop;          $ grep chrome /usr/share/applications/defaults.list     application/xhtml+xml=google-chrome.desktop     text/html=google-chrome.desktop     text/xml=gedit.desktop;pluma.desktop;google-chrome.desktop     x-scheme-handler/http=google-chrome.desktop     x-scheme-handler/https=google-chrome.desktop      In those files, I replaced all occurrences of `firefox` (my previus default) with `google-chrome`. No other browsers are defined anywhere in the file:              $ grep -E 'firefox|opera|chromium' /usr/share/applications/defaults.list \         .local/share/applications/mimeapps.list     $         * Launching chrome as root in case that helps but it won't let me: ![enter image description here](http://i.stack.imgur.com/3kTWZ.png)   * Using Debian's alternatives system to set it as default:              $ sudo update-alternatives --install /usr/bin/www-browser www-browser /usr/bin/google-chrome 1080     update-alternatives: using /usr/bin/google-chrome to provide /usr/bin/www-browser (www-browser) in auto mode          $ ls -l /etc/alternatives/www-browser     lrwxrwxrwx 1 root root 22 Jan 23 17:03 /etc/alternatives/www-browser -> /usr/bin/google-chrome      None of these seem to have any effect. Will no one rid me of this turbulent pop-up?


convert display to monochorme

My Asus netbook has Debian Wheezy. I came across a weird idea. How would it look if my display screen is monochrome. Is it possible to configure X11 to make the display monochrome?


/etc/environment not working

I am using Ubuntu 12.04. Recently, I accidentatlly removed `python`, causing a huge number of packages to be uninstalled. I reinstalled them, but now I am having problems.               $ echo $PATH     /home/paul/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/home/paul/.rvm/bin      Note that there is no `/sbin` or `/usr/local/sbin`! I have no idea how that happened! Thus,               $ sudo apt-get autoremove -y     ...     dpkg: warning: 'ldconfig' not found in PATH or not executable     ...     $ sudo shutdown now     sudo: shutdown: command not found.      I've gone looking. `/etc/environment` (which I have not touched) has               $ cat /etc/environment     PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"      I've rebooted (a couple times). Why doesn't my path have `/sbin`? **UPDATE** I tried creating a new user               $ sudo adduser paul-test     $ su -- paul-test     $ echo $PATH     /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games      Also,               $ sudo su     $ echo $PATH     /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games      So something is killing `/sbin` for me. I've checked `.bashrc`.               PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting      And .profile               PATH="$HOME/bin:$PATH"      There is no `~/.bash_profile` or `~/.bash_login`. **FYI** This the same problem described here and here and many other places. They treat the symptom of `apt-get` not working, rather than correcting the real problem of no `/sbin`.


Changing text color in c-shell

I can change the text color in the terminal permanently by adding this:               export PS1="\e[0;31m[\u@\h \W]\$ \e[m"      to the `.bashrc` file. Now I have to go into cshell, what is the corresponding way?


Working with rar files

I have a directory full of rar files, with extensions ranging from `.r00` to `.r30`. It also has one file with `.rar` extension. From all of this must come a video file. How do I do it?


Compatible Wireless Router?

I'm looking for a wireless router for personal use. I have a small apartment and need the router primarily for my android phone connection. I might need it for streaming video as well. I'm running Kubuntu on a ThinkPad T61p. My wireless card is: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection (rev 61) I'm looking for a reasonably feature-rich router that I will not have to change in the next 2-3 years. Some of the brands I've been recommended so far are: NetGear such as WNR3500L or 3500 D-Link such as DIR 655 Linksys Any ideas? Or any up2date list?


vim -N mode: where to use it?

I am following the Peepcode screencasts to learn vim. The presenter mentions about the `-N` mode but doesn't elaborate it much and says that it should be the default mode. My questions:   * What is the `-N` mode?   * Should I always use it?    * If yes, how do I configure it in the `.vimrc`? EDIT: The author does mention that it should always be used, but doesn't elaborate why and how. Thanks for your time.


running kernel on QEMU

I face this message:               Failed to execute /initKernel panic - not syncing: no init found.      Try passing init=option to kernel.      I am using this command line:               qemu-system-x86_64 -hda disk.img -kernel /home/marssonubuntu/linux_qemu/linux-3.3.3/arch/x86/boot/bzImage -initrd my-initramfs.cpio -append "root=/dev/sda rdinit=/sbin/init"      on qemu, the full message is:               Failed to execute /sbin/init Kernel panic - not syncing: No init found.      Try passing init= option to kernel. see Linux Documentation/init.txt for guidance.      Pid: 1, comm: swapper Not tainted 3.3.3 #1      Call Trace:      [<ffffffff811d78b4>] ? panic+0xa9/0x197     [<ffffffff811d6927>] ? init_post+0xb2/0xb2     [<ffffffff812aad96>] ? kernel_init+0xff/0xff     [<ffffffff811dcd44>] ? kernel_thread_helper+0x4/0x10     [<ffffffff812aac97>] ? do_one_initcall+0x121/0x121     [<ffffffff811dcd40>] ? gs_change+0xb/0xb


removing spaces from first column

My input file has positions in first column with different number of spaces (or no space)               16504   16516                1650811   16520            1651   16524             16516111   16528             165204   16532             I need to get an output file where fist column has no spaces at all, while keeping second column as it is.               16504   16516            16508   16520          16512   16524           16516   16528            16520   16532


NAS device failed and I am attempting to get data back - HELP!

Not a Linux guy!~ Tried on windows pc and failed. Put the Nas device hard drive is in an older pc with Kali in forensic mode because device failed and all no longer allowed access to data on hard drive Kali shows the Hitachi drive but states "unallocated". To my knowledge all data was on when failure occurred. This drive has all data for 12 years of kids, family, etc. Tried fdisk and cannot get access either, also tried mounting several ways to no avail. All help is appreciated


Centos : yum errors : dependencies conflict

On Centos 5, for installing some program, i need to upgrade libxml2. But i can't because of another package (libxml2-python) that seems needing my current obsolete version of libxml2 Can you help me to solve this?               [root] # yum install libxml2 Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Excluding Packages from CentOS-5 - Plus Finished Excluding Packages from CentOS-5 - Updates Finished Setting up Install Process Resolving Dependencies     --> Running transaction check     ---> Package libxml2.i386 0:2.6.26-2.1.21.el5_9.3 set to be updated     --> Finished Dependency Resolution          Dependencies Resolved          ==========================================================================================================================================================  Package                           Arch                           Version                                            Repository          Size     ========================================================================================================================================================== Installing:  libxml2                           i386                        2.6.26-2.1.21.el5_9.3                              base                           799 k          Transaction Summary     ========================================================================================================================================================== Install       1 Package(s) Upgrade       0 Package(s)          Total size: 799 k Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug ERROR with rpm_check_debug vs depsolve: libxml2 is needed by (installed) libxml2-python-2.6.32-1.i686 Complete! (1, [u'Please report this error in https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%205&component=yum'])