How to move EFI and boot partitions?

I am in the midst of moving these two partitions from sda5 and sda6 to sda1 and sda2 respectively. This is to allow me to have a contiguous space for the root file system to grow. The following is what I have done so far:   * Create partition sda1 for EFI System with `gdisk`   * Create partition sda2 for boot with `gdisk`   * Copy content on sda5 to sda1 with `dd`   * Copy content on sda6 to sda2 with `dd`   * Remove boot flag on the old EFI System sda5 with `parted` The following is what I have now (`# parted -l`):               Number  Start   End    Size    File system  Name                  Flags      1      1049kB  211MB  210MB   fat16        EFI System            boot      2      211MB   735MB  524MB   ext4         Microsoft basic data      4      200GB   250GB  50GB      5      250GB   250GB  210MB   fat16        EFI System Partition      6      250GB   251GB  524MB   ext4      7      251GB   481GB  230GB                                      lvm      Upon reboot, the boot menu that I was presented with is still tied to what is inside the old EFI System partition in sda5, despite turning off its boot flag. How to proceed further from here?


Control how linux deletes files

What exactly happens when an application deletes a file? Is there any way to control this behavior? Basically I want to `shred` instead of `rm` in all cases, but of course applications do not make calls to `rm`, I am guessing they interact directly with the kernel?? Would I have to modify the kernel to implement this feature?


Can conky float over maximized windows?

My idea is to use a minimized conky window on the desktop to show basically CPU and memory data all the time. Is this possible with Conky?


Force local DNS resolution for external hosts

**My Environment:** * _OS:_ * Angstrom Linux **DNS:** Bind **Current Scenario:**   1. User connects to my private offline network.   2. User tries to access google.com, and my box is on a private network therefore they connection unavailable error. **Example Desired Scenario:**   1. User connects to my private offline network.    2. User tries to access google.com or any other external host in their browser and they get redirected to my splash page. The idea is that if my machine looses internet connectivity, the end user will still be able to hit google.com or any other external site and get redirected to my splash/portal page. Any thoughts or feedback on how this can be achieved would be greatly appreciated.


Why is my Yellow Dog keyboard layout wrong?

I just installed Yellow Dog on my PowerBook G4, and it worked, and noticed my mac keyboard. Then, suddenly, the layout went wrong. Most keys don't do anything, and I have letters instead of arrow keys. I logged off to see if it helps, but then I couldn't even log on again (have to type my username). I'm writing this on OSX. Is there any way to get the layout back? P.S. I just rebooted a second time, and everything works - I'd still like to know what happened though...


Restricting access to files on an external drive

I was wondering how to restrict access to a specific drive in Unix on the Mac. I was thinking to do this in Terminal where I create a file like this `mkfile 6k secure_access`. And where secure_access will be on the external drive and will only allow a specific user to be allowed to access the drive, thereby preventing other users from accessing it.


Apache won't read file which are being actively written

I want to show a log via a webpage. Every 0.5 seconds a script replaces the data in the log with the newest measurements. When this script is running and updating the file I cannot see the file in the browser. When I stop the script I, so It is not being updated, I can see the file in my browser. I guess Apache is the problem. But I cannot find out where it resides. How can I read a file in the browser while it is being written?


Why is vim offering me spelling suggestions instead of using the completefunc?

I am trying to set up vim for writing email. I have a plugin to provide autocompletion of email addresses (notmuch abook ). If I do `:set completefunc` it tells me it is `CompleteAddressBook` as expected. However, when I hit `Tab` I get what appear to be spelling suggestions from a word dictionary. I do have `spell` set, but I'm confused as to how to get past spell to get `completefunc` used. You can see my vimrc in case there is something weird in there. Ideas for debugging steps welcome.


Command to get cpu cores in LINUX IA64

I tried `cat /proc/cpuinfo` but there is no "cpu cores" it works on LINUX though `cat /proc/cpuinfo | grep "cpu cores"` Help me get a command for "cpu cores" in LINUX IA64


Deleting all C comments with sed

I am trying to write a script that will delete all comments and everything in between inside C files in my current directory. I've been using `sed`, and this is what I have so far:               sed -i '/ * [^()] */d' *.c This works when the comments are on the same line as an asterisk or backslash. However it doesn't work when there is a commented line without a slash or asterisk. I know sed goes line by line, I just don't know how to tell it to keep deleting until it sees a `*/`.


Why might an external Hard Disk Run super slow?

I have an external Western Digital HDD (1gig) which is running very slow, 0.5 - 1mb per second. This is on a Mac Pro running the latest OS with all the patches. The HDD is connected via USB directly to the computer (i.e. no hub or anything.) Also I ran a disk diagnostic on it which comes up clean. The deeper diagnostic takes too long to finish.   * could it be a hardware problem in the HDD?   * could I need a different cable?   * any other diagnostic steps that you might suggest? Additional info I got from the OS. Does that tell you anything (me not)               ext HDD 1021:            Product ID:   0x1021       Vendor ID:    0x1058  (Western Digital Technologies, Inc.)       Version:  20.21       Serial Number:    888881563550353537363230       Speed:    Up to 480 Mb/sec       Manufacturer: Western Digital       Location ID:  0xfa200000 / 2       Current Available (mA):   500       Current Required (mA):    2       Capacity: 1 TB (1,000,202,043,392 bytes)       Removable Media:  Yes       Detachable Drive: Yes       BSD Name: disk2       Partition Map Type:   GPT (GUID Partition Table)       S.M.A.R.T. status:    Not Supported       Volumes:     EFI:       Capacity: 209.7 MB (209,715,200 bytes)       BSD Name: disk2s1       Content:  EFI     ExternalHD:       Capacity: 999.86 GB (999,858,069,504 bytes)       File System:  HFS+       BSD Name: disk2s2       Content:  Apple_HFS       Volume UUID:  FFFFFEB2-42F8-3510-85F4-12632D99D19B


Bash scripting: Associated Array only recognizes one value when several given

This lines of a Bash (4.0) Script > >     klang=([string_0]='element_0' [string_1]='element_1' > [string_2]='element_2') >     echo "${klang[*]}"     # should output the all set elements >     echo "${#klang[*]}"    # should output the number of set elements >   returns (for some reason): > >     element_2 >     1 >   There are no other commands set in this script and I am really new in Bash scripting. What happened to the other elements (`Element_0` and `Element_1`)? This really worked perfectly with indexed arrays and numbers and everything, but doesn't work with text - well except for one element which is a bit less than I asked for… Where did I miss something?


Start a song from a specific time in rhythmbox using command line

I would like to start a song from my terminal, starting from the first minute. i.e.: the command will run the _music.mp3_ starting from the minute 1. I am able to run a music with                rhythmbox music.mp3       However it is starting from 0. How to do it for starting from minute 1?


SSH accesss between CentOS and Vmware installed Ubuntu

I am here to request the Linux lads about using the SSH type remote access between my CentOS (Host) and VMWare installed Ubuntu. I am not new to Linux but I am completely new with practical experience of SSH. Any help would be appreciated.


Error in compiling file using gcc: "/bin/sh: g++: command not found"

I want to compile a c++ program in Fedora Linux, but the program isn't compiled correctly. I got the following error:               /bin/sh: g++: command not found     make[1]: [*.o] Error 127      make[1]: Leaving directory      Why?


Best Practices for Configuring/Reading Sensor Devices

I have a gadget with a number of environmental sensors attached via an I2C bus, and would like to be able configure and read these sensors via an unprivileged application. Unfortunately, there doesn't appear to be a consistent way of doing this, and I was wondering what the prevailing practices were. To take a specific example: The ISL29023 is an ambient light sensor chip which has a kernel driver. In kernel 3.10.x, this device issues its reports as an input device with the input code `ABS_MISC`. The current measurement can also be read out of sysfs, alongside a pile of other entries that let you configure the chip's measurement parameters. (No entry is created under `/dev`.) If you're running as root, this is fine, but I don't want applications or servers running as root if they don't have to. The way I've been handling this so far is to create a udev rule which runs `/bin/chmod` and `/bin/chown` on the sysfs entries to change them to be writeable to members of a certain group (say, "ambilux"). Then I create a user who is a member of the ambilux group, and run the app as that user. This approach works, but messing around in sysfs this way seems fraught with peril, and was wondering if there was some superior approach that I've been missing.


How can I bind together several wifi adapters into one internet connection?

I would like to get around an unnecessary and extremely tight (20k) speed cap per wifi client on a wifi network providing internet. Each client passes through a captive portal that requires just clicking a button for 24 hours of use. What are some basic recipes for configuring a Linux box with four wifi adapters to combine them into a single 80k link that is transparent to applications, so for example if I go to speedtest.com in a browser, it will read 80k? Secondly, is there any way of doing this with only one wifi adapter, but simulate four by connecting to the wifi network with four different Mac addresses?


How to read user input in pipe?

Let's assume I have a file named `confirmation.sh` with the following content:               #!/bin/bash          echo -n "Are you sure [Y/n]? "     read line     case "$line" in         n|N) echo "smth"             ;;         y|Y) echo "smth"             ;;     esac      and I want to run this script in the following way:               cat confirmation.sh | sh      I see `Are you sure [Y/n]?` and script is interrupted. What's the problem? Thanks!


Fedora 15: Linux 2.6.40 + tg3 = pain

I have an IBM BladeCenter blade running Fedora 15. Everything works fine with 2.6.38 kernels, but when I boot with a 2.6.40 kernel, I lose connectivity after a few seconds. Removing and then re-inserting the `tg3` module restores connectivity for about five seconds, after which I lose connectivity again. These are dual-Xeon blades. This one has two 2.8GHz Xeons with HT and 2GB of RAM. The blade is an 8832-L1X running BIOS version 1.13. The output of `lspci` is:               00:00.0 Host bridge: Broadcom CMIC-LE Host Bridge (GC-LE chipset) (rev 33)         00:00.1 Host bridge: Broadcom CMIC-LE Host Bridge (GC-LE chipset)         00:00.2 Host bridge: Broadcom CMIC-LE Host Bridge (GC-LE chipset)         00:01.0 VGA compatible controller: ATI Technologies Inc Rage XL (rev 27)     00:0f.0 Host bridge: Broadcom CSB6 South Bridge (rev b0)     00:0f.1 IDE interface: Broadcom CSB6 RAID/IDE Controller (rev b0)     00:0f.2 USB Controller: Broadcom CSB6 OHCI USB Controller (rev 05)     00:0f.3 ISA bridge: Broadcom GCLE-2 Host Bridge     00:10.0 Host bridge: Broadcom CIOB-E I/O Bridge with Gigabit Ethernet (rev 12)     00:10.2 Host bridge: Broadcom CIOB-E I/O Bridge with Gigabit Ethernet (rev 12)     01:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5704S Gigabit Ethernet (rev 02)         01:00.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5704S Gigabit Ethernet (rev 02)      Here's a `dmesg` excerpt with kernel-PAE-2.6.38.8-32.fc15.i686 (working):               [11.545123] tg3.c:v3.116 (December 3, 2010)     [11.545152] tg3 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16     [11.599499] tg3 0000:01:00.0: eth0: Tigon3 [partno(BCM95704A41) rev 2002] (PCIX:133MHz:64-bit) MAC address     [11.599510] tg3 0000:01:00.0: eth0: attached PHY is serdes (1000Base-SX Ethernet) (WireSpeed[0])     [11.599518] tg3 0000:01:00.0: eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[1] TSOcap[0]     [11.599525] tg3 0000:01:00.0: eth0: dma_rwctrl[769f4000] dma_mask[64-bit]     [11.599577] tg3 0000:01:00.1: PCI INT B -> GSI 17 (level, low) -> IRQ 17     [11.627997] tg3 0000:01:00.1: eth1: Tigon3 [partno(BCM95704A41) rev 2002] (PCIX:133MHz:64-bit) MAC address     [11.628066] tg3 0000:01:00.1: eth1: attached PHY is serdes (1000Base-SX Ethernet) (WireSpeed[0])     [11.628074] tg3 0000:01:00.1: eth1: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] TSOcap[1]     [11.628082] tg3 0000:01:00.1: eth1: dma_rwctrl[769f4000] dma_mask[64-bit]     [22.000286] tg3 0000:01:00.0: eth0: Link is up at 1000 Mbps, full duplex     [22.000294] tg3 0000:01:00.0: eth0: Flow control is off for TX and off for RX      And here's one from kernel-PAE-2.6.40.6-0.fc15.i686 (not working):               [10.262141] tg3.c:v3.119 (May 18, 2011)     [10.262177] tg3 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16     [10.309325] tg3 0000:01:00.0: eth0: Tigon3 [partno(BCM95704A41) rev 2002] (PCIX:133MHz:64-bit) MAC address              [10.309336] tg3 0000:01:00.0: eth0: attached PHY is serdes (1000Base-SX Ethernet) (WireSpeed[0], EEE[0])     [10.309344] tg3 0000:01:00.0: eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[1] TSOcap[1]     [10.309351] tg3 0000:01:00.0: eth0: dma_rwctrl[769f4000] dma_mask[64-bit]     [10.309431] tg3 0000:01:00.1: PCI INT B -> GSI 17 (level, low) -> IRQ 17     [10.361613] tg3 0000:01:00.1: eth1: Tigon3 [partno(BCM95704A41) rev 2002] (PCIX:133MHz:64-bit) MAC address              [10.361624] tg3 0000:01:00.1: eth1: attached PHY is serdes (1000Base-SX Ethernet) (WireSpeed[0], EEE[0])     [10.361633] tg3 0000:01:00.1: eth1: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] TSOcap[1]     [10.361640] tg3 0000:01:00.1: eth1: dma_rwctrl[769f4000] dma_mask[64-bit]     [21.054276] tg3 0000:01:00.0: eth0: Link is up at 1000 Mbps, full duplex     [21.054284] tg3 0000:01:00.0: eth0: Flow control is off for TX and off for RX      Again, the symptom is that networking works fine for a few seconds but then completely stops. Doing an `rmmod tg3` followed by a `modprobe tg3` restores connectivity for a few seconds. Nothing unusual appears in any logs. I've tried a few kernel option workarounds. I don't remember exactly which, but I know I tried `acpi=noirq`, `acpi=ht`, `irqpoll`, and `noapic`. `modinfo`, minus the many `alias` lines shows:               filename: /lib/modules/2.6.40.6-0.fc15.i686.PAE/kernel/drivers/net/tg3.ko     firmware:       tigon/tg3_tso5.bin     firmware:       tigon/tg3_tso.bin     firmware:       tigon/tg3.bin     version:        3.119     license:        GPL     description:    Broadcom Tigon3 ethernet driver     author:         David S. Miller (davem@redhat.com) and Jeff Garzik (jgarzik@pobox.com)     srcversion:     389C3BA89E4ECF8460A74C0     depends:         vermagic:       2.6.40.6-0.fc15.i686.PAE SMP mod_unload 686     parm:           tg3_debug:Tigon3 bitmapped debugging message enable value (int)      Fedora reports the kernel at 2.6.40 for "compatibility with older userspace". **Update** : Doing `ifconfig eth0 down` followed by a new `ifconfig` to bring it up and adding the appropriate routes makes everything work indefinitely. Doing an `rmmod tg3` followed by a `modprobe tg3` makes it work for a few seconds and then break again. So at least I have a workaround for now -- adding `/etc/rc.d/init.d network restart` into `rc.local`. I'd still like to know what's wrong and whether there's a proper fix.


How do you prevent a DHCP release during shutdown?

I am currently using Ubuntu 14.04, but expect this to be applicable for different distros. I would like to prevent a DHCP release during shutdown, and opt for either the lease to expire or for a DHCP renew (if needed) on startup. Is this possible?


Extend Workspace on Kali using VMware

I'm using Kali on Windows via VMware. The web browser and other things sometimes seem too much zoomed in and I can't get to certain links or buttons. How do I zoom out or expand the area? (clicking maximize doesn't do anything) Provided is a screen shot to better illustrate what I mean: ![enter image description here](http://i.stack.imgur.com/UrXD0.jpg) As you can see, I can't get to what's below.   So far I've been managing with the tab key, but it's stressful.


vim: how do I set :match and :2match search results to different colors?

For example, I want something along the lines of:               :match search /<div/ guib=Green     :match search /<\/div>/ guibf=Blue      only that doesn't work.


Running a command based on output of previous command

Consider the following command. I want to echo "yes" if grep has output and echo "no" if grep returns no output. `cat myfile | grep "something"` Can I do this without `if` command?


SMTP server that works with gmail?

I'm running debian and in the past I used google apps free edition. That is no longer available so I won't be able to use it for my new domain on my new box. In the past when I tried to setup a smtp server I could not send emails to my gmail account. I believe the problem was I didn't have SSL How do I setup a fairly straightforward SMTP server? I need 1 or 2 outgoing email address and I'll want a catchall that forwards a copy to my main email address. I don't know what words to do a search for. Also is it possible to send emails to gmail without a SSL certificate? Perhaps using an IP address instead of a domain? IE me@123.456.789.10 to me@gmail.com?


`wait` doesn't wait for `wget --background`

I have gone through several SE posts on the unix wait command and none of the posts resolve my problem. I have a weather forecast model to run. It has first to prepare some folders, then download data using wget, then run the forecast. The data download can take anything up to 30-60 minutes due to low speed. What happens is that when the data download starts the program goes ahead to run commands before the data is ready. Below is my crontab entry to start the run               15 09 * * * /bin/bash /home/zmumba/WRF/SCRIPTS/wrf_run_00.sh &      This is to run at 09 15 everyday, every week and every month. The files to run in wrf_run_00.sh are               !/bin/bash     year=`date "+%Y"`     month=`date "+%m"`     day=`date "+%d"`      source /home/zmumba/.bashrc          perl /home/zmumba/WRF/SCRIPTS/wrf_Namelists_and_Dirs_00_Daily.pl     perl /home/zmumba/WRF/SCRIPTS/download-file_gen00.pl          wget --directory-prefix=/home/zmumba/WRF/DATA/${year}${month}${day}00 --background --continue --progress=bar --input-file=/home/zmumba/WRF/SCRIPTS/download-file-list-one_deg_00.txt           wait$!          cd /home/zmumba/WRF/WPS      and the rest of the commands to run the model follow. Any assistance will be appreciated.


How can I increase the acceleration of the mouse wheel via xinput?

I have a Microsoft wireless USB mouse whose scroll wheel seems to have absolutely no acceleration whatsoever on Linux. On Windows and OSX, the faster I scroll, the faster the page scrolls, and vice versa. I managed to use xinput to change the mouse sensitivity settings following this guide, and it worked great. But when I follow the same steps to change the mouse wheel settings, nothing seems to change. Here is the output of `$ xinput --list-props` on my device:               Device 'Microsoft Microsoft® 2.4GHz Transceiver v8.0':         Device Enabled (133):   1         Coordinate Transformation Matrix (135): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000         Device Accel Profile (259): 0         Device Accel Constant Deceleration (260):   1.000000         Device Accel Adaptive Deceleration (261):   1.500000         Device Accel Velocity Scaling (262):    0.125000         Device Product ID (250):    1118, 1970         Device Node (251):  "/dev/input/event2"         Evdev Axis Inversion (263): 0, 0         Evdev Axes Swap (265):  0         Axis Labels (266):  "Rel X" (143), "Rel Y" (144), "Rel Horiz Wheel" (256), "Rel Dial" (257), "Rel Vert Wheel" (258)         Button Labels (267):    "Button Left" (136), "Button Middle" (137), "Button Right" (138), "Button Wheel Up" (139), "Button Wheel Down" (140), "Button Horiz Wheel Left" (141), "Button Horiz Wheel Right" (142), "Button Side" (254), "Button Extra" (255), "Button Unknown" (253), "Button Unknown" (253), "Button Unknown" (253), "Button Unknown" (253)         Evdev Middle Button Emulation (268):    0         Evdev Middle Button Timeout (269):  50         Evdev Third Button Emulation (270): 0         Evdev Third Button Emulation Timeout (271): 1000         Evdev Third Button Emulation Button (272):  3         Evdev Third Button Emulation Threshold (273):   20a         Evdev Wheel Emulation (274):    0         Evdev Wheel Emulation Axes (275):   0, 0, 4, 5         Evdev Wheel Emulation Inertia (276):    10         Evdev Wheel Emulation Timeout (277):    200         Evdev Wheel Emulation Button (278): 4         Evdev Drag Lock Buttons (279):  0      I've modified properties 274 to 278, but no changes resulted. My distribution is Debian Linux, desktop environment is Xfce, and computer is a Lenovo Thinkpad X201, though this problem seems to only be specific to this mouse rather than any of those things. Am I missing something via the xinput method, or should I try something else entirely? edit: I should specify that I am trying to _increase_ the speed of the mouse wheel, preferably via acceleration, as scrolling is painfully slow at the moment.


Need to create a ksh script for transferring files between application server and db server

I have a requirement where I need to automate the transfer of a particular file from one location in the application server to the database server. I can do it manually by using these steps but I need it in the script               #! /bin/ksh          directory path where the file need to be          ftp (hostname of the application server)           username           password          file location in the apps server          get filename          quit      Any help is really appreciated.


Have grep output spaced for each file

When I do grep on a bunch of files, and several file have the word I am looking for, the output is hard to read as it's one after the other. Is there anyway to insert additional \n's after the matching output of each file. Example, current output what I get               $ grep word daily_log.201407*     <daily_log.20140702-matches  about 100 lines>     <daily_log.20140704-matches  about 10 lines>     <daily_log.20140706-matches  about 50 lines>      Trying to achieve something like               $ grep word daily_log.201407*     <daily_log.20140702-matches  about 100 lines>               <daily_log.20140704-matches  about 10 lines>               <daily_log.20140706-matches  about 50 lines>      Hope the question is clear. Any way to do this?


System hangs on shutdown/restart - is ssh involved?

If I ssh into my server and do 'shutdown -r now', the shutdown hangs on the message 'Sending processes the KILL signal', and I have to walk into the lab and use the power button to force a shutdown. When I do the same thing on a session with a locally attached keyboard/monitor, the shutdown works fine. How do I at least confirm what process is hanging?


ssh_config: specify command to be executed on the remote machine upon login

This is an expansion of my earlier question. I need to run a **locally- stored** command (i.e. `mount /home`) on a remote machine upon ssh login. At the moment, I am using:               ssh -t mymachine.example.com 'mount /home ; /bin/bash'      which works fine, but I was wondering whether I could put this command into my `.ssh/config` so that I don't have to type it every time. I found a `LocalCommand` option, but I don't see any `RemoteCommand` option. It is importand that the `command-to-be-executed` be stored on the local machine, as it will contain password to open an encrypted disk. That is the reason why I cannot put the command into `.profile` on the remote machine.


how can I set a login prompt as soon as possible in the boot sequence?

I want my login prompt to come as soon as few necessary drivers are loaded. So for example once SPI driver is loaded, I will put the login prompt application just below SPI driver , and the CPU will execute this login application. Ultimately I will be having a fully running login prompt on the console just after loading of SPI drivers is over. How can I set a login prompt as soon as possible in the boot sequence? How should I proceed?


Documentation for vifm?

![enter image description here](http://i.stack.imgur.com/pJzPB.png) `vifm` looks like a good file manager, but it lacks documentation. Is there a manual or tips on how to use it? I'm looking for information on copying/moving a dir, creating a new empty file, editing a file, creating sym/hardlink, etc.


added new library, old one hanging around

In ubuntu 12.04, I downloaded the source for a geospatial library, gdal-1.11.0, into ~/src, configured it and compiled it successfully, it seemed. New files such as `libgdal.a` got put into /usr/local/lib. However when I run a program that depends on it,               $ ogrinfo --formats      I get               ERROR 1: ogrinfo was compiled against GDAL 1.11 but current library version is 1.10      It seems I haven't removed the older version of GDAL. How should I do that? Some info about my system:               $ uname -a     Linux ubuntu 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux


sendmail not sending to the cloud (local mail works)

I'm using a perl module (Mail::Sendmail) which uses `sendmail` to send stuff. It hasn't been working, but hasn't been giving me any errors. So now I suspect `sendmail`. I tried:               telnet 127.0.0.1 25     mail from:root@localhost.com     rcpt to:max@f33r.com     data      subject: subject line      sgiopjsdoigjsd      sdgsdg           sdgfsdg      .     quit      I get the "mail accepted for delivery" message, which is what should happen. I wait around for a couple minutes and nothing in my inbox. So I take a look at `/var/log/maillog.3` and it doesn't have anything pertaining to what I just did. I tried sending mail locally to another user by doing `mail user@localhost.localdomain` and that worked. But still nothing in the logs (which makes me believe the real logs are somewhere else). **Summing up:**   * Can't send mail to the cloud, but it works locally   * Unknown location of sendmail log file


How to improve this backup script?

I wrote this backup script. I run `rsync`, `tar` and a dump of mysql. I'd like to add some features like email alert or some kind of statistic. Here is the script:               #!/bin/sh          DATE=`date +%D-%T`     ORIGIN=/home/share/     DEST=/media/BACKUP/mercurio/     LOGFILE=log.txt     echo "=====Starting backup on $DATE =====" >> $LOGFILE     echo "==Start rsync" >> $LOGFILE      rsync -arHu --delete --stats $ORIGIN $DEST/share >> $LOGFILE     wait     if [ $? -eq 0 ]     then             echo "==rsync ok"  >> $LOGFILE     else             echo "==rsync ko"   >> $LOGFILE     fi          echo "==Sart TAR" >> $LOGFILE     tar -czf $DEST`date +%y%m%d-%T`.tar.gz $ORIGIN     wait     if [ $? -eq 0 ]     then             echo "==tar ok" >> $LOGFILE     else             echo "==tar ko" >> $LOGFILE     fi     echo "==Start DUMP" >> $LOGFILE     mysqldump -u root -ptoor --all-databases > ${DEST}databases/`date +%Y%m%d-%k:%M`.sql     wait     if [$? -eq 0 ]     then             echo "==dump ok" >> $LOGFILE     else              echo "==dump ko" >> $LOGFILE     fi     echo "=====End Bakcup=====" >> $LOGFILE


Is there a tool to visualize a filesystem allocation map on Linux?

May you have ever used filesystem defragmentation tools (like Norton SpeedDisk or Piriform Defraggler) on Windows, you have probably seen such a diagram: ![Defraggler ](http://i.stack.imgur.com/2RlKW.png) It displays a filesystem sectors map, painting (as for this particular example) sectors (sets of sectors actually, to fit the whole partition in the screen) occupied by non-fragmented (contiguous) files in blue, the opposite in red and free sectors in white (and some more colours for some more particular cases which can happen to be of interest). You can click on a "sector" and see what particular files "live" there. Is there such a visualization tool for Linux? UPDATE: I've accepted sr_'s answer as it seems perfectly the answer to the question but I would be really happy to see a better option :-)


Why does find -exec du sum up differently?

I have family pictures and movies in a folder /media/data/Selbstgemacht and I'd like to find the size of all pictures. In /media/data I use `find Selbstgemacht -type f -iname '*.jpg' -exec du -ch '{}' +` which returns 5,1GB.   However, if I step down into the folder "Selbstgemacht" and use `find . -type f -iname '*.jpg' -exec du -ch '{}' +` it returns 7,0GB. I then compared the output of find to check if they find the same files:   From parent folder `find Selbstgemacht -type f -iname '*.jpg' -printf '%P\n' |sort > test1.txt`   From subfolder `find . -type f -iname '*.jpg' -printf '%P\n' |sort > ../test2.txt` The files are identical, so both find commands find exactly the same files, which leads me to thinking that the difference in the size du reports must be due to something else. What exactly is the cause here? System information:   * Debian stable    * find (GNU findutils) 4.4.2      * D_TYPE O_NOFOLLOW(enabled)     * LEAF_OPTIMISATION, FTS(), CBO(level=0)    * du (GNU coreutils) 8.13


How can I use grep to search multiple unnested directories?

It may sound like I'm asking the same thing as this question, but I have different requirements. This is an example of my filesystem:   * /code/      * internal/        * dev/       * main/     * public/        * dev/       * main/       * release/     * tools/ /code/internal/dev/, /code/public/dev/ and /code/tools/ contain subdirectories for multiple projects. I work almost exclusively in the dev branches of /code/internal/ and /code/public/, and often I want to search for a text string in those directories along with /code/tools/ (which has no branches). In these instances I have to do three separate commands:               $ grep -r "some string" /code/internal/dev/     $ grep -r "some string" /code/public/dev/     $ grep -r "some string" /code/tools/      I'd like to know if there's a single command to do this. If not, I would most likely need to write a simple bash script.


A distro that supports intel/nvidia hybrid graphics out of the box

I've spent so much time trying to get various flavours of Linux to run on my Dell XPS LS02 laptop which only has a HDMI output. I've tried all sorts of solutions and methods including http://bumblebee- project.org/ However none have managed to get me a stable second display working. The question, is there any distribution that supports the intel/nvidia(optimus) hybrid chipset out of the box?


Can't apply chmod to a file

I have a file on my HDD,               cd /media/celebisait/5AC69788C6976355      There is my file called `myFile.tar.gz`. I do a`ls -l`,               -rw------- 2 celebisait celebisait  1387745311 Jun  6  2013 myFile.tar.gz      Everything seems fine. However, when I do,               $ sudo chmod 755 myFile.tar.gz      I do not have any errors but nothing happens, i.e., when I do `ls -l` again, I get the same output,               -rw------- 2 celebisait celebisait  1387745311 Jun  6  2013 myFile.tar.gz      Chmod does not change.. Why? PS: I use Ubuntu 13.04. ## Edit:               $ cd /media/celebisait/5AC69788C6976355     $ df          Filesystem     1K-blocks      Used Available Use% Mounted on     /dev/sda2       89873576  42976028  42325544  51% /     none                   4         0         4   0% /sys/fs/cgroup     udev            16436736         4  16436732   1% /dev     tmpfs            3289260       920   3288340   1% /run     none                5120         0      5120   0% /run/lock     none            16446280       764  16445516   1% /run/shm     none              102400        52    102348   1% /run/user     /dev/sda1          94759      2208     92551   3% /boot/efi     /dev/sdb1      767999996 541212516 226787480  71% /media/celebisait/5AC69788C6976355     /dev/sdb2      767999996   1466472 766533524   1% /media/celebisait/54D09DBDD09DA5B0      ## Edit 2:               $ cd /media/celebisait/5AC69788C6976355     $ mount          /dev/sda2 on / type ext4 (rw,errors=remount-ro)     proc on /proc type proc (rw,noexec,nosuid,nodev)     sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)     none on /sys/fs/cgroup type tmpfs (rw)     none on /sys/fs/fuse/connections type fusectl (rw)     none on /sys/kernel/debug type debugfs (rw)     none on /sys/kernel/security type securityfs (rw)     none on /sys/firmware/efi/efivars type efivarfs (rw)     udev on /dev type devtmpfs (rw,mode=0755)     devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)     tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)     none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)     none on /run/shm type tmpfs (rw,nosuid,nodev)     none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)     /dev/sda1 on /boot/efi type vfat (rw)     binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)     gvfsd-fuse on /run/user/celebisait/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=celebisait)     /dev/sdb1 on /media/celebisait/5AC69788C6976355 type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)     /dev/sdb2 on /media/celebisait/54D09DBDD09DA5B0 type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,blksize=4096)      ## Edit 3:               $ sudo fdisk -l /dev/sdb1          Disk /dev/sdb1: 786.4 GB, 786432000000 bytes     255 heads, 63 sectors/track, 95611 cylinders, total 1536000000 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x6e697373          This doesn't look like a partition table     Probably you selected the wrong device.               Device Boot      Start         End      Blocks   Id  System     /dev/sdb1p1   ?  1936269394  3772285809   918008208   4f  QNX4.x 3rd part     Partition 1 does not start on physical sector boundary.     /dev/sdb1p2   ?  1917848077  2462285169   272218546+  73  Unknown     Partition 2 does not start on physical sector boundary.     /dev/sdb1p3   ?  1818575915  2362751050   272087568   2b  Unknown     Partition 3 does not start on physical sector boundary.     /dev/sdb1p4   ?  2844524554  2844579527       27487   61  SpeedStor     Partition 4 does not start on physical sector boundary.          Partition table entries are not in disk order      ## Edit 4:               $ sudo fdisk -l /dev/sdb          Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes     255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x9c73d093             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1            2048  1536002047   768000000    7  HPFS/NTFS/exFAT     /dev/sdb2      1536002048  3072002047   768000000    7  HPFS/NTFS/exFAT     /dev/sdb3      3072002048  3907026943   417512448    7  HPFS/NTFS/exFAT


File descriptors & shell scripting

I am having a very hard time understanding how does one use file descriptors in shell scripts. I know the basics such as               exec 5 > /tmp/foo      So fd 5 is attached to foo for writing.               exec 6 < /tmp/bar      … for reading.               exec 5>&-      … close fd. Now what does this do?               #!/bin/bash          exec 5 > /tmp/foo      exec 6 < /tmp/bar           cat <&6 | while read a     do          echo $a >&5     done      As i understand `&5` closes the fd, so how is the output still being re- directed successfully after each call? This is a copy pasta from : Here It claims using this over a simple `echo $a > file` would make it much quicker, I however fail to understand. I would appreciate any links to decent tutorial. I google powers seem to be failing me.


High CPU utilization with zip command

When I am using the `zip` utility in Linux to compress files, CPU utilization is going to 100%. Can anybody help me why CPU utilization is so high? I'm using the command:               zip file_name *.xml


Lubuntu PowerPC with no apt repositories?

I've installed Lubuntu 13.04 on my G4 Mac Mini, however it didn't have any `apt` repositories, except from the CD. I've copied over the repositories from my i386 installation, but it can't find some of them. What repositories do I need to make it work? **Output from`apt-get update`:**               ...          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/main/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/restricted/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/universe/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/multiverse/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.200 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring/main/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring/restricted/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring/universe/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring/multiverse/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring-updates/main/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring-updates/restricted/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring-updates/universe/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring-updates/multiverse/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring-backports/main/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring-backports/restricted/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring-backports/universe/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/raring-backports/multiverse/binary-powerpc/Packages  404  Not Found [IP: 91.189.92.177 80]          E: Some index files failed to download. They have been ignored, or old ones used instead.      **Old`/etc/apt/sources.list`:**               deb cdrom:[Lubuntu 13.04 _Raring Ringtail_ - Release powerpc (20130424)]/ raring main multiverse restricted universe      **`/etc/apt/sources.list` copied from i386:**               # deb cdrom:[Lubuntu 13.04 _Raring Ringtail_ - Release i386 (20130423.1)]/ raring main multiverse restricted universe          # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to     # newer versions of the distribution.     deb http://gb.archive.ubuntu.com/ubuntu/ raring main restricted     deb-src http://gb.archive.ubuntu.com/ubuntu/ raring main restricted          ## Major bug fix updates produced after the final release of the     ## distribution.     deb http://gb.archive.ubuntu.com/ubuntu/ raring-updates main restricted     deb-src http://gb.archive.ubuntu.com/ubuntu/ raring-updates main restricted          ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu     ## team. Also, please note that software in universe WILL NOT receive any     ## review or updates from the Ubuntu security team.     deb http://gb.archive.ubuntu.com/ubuntu/ raring universe     deb-src http://gb.archive.ubuntu.com/ubuntu/ raring universe     deb http://gb.archive.ubuntu.com/ubuntu/ raring-updates universe     deb-src http://gb.archive.ubuntu.com/ubuntu/ raring-updates universe          ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu      ## team, and may not be under a free licence. Please satisfy yourself as to      ## your rights to use the software. Also, please note that software in      ## multiverse WILL NOT receive any review or updates from the Ubuntu     ## security team.     deb http://gb.archive.ubuntu.com/ubuntu/ raring multiverse     deb-src http://gb.archive.ubuntu.com/ubuntu/ raring multiverse     deb http://gb.archive.ubuntu.com/ubuntu/ raring-updates multiverse     deb-src http://gb.archive.ubuntu.com/ubuntu/ raring-updates multiverse          ## N.B. software from this repository may not have been tested as     ## extensively as that contained in the main release, although it includes     ## newer versions of some applications which may provide useful features.     ## Also, please note that software in backports WILL NOT receive any review     ## or updates from the Ubuntu security team.     deb http://gb.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse     deb-src http://gb.archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse          deb http://security.ubuntu.com/ubuntu raring-security main restricted     deb-src http://security.ubuntu.com/ubuntu raring-security main restricted     deb http://security.ubuntu.com/ubuntu raring-security universe     deb-src http://security.ubuntu.com/ubuntu raring-security universe     deb http://security.ubuntu.com/ubuntu raring-security multiverse     deb-src http://security.ubuntu.com/ubuntu raring-security multiverse          ## Uncomment the following two lines to add software from Canonical's     ## 'partner' repository.     ## This software is not part of Ubuntu, but is offered by Canonical and the     ## respective vendors as a service to Ubuntu users.     # deb http://archive.canonical.com/ubuntu raring partner     # deb-src http://archive.canonical.com/ubuntu raring partner          ## This software is not part of Ubuntu, but is offered by third-party     ## developers who want to ship their latest software.     deb http://extras.ubuntu.com/ubuntu raring main     deb-src http://extras.ubuntu.com/ubuntu raring main


Where did Redhat derive from?

Where did Redhat derive from? Did it derive directly from Linus Torvaldis linux distro (2 years earlier) or did it have roots in BSD or System-V ?? I am just wondering how to classify Redhat in the Linux world.               1991     Linus Torvalds releases the Linux® kernel.     1993     Bob Young incorporates ACC Corporation, a catalog business      that sells Linux and UNIX software accessories and books,      and distributes a magazine called New York UNIX.     1994     Marc Ewing creates his own distribution of Linux, which he     names Red Hat® Linux. Released in October, it becomes known      as the Halloween release.


PekWM doesn't List Minimized Windows

I recently installed the PekWM. I noticed when I minimize any window,it will be removed from `ATL+TAB` List. In other words "the minimized windows are not listed in `ALT+TAB` menu."   I want to know it is by design or it is a bug. If it is a bug is there any workaround to fix it.


Where did /usr/lib64 go and what is /usr/lib/x86_64-linux-gnu?

I have two Ubuntu-x86_64 systems. One is version 10.04, the other 12.04 and there is a difference in the structure of the lib directories. This doesn't surprise me, but I'm curious if anyone knows why. Is there a good™ reason why? **10.04** `2.6.32-38-server #83-Ubuntu SMP Wed Jan 4 11:26:59 UTC 2012 x86_64 GNU/Linux`               /usr/lib     /usr/lib32     /usr/lib64      **12.04** `3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 GNU/Linux`               /usr/lib     /usr/lib/x86_64-linux-gnu


crontab error with (No MTA installed) but I use >/dev/null 2>&1

I'm new on linux user I try to run crontab to backup my database with vagrant user               * * * * * /usr/bin/mysqldump -h localhost -u root -p root mydb | gzip > /var/backup/all/database_`date +%Y-%m-%d`.sql.gz >/dev/null 2>&1      when the crontab runs there is no backup file in the folder (my backup/all has the permission scheme `755`). This is error from `/var/log/syslog`               Aug 16 11:55:01 precise64 CRON[2213]: (vagrant) CMD (/usr/bin/mysqldump -h localhost -u root -p root mydb | gzip > /var/backup/all/database_`date +%Y-%m-%d`.sql.gz >/dev/null 2>&1)     Aug 16 11:55:01 precise64 CRON[2212]: (CRON) info (No MTA installed, discarding output)      So I think   1. it's about crontab can't create backup file because of Permission denied.   2. it's about I'm didn't install MTA but I use `>/dev/null 2>&1` to disable crontab to sent it to email why it error ?


installing synaptic package manager from outside the repos

I have been facing some problems in installing software with ubuntu software center, due to the fact that I have not been able to run no proxy for the whole system, I have tried all methods prescribed in various websites to do the same but i always get `407 Proxy Authentication Required`. So I want to install synaptic package manager through source code or .deb file which can be downloaded from the internet and then installed manually. Please post the link from which the same can downloaded and also steps to install it manually. A little detail would be of great help as I am a beginner and unaware of the nuances. As suggested in one of the answers when i download the .deb package and perform `sudo dpkg -i synaptic_0.81.2_amd64.deb` in the terminal this is what happens... ![enter image description here](http://i.stack.imgur.com/sZePa.png) I am not able to make out where there has been a mistake.


How to parse XML to CSV with a shell script?

What is the ideal way to parse an `.xml` file into a `.csv` file that I could include with my shell scripts. I know bash cant do it but I'm unsure if I should try in `awk` or `sed`. I imagine a language would be the best solution such as python but I do not know python nor have I touched it.


Terminal Root Command Warning

Is it possible to write a script (or change some file) in order to warn the user that they are using a command that is normally reserved for root? And if so, how? I'm currently the administrator of my machine, but I'd still like a warning that reminds me I'm using a root command.


How can I extract/parse a complete URL from a semi random string?

I'd like to have bash parse/extract a full URL (and only the url) from a random short string. Examples:               bob, the address is http://www.google.com      or               https://foo.com/category/example.html is up      or               Error 123 occurred at http://bit.ly/~1223456677878      or               Stats are up: https://foo1234.net/report.jpg      I tried using `cat foo_output | egrep -o "https?://[\w'-\.]*\s"` but that didn't seem to work.


Is there a way to communicate with someone at their desktop?

My wife is sitting at her home desktop, `alpha`, which is running a recent version of Ubuntu. I am on a bus, using ConnectBot on my G1 phone, and can SSH into `alpha` from wherever I am. For complicated reasons, I cannot use IM, email, or the telephone in order to contact her. (E.g. I don't want to wake the baby, my IM client is broken, my email server is down.) My only option is to ssh into `alpha` remotely and try to somehow make something appear on the screen. She's using KDE; how can I make something pop up to get her attention and let her know I'm trying to communicate with her? I thought it was possible to remotely trigger something (like xmessage) to appear on her screen even though my SSH session doesn't have an X display. EDIT: To clarify, my phone is not running any flavor of X, so X-over-ssh is not possible. Would the following work?               $ export DISPLAY=:0     $ xmessage "test"


Multiple Users on a Desktop Environment

This is probably a REALLY stupid question. But anyways, lets pretend we had a *nix rather powerful system... Now Obviously I know you can set up multiple users to login to a system.......but how exactly do you do that? Like....how would all the monitors connect and such, or would you need a smaller computer node that like....reroutes it or something? I know that probably sounds dumb...but how do System Admins and such set up multiple users for a *nix system? across a large building or something?


Intel Z68 chipset raid5 disappeared

I have this motherboard, it's a gigabyte Intel Z68 chipset. I used the Intel chipset configuration (between BIOS and OS) to configure a 3 disk Raid5 array which I formatted as NTFS (Linux already has a 2 Disk Raid1 ext3 array). One of the nice things about using NTFS is that I had a large raid array that both operating systems could see. This changed today and I still cannot figure out why. I don't think I did any upgrades and all of the dev nodes for the individual drives are still there but my Linux system does not recognize the presence of the array. Does anyone have any suggestions? I'm stumped. System: Archlinux x64 Windows 7 x64 (Still sees raid array just fine) edit: I just rebooted (which I had done 3 or 4 times before already) and now it's back. I'll check dmesg if it happens again. Newbie mistake forgetting to check that.


Play RTMP stream from command-line

I've managed to get flvstreamer to read a radio station's RTMP stream with the options `--live -r [url]`, and it outputs what I guess is the raw audio data + stream info to stdout. Can I make it play the stream through my speakers, from the command-line? Possibly by sending sending the raw audio data to `mplayer` or something else. Thanks. * * * I got it to work with the command `./flvstreamer_x86 --live --quiet -r [url] --buffer 3000 | mplayer -vo null -`, **but it quits after a couple of seconds to a couple of minutes**. I added `--buffer 3000` to imitate what I saw when tracing the original Flash player with Wireshark. These are the last rows of output.               [pulse] working around probably broken pause functionality,             see http://www.pulseaudio.org/ticket/440     AO: [pulse] Init failed: Connection refused     Failed to initialize audio driver 'pulse'     AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)     Video: no video     Starting playback...     FAAD: Failed to decode frame: Maximum number of bitstream elements exceeded     A:16866.9 ( 4:41:06.9) of 0.0 (unknown)  8.1%          Exiting... (End of file)      This was with flvstreamer 1.81. I couldn't get it to work with any version above, they just output               FLVStreamer v2.1c1     (c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL     Connecting ...     ERROR: rtmp server sent error     Starting Live Stream     FLV☺♣               Metadata:       audiodatarate         48.00       audiosamplerate       44100.00       audiocodecid          10.00     [stripped]      How can I make it play continuously? Thanks.


Unique hardware signatures in BSD?

What unique hardware signatures can you get from, for example, a FreeBSD system? I am right now using the ethernet mac address (getifaddrs(3)) but as we all know this can easily be changed with ifconfig. So what else is there? Anything in sysctl? I am using C to do this so if I can just find out where to look I will most likely find a way to get it.


Several versions of JAVA on one PC

I want to use jre-1_5_0_21 on my Fedora 14 box. Here's whats installed on my PC:               $ update-alternatives --config java          There are 2 programs which provide 'java'.            Selection    Command     -----------------------------------------------     *+ 1           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java        2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java          Enter to keep the current selection[+], or type selection number: 1     failed to create /var/lib/alternatives/java.new: Permission denied     $       rpm -qa               $ rpm -qa | grep -i java     java-1.6.0-openjdk-plugin-1.6.0.0-52.1.9.7.fc14.i686     java-1.6.0-openjdk-1.6.0.0-52.1.9.7.fc14.i686     java-1.5.0-gcj-1.5.0.0-34.fc14.i686     java_cup-0.11a-4.fc13.noarch     tzdata-java-2011d-3.fc14.noarch     $       How can I have several versions of java installed on my PC, and selecting it by: "update-alternatives --config java"?      UPDATE: so like when having several php versions on a webserver, I need to have several versions of JAVA, and it would be a practical thing to switch between the versions with "update-alternatives" then restart the webbrowser -> then the applet, that needs previous version of java [...] would start simply [...]      Thanks!


What preparations should I make before reinstalling windows?

Since Windows still does not offer means to skip rewriting the MBR, what can I do _before_ reinstalling Windows to get Grub2 back into the MBR as easy as possible? (I'll also appreciate it if the answer then describes _how_ to restore Grub)


Locking the screen via CLI?

Is there any way that I can lock the screen CLI-style? I'm trying to target as many desktop managers as possible (mostly LightDM, but GDM, KDM, SLiM, XScreensaver, etc. would be great too), but I can only dig things up for GDM and XScreensaver. For GDM, it would be:               gnome-screensaver-command -l      For XScreensaver:               xscreensaver-command -lock      Is there a similar command for KDM and LightDM?


What do you filter / exclude list when doing backup with rsync?

I'm trying to build a comprehensive filter / exclude file, to prevent backuping stuff that doesn't make sense do backup, such as temporary / cache data or easily recreatable files. I would appreciate if you could share (part of) your exclude list for rsync backups. Here is what I have so far:               ## Universal excludes          lost+found     ld.so.cache          # backup text files (e.g. from Emacs)     - *~     - \#*\#          # Commonly distributed Mac OS X cache     - .DS_Store          # Commonly distributed Windows cache     - Thumbs.db          ## Root file system     - /dev/     - /etc/modules.conf     - /media/     - /proc/     - /sys/     - /tmp/     - /usr/portage/     - /usr/src/     - /var/tmp/     - /var/log/          # Of the mounted stuff, whitelist only my two data partitions     - /mnt/     + /mnt/data1     + /mnt/data2          # Common package managers (apt, yum)     - /var/cache/apt/     - /var/cache/yum/          ## Filters for home dirs (assumes /home/<user> dir structure)          # Cache     - /home/*/.cache/          # Downloads     - /home/*/Downloads/     + /home/*/Downloads/src/          # Dropbox     - /home/*/Dropbox          # Temporary files / cache     - /home/*/.local/share/Trash     - /home/*/.cache     - /home/*/.Trash          # X Windows System     - /home/*/.xsession-errors*          # Gnome temp stuff     - /home/*/.compiz*/session     - /home/*/.gksu.lock     - /home/*/.gvfs          # Common Applications          # Adobe Reader     - /home/*/.adobe/**/AssetCache/     - /home/*/.adobe/**/Cache/     - /home/*/.adobe/**/Temp/     - /home/*/.adobe/**/UserCache.bin          # Dropbox temp stuff     - /home/*/.dropbox/     - /home/*/.dropbox-dist/          # Gimp     - /.gimp-*/tmp     - /.gimp-*/swap          # Mozilla Firefox     - /home/*/.mozilla/firefox/*/Cache/     - /home/*/.mozilla/firefox/*/lock     - /home/*/.mozilla/firefox/*/.parentlock          # Mozilla Thunderbird     - /home/*/.mozilla-thunderbird/*/lock     - /home/*/.mozilla-thunderbird/*/.parentlock          # Pidgin (accounts.xml contains passwords in clear text)     - /home/*/.purple/accounts.xml      What else do you think would be useful to add to this filter file, or what do you use and why?


iptables forwarding and routing

In fact, this question is about openwrt and CoovaAP, but I guess it's the same in other linux distributions. I've two interfaces, a "wan" and a "wlan" interface. Is there by default any filter, which restricts which packets are forwarded from the wlan interface to the wan? Especially if the wlan interface on the router is 192.168.1.1 and someone connected to this interface enters 172.16.1.1 as IP on his machine. Are his packets then forwarded anyway? Is the routing decision only made up by the destination IP or is it influenced by the source? I think the problem would be that answers to the 172.16.1.1 machine wouldn't make their way back. Could the iptables forward rules make the interfaces behave like a switch? If I wanted 172.16.x to be forwarded, I could setup an alias on this physical interface. Is there another way? The default Coova firewall script just says               iptables -A FORWARD -i $WIFI -o $WAN -j ACCEPT      I disabled masquerading. Is it possible to "separate" networks in this way and to rely on this? Is there a way someone could make his packets be forwarded with a not-192.168.1.x address? The reason for this question is, that behind the WAN-interface are machines which should not be reachable for WLAN users. Those machines rely on the source-IP address.


Thin client that is only allowed to run certain applications

Im thinking about testing out LTSP on a PPC server for a handful of PPC macs. Before I go ahead with testing and building out everything, is it possible to limit what apps are ran on the thin client? Lets say I only want the thin client to be able to run a web browser and adobe reader, is that possible? Almost like an internet café. I'm also open to other suggestions, maybe thin provisioning isn't the right track to head down if I want a really 'locked' down OS.


how to download a file using just bash and nothing else (no curl, wget, perl, etc.)

I have a minimal headless *nix which **does not have** any command line utilities for downloading files (e.g. no curl, wget, etc). I only have bash. How can I download a file? Ideally, I would like a solution that would work across a wide range of *nix.


Create a GPT partition covering the free space

I have 480 GB SSD it currently has the following partitions 256MB EFI partition, 16GB SWAP, and 40GB CentOS 7 see details from `lshw` below. I want to use the remaining 400GB of unused space on the drive as an iSCSI target. The system only has /dev/sda1, /dev/sda2, /dev/sda3, there is no /dev/sda4 mapped to the 400GB of free disk space on the SSD. How do I add /dev/sda4 and map it to the unused 400DB on my disk so that it can be used as an iSCSI target? I am on CentOS 7.               *-scsi               physical id: 1               logical name: scsi3               capabilities: emulated             *-disk                  description: ATA Disk                  product: Crucial_CT480M50                  physical id: 0.0.0                  bus info: scsi@3:0.0.0                  logical name: /dev/sda                  version: MU03                  serial: 13440956E89D                  size: 447GiB (480GB)                  capabilities: gpt-1.00 partitioned partitioned:gpt                  configuration: ansiversion=5 guid=ab9704e2-9162-4c08-a759-956ad6a2f8f1 logicalsectorsize=512 sectorsize=4096                *-volume:0 UNCLAIMED                     description: Windows FAT volume                     vendor: mkfs.fat                     physical id: 1                     bus info: scsi@3:0.0.0,1                     version: FAT16                     serial: fa26-fbee                     size: 255MiB                     capacity: 255MiB                     capabilities: boot fat initialized                     configuration: FATs=2 filesystem=fat name=EFI System Partition                *-volume:1                     description: Linux swap volume                     vendor: Linux                     physical id: 2                     bus info: scsi@3:0.0.0,2                     logical name: /dev/sda2                     version: 1                     serial: c2b0907a-8337-4f32-b1e9-9affe6927264                     size: 15GiB                     capacity: 15GiB                     capabilities: nofs swap initialized                     configuration: filesystem=swap pagesize=4095                *-volume:2                     description: data partition                     vendor: Windows                     physical id: 3                     bus info: scsi@3:0.0.0,3                     logical name: /dev/sda3                     logical name: /                     serial: f7efca38-7631-4a20-ae0a-04942971d5ba                     capacity: 39GiB                     configuration: mount.fstype=xfs mount.options=rw,seclabel,relatime,attr2,inode64,noquota state=mounted      fdisk -l output below.               fdisk -l /dev/sda     WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.          Disk /dev/sda: 480.1 GB, 480103981056 bytes, 937703088 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk label type: gpt               #         Start          End    Size  Type            Name      1         2048       526335    256M  EFI System      EFI System Partition      2       526336     33294335   15.6G  Linux swap            3     33294336    115214335   39.1G  Microsoft basic


How to disable styling on man pages?

Is there an easy way to turn off all styling on man pages? Colors, bold, italics, everything... If not, what is an uneasy way?


Wireless doesn't connect automatically in Ubuntu when connection is established with wifi Router Again

I am facing a problem here with Ubuntu version 10.4 I am working with. I am having a wifi router and when I start my system, Ubuntu connects to wifi automatically. But if due to some reasons the connection is lost and established again then Ubuntu wireless system doesn't connect automatically and it pops up with a window to enter the key again to connect. There are many times I keep my system ON with something to download and went away for some time, only to come back and see that the Ubuntu is waiting for my inputs to connect again as router had lost its connection. Is there any file settings needs to be done so that it connects to wifi without and user input required ? Or is there any shell script or command which can help in doing that.


Cannot start xterm over ssh after several successes

I am running some MATLAB scripts on the command-line of a remote computer using `ssh`. These scripts launch 5 `xterms` that are forwarded to me via ssh (using the `-X` option). At the moment I am debugging my code so I am restarting my scripts every now and then. Everything works fine for a couple of runs, but after the N'th time (where N is a random number) I get theses error messages:               xterm Xt error: Can't open display: localhost:10.0     xterm Xt error: Can't open display: localhost:10.0     xterm Xt error: Can't open display: localhost:10.0     xterm Xt error: Can't open display: localhost:10.0     xterm Xt error: Can't open display: localhost:10.0      After this I can continue to use ssh except for starting anything GUI-related, meaning that I can no longer start `xterms` remotely. My only workaround is to restart the ssh connection. Can I fix this somehow to never be bothered again by this? **System**   * local system: privately owned laptop, running Chakra Linux, KDE   * remote system: university computer, running openSuSe, KDE


Detection of USB Modem is unstable - how can I correct this?

I am using Huawei 3G USB Modem in Ubuntu 12.04 LTS on DELL Inspiron NS5520. I tried every possible solution but had no luck. Whenever my USB Modem disconnects, I can not re-connect it and then I have to restart laptop. On restart, sometimes it detects the USB Modem and sometimes not. In Ubuntu 11.x It was working fine, but now I am using 12.04. This is the lsusb ouput:               Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub     Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub     Bus 003 Device 003: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem     Bus 001 Device 003: ID 0bda:0129 Realtek Semiconductor Corp.      Bus 001 Device 004: ID 0c45:648d Microdia      Bus 002 Device 003: ID 8087:07da Intel Corp      Any help will be greatly appreciated.


Is there a FUSE which permits transparently accessing incremental backups?

While _creating_ incremental backups is relatively simple (and can be automated, e.g. via `rdiff-backup`), in order to access a specific state of a file one first has to manually restore the backup, which is both not-simple and tedious if you need to browse through multiple states. So is there a FUSE which allows to transparently access previous states e.g. via some `filename@2013-01-23` (the backup made at that date, if existing) or `filename@{-2}` (two backups ago) syntax while the current and backup files reside on arbitrary filesystems (including remote ones, e.g. nfs backups while the current state is on a local ext3)?


Ping command results in packet loss

Whenever I `ping` on my personal computer, nothing gets displayed other than a single statement. Upon stopping execution, I see that several packets were transmitted in the statistics. On top of all this, I'm getting a rather absurd packet loss. What can I do to make `ping` react in a sane manner? I am running **Centos 6.5 64bit**. Below is an example output when I try `ping google.com`:               [root@Virus os]# ping google.com     PING google.com (74.125.230.160) 56(84) bytes of data.     ^C     --- google.com ping statistics ---     5 packets transmitted, 0 received, 100% packet loss, time 4274ms      `ifconfig -a`:               [root@Virus os]# ifconfig -a     eth0      Link encap:Ethernet  HWaddr B4:B5:2F:29:FE:D7                 UP BROADCAST MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)          lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:108 errors:0 dropped:0 overruns:0 frame:0               TX packets:108 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:9081 (8.8 KiB)  TX bytes:9081 (8.8 KiB)          wlan0     Link encap:Ethernet  HWaddr 84:4B:F5:14:9B:58                 inet addr:172.20.40.55  Bcast:172.20.255.255  Mask:255.255.0.0               inet6 addr: fe80::864b:f5ff:fe14:9b58/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:56944 errors:0 dropped:0 overruns:0 frame:0               TX packets:40200 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:55308863 (52.7 MiB)  TX bytes:6291284 (5.9 MiB)      `iptables -L`:               [root@Virus www]# iptables -L     Chain INPUT (policy ACCEPT)     target     prot opt source               destination              ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED      ACCEPT     icmp --  anywhere             anywhere                 ACCEPT     all  --  anywhere             anywhere                 ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh      REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited           Chain FORWARD (policy ACCEPT)     target     prot opt source               destination              REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited           Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination       `netstat -nr`:               [root@Virus www]# netstat -nr     Kernel IP routing table     Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     172.20.0.0      0.0.0.0         255.255.0.0     U         0 0          0 wlan0     0.0.0.0         172.20.4.254    0.0.0.0         UG        0 0          0 wlan0


I can't use the command ftp

When I try to install ftp               [root@localhost bin]# yum install ftp     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile     Setting up Install Process     No package ftp available.     Error: Nothing to do      When I try to connect to my ftp               [root@localhost bin]# ftp 10.2.4.202     -bash: ftp: command not found      with yum               [root@localhost bin]# yum ftp 10.2.4.202     Loaded plugins: fastestmirror     No such command: ftp. Please use /usr/bin/yum --help      yum search ftp               yum search ftp     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile     ====================================================================== N/S Matched: ftp ======================================================================     curl.x86_64 : A utility for getting files from remote servers (FTP, HTTP, and others)     wget.x86_64 : A utility for retrieving files using the HTTP or FTP protocols            Name and summary matches only, use "search all" for everything.      yum install lftp, list *ftp*, install ncftp (same results)                yum install lftp     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile     Setting up Install Process     No package lftp available.     Error: Nothing to do      lftp               # lftp 10.2.4.202     -bash: lftp: command not found      yum repolist               yum repolist     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile     repo id                                                           repo name                                                                            status     CactiEZ                                                           CactiUsers Cactiez Repo                                                               30     pgdg93                                                            PostgreSQL 9.3 6 - x86_64                                                            195     repolist: 225


Fedora 19: can't disable the firewall

I've installed a server (WSO2 ESB) in my laptop. When I run it, going to the browser and typing the console address `https://10.13.6.75:9443/carbon`, it works normally, but if I try it on another machine on the network, it gives timeout. Some observations:   * ping works   * telnet respond on ssh port (22) but not in 23, 8080, 9443, etc   * I've already executed `service firewalld stop`, `service iptables stop`, and disabled the `selinux`, but no results. There's another process involved blocking the requests?


Installation of QEMU, GCC for ARM in RHEL

We are setting up a lab which has the QEMU system to emulate an ARM processor and run assembly programs. The lab is currently setup with the host operating system as Ubuntu. We are migrating the lab to RHEL environment. We are going to use RHEL 5.6 version OS. These are the set of software that needs to be installed to make the lab up and running.   * QEMU Emulator - It was fairly straight-forward. I used the command **yum install qemu** and **yum install qemu-kvm** for the virtualization.    * GCC for ARM - I am actually stuck in this process. I downloaded the gcc arm from this link. I used the command, **tar xjvf gcc-arm-none-eabi-4_7-2013q1-20130313-linux.tar.bz2** to extract the file and install it. However, after installation if I run the command, **arm-none-eabi-gcc --version** it is not giving me the version but an error saying command not found.    * GDB communicating with the QEMU/ARM program being executed.  What am doing wrong in the installation process? EDIT: The contents of the tar ball after extraction are as below. There are 5 folders named,   * arm-none-eabi   * bin   * gcc- arm-none-eabi-4_7-2013q2   * lib   * share


Reasonable literature on network printing (protocols)

I need some recommendations on reasonable and up-to-date literature about network printing, the corresponding protocols (ipp, lpdp, ...), printjob authentication and accounting in heterogenous networks.


In bash, how can I echo the variable name, not the variable value?

Suppose that I have a variable `var` in bash. I can assign a value to it. For example, I will make it a string:               var="Test"      I want to `echo` the name of `var`, not the value held by `var`. (I can do the latter with `echo $var`, but I actually want to do the former.) The answer to this question from SO says to use `echo ${!var}`, but when I do that I echo just returns a blank line. For example, this bash script               #!/bin/bash          echo "Hi"     var="Test"     echo ${!var}     echo "Bye"      returns this output:               Hi          Bye      with just a blank line between **Hi** and **Bye** , instead of **var**. What am I doing wrong? I'm running **bash 4.1.5(1)** on **Ubuntu 10.04.4**.


Wildcards inside quotes

This will be an easy one, but in my memories, when shell scripting, using double quotes would allow expanding globbing and variables. But in the following code:               #!/bin/sh          echo *.sh     echo "*.sh"     echo '*.sh'          echo $LANG     echo "$LANG"     echo '$LANG'      I get this result:               bob.sh redeployJboss.sh     *.sh     *.sh     en_US.utf8     en_US.utf8     $LANG      So single quoting prevent glob AND variable expansion but double quoting allows only variable expansion and no globbing? Can I glob in any quoting pattern?


Missing Messages and Secure logs files on CentOS

I'm having troubles with CentOS release 6.4 (Final). I'm looking for log files in `/var/log/` and I'm obviously missing two files:   * `/var/logs/messages`   * `/var/log/secure` I was checking if rsyslog is running (`service rsyslog status`) and it's _OK_. My rsyslog config file is called `/etc/rsyslog.conf`, folder `/etc/rsysconf.d/` is empty. Can anyone shed some light on what's going on?


How can I delete a file with no name

I somehow managed to create a file that doesn't seem to have a filename. I found some information regarding how to get more details of the file in the following thread. However, I tried some of the suggestions listed and can't seem to delete the file. I'm not sure what I did to create it, but it happened while trying to copy an xml file. Any ideas are appreciated. Some info on the file is as follows;               > ls -lb     total 296     -rw-r--r--   1 voyager  endeavor  137627 Jan 12 12:49 \177          > file *     :               XML document          > ls -i      417777         I tried to find using the inum switch and then pipe that to rm as that seemed like the most foolproof way of getting rid of it. However, the example given at the bottom of the thread linked below failed for me. Example was;               > find -inum 41777 -exec ls -al {} \;     find: illegal option -- i     find: [-H | -L] path-list predicate-list      so I tried using the path list first like the following, but that didn't work either;               > find . -inum 41777 -exec ls -al {} \;      Any help on how to remove this file is appreciated. I'm not sure what the non- printable character \177 is or how I can pass that to an rm command, but I really want to make sure I don't mess up any other files/directories in my attempt to delete this file. Thanks.


How to find out that someone is using a Keylogger on the machine I am using?

HW/SW/whatever keyloggers are there. How to find out? E.x.: Regularly check the cable of the keyboard, because there could be HW keyloggers: http://i.imgur.com/TeMwo.jpg But what about other HW keyloggers, or Software keyloggers? [Using a Linux, e.x.: Fedora or Ubuntu for OS!] - How to track keylogger softwares/solutions? What are the "best-practises?


Mutt multi content type

Good afternoon I want to send multiple content_type with mutt. Can I do that? Here is my code :               mutt -e "set content_type=text/html" -e "set content_type=text/plain" someone@mail.com -s "Multi content_type" < body.html body.txt      I mean, I have 2 version of email body, body.html and body.txt What I want is, send both of them in same time but when someone read it, it only read one of each version. If his/her email client doesn't support html, he/she read text version instead of html version.


Note taking app that can sync both android and Linux

I've been looking high and low for an Evernote alternative for Linux. I know I can use Everpad or Evernote in WINE but they don't work natively. Any note-taking app would be fine as long as it can sync my android and my linux.


debian X Xconf resolution xrandr badmatch

Recently I minimal installed debian squeeze(amd64), when I configs my resolution, unexpected errors came out, I did a lot of searching, but couldn't find a way to figure it out.   1. to install the desktop environment: `apt-get update`, `apt-get install xorg-core xserver-xorg-core gnome-core gdm3`   2. to install graphic grivers `apt-get install build-essential nvidia-kernel-common linux-headers-$(uname -r)`, `./NVIDIA-Linux-x86_64-304.64.run` steps above seems all things is in the correctly way.   1. to set resolution : `cvt 1440 900`, `xrandr --newmode xxx`, `xrandr --addmode VGA-0 xxx` then I got that error: > X Error of failed request: BadMatch (invalid parameter attributes) Major > opcode of failed request: 153 (RANDR). Minor opcode of failed request: 18 > (RRAddOutputMode). Serial number of failed request: 29. Current serial > number in output stream: 30. I don't know what information U need, and just list some graphic card: nvidia gt630. monitor: phlips 190cw(1440x900, works well on windows) `xrandr` out put               Screen 0: minimum 8 x 8, current 1280 x 1024, maximum 16384 x 16384     DVI-I-0 disconnected (normal left inverted right x axis y axis)     VGA-0 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 338mm x 270mm        1280x1024      60.0*+   75.0          1024x768       75.0     70.1     60.0          800x600        75.0     72.2     60.3     56.2          640x480        75.0     72.8     59.9       DVI-I-1 disconnected (normal left inverted right x axis y axis)     HDMI-0 disconnected (normal left inverted right x axis y axis)       1440x900_60.00 (0x29f)  106.5MHz             h: width  1440 start 1528 end 1672 total 1904 skew    0 clock   55.9KHz             v: height  900 start  903 end  909 total  934           clock   59.9Hz      `lshw -c video` out put               *-display                       description: VGA compatible controller        product: nVidia Corporation        vendor: nVidia Corporation        physical id: 0        bus info: pci@0000:05:00.0        version: a1        width: 64 bits        clock: 33MHz        capabilities: pm msi pciexpress vga_controller bus_master cap_list rom        configuration: driver=nvidia latency=0        resources: irq:16 memory:f6000000-f6ffffff memory:e0000000-efffffff(prefetchable) memory:f0000000-f1ffffff(prefetchable) ioport:d000(size=128) memory:f7000000-f707ffff(prefetchable)      xorg.conf               Section "ServerLayout"         Identifier     "Layout0"         Screen      0  "Screen0"         InputDevice    "Keyboard0" "CoreKeyboard"         InputDevice    "Mouse0" "CorePointer"     EndSection          Section "Files"     EndSection          Section "InputDevice"         # generated from default         Identifier     "Mouse0"         Driver         "mouse"         Option         "Protocol" "auto"         Option         "Device" "/dev/psaux"         Option         "Emulate3Buttons" "no"         Option         "ZAxisMapping" "4 5"     EndSection          Section "InputDevice"         # generated from default         Identifier     "Keyboard0"         Driver         "kbd"     EndSection          Section "Monitor"         Identifier     "Monitor0"         VendorName     "Unknown"         ModelName      "Unknown"         HorizSync       30.0 - 83.0         VertRefresh     55.0 - 75.0         Option         "DPMS"     EndSection          Section "Device"         Identifier     "Device0"         Driver         "nvidia"         VendorName     "NVIDIA Corporation"     EndSection          Section "Screen"         Identifier     "Screen0"         Device         "Device0"         Monitor        "Monitor0"         DefaultDepth    24         SubSection     "Display"             Depth       24         EndSubSection     EndSection      * * * **update** : I trid to get edid: `apt-get install read-edid`, `sudo get-edid | parse-edid` but got this error:               get-edid: get-edid version 2.0.0              Performing real mode VBE call         Interrupt 0x10 ax=0x4f00 bx=0x0 cx=0x0         Function supported         Call successful              VBE version 300         VBE string at 0x11100 "NVIDIA"          VBE/DDC service about to be called         Report DDC capabilities              Performing real mode VBE call         Interrupt 0x10 ax=0x4f15 bx=0x0 cx=0x0         Function supported         Call successful              Monitor and video card combination does not support DDC1 transfers         Monitor and video card combination does not support DDC2 transfers         0 seconds per 128 byte EDID block transfer         Screen is not blanked during DDC transfer          Reading next EDID block          VBE/DDC service about to be called         Read EDID              Performing real mode VBE call         Interrupt 0x10 ax=0x4f15 bx=0x1 cx=0x0         Function supported         Call failed          The EDID data should not be trusted as the VBE call failed     Error: output block unchanged      * * * **update** I tried to force the resolution to 1440x900 by using `nvidia-settings`, after reboot, resolution changed to 1440X1024(nvidia-settings added a line to xorg.conf `Option "metamodes" "1440x1024 +0+0"`). screen become horizon- scrollable like that: ![enter image description here](http://i.stack.imgur.com/AWe06.png) I also tried to extract `edid.bin`(by using nvidia-settings) and add `Option "CustomEDID" "DFP-1:/etc/X11/edid.bin"` at `Section "Device"` to xorg.conf. thanks to the awesome post `Fixing Ugly DVI/HDMI Displays due to EDID bugs on nVidia drivers`, but unfortunately it doesn't work either. Any help is greatly appreciated. Thank you


fail2ban log parsing too slow on Raspberry Pi - options?

I'm running fail2ban on a Raspberry Pi at 950MHz which I cannot overclock further. The Pi is occasionally subject to SYN floods on particular ports. I've set up iptables to throttle the rate of SYNs on the port of interest; when the throttle limits are exceeded, hosts which send SYNs are dropped into the REJECT chain and the particular SYN packet which exceeded the limit is logged. fail2ban then watches for these logged SYNs and, after seeing a few, temporarily bans the host for a short time (this is a transient issue in the app I'm working with). The problem is that the SYN floods can occasionally reach rates which are too fast for fail2ban to keep up with; I'll see 20-40 log messages per second, and eventually fail2ban falls behind and becomes ineffective. To add insult to injury, it continues consuming a LOT of CPU as it tries to catch up. I have verified that DROP chained packets from hosts already banned by fail2ban are _not_ logged, and thus do not add to its load. What are my options here? I have a few ideas, but no clear path forward.   1. Could I make the log-parse regex "easier" so it takes fewer cycles? Would using iptables --log-prefix to put a token near the start of the log message, and/or otherwise simplifying/altering the fail2ban regex help? Here is the current fail2ban config line containing a regex:   `failregex = kernel:.*?SRC=(?:::f{4,6}:)?(?P<host>[\w\-.^_]+) DST.*?SYN`   2. Is there a faster way for fail2ban to watch for the packets exceeding the limits than parsing kern.log?   3. Could fail2ban be run under PyPy instead of CPython with minimal nonstandard wizardry (the OS is Raspbian 7, so, mostly Debian 7)?   4. Is there something better than fail2ban that I could use to watch for the packets which exceed the SYN limits, and after N exceeds in X seconds, temporarily put the offending IP into the iptables DROP bucket, and take it out when the ban timer expires? Again, I'd vastly prefer a solution that uses as much software available in Debian as possible, though I can build Debian packages in a pinch.


In Debian based systems, how do we purge configuration files of packages that have already been uninstalled?

To be more specific, I would like to do the equivalent of adding the `--purge` flag to the following command               sudo apt-get autoremove --purge [package name]      to packages that are no longer on the system. Preferably, I would like to know how to do it to specific packages and to every uninstalled package in the system.


Grep: search and replace full line

The command                grep "foo" myfile.txt      prints all matching lines in my file. Now I want to replace the **full line** with another string. How can I do that?


Is it possible in bash, to start reading a file from an arbitary byte count offset?

I want to locate a date which is somewhere in an 8 GB log (text). Can I somewhat bypass a full sequential read, and first do binary splits of the file (size), or somehow navigating the filesystem `inodes` (which I know _very_ little about), to start reading from each split point, until I find a suitable offset from where to start my text search for a line cotaining the date? `tail`'s read of the last line doesn't use a normal sequential read, so I wonder if this facility is somehow available in bash, or would I need to use Python or C/C++... but I am specifically interested in a `bash` option..


Command works with tilde at the end. How?

I'm on Ubuntu. I have a script called `myscripts` in `/usr/bin/myscripts` This script simply changes the current directory to               ~/Work/MyScripts      Normally, I simply open a terminal and type               ~/Desktop$ . myscripts      However, today, I accidentally typed               ~/Desktop$ . StartAllScript~      To my surprise, this started Tomcat (~Work/Myscripts/ has a script to start Tomcat). I also tried               ~/Desktop$ . StartAllScript      But that gave me the error               bash: StartAllScript: No such file or directory      So how did `. StartAllScript~` work?


Virtual write-only file system for storing files in archive

I have an embarrassingly parallel process that creates a huge amount of nearly (but not completely) identical files. Is there a way to archive the files "on the fly", so that the data does not consume more space than necessary? The process itself accepts command-line parameters and prints the name of each file created to stdout. I'm invoking it with `parallel --gnu` which takes care of distributing input (which comes from another process) and collecting output:               arg_generating_process | parallel --gnu my_process | magic_otf_compressor      **SIMPLE EXAMPLE** for the first part of the pipe in `bash`:               for ((f = 0; $f < 100000; f++)); do touch $f; echo $f; done      How could `magic_otf_compressor` look like? It's supposed to treat each input line as file name, copy each file to a compressed `.tar` archive (the same archive for all files processed!) and then delete it. (Actually, it should be enough to print the name of each processed file, another `| parallel --gnu rm` could take care of deleting the files.) Is there any such tool? I'm not considering compressing each file individually, this would waste far too much space. I have looked into `archivemount` (will keep file system in memory -> impossible, my files are too large and too many) and `avfs` (couldn't get it to work together with FUSE). What have I missed? I'm just one step away from hacking such a tool myself, but somebody must have done it before... **EDIT** : Essentially I think I'm looking for a stdin front-end for `libtar` (as opposed to the command-line front-end `tar` that reads arguments from, well, the command line).


Configure multiple interfaces with different hostnames using DHCP and DNS

I have a machine running Ubuntu 12.04 Server with two interfaces connected (eth0, eth1) to the network. Our network is set up so that a FreeBSD based DHCP server hands out leases and registers the client supplied host names with a DNS server on the same network. The two interfaces need to have different host names to register both on DNS. In /etc/network/interfaces I have added the hostname for eth1:               # The primary network interface (hostname: host0)     auto eth0     iface eth0 inet dhcp          # Secondary interface      auto eth1     iface eth1 inet dhcp       hostname host1      The dhcp client config looks something like this:                   option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;              send host-name "<hostname>";         request subnet-mask, broadcast-address, time-offset, routers,                 domain-name, domain-name-servers, domain-search, host-name,                 netbios-name-servers, netbios-scope, interface-mtu,                 rfc3442-classless-static-routes, ntp-servers,                 dhcp6.domain-search, dhcp6.fqdn,                 dhcp6.name-servers, dhcp6.sntp-servers;      The leases obtained look like this:               # /var/run/resolvconf/interface/eth0.dhclient     lease {       interface "eth0";       fixed-address 192.168.28.249;       option subnet-mask 255.255.255.0;       option routers 192.168.28.30;       option dhcp-lease-time 129600;       option dhcp-message-type 5;       option domain-name-servers 192.168.28.1,192.168.24.58;       option dhcp-server-identifier 192.168.28.1;       option ntp-servers 192.168.28.1,192.168.58.43,192.168.24.58;       option broadcast-address 192.168.28.255;       option domain-name "some.org";       renew 4 2014/02/20 01:00:39;       rebind 4 2014/02/20 15:31:19;       expire 4 2014/02/20 20:01:19;     }          # /var/run/resolvconf/interface/eth1.dhclient     lease {       interface "eth1";       fixed-address 192.168.19.69;       option subnet-mask 255.255.255.0;       option routers 192.168.19.30;       option dhcp-lease-time 129600;       option dhcp-message-type 5;       option domain-name-servers 192.168.28.1,192.168.24.58;       option dhcp-server-identifier 192.168.28.1;       option ntp-servers 192.168.28.1,192.168.58.43,192.168.24.58;       option broadcast-address 192.168.19.255;       option domain-name "some.org";       renew 3 2014/02/19 21:56:46;       rebind 4 2014/02/20 15:30:42;       expire 4 2014/02/20 20:00:42;     }      I do not have control over the FreeBSD DHCP server, but have been told the leases were recorded as:               #####################     lease 192.168.28.249 {     starts 5 2014/02/14 03:24:14;     ends 6 2014/02/15 15:24:14;     cltt 5 2014/02/14 03:24:14;     binding state active;     next binding state free;     hardware ethernet 00:01:02:03:04:12;     set ddns-rev-name = "249.28.168.192.in-addr.arpa.";     set ddns-fwd-name = "host0.dhcp.some.org";     client-hostname "host0";     on expiry or release {     switch (ns-update (delete (1, 12, ddns-rev-name, null))) {     case 0:     unset ddns-rev-name ;     break;     }     switch (ns-update (delete (1, 1, ddns-fwd-name, leased-address))) {     case 0:     unset ddns-fwd-name ;     break;     }     on expiry or release;     }     }     lease 192.168.19.69 {     starts 4 2014/02/13 14:40:47;     ends 6 2014/02/15 02:40:47;     cltt 4 2014/02/13 14:40:47;     binding state active;     next binding state free;     hardware ethernet 00:01:02:03:04:14;     client-hostname "host0";     }          #####################      In both leases on the server side the client-hostname has the value "host0". Note that the leases were handed out on two different subnets: 192.168.28.0 and 192.168.19.0. Is my /etc/network/interfaces configuration all that is needed for sending the secondary interface's hostname to the DHCP server? If so, what else should I check on the client side to debug? (IP addresses and MAC addresses were modified to hide real values)


Timestamp of socket in /proc/<pid>/fd

If I list `/proc/<pid>/fd` I see a number of entries for sockets. These entries have timestamps. At first I thought they were when the socket was created. But it doesn't always appear to be the case. What does this timestamp mean?


Shell script to produce duplicate output with increments

I need a script that will produce the following output many times               @float Figure,fig:n     @cindex      @image{n,9cm}.     @caption{}     @end float      but where n (both times) is replaced by 1, 2, 3, up to a large number. Thanks.


When is xargs needed?

The `xargs` command always confuses me. Is there a general rule that can help me figure out when I need it? Consider the two examples below:               $ \ls | grep Cases | less      prints the files that match 'Cases', but changing the command to `touch` will require `xargs`:               $ \ls | grep Cases | touch     touch: missing file operand     Try `touch --help' for more information.          $ \ls | grep Cases | xargs touch


Configure permissions

I'm sharing a git repository with a friend over SSH. He pushes from and pulls to his git repository using my machine's SSH server, where the shared git repository is. Problem is that when he pushes a commit, I can't pull, because the commit is `janito users rwx------` (these are permission metadata). I created a group called git, added him and myself, and the repository is `jpmelos git rwxrwx---`. How can I force files created in the repository directory to be `<creator> git rwxrwx---` as well, so we can always pull and push without worrying about permissions? Or you can suggest better solutions to the problem, of course. Restrictions are that we need to use the SSH on my machine (we are not ready to make the code public yet) and we are already pushing and pulling from a bare repository I created separately from my working repository. Thanks!


How to safely kill processes so that output redirection is not aborted?

I'm writing some automation scripts, in which I need to kill some processes. Previously I would usually use `kill -9 pid` to kill processes but once upon a time, I notice that when I used `kill -9` to kill some `tcpdump` processes: For example:               tcpdump -i eth0 -w output.pcap      The captured packets were not put into `output.pcap` and it was empty. But if I used `kill`, it worked fine. For some processes, like `./prog >> test_log`, I'm afraid if I use `kill -9` to kill the processes the output won't get redirected to `test_log`. I'm also afraid if I use `kill` without `-9` the kill command may fail. Can anyone tell me how to properly use `kill` so that the killing doesn't cause problems with the output file and I'm able to kill the processes without issue?


Separate STDOUT noise from ncurses

I am trying to run an `ncurses` GUI application on an ARM board. I am running it using the serial console `ttyAMA0` port. But when I run the ncurses program, the other processes running in the background will print debug messages i.e qDebug, qWarning into `STDOUT` i.e on the GUI layout and hence results in noise. I think the problem is because all the processes are using the same console device. So is there is a command line or programmatic solution for this problem so that I could not see the other process' `STDOUT` on my `ncurses` GUI ? I tried GNU `screen` It is not really helping. Even in screen session I am seeing the output of those processes polluting the screen **P.S: I have triedgdb solution and it works fine. But I want alternative solution for this**


Bulk Adding Users to Groups

Let's assume I have a Linux box configured as a primary domain controller with 50 users connecting at any given time. If I wanted to create two groups, one called "Teachers" and the other "Students" How could I script something so I wouldn't have to individually type out each command for each user when adding them to their appropriate group? This is what scripting is all about yes?


Failed packages list

I am planning to write a script to get the list of upgrades available on Ubuntu server and upgrade them. I can get the list of upgrades with "apt-get -s upgrade". But how to get a report on list of packages that failed during the above command. Any specific command or technique? I can't find any option in apt-get or other command.


End of lines problem in emacs when editing markdown texts via It's All Text

I want to edit markdown source in emacs using the It's All Text plugin for firefox. In markdown you have to add two spaces to the line-end to get a new line. Suppose there is such a newline in a markdown source. If I open this in emacs via It's All Text, change something else and save it then the two spaces at the end of the line dissapear which is very annoying. So is there a way to configure emacs not to touch such spaces at line ends in this case?


How to block the xfce desktop right-click mouse menu

I have a Linux Mint 14 machine and want to child-proof it. My main concern right now is the menu that appears when I right-click on any empty desktop space. I want to eliminate it from appearing.