Improving TCP performance over a gigabit network

I have two machines both network cards speed is 10Gbps.   * The inbound bandwidth between the two machines is 10Gbps, the outbound bandwidth **internet bandwidth** is 500Mpbs.   * Both machines are using public IP addresses in the public and private network.   * Both machines transfer and connecti on Nginx's port 80, and machine B is used for streaming media, like Youtube streamed videos. I checked the transfer speed using `iperf` utility From **machine A** to **machine B** :               # iperf -c 0.0.0.2 -p 8777     ------------------------------------------------------------     Client connecting to 0.0.0.2, TCP port 8777     TCP window size: 85.3 KByte (default)     ------------------------------------------------------------     [  3] local 0.0.0.1 port 38895 connected with 0.0.0.2 port 8777     [ ID] Interval       Transfer     Bandwidth     [  3]  0.0-10.8 sec    528 KBytes    399 Kbits/sec      My Current Connections in machine B:               # netstat -an|grep ":8777"|awk '/tcp/ {print $6}'|sort -nr| uniq -c        2072 TIME_WAIT          28 SYN_RECV           1 LISTEN         189 LAST_ACK         139 FIN_WAIT2         373 FIN_WAIT1        3381 ESTABLISHED          34 CLOSING      **machine A** Network Card Information:               Settings for eth0:             Supported ports: [ TP ]             Supported link modes:   100baseT/Full                                     1000baseT/Full                                     10000baseT/Full             Supported pause frame use: No             Supports auto-negotiation: Yes             Advertised link modes:  10000baseT/Full             Advertised pause frame use: No             Advertised auto-negotiation: Yes             Speed: 10000Mb/s             Duplex: Full             Port: Twisted Pair             PHYAD: 0             Transceiver: external             Auto-negotiation: on             MDI-X: Unknown             Supports Wake-on: d             Wake-on: d             Current message level: 0x00000007 (7)                                    drv probe link             Link detected: yes      **machine B** Network Card Information:               Settings for eth2:             Supported ports: [ FIBRE ]             Supported link modes:   10000baseT/Full             Supported pause frame use: No             Supports auto-negotiation: No             Advertised link modes:  10000baseT/Full             Advertised pause frame use: No             Advertised auto-negotiation: No             Speed: 10000Mb/s             Duplex: Full             Port: Direct Attach Copper             PHYAD: 0             Transceiver: external             Auto-negotiation: off             Supports Wake-on: d             Wake-on: d             Current message level: 0x00000007 (7)                                    drv probe link             Link detected: yes      `ifconfig` **machine A** :               eth0      Link encap:Ethernet  HWaddr 00:25:90:ED:9E:AA               inet addr:0.0.0.1  Bcast:0.0.0.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:1202795665 errors:0 dropped:64334 overruns:0 frame:0               TX packets:2313161968 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:893413096188 (832.0 GiB)  TX bytes:3360949570454 (3.0 TiB)          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:65536  Metric:1               RX packets:2207544 errors:0 dropped:0 overruns:0 frame:0               TX packets:2207544 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:247769175 (236.2 MiB)  TX bytes:247769175 (236.2 MiB)      `ifconfig` **machine B** :               eth2      Link encap:Ethernet  HWaddr 00:25:90:82:C4:FE               inet addr:0.0.0.2  Bcast:0.0.0.2  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:39973046980 errors:0 dropped:1828387600 overruns:0 frame:0               TX packets:69618752480 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:3013976063688 (2.7 TiB)  TX bytes:102250230803933 (92.9 TiB)          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:65536  Metric:1               RX packets:1049495 errors:0 dropped:0 overruns:0 frame:0               TX packets:1049495 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0               RX bytes:129012422 (123.0 MiB)  TX bytes:129012422 (123.0 MiB)      ### The problem As you can see from `iperf` utility, the transfer speed from machine A to machine B slow. When I restart network service on machine B the transfer to machine A is at full speed, after 2 minutes, it's getting slow. How could I troubleshoot the slow speed issue and fix it on machine B? Notice: if there are any other commands I should execute on either machine for more information, so it might help resolve the problem, please let me know in comments.


How to convert text or character to hex in korn shell

Does the unix korn shell provide a function to convert text or character to hex eg. hex 31 32 37 33 34 35 35 36 36 37 value of characters 1273455667 Here i have written the code to display but i don't know how to store the result in a variable               str=1273455667          for (( i=0; i < ${#str}; i++ ))     do     c=${str:$i:1}     if [[ $c == ' ' ]]     then     printf "[%s] %X\n" " " \'\ \'     else     printf "[%s] %X\n" "$c" \'$c\'     fi     done


Ubuntu - Booting black screen with purple border

After the installation of Ubuntu, when I try to boot a black screen with a purple box appears without let me see the GRUB menu. Then the screen becomes black and Ubuntu starts booting. Ubuntu is the only OS installed, but it's quite annoying as I can't see the bootloader options. What could be wrong?


PPTP VPN error: LCP terminated by peer

I cannot connect to my PPTP VPN server, even though the CHAP authentication succeeds. This is from /var/log/syslog:               Jun 11 07:27:22 aspire pppd[32221]: CHAP authentication succeeded     Jun 11 07:27:22 aspire pppd[32221]: LCP terminated by peer (MPPE required but cannot negotiate MPPE key length)     Jun 11 07:27:22 aspire pptp[32232]: nm-pptp-service-32219 log[pptp_read_some:pptp_ctrl.c:544]: read returned zero, peer has closed


local package cache for arch linux

I am running an arch linux system and want to host a few arch linux VMs. For installing and updating the VMs they need access to the arch package repository which is usually achieved by a direct network connection to the official arch servers. In my situation this would result in downloading the same packages again and again for my host and all the VMs. Is there a good way to cache those packages locally to avoid downloading them again?


Shell script and adding large values in a delimited file problem

I have a script that reads through a delimited file and adds up the 3rd element in the file for each record. For a majority of the data files, this works fine except for one. I have one data file were there are 193 records in the data file. I am expecting to get 2028219.43 back from the script. Instead, I get an exponental number back which appears to have been rounded up. At first I thought that by using printf I will get the number but if the number has already been rounded, then it's not going to give me back what I am expecting. This is the code that I am using to read the delimited datafile. The data in each record is delimited by an *.:               export clm_total=$( awk -F* '{f1+=$3} END {print f1}' datafile.dat)     export new_clm_total=$(printf "%.2f" $clm_total)      This is what shows up in the log when I run the script:               + export clm_total=2.02822e+06     + printf %.2f 2.02822e+06     + export new_clm_total=2028220.00     + echo 2028220.00      This is a sample of the data file. There are more records, I didn't didn't think it was necessare to display all 193 records:               CLM*123456789*4820.9***13:A:1**A*Y*Y     CLM*123698547*3642.05***13:A:7**A*Y*Y     CLM*147852369*579.25***13:A:1**A*Y*Y     CLM*789654123*929.8***13:A:1**A*Y*Y      What I am expecting back is 2028219.43 What I am getting back is 2.02822e+06 Which then gets formatted as 2028220.00


Is it possible to copy whole userland into other machine in FreeBSD?

AFAIK, FreeBSD has strict separation between base system and userland. IMO, theoretically, it seems possible to transfer whole userland to other machine by simple copying. If the base systems are equal (version) Can I actually copy the userland by simple copying? If it's possible what directories should I copy? If it is not, what's the major reason which prevent copying userland configurations? **Update** The term _userland_ seems to be wrong in the text. My intention was **stuffs of full OS except base system** , and I don't know correct wording for this.


Compiling OpenSSH client or Dropbear for Android

I have an interesting problem. I'd like to use a private SSH key with my Android Terminal Emulator (`jackpal.androidterm`). I'd like to install the private key in a fairly- secure location and be able to access the key in a fairly straightforward way. I'd like to do this:               ssh theotherserver      With a `~/.ssh/config` file looking like this:               Host theotherserver         User mycustomuser      And the private key being read from `~/.ssh/id_rsa`. The problem is that Dropbear by default looks in `/data/.ssh` (at least here on CyanogenMod 11) and this folder is meant to be owned by `root`. I've done a `chown` and `chmod` on the directory and its children to be able to use it with the "app user" which is `u0_a100`, and that works, but these permissions are wiped on reboot: so no go. What I'd really like to do is to simply tell Dropbear via a configuration file that its home lives in `/data/data/jackpal.androidterm/app_HOME/.ssh`, as this directory will be 'for sure' owned by the "app user" and I won't run into any permissions issues. An added benefit is that other users won't be able to read this directory as it is private to the application. (dir permissions is `drwxrwx--x`) Is there a way to configure Dropbear with a configuration file to change the location of its default `.ssh` directory? It would be awesome if it just used `$HOME`, but it's obviously not. If that is impossible, how can I compile OpenSSH client or Dropbear for Android in a way that would enable me to achieve my (seeming simple) goal?


Unstable wireless connection on Debian 7.5 with a AR9382 chipset

I recently reformatted my primary drive (I have a custom built machine based on a Clevo P150 chassis), and decided to opt for Debian (7.5 / Wheezy) after some years using Ubuntu. My issue - which I believe I also had in my Ubuntu days - is that my wireless connection is unstable and tends to stall every 30-60 minutes or so; there is no error or notice of disconnection, web pages simply won't load and IRC doesn't seem to respond (until it disconnects). After a five minutes or so or after reconnecting to my network, the connection returns. My wireless card is a Bigfoot Killer Wireless-N 1102 which sports a AR9382 chipset, which ath9k is meant to support (and indeed mostly seems to do). Other than checking the drivers I have no idea how to begin diagnosing this issue, so any and all ideas will be appreciated.


SCSI Tape drive on ubuntu and centos

On ubuntu 12.10 I have those SCSI drives:               [1:0:0:0]    cd/dvd  TSSTcorp CDDVDW TS-H653N  0208  /dev/sr0      [2:0:0:0]    disk    Generic  USB SD Reader    1.00  /dev/sdb      [2:0:0:1]    disk    Generic  USB CF Reader    1.01  /dev/sdc      [2:0:0:2]    disk    Generic  USB SM Reader    1.02  /dev/sdd      [2:0:0:3]    disk    Generic  USB MS Reader    1.03  /dev/sde      [3:0:0:0]    mediumx HP       C7200            162D  /dev/sch0     [3:0:1:0]    tape    HP       Ultrium 1-SCSI   E24V  /dev/st0       On centOS 5.9 I have those SCSI drives:               [0:0:0:0]    disk    ATA      Hitachi HDT72503 V54O  /dev/sda     [1:0:0:0]    cd/dvd  TSSTcorp CDDVDW TS-H653N  0208  /dev/sr0     [2:0:0:0]    disk    Generic  USB SD Reader    1.00  /dev/sdb     [2:0:0:1]    disk    Generic  USB CF Reader    1.01  /dev/sdc     [2:0:0:2]    disk    Generic  USB SM Reader    1.02  /dev/sdd     [2:0:0:3]    disk    Generic  USB MS Reader    1.03  /dev/sde      Loaded kernel modules on ubuntu.   Loaded kernel modules on centos.   This is the same machine, with same adapter, but with different operating systems. In both situations `st` kernel module is loaded, but in centos I don't have my tape library in lsscsi and in /dev/st0. What might be the cause that this won't work on centOS ?


Trying to compare a variable that is multiline in a if comparison

Here is the current file I am running:               #!/bin/ksh -x          export BIN_DIR="../../env"     . $BIN_DIR/vdenv.ksh          success="DROP     CREATE TABLE     GRANT"          $worker_dir/runsql.ksh ddl X X > chnl_avt_v1.log     result=$(sed -e '/DROP/,/GRANT/!d' chnl_avt_v1.log)          if [ "$result" -eq "success" ]; then            echo "hi"     else             echo "NOO"     fi      Below is the error I receive even though I know that both $success and $result are the same. I am a newbie UNIX user.               result=DROP     CREATE TABLE     GRANT     + [ DROP     CREATE TABLE     GRANT -eq success ]     master_list_ddl.ksh[13]: DROP ^JCREATE TABLE^JGRANT: syntax error     + echo NOO     NOO


How do I watch protected flash videos (such as on nbcolympics.com) using Linux?

For people from the US with certain cable TV subscriptions, NBC offers footage of the 2014 winter Olympics from a website, nbcolympics.com. However, I find I am unable to view any of the video content from my Linux machine. I have tried from Chrome and Firefox. **Chrome** : When clicking on a video, I am taken to the webpage of the video and all of the non-video content (e.g. the twitter stream, the summary of the video) loads. However, the page is covered in a dark transparent overlay and a "waiting" spinner continuously spins. I cannot click on anything from the web page. **Firefox** : When clicking on a video, I am taken to the webpage of the video and all of the non-video content loads. The page is also covered with a dark, transparent overlay, but this time with a window in the middle to choose my cable provider. When I select my cable provider, xfinity, the page re-loads and the same screen appears again, with the same transparent overlay and the same dialog asking for my cable provider. Here is a screenshot of the Firefox window: ![Firefox showing dialog to select cable company](http://i.stack.imgur.com/kIJft.png) I am using Fedora 19 and do not generally have problems viewing other flash content. Is there any method to watching the videos on nbcolympics.com from a Linux computer?


Arch CPU temperature much higher than on Debian

I switched to Arch Linux from Debian/Crunchbang and noticed much higher temperature. It's almost the same configuration: openbox, etc and Arch runs with 57-70 °C but Debian works with 43°C - 50°C I really like Arch, but I can't fix it, my touchpad gets really hot. It's something with software, because wheezy was cold enough for comfortable work.


If statements into Array

I'd like to ask if below code (multiple if statements) can be converted into array? Here:               if [ "$(egrep -l 'NU.PRODUCT' $LINE)" ]; then         VALUE='PRODUCT'     elif [ "$(egrep -il 'NU.SERVICE' $LINE)" ]; then         VALUE='SERVICE'     elif [ "$(egrep -il 'NU.COMMERCE' $LINE)" ]; then         VALUE='COMMERCE'     elif [ "$(egrep -il 'NU.EDUCATION' $LINE)" ]; then         VALUE='EDUCATION'     else         VALUE='OTHERS'     fi


Linux as router with multiple internet providers

Linux as router: I have 3 Internet providers, each with its own modem. **Provider1** , which is gateway address 192.168.1.1   Connected to linux router **eth1** /192.168.1.2 **Provider2** , gateway address 192.168.2.1   Connected to linux router **eth2** /192.168.2.2 **Provider3** , gateway address 192.168.3.1   Connected to linux router **eth3** /192.168.3.2                                                                                ________                                                        +------------+         /                                                        |            |        |                                 +----------------------+ Provider 1 +--------|             __                  |192.168.1.2           |192.168.1.1 |       /         ___/  \_         +------+-------+              +------------+      |       _/        \__      |    eth1      |              +------------+      /      /             \ eth0|              |192.168.2.2   |            |      |     |Client network -----+  ROUTER  eth2|--------------+ Provider 2 +------|     Internet      \10.0.0.0/24 __/    |              |              |192.168.2.1 |      |        \__     __/       |    eth3      |              +------------+      \           \___/          +------+-------+              +------------+       |                                 |192.168.3.2           |            |       \                                 +----------------------+ Provider 3 +-------|                                                        |192.168.3.1 |       |                                                        +------------+       \________      I would like to route the clients in network 10.0.0.0/24 by source IP to different gateways.   The interface to the client network is **eth0** /10.0.0.1, which is the default gateway for all clients. For example:   10.0.0.11 should be routed to Provider1 @ eth1   10.0.0.12 should be routed to Provider2 @ eth2   ...and so on... I think I need to use `ip route` and `iptables` for SNAT, but I have not figured out exactly how.   Here is the script I have so far.   ipv4 forwarding is enabled.               #!/bin/bash     # flush tables     ip route flush table connection1     ip route flush table connection2     ip route flush table connection3          # add the default gateways for each table     ip route add table connection1 default via 192.168.1.1     ip route add table connection2 default via 192.168.2.1     ip route add table connection3 default via 192.168.3.1          # add some IP addresses for marking     iptables -t mangle -A PREROUTING -s 10.0.0.11 -j MARK --set-mark 1     iptables -t mangle -A PREROUTING -s 10.0.0.12 -j MARK --set-mark 2     iptables -t mangle -A PREROUTING -s 10.0.0.13 -j MARK --set-mark 3          # add the source nat rules for each outgoing interface     iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 192.168.1.2     iptables -t nat -A POSTROUTING -o eth2 -j SNAT --to-source 192.168.2.2     iptables -t nat -A POSTROUTING -o eth3 -j SNAT --to-source 192.168.3.2          # link routing tables to connections (?)     ip rule add fwmark 1 table connection1     ip rule add fwmark 2 table connection2     ip rule add fwmark 3 table connection3          #default route for anything not configured above should be eth2


Why does `at` warn me that commands will be executed using /bin/sh? What if I want a different shell?

I tried to use `at` from within a script of mine and it prints: > warning: commands will be executed using /bin/sh How would I use different shell if I wanted?


How do I access a login through ssh when there is no password set?

I would like to be able to access my home machine's account over ssh from a remote desktop. It allows me to connect when I say ssh uname@ip_addr, but it then prompts for a password. This account has no password set up. Is there some way to simply connect with no password? (Usually when the need arises to do this I'm on Mac OSX or FreeBSD, occasionally Fedora.) Any help would be appreciated. (A reference to a line on a man page or equiv. would be an acceptable answer.)


Gentoo 3.8.13 x86_64 Update problem

I am trying to perform full system update for my Gentoo 3.8.13 x86_64               emerge --update --deep --with-bdeps=y --newuse world      But I am getting the following error               !!! Problem resolving dependencies for media-video/vlc from @selected     ... done!          !!! The ebuild selected to satisfy "media-video/vlc" has unmet requirements.          - media-video/vlc-2.0.7::gentoo USE="a52 aac alsa avcodec avformat cdda dbus dts dvbpsi dvd encode ffmpeg flac gcrypt gnome libnotify mmx mp3 mpeg ncurses ogg opengl png postproc pulseaudio qt4 samba sdl sse svg swscale truetype udev vorbis x264 xcb xml xv -X -aalib (-altivec) -atmo (-audioqueue) -avahi -bidi -bluray -cddb -dc1394 -debug -dirac (-direct2d) -directfb (-directx) (-dshow) -dvb (-dxva2) -egl -fbosd -fluidsynth -fontconfig -gme -gnutls -growl -httpd -ieee1394 (-ios-vout) -jack -kate -kde -libass -libcaca -libproxy -libsamplerate -libtar -libtiger -linsys -lirc -live -lua (-macosx) (-macosx-audio) (-macosx-dialog-provider) (-macosx-eyetv) (-macosx-qtkit) (-macosx-quartztext) (-macosx-vout) -matroska (-media-library) -modplug -mtp -musepack (-neon) -omxil -optimisememory -opus -oss -portaudio -projectm -pvr -rtsp -run-as-root -schroedinger -sdl-image -shine -shout -sid -skins -speex -sqlite -switcher -taglib -theora -twolame -upnp -v4l -vaapi -vcdx -vlm (-waveout) (-wingdi) -wma-fixed -xosd -zvbi"          The following REQUIRED_USE flag constraints are unsatisfied:          qt4? ( X ) sdl? ( X )          The above constraints are a subset of the following complete expression:          aalib? ( X ) bidi? ( truetype ) cddb? ( cdda ) dvb? ( dvbpsi ) dxva2? ( avcodec ) egl? ( X ) ffmpeg? ( avcodec avformat swscale postproc ) fontconfig? ( truetype ) gnutls? ( gcrypt ) httpd? ( lua ) libcaca? ( X ) libtar? ( skins ) libtiger? ( kate ) media-library? ( sqlite ) qt4? ( X ) sdl? ( X ) skins? ( truetype qt4 X ) switcher? ( avcodec ) vaapi? ( avcodec X ) vlm? ( encode ) xosd? ( X ) xv? ( xcb )          (dependency required by "@selected" [set])          (dependency required by "@world" [argument])      Can anyone suggest me, how can I perform a full update * * * Thanks to every one, It works when I add the X use flag in make.conf. but Now I got some message from the update,               * Messages for package x11-drivers/ati-drivers-13.4:          *   CONFIG_DRM must be disabled or compiled as a module and not loaded for direct     *   rendering to work.     * Please check to make sure these options are set correctly.     * Failure to do so may cause unexpected problems.     *      * Please note that this driver only supports graphic cards based on     * Evergreen chipset and newer.     * This includes the AMD Radeon HD 5400+ series at this moment.     *      * If your card is older then use x11-drivers/xf86-video-ati     * For migration informations please refer to:     * http://www.gentoo.org/proj/en/desktop/x/x11/ati-migration-guide.xml     * To switch to AMD OpenGL, run "eselect opengl set ati"     * To change your xorg.conf you can use the bundled "aticonfig"     *      * If you experience unexplained segmentation faults and kernel crashes     * with this driver and multi-threaded applications such as wine,     * set UseFastTLS in xorg.conf to either 0 or 1, but not 2.     *      * Fully rebooting the system after an ati-drivers update is recommended     * Stopping Xorg, reloading fglrx kernel module and restart Xorg     * might not work     *      * Some cards need acpid running to handle events     * Please add it to boot runlevel with rc-update add acpid boot      I have the following AGP card               VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Park [Mobility Radeon HD 5430/5450/5470]     Audio device: Advanced Micro Devices [AMD] nee ATI Cedar HDMI Audio [Radeon HD 5400/6300 Series]      do I need to worry about this message or I should leave this message unattended? any suggestion


Looping through commands' results, KSH script

I'd like to put two strings in two different variables. Let's take a small example. after a simple grep, I got this :               $ grep nl.*acc.*bas :     ABAS01=...     ABAS02=...      I'd like to have two variables, one containing ABAS01, and the other containing ABAS02. How can I do this ? I guess a loop can be used to go through all the results from my query, then I could do a `cut -d= -f1` to retrieve the name of the variables. How can I do this ?


Error mounting drive with fstab

I have an small server in my house with an external usb 2TB hard drive: `/dev/sdb1: LABEL="Data" UUID="eedc3098-221d-4800-b8b4-efa4fef23f5f" TYPE="ext4"` I have the next line in `/etc/fstab`: `UUID=eedc3098-221d-4800-b8b4-efa4fef23f5f /home/data ext4 defaults 0 2` When I boot the system I get the next error: `Unable to resolve 'UUID=eedc3098-221d-4800-b8b4-efa4fef23f5f' fsck died with exit status 8` Then, the system ask me about root password for maintenance. If I log in like root and type: `fsck.ext4 'UUID=eedc3098-221d-4800-b8b4-efa4fef23f5f'` I get: `Data: clean 99709/122101760 files, 232470354/488378368 blocks` If I say to fsck to not ckeck the filesystem on startup (changing last 2 into a 0) the system starts properly (with the warning: `special drive UUID=eedc3098-221d-4800-b8b4-efa4fef23f5f doesn't exist`) and my partition doesn't mount. But the uuid exists in `/dev/disks/by-uuid` How can I mount my drive properly? I thoght that maybe it can be a problem related with USB


startx from mac osx to RHEL6

I am trying to get a GUI over ssh -X. My RHEL6 server did not have X Window System and a graphical desktop environment. So I installed using `yum groupinstall "X Window System" Desktop`. It installed completely. I also enabled `X11 Forwarding`. Now I am trying to get the GUI from ssh from my Mac. I do `ssh -X devserver`. Then I type `sudo startx`, but it gives me this error.               Initializing built-in extension Generic Event Extension     Initializing built-in extension SHAPE     Initializing built-in extension MIT-SHM     Initializing built-in extension XInputExtension     Initializing built-in extension XTEST     Initializing built-in extension BIG-REQUESTS     Initializing built-in extension SYNC     Initializing built-in extension XKEYBOARD     Initializing built-in extension XC-MISC     Initializing built-in extension XINERAMA     Initializing built-in extension XFIXES     Initializing built-in extension RENDER     Initializing built-in extension RANDR     Initializing built-in extension COMPOSITE     Initializing built-in extension DAMAGE     Initializing built-in extension MIT-SCREEN-SAVER     Initializing built-in extension DOUBLE-BUFFER     Initializing built-in extension RECORD     Initializing built-in extension DPMS     Initializing built-in extension X-Resource     Initializing built-in extension XVideo     Initializing built-in extension XVideo-MotionCompensation     Initializing built-in extension SELinux     Initializing built-in extension XFree86-VidModeExtension     Initializing built-in extension XFree86-DGA     Initializing built-in extension XFree86-DRI     Initializing built-in extension DRI2     Loading extension GLX     GNOME_KEYRING_SOCKET=/tmp/keyring-2T42OF/socket     SSH_AUTH_SOCK=/tmp/keyring-2T42OF/socket.ssh     GNOME_KEYRING_PID=14059          ** (gnome-panel:14074): CRITICAL **: panel_key_file_load_from_uri: assertion `uri != NULL' failed          ** (gnome-panel:14074): CRITICAL **: panel_key_file_load_from_uri: assertion `uri != NULL' failed          ** (gnome-panel:14074): WARNING **: panel-applet-frame.c:1288: failed to load applet OAFIID:GnoteApplet:     (null)      **Is this the right way. If not how do I properly get a GUI of RHEL on mac?**


No font in emacs on CentOS

When I open emacs over an SSH connection I get this error               Warning: Cannot convert string "-*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-*" to type FontStruct     Warning: Cannot convert string "-*-helvetica-medium-r-*--*-120-*-*-*-*-iso8859-1" to type FontStruct      and the font is replaced with empty squares. Does anyone know what could be wrong? ![enter image description here](http://i.stack.imgur.com/wlK8u.png)


Extracting text string from file, assigning them to variables then writing them to another file?

Basically, its a game server (minecraft) and I have a situation where I am attempting to automate new world generation. Basically, I have a file that gets generated happily which has this snippet in it. file1.txt               keepSpawnInMemory: 'true'     spawnLocation:       ==: MVSpawnLocation       yaw: 0.0       pitch: 0.0       z: 256.5       y: 62.0       x: -223.5     autoLoad: 'true'     bedRespawn: 'true'      This works fine, but I need to extract the z: 256.5, y:62.0 and x: -223.5 respectively and then write a file called file2.txt with the following lines.                world: mine      x: -223.5      y: 62.0      z: 256.5      yaw: 0.0      pitch: 0.0      name: mine      I assume I'll be using something like awk to extract the initial numbers, assigning them to variables then writing the file? I have never used awk before, and I am insanely confused. Appreciate any help in this guys. Im using Ubuntu linux, bash scripts. Can I extract text like that and make them into variables using awk and bash? EDIT: I did forget to mention that the file 1 has multiple instances of x,y and z. It can be accessed here: http://pastebin.com/TqaLcWzV Is there a way to start at a certain line? For example, z, y and x will always be on lines 183, 184 and 185 respectively.


SSH tunnelling explained in layman's terms

I've just used this guide to create a SSH tunnel to bypass my corporate proxy. I didn't use the usual "Putty", but in "MobaXterm" (a program similar to putty that also offers unix tools) I wrote, to create the tunnel:               ssh -D 7070 -p 22 user@yourserver.com sleep 9999      Then I went to my browser (Firefox) and I told it to use _SOCKS_ on the _localhost_ port **7070**. All is good and it's working, but I have no clue on how the underling technology actually works. I mean, on a general level I know how the process works, but I would like to go a little deeper than that. What I mean is, currently we can compare my knowledge to the one I have of cars: I know there is an engine, 4 wheels, etc, but I have no clue how the engine actually uses gasoline to move the car. The 2 answers I received so far only explain to me what I already know. I have a CCNP, work in a datacenter as network engineer, know how to program, know fair enough of the Linux environment. What I would like to have from you is a thorough (but less than a 20-pages-long-RFC) answer. The answer should include:   1. A description of the main options tunnel-wise. A good example is the image in this answer: Understanding SSH tunnels   2. Which type of tunnel is used when and for what (normal tunnels, reverse tunnels)   3. A wireshark capture of the before/after the tunnel   4. An image explaining the process (I am a visual guy after all) I promise that **I will give 100 points** as soon as I can put a bounty on the question. I really need a good answer on this. (In case I forget about the bounty, please email me: ilcon7e[at]gmail[dot]com **_EDIT_** Improved the question.


How to retrieve environment variable from string name in KSH

I've the following variable :               x="envVar"      and 'envVar' is the one of my environment variable's name containing a path (of a folder by instance). So I'd like to do               cd $x       but it doesn't work. How can I do to use x's value as the environment variable ? I wasn't able to make it work with "eval".


apostrophe appearing whenever type letters with soft signs

I use a Latvian keyboard layout (apostrophe variant) and whenever I type letters with a soft sign it prints an actual apostrophe before each letter. For example, instead of `āēģņļ`, I get `'ā'ē'ģ'ņ'ļ`. How can I fix this?


Convert text to image in centos from bash

I want to create an image [jpg, png, doesn't matter] from shell but I don't have convert command. The image is very simple - white background with a medium-size black text in the middle. Is it possible?


ls with find :: report total size

I am trying to get the total size of files satisfying a `find`, e.g.:               ls  $(find -maxdepth 2 -type f)      However, this kind of invocation of `ls` does not produce the total size as well.


show part of wraped lines in vim instead of hiding it with the @ character

I use `vim` not only for coding but also for text writing. In this context I use the wrap and linebreak options to wrap my text. Since lines - forming paragraphs in text writing - can be very long a wraped line easily does not fit in the lower part of the screen so `vim` hides all the wrapped line replacing the visible part of it with the @ symbol. Is there any chance to avoid this so that `vim` just shows the part of the wraped line that still fits at the bottom of the screen?


How does createrepo work. How does yum understand parse its files. A conceptual explanation

I am **not** looking for a how-to on creating a repo (createrepo) or using yum. I want to understand how they work together.   I want to know what files yum looks at and why, what those files contain.   I want to understand the structure of the repo and its files. I want to understand how it all works together.   I have read many how-to's, I am looking for a more conceptual understanding. I working with Centos 6 32bit.


Use "grep" to match text in multiple files

I have data in multiple files. I want to find some text that matches in all files. Can I use the `grep` command for that? If yes then how?


Waiting until SSH tunnel (ssh -w) is set up before running command

When using SSH VPN tunnelling (-w option), is there a way to know when the tunnel is actually up? I want to use this in a script that automatically sets up the tunnel by running ssh -w then running ifup [1]. The -f option doesn't help because it returns after connecting to the server but before the tunnel is up. Sleeping for a few seconds does work, but it just feels too hacky. The LocalCommand option seems to work, for example:               ssh -w 0:1 "-oLocalCommand=ifup tun0" "-oPermitLocalCommand=yes" myserver.example.org true      However, the man page says: "The command is run synchronously and does not have access to the session of the ssh(1) that spawned it." Is the above invocation guaranteed to work or was it just luck that LocalCommand was executed after the tunnel is set up? More importantly, is there a standard way for using ssh -w in scripts? [1] I'm on Fedora, ifup works because I've set up `/etc/sysconfig/network- scripts/ifcfg-tun0` and `/etc/sysconfig/network-scripts/route-tun0`


How to specifying different ports for multiple host in cssh?

I am using `cssh` to telnet into multiple hosts at the same time. I have changed the `ssh=/usr/bin/telnet` to point to the telnet program. The problem I am facing is that each host uses different port for telnet. I tried the following format but it did not work               cssh host1:100 host2:200 host3:300      How do I specify different port numbers for the different host?


stat meanings of computing nodes

I submitted a job to a Linux cluster which uses SGE job scheduler. The job stat is qw for a long time, so I inspected the stats of computing nodes using "qstat -f". I found that many nodes were labelled with stats "d", "adu" and "E". I wonder what these stats mean. The Grid Engine Man pages listed these stats for filtering queue instances ( `-qs {a|c|d|o|s|u|A|C|D|E|S}` ), but no further explanation on the meaning of these stats. What do the states mean?


How do I install the latest gcc on FreeBSD?

How do I install the latest `gcc` on FreeBSD ind set up the system so that this latest version would be used to compile further programs? At the moment of this writing the latest release of `gcc` is version 4.9.0. I use FreeBSD 10.0. I actually need `g++`, the C++ compiler, but I need to install something like `gcc49` package for it, right?


I cannot use yum command and ssh after mount drive.(CentOS)

As the title above, I cannot use yum command after I mount like below.               mount /dev/xvdb3 /usr          Filesystem                         Size  Used Avail Use% Mounted on     /dev/xvda                          9.9G  1.9G  7.6G  20% /     none                               3.7G     0  3.7G   0% /dev/shm     /dev/xvdb1                        1012M   34M  927M   4% /tmp     /dev/xvdb2                          20G  250M   19G   2% /var     /dev/xvdb3                          15G  1.5G   13G  11% /usr     /dev/mapper/instancevg-instancelv  792G  197M  751G   1% /home          [root@ip-10-0-0-10 ~]# yum     -bash: yum: command not found      I can use yum after I umount /dev/xvdb3.   ssh cannot connect remotely after disconnected from the server.   I MUST REBOOT server to connect by ssh.   What should I do?


Xenomai and Ubuntu

I have installed xenomai 2.4.8 in Ubuntu 11.04 with this command:               apt-get install libxenomai-dev      Now I want test a simple vxWorks program, but when I compile my program, I receive this message: > Xenomai: vxworksskin or CONFIG_XENO_OPT_PERVASIVE disabled   >  (modprobe xeno_vxworks?) ...and the output of `modprobe xeno_vxworks` is: > FATAL: Module xeno_vxworks not found My question is, how can I eanble the xeno_vxworks module? I am new to Xenomai so please forgive me if my question is silly.


Why isn't the Iptables persistent service saving my changes?

I followed this tutorial to set up IP rules on ubuntu 12.04. Everything worked fine on setup -- but now I've made changes to the firewall that do not persist upon reboot. I do not understand why that is. Here is a demonstration of how I am using iptables-persistent. What am I doing wrong?               $ sudo service iptables-persistent start      * Loading iptables rules...                                                                                *  IPv4...                                                                                *  IPv6...             $ sudo iptables -L   //shows a certain rule     $ iptables -D INPUT ... //command successfully drops the rule     $ sudo iptables -L   //shows rule has been deleted           $ sudo service iptables-persistent restart      * Loading iptables rules...                                                                                *  IPv4...                                                                                *  IPv6...                                                                                [ OK ]       $ sudo iptables -L  //rule is back


No hibernate option in power manager on Mint 16 MATE

In my fresh install of Linux Mint 16 with MATE, I have no hibernate option in the Power Manager; only suspend and shutdown. In the Quit menu I have hibernate as an option. Also `sudo pm-hibernate` works from the command line. Any suggestions of how to enable hibernate in the Power Manager? I want to hibernate when the laptop lid closes. I have just enough swap space for hibernation to work:               $ free -h                  total       used       free     shared    buffers     cached     Mem:          3.5G       1.6G       1.8G         0B        18M       406M     -/+ buffers/cache:       1.2G       2.3G     Swap:         3.6G        16M       3.6G


Unable to boot to windows

Context: Recently I've bought an SSD. Before that I had 2 HDDs; one being a 500GB drive with a W7 installation, and another 320GB Drive containing two partitions, one of which for storage (NTFS) and another to hold a linux mint installation (Which I'm currently on). When the SSD arrived I set up another W7 installation. Once this was fully set-up, I wanted to format the 500GB drive to use it for storage. I've done this today, and as a result wiped the windows loader from my system. Ideally, what I would like is for the windows boot manager to be on the SSD, and a grub installation on the 320GB drive. Then I'd like the system to boot to the 320GB drive, and give options to load the Windows boot manager, or boot to linux. Since the windows drive cannot be booted to, when running a W7 disc and using CLI I get the error "element not found" when attempting to use "recboot /fixboot". using /scanos does find my W7 installation however. I've also set the W7 partition as active and rebooted, but had the same results. I've also attempted using boot-repair, however my system still cannot boot to windows. My current boot summary is here. My current grub boot menu just lists the mint installations. How can I fix this to include a windows boot loader? @terdon:               Generating grub.cfg ...     Found linux image: /boot/vmlinuz-3.11.0-15-generic     Found initrd image: /boot/initrd.img-3.11.0-15-generic     Found linux image: /boot/vmlinuz-3.11.0-12-generic     Found initrd image: /boot/initrd.img-3.11.0-12-generic       No volume groups found     done


Linksys wusb600n support on Debian-6

I'm on my way from Windows 7 to Debian 6. The only problem... I'm not sure about my network adapter. Its Linksys wusb600n and without it - no internet access for me.   * Does Debian 6 support it?   * Will it be supported without additional drivers (or what they are called)?


Print the system clipboard content in bash

There is a way to put some command output to system clipboard via `xclip`.               some-command | xclip -selection clipboard      I'd like to perform a reverse task - Print system clipboard to terminal. How it can be done?


awk with if statements

I am trying to print from a file using awk, but my output is empty. Here is my code so far               accountNum=$1     while read -r LINE || [[ -n $LINE ]] ; do                 awk -F',' '{ if($1==accountNum) { print $3.$2 } }' Accounts     done < Accounts      I have also tried this:               accountNum=$1     while read -r LINE || [[ -n $LINE ]] ; do                 echo $LINE  | awk -F',' '{ if($1==accountNum) { print $3.$2 } }'      done < Accounts      The input file is :               1,Doe,John     2,Rooney,Wayne     3,Smith,Will     4,Crow,Russel     5,Cruise,Tom      The expected output when I run the file is               $./file.sh 3     Will Smith      But I get the following               $./file.sh 3     $      That is nothing is being printed out. I know the solution with cut, but I want to use awk.


Copy files without encryption (ssh) in local network

`scp` works well in all cases, but the Raspberry Pi is to weak to copy files efficiently in a secure environment (lan). The theoretically possible 6,75 MB/s via 54 Mbit wireless lan shrink down to about 1.1 MB/s. Is there a way to copy files remotely without encryption? It should be a cli command with no dependencies to extra services (ftp, samba) or at least with a minimum of configuration. I mean, a standard tool that works quite well out-of-the-box with standard programms/services (like scp/ssh).


Can subsequent nameservers defined in /etc/resolv.conf be used if the previous nameservers can not be resolved?

I don't know much about networking...but I've been spending a lot of time reading about it. In my `/etc/resolv.conf` I have listed 3 `nameservers`. I understand that the second name namer is used only if the first one has a failure, or times out. Is there a way for me to get it to use the second one when the first one cannot be resolved? This is on my Centos workstation. I'm not running a nameserver.


Extracting a file attachment from an email message and saving it to a file?

I have an email stored in plaintext (yes, headers, messages, attachments, everything in one plaintext file) and I'd like to extract a PDF document from it. I've copied the base64-encoded text, then ran it through `base64 -d` and `cat`ted it to a file. I then tried opening it up, which didn't work, and it doesn't appear like a PDF file. Is there something I'm doing wrong here? I'm fairly certain that it is, indeed, encoded in base64 and that it's a PDF file. Here is the email:               ---------- MESSAGE FOLLOWS ----------     Date: Tue, 6 Mar 2012 12:24:24 -0800 (PST)     From: "Outer, Inc." <admin@outer.com>     To: Mike Young <inner@outer.org>     Message-ID: <169371530.01331065464959.JavaMail.admin@outer.com>     Subject: Your results are in, Mike!     MIME-Version: 1.0     Content-Type: multipart/mixed;          boundary="----=_Part_0_1998493940.1331065464916"     X-Peer: 127.0.0.1          ------=_Part_0_1998493940.1331065464916     Content-Type: multipart/alternative;          boundary="----=_Part_1_1254200493.1331065464936"          ------=_Part_1_1254200493.1331065464936     Content-Type: text/plain; charset=us-ascii     Content-Transfer-Encoding: 7bit          Great job, Mike on your baby!     ------=_Part_1_1254200493.1331065464936     Content-Type: text/html; charset=us-ascii     Content-Transfer-Encoding: 7bit
Great job, Mike on your baby!
                   ------=_Part_1_1254200493.1331065464936--          ------=_Part_0_1998493940.1331065464916     Content-Type: application/pdf; name="Baby Results.pdf"     Content-Transfer-Encoding: base64     Content-Disposition: attachment; filename="Baby Results.pdf"          JVBERi0xLjQKJeLjz9MKMyAwIG9iaiA8PC9UeXBlL1hPYmplY3QvQ29sb3JTcGFjZS9EZXZpY2VH     cmF5L1N1YnR5cGUvSW1hZ2UvQml0c1BlckNvbXBvbmVudCA4L1dpZHRoIDI1My9MZW5ndGggMTYx     ...     HR5P9F0eg4+P8tWzo2bPl6eGcNwyLqqW+chQi7Fo/CTWPUI7Kud1ZYgpcnSg7do4SKpTy10jyggP     1dVbvqS63pYxNl1JGGcvD1P+VFdN2b7O3YBqXTuiRteun3nmUdcoObmr5qduv09


How to follow symlinks in NFS?

I have different disks with pictures               /media/drive1/pictures/     /media/drive2/pictures/     /media/drive3/pictures/     /media/drive4/pictures/     # ...      I have a folder called **share** which has symlinks for _every_ subfolder of each _pictures_ directory of each drive. I merge every subfolder with a script like this:               # I do this for every drive     for item in "/media/drive1/pictures/"*     do         target=/media/share/pictures/`basename "$item"`         if [ ! -d "$target" ]; then             ln -s "$item" "$target"             chown -h lsc:lsc "$target"         fi     done      I've been sharing this successfully with Samba for a whlle now.               [global]     # ...     follow symlinks = yes      Since this is a pure private network and the share is READONLY, security isn't a big deal.               ### /etc/exports     /media/share *(ro,async)      When I mount my share `mount 1.2.3.4:/ foo` the symlinks try to follow on the local host. **My question:** How can I share a folder that follows symlinks _on_ the host that's sharing the mount? **NOTE:** The `bind bind` solution in `/etc/fstab` won't work here, since every subfolder of `/media/share/` points to different locations/disks.


How can I update to a newer version of Git using apt-get?

I've just set up a new machine with Ubuntu Oneiric 11.10 and then run               apt-get update     apt-get upgrade     apt-get install git      Now if I run `git --version` it tells me I have `git version 1.7.5.4` but on my local machine I have the much newer `git version 1.7.9.2` I know I can install from source to get the newest version, but I thought that it was a good idea to use the package manager as much as possible to keep everything standardized. So is it possible to use `apt-get` to get a newer version of `git`, and what is the right way to do it?


How to automatically install packages?

I want to install packages automatically by running a script I can write `yum install php`, but I want it to install another package once installation of the php package is completed. Is there any solution to make it automatic? I have around 20 packages which are to be downloaded from remi repository.


How Can I Reset Graphics Drivers and Restore Defaults?

I tried to install AMD graphics without reading. My CrunchBang crashed and now every time I try to login, my keyboard inputs don't go into the login screen. I can reset X with `Ctrl`+`PrtScn`+`K` and it resets but same issue appears. How can I fix that and any other driver issues that may have evolved from my ignorance?


fix ctrl-O in xterm?

I'm trying to investigate the vt100 alternate graphics character-set with xterm. And somehow my setup doesn't allow the examples to work correctly. The sequence "`Esc`(B" sets the G0 character set to US ASCII. "`Esc`)0" sets the G1 character set to the alternate graphics character set. "`Ctrl`+`N`" (ascii Shift-Out) switches to the G1 set. But "`Ctrl`+`O`" (ascii Shift-In) to shift back to G0 is not taking effect (investigating with `cat`). It seems to be hijacked by the pty or something. `stty -a` shows               $ stty -a     speed 38400 baud; rows 60; columns 97; line = 0;     intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = ^Z;     start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O;     min = 1; time = 0;     -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts     -ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany     imaxbel     opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0     isig icanon iexten echo echoe echok -echonl -noflsh -tostop echoctl echoke      Now, I can call "stty flush `ctrl-V``ctrl-E`" (just to pick something seemingly innocuous), and the read-out from `stty -a` changes. But still `ctrl-O` doesn't shift me back to the G0 set. What else can I do to fix this? I'm using Cygwin32 xterm on Windows 8.


Using nvidia-settings over ssh

Now the new nvidia-driver has implemented CoolBits for the newer graphics cards I'm attempting to control fan/clock speed over ssh. When attempting to run anything with nvidia-settings via ssh I get errors like the following:               user@system:~$ nvidia-settings -a [gpu:0]/GPUOverclockingState=1     ERROR: The control display is undefined; please run `nvidia-settings --help`            for usage information.     user@system:~$ nvidia-settings -q GPU3DClockFreqs     ERROR: The control display is undefined; please run `nvidia-settings --help`            for usage information.      Is this due to the Xorg server not starting up (No monitor plugged in) and nvidia can't hook into the Xorg's current graphics card? Is there a way to specify the GPU nvidia-settings uses?               user@system:~$ nvidia-settings -v     nvidia-settings:  version 337.19  (buildmeister@swio-display-x86-rhel47-04)     Tue Apr 29 20:12:23 PDT 2014       The NVIDIA X Server Settings tool.            This program is used to configure the NVIDIA Linux graphics driver.       For more detail, please see the nvidia-settings(1) man page.            Copyright (C) 2004 - 2010 NVIDIA Corporation.          user@system:~$ uname -a     Linux system 3.2.0-64-generic-pae #97-Ubuntu SMP Wed Jun 4 22:22:15 UTC 2014 i686 i686 >i386 GNU/Linux


rsync mkstemp failed: Invalid argument (22) with USB flash drive

I use "Back In Time" which is nothing more than a front end GUI to rsync version 3.0.9 protocol version 30. I'm running ubuntu 12.04. My backup device is a locally mounted USB flash stick/drive formatted as ext2. It gives me numerous errors similar to the following... > [E] Error: rsync: mkstemp > "/media/apb/0543d632-d24b-4b4e-8ca8-56d22c19e62f/backintime/myhost.mydomain.com/root/4/new_snapshot/backup/home/apb/Documents/7uzyrwsy.default-20131026-1639/Mail/pop- > server.bak.rr-8.com/.Sent.msf.RZMdLy" failed: Invalid argument (22) The command line that Back in Time uses to call rsync:               [I] rsync -rtDH --links --no-p --no-g --no-o  --delete --delete-excluded  -v       --chmod=Du+wx  --exclude="/media/apb/0543d632-d24b-4b4e-8ca8-56d22c19e62f"      --exclude="/root/.local/share/backintime" --exclude="/tmp/backintime"      --include="/home/apb/asterisk/" --include="/home/apb/" --include="/home/"      --include="/home/apb/Documents/" --include="/home/apb/Linux-Centos/"      --exclude=".gvfs" --exclude=".cache*" --exclude="[Cc]ache*"      --exclude=".thumbnails*" --exclude="[Tt]rash*" --exclude="*.backup*"      --exclude="*~" --exclude="/root/Ubuntu One" --exclude=".dropbox*"      --exclude="/proc/*" --exclude="/sys/*" --exclude="/dev/*" --exclude="/run/*"      --include="/home/apb/asterisk/**" --include="/home/apb/Documents/**"      --include="/home/apb/Linux-Centos/**" --exclude="*" / "/media/apb/0543d632-d24b-4b4e-8ca8-56d22c19e62f/backintime/myhost.mydomain.com/root/4/new_snapshot/backup/"      Any ideas as to what's causing the failure, and better yet... how to fix it?


Apache 2.2, PHP 5.3 and MySQLl 5.5 on Linux Mint 17?

Our stack consists of Apache 2.2, PHP 5.3 and MySQL 5.5. I've installed Linux Mint 17 Giana. If I install `apache2` via `apt`, it will install Apache 2.4 which is not required for me. Is there any way to install Apache 2.2 and PHP 5.3 via `apt` by changing canonical repository?


What is a canonical way to find the actual maximum argument list length?

Following ARG_MAX, maximum length of arguments for a new process it seems like `ARG_MAX` is wrongly (or at least ambiguously) defined on my Mac Mini 3,1 running Ubuntu 12.04:               $ getconf ARG_MAX # arguments      2097152     $ locate limits.h | xargs grep -ho 'ARG_MAX[ \t]\+[0-9]\+' | uniq | cut -d ' ' -f 8     131072      The actual limit seems to be somewhere between these:               $ cd "$(mktemp -d)"     $ touch $(seq 1 131072) && find . -mindepth 1 -printf x | wc -c && rm *     131072     $ touch $(seq 1 131073) && find . -mindepth 1 -printf x | wc -c && rm *     131073     $ touch $(seq 1 $(getconf ARG_MAX)) && find . -mindepth 1 -printf x | wc -c && rm *     bash: /usr/bin/touch: Argument list too long      I did a small search:               cd "$(mktemp -d)"     min=131072     max=2097152     while true     do         search=$((min + (max - min) / 2))         if touch $(seq 1 $search) 2>/dev/null         then             min=$search         else             max=$search         fi         [[ $((max - min)) -le 1 ]] && echo "ARG_MAX = $min" && break     done      Eventually this resulted in `ARG_MAX = 314290`, which doesn't seem to have any relation to either of the `ARG_MAX` values found before. Is this normal? Is there a simpler way to find the actual `ARG_MAX`? Did I misunderstand the definition of ARG_MAX? It seems it's actually the byte (or possibly character) length of the arguments with or without (?) the separating spaces. If it's really the byte length, are there also other restrictions?


Avoiding duplicate entries in ~/.ssh/known_hosts

I have my DNS search path set to ".intranet", ie, `/etc/resolv.conf` contains:               search intranet      When I SSH to a host using a FQDN, like "mailserver.intranet", it adds an entry for "mailserver.intranet" to `~/.ssh/known_hosts`. If I later SSH to this same host but using the simple "mailserver" name, SSH adds another entry to known_hosts for "mailserver". Is it possible to make SSH always use FQDN in known_hosts to avoid this duplicity?


how can one program an operating system from scratch?

My programming skills are still rudimentary but I'm curious to know how can one program an operating system from scratch . I know that one must understand how the hardware of the computer work and how it connects to each other and the computer software . But Is it possible to design an OS using predesigned modules that are concerned with the hardware part (like The class libraries in C++) .And can one design an operating system using C++ running on a windows framework ? Thanks in advance.


How to change SMTP outgoing port on Centos 6.3

I have a dedicated server running Centos 6.3. My customer wants to use Microsoft Outlook to send and receive e-mails. He can connect and receive his mails but when he tries to send e-mail he can't because in Turkey SMTP outgoing port 25 is blocked. I need to change the SMTP outgoing port to 587. How can I change it on my server allow mail to be sent?


Local area network without using the IP protocol in Linux

I've read a little about Internet protocols and deduced that on local area network, there is no need to use the IP protocol, though it's normally used. Is there a possibility to turn off the IP protocol in Linux and use only MAC (ethernet) addresses for frame delivering? How would you do it? I guess there will be a problem with `TCP`. I'm not sure if it can work on top of `LLC layer`. The IP protocol overhead is so small that it's being used on LANs (with hubs) too?


Logic behind Postgres binary installation path on Debian

It appears that the Postgresql installation is split into three folder locations on Debian: > Configuration: /etc/postgresql > > Binaries: /usr/lib/postgresql > > Data: /var/lib/postgresql I understand the benefits of splitting up the configuration files and the data, however, the binaries location is confusing to me -- why wouldn't it simply be in /usr/bin? More to the point, why would some binaries go into /usr/bin and others into /usr/lib?


Change screen "hardstatus" color dynamically

I show the hard-disk free space in `hardstatus` screen. But also I want change the color of this value when it's less than a value to alert me.   I have done a script that it checks this and it returns a string if it's true or nothing if it's false.   But the problem is change the color in `hardstatus` screen. This is the line:               hardstatus alwayslastline "%?%27`%{+B r}%?Velocidad"      The hardstatus works but I won't show the output of script check (%27), only change the color. But `%?` needs a not empty string to do this. How can I do this?


Retrieve the window name and role

I'm running Eclipse and I detached some of the windows. Now I have 4 windows linked to Eclipse. What I need is to be able to identify each individual window and be able to control it. If I run tools like: `xprop`, `xwininfo`, or `wmctrl -l` I can retrieve the `WM_CLASS` and `WM_NAME` for the main window but I can't get them for the other 3 child windows. How can I retrieve the `WM_NAME` and `WM_ROLE` for all 4 windows?


Can not connect wirelessly to internet in CrunchBang 10

I am trying to install Crunch Bang 10 on a clients computers. The problem is, wireless internet is not working. Internet on the computer has worked before when it had Lubuntu on it. I have wired works. The computer could temporaily be connected with a wire to do the fix, but it can not be permanent. Also, if it helps, the output from `lspci` (I saw at http://www.cyberciti.biz/faq/linux-find-wireless-driver-chipset/ it told you some wireless info.)               00:00.0 Host bridge: Intel Corporation 82845 845 [Brookdale] Chipset Host Bridge (rev 04)     00:01.0 PCI bridge: Intel Corporation 82845 845 [Brookdale] Chipset AGP Bridge (rev 04)     00:1d.0 USB Controller: Intel Corporation 82801CA/CAM USB Controller #1 (rev 02)     00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 42)     00:1f.0 ISA bridge: Intel Corporation 82801CAM ISA Bridge (LPC) (rev 02)     00:1f.1 IDE interface: Intel Corporation 82801CAM IDE U100 Controller (rev 02)     00:1f.5 Multimedia audio controller: Intel Corporation 82801CA/CAM AC'97 Audio Controller (rev 02)     00:1f.6 Modem: Intel Corporation 82801CA/CAM AC'97 Modem Controller (rev 02)     01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility M7 LW [Radeon Mobility 7500]     02:00.0 Ethernet controller: 3Com Corporation 3c905C-TX/TX-M [Tornado] (rev 78)     02:01.0 CardBus bridge: Texas Instruments PCI1420 PC card Cardbus Controller     02:01.1 CardBus bridge: Texas Instruments PCI1420 PC card Cardbus Controller     02:03.0 CardBus bridge: Texas Instruments PCI1410 PC card Cardbus Controller (rev 01)


Debian Wheezy rebooting instead of powering off

I'm having a weird issue with my Debian Wheezy desktop. When I try to shutdown the system (either from Gnome or from the command line with `shutdown -h now`) the computer automatically reboots. The weirdest thing is that the last message before rebooting is "Will now halt"... and a few seconds later, the computer restarts. After waiting for the system to start, if I issue `shutdown -h now` from the console (before starting GNOME), the computer shutdowns cleanly, and _stays_ off. Although I know that I could leave the computer on indefenitely (after all, this is not a Windows box), I prefer to shut it down properly. Is there some configuration file and/or option I should look at to solve this issue? **_Background info_**   * Debian 7.5 "Wheezy" 64 bit   * Processor: Intel Core i7   * Motherboard: ASUSTeK P8B75-M


No elevated permissions when using GUI applications on i3 wm

I'm running Lubuntu 13.10 with the i3 window manager. Tasks that need elevated permissions, like installing applications from the lubuntu software center or using the gnome-disks, complain about not having sufficient permissions and never prompt for a password. Sudo through the command line works so it seems to be just an issue with GUI applications. Everything works as normal when running vanilla lubuntu.


Contiguous copy – How do I copy files contiguously?

I want to copy a number of files onto a flash drive such that each individual file is contiguous. They do not need to be contiguous with each other, and can be in any order. The files will be very large – hundreds of megabytes, to gigabytes. No other files on the drive should be defragmented; doing so would waste time and cause unnecessary wear on the flash media. I want to be able to do this for at least FAT32, but methods for `*nix` filesystems will also be appreciated. Essentially, there are 2 approaches to this:   * Copy then defragment the files.   * Defrag enough contiguous free space for each file, then copy each file into its place. The 2nd option would generally be far quicker than the 1st, and would avoid causing unnecessary wear on the flash media, so the 2nd option would be very much preferable. I don't mind solutions that work offline, but obviously online is preferable.


How can I `man print`?

Where can I find more information about the command(?) `print` since I don't receive a result when I input `man print`? For example, in the `zsh` I can do the following:               $ print "Hello, world\!"     Hello, world!      I've seen `print -P foo` and `print -n bar` used among other flags and have no idea what they mean nor do I know where to look for further information. So we have two questions really:   1. Where does `print` come from and where can I find documentation for it?   2. Where does one find documentation for similar items that are not to be found in the `man` pages? NOTE: For clarification, I'm not trying to print a sheet of paper. I am also aware of `printf`, which allows for formatted output and has a man page.


Make OpenGL GLX work with Steam client on Debian jessie

I'm trying to install Steam Client on Debian 8 (Jessie) 64-bit because the instructions ask me to (and because I've tried without them and it fails... read on!). In following the instruction I've basically done the following:               deb http://http.debian.net/debian/ jessie main contrib non-free     dpkg --add-architecture i386     aptitude update     aptitude install steam     aptitude install libgl1-fglrx-glx:i386      That last one was in an attempt to install the 32-bit drivers for my ATI Radeon HD 7800. These are needed because steam is apparently 32-bit and requires 32-bit drivers. The output when I run that command is:               user@home:~$ sudo apt-get install libgl1-fglrx-glx:i386     Reading package lists... Done     Building dependency tree            Reading state information... Done     Package libgl1-fglrx-glx:i386 is not available, but is referred to by another package.     This may mean that the package is missing, has been obsoleted, or     is only available from another source     E: Package 'libgl1-fglrx-glx:i386' has no installation candidate      When I now run steam I get the following message: > OpenGL GLX context is not using direct rendering, which may cause > performance problems. > > For more information visit > https://support.steampowered.com/kb_article.php?ref=9938-EYZB-7457. That link takes me to a page basically asking me to install the 32-bit drivers. > >     user@home:~$ glxinfo | grep rendering >     direct rendering: Yes >   Well that's good, I think. But when I try to run, for example, `Counterstrike: Source` I get this: > Could not find required OpenGL entry point 'glGetError`! Either your video > card is unsupported, or your OpenGL driver needs to be updated. I'm guessing this is because I didn't install that driver? To confirm I have the right sources, here is my `/etc/apt/sources.list` file:               user@home:~$ cat /etc/apt/sources.list                                     deb http://http.us.debian.org/debian/ jessie contrib main     deb http://http.debian.net/debian/ jessie main contrib non-free     deb-src http://http.debian.net/debian/ jessie main contrib non-free     deb http://repository.spotify.com stable non-free     deb-src http://repository.spotify.com stable non-free      Unfortunately the suggested solution to the following (very similar) question was included in my steps and didn't help in my case: Debian Stable libgl1-nvidia-glx:i386 not found (trying to install Steam) I'm assuming those instructions are there because they work, and they say specifically that they're for `debian jessie`. What am I doing wrong here? **EDIT:** As Braiam points out the problem might have more to do with a steam problem that my setup. I have tried to follow one of the suggested fixes by doing this: > mv ~/.steam/ubuntu12_32/steam-runtime/i386/lib/i386-linux- > gnu/libgcc_s.so.1{,.disable} However, unlike the reports of others this didn't seem to help me much (same outcome as before).


Ubuntu and Fedora with slow intervals

I recently switched from Windows 7 to Linux and am completely new to this operating system. Although I am convinced by its advantages, an insurmountable problem has come up during this transition. Both Ubuntu 12.04 LTS and Fedora 17 exhibit brief intervals of normal operation, alternated by periods of extreme lag. The latter are characterized by drop-down lists that barely open, slow switching between programs, buttons that become highlighted only after a few seconds, etc. After some time my radiator roars for 10 seconds, the whole systems accelerates and becomes (very) fast again. Turning off some visual gimmicks doesn't help. My current set-up: Asus N53S, Intel Core i7-2670QM, 2.2 GHz, 8 GB RAM.


Custom shortcut to i3lock screen

I'm having difficulties with creating a custom keyboard shortcut. I'm trying to lock my screen using `i3lock` with a picture. From the terminal, the command               i3lock -i ~/Pictures/lock.png      works like charm. When I go `System Settings -> Keyboard -> Custom Shortcut` what do I write into the `Command` line? I've tried:               gnome-terminal -e "i3lock -i ~/Pictures/lock.png"      but it doesn't work.


Is it possible to stop a shutdown command?

Assuming you've just entered the command `shutdown -h now` (or something equivalent), is there realistically anything you can do (if you're quick enough) to prevent the machine shutting down?


Rsync protocol name full path,not a module

Is it possible to name the full path to source directory in rsync command instead of the name of the module. For example:               rsync -av rsync://10.171.73.23/home/user/work/tests .      instead of :               rsync -av rsync://10.171.73.23/ftp/work/tests .      (ftp is a module from /etc/rstncd.conf) When trying the first version I get `'@ERROR: Unknown module 'home''`


What does \? mean in a regular expression?

The following command is used to search for a 7-digit phone number:               grep "[[:digit:]]\{3\}[ -]\?[[:digit:]]\{4\}" file      What does `\?` stand for?


Are there any repositories for Fedora 3?

Is there any alive repository for my Fedora Core 3 Linux? (I want to use the `yum` command but one error comes and tells that `base url is not valid`) Any help to find any alive repository is very much appreciated :)


bash event not found trying to match and exclude parenthesis in grep

In a very long line I'll summarize with:               (foo),(bar,baz(word,right),(end)      I want to print only:                     (bar,baz(word,right      To match the second parenthesis, I exclude the word that follows the third one:               $ grep -oP "\\(.*(?!word).*right"      but Bash interprets the exclamation mark: > -bash: !word: event not found Protecting the exclamation mark with single quote fails with `grep: missing )`               $ grep -oP '\\(.*(?!word).*right'     $ grep -oP '\\((?!word)(.*right)'      Protecting the exclamation mark with backslash fails with `grep: unrecognized character after (? or (?-` Any idea? Note: `-P` is for Perl regex and `-o` is to print only the matching part of a line


Compiling FreeRTOS on ubuntu

How could I compile the FreeRTOS Source Code and run it (possibly on qemu) on Ubuntu 11.04?


RHEL 7.0 can't connect to internet

I'm setting up a new RHEL 7.0 installation (we're running the trial), but I can't get it to connect to the internet from command line. I'm trying to add these repos, as I currently have 0 installed, but I get `curl: (6) Could not resolve host: URL; Unknown error`. I just tried to `wget` a file and it just sits indefinitely. I cannot ping the server from my local network. `ifconfig eth0` results are shown below.               eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500         inet 192.168.201.92  netmask 255.255.255.0  broadcast 192.168.201.255         inet6 fe80::215::5dff:feca:963e  prefixlen 64  scopeid 0x20<link>         ether 00:15:5d:ca:96:3e  txqueuelen 1000  (Ethernet)         RX packets 704958  bytes 80931741 (77.1 MiB)         RX errors 0  dropped 36906  overruns 0  frame 0         TX packets 84  bytes 10038 (9.8 KiB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0      Per request, here is `ip ro`. `/etc/resolv.conf` exists but is blank.               default via 192.168.201.199 dev eth0  proto static  metric 1024     192.168.201.0/24 dev eth0  proto kernel  scope link  src 192.168.201.92      * * * I found a typo in my config file, and I can now `wget` files. The `rpm` commands given in the above linked article are still failing with the given error.


Is it possible to put arithmetic expressions in a crontab?

I know I can do simple arithmetic in shell scripts, like so:               #!/bin/bash     ((sum = 1 + 2))     echo sum      This will output 3 on execution. My question now is, can this kind of expressions be used in crontab? For example, see this line:               03,13,23,33,43,53 * * * * ~/DoSomeStuff.sh      The minutes could be specified as `x+3` with `x` the expression `*/10`, which can be used in crontabs. However, simply writing `*/10+3` or `((*/10+3))` wont work. Is there any way to do this? And what is the correct syntax? The alternative, that certainly works, is putting a `sleep 3m`. I'm just wondering if the arithmetic way of doing it is somehow possible.


Create map network_iface_name <--> IPv4 address

I'd like to implement a bash script that creates a mapping between the network cards (or interfaces) names in my computer and their IP address (in CIDR format, if possible). The goal is having something like an associative array, or a file looking like:               lo: "127.0.0.1/8"     eth0: "192.168.1.123/24"     br-priv: ""      # <-- No IP assigned     wlan0: "10.42.0.10/24"      I have the `ifconfig` and the `ip` commands available, but the parsing of their outputs is a bit tricky, because the IP address and the interface's name don't appear in the same line so I would have to find the interface IP address and then rollback to find the network's name, or viceversa. Is there any other way to find my interfaces IP addresses? I have all the interfaces names (as directory names) under `/sys/class/net/`               root@borrajax:~# ls /sys/class/net/     br-priv/   eth0/    lo/    mon0/   wlan0/      But I haven't been able to find their IP in those directories. Doing that would be great, because I could just walk the directory, retrieve the directory's name and then read the IP from some other file. This is intended to run in an embedded system running OpenWRT, but a solution for a Debian based system might be suitable. My `bash`'s version is 4.2.28, just in case.


xmodmap -e 'remove mod2 = Num_Lock' NumLock not working with Citrix Session

I've installed CentOS 6.5 - 32-bit and am using GNOME, connecting to a Citrix App server. While connecting, I'm not able to use the `Numlock` in the session. So from a blog I've found how to fix this usijg the following command:               xmodmap -e 'remove mod2 = Num_Lock'      After executing this command, `Numlock` works fine within the Citrix session, but the Numlock LED is no longer lighting up (on/off) when pressed. When the session is closed, the `Numlock` continues to not work in other Linux apps until the above command is executed from a terminal.


Treatment of backslashes across shells

How do `echo` and `printf` treat backslashes in `zsh`, `bash` and other shells? Under **zsh** I get the following behavior:               $ echo "foo\bar\baz"     foaaz     $ echo "foo\\bar\\baz"     foaaz     $ echo 'foo\bar\baz'     foaaz     $ echo 'foo\\bar\\baz'     foo\bar\baz      Under **bash** , things seem a bit more consistent:               bash$ echo "foo\bar\baz"     foo\bar\baz     bash$ echo 'foo\bar\baz'     foo\bar\baz     bash$      But more concretely: **How can I pass a string containing backslashes such as`\\\foo\bar\something`** to:   * `echo`   * `printf`   * `print` **and get exactly the same string?** (in `zsh` and `bash`)? Here is another experiment with functions in zsh:               function foo     {         echo -E '$1'     }          $ foo \\here\is\some\path     $1      How can I have it just print `\\\here\is\some\path`? ### Update (Note: this has now been answered in Stephane's comment) I have tried the following in zsh 5.0.2:               function foo     {         printf '$s\n' $1      }          foo '\\some\path'      But this prints `$s` ?


Can groff create a ps file with interpreted ANSI escape characters?

This question is inspired by this one on SU. How can I print bold or color using `lp` and ANSI escape sequences? I know how to display, for example, bold text in the terminal: > $ echo -e '\033[01;1mthis text will be bold\033[00;0m,this will not'   >  **this text will be bold** ,this will not However, when I pipe this directly to `lp` I get a file that looks like this:               01;1mthis text will be bold00;0m,this will not      So, I figure the way to do this would be to use `groff` to create a postscript file and print that. It looks like `groff` should be able to do this, I know it can correctly convert a man page to a ps file and keep whatever is bold in the man page bold in the postscript. However, the `groff` documentation is enormous and kind of esoteric to someone with no postscript experience. I have tried various combinations of options, all of which result in a postscript file that looks like the line above:               echo  -e '\033[01;1mthis text will be bold\033[00;0m,this will not' | groff >a.ps     echo  -e '\033[01;1mthis text will be bold\033[00;0m,this will not' | groff -c >a.ps     echo  -e '\033[01;1mthis text will be bold\033[00;0m,this will not' | groff -Pc >a.ps     echo  -e '\033\[01;1m\]this text will be bold\033\[00;0m\],this will not' | groff -Tascii >a.ps      echo  -e '\033[01;1mthis text will be bold'| groff -man >a.ps      echo  -e '\033[01;1mthis text will be bold'| groff -mdoc >a.ps      echo  -e '\033[01;1mthis text will be bold'| groff -me >a.ps     echo  -e '\033[01;1mthis text will be bold'| groff -mm >a.ps     echo  -e '\033[01;1mthis text will be bold'| groff -ms >a.ps      So, how can I use `lp` and `groff` or any other tool combination to print bold or colored text from the terminal?


Hardware and software inventorying

### Objective Collect hardware and software information from lab computers, respecting students' privacy. ### Type of information to collect Examples:   * System memory   * Bash verion   * JVM version   * Operating system version (build/last update) ### User base   * OS X   * Linux   * FreeBSD ### Type of information to _avoid_ collecting   * CPU serial number   * Computer serial number (e.g. output of `sudo lshw`)   * Network interface card MAC address ### Method of delivery   * Clients join the lab network and execute a Bash script as plain users (i.e. not `root`) ### Constraints   * No backgrounding of processes   * No installation of custom software outside distribution packages   * No reading of any personal data, anywhere   * No agents   * No self-scheduling of re-execution at a later time/date   * Script to be kept open-source, students can look at it at any time (full transparency) ### Permissible to do   * Block network access until the script has been run ( _notice: code that does this exists already, actually keeping the VLAN shut until the "report" has been sent back and validated.. no need to code this_ )   * If only a user has 16GB of RAM, although that uniquely identifies him/her, that's fine ### Example of acceptable commands               printf -v operating_system \               'OS X v%s (build %s)' \               $(sw_vers -productVersion) \               $(sw_vers -buildVersion)      or                local -r linux_kernel_version=$(uname -r)      printf -v operating_system \                'Linux (kernel %s)' \                "$linux_kernel_version"      if [[ -f /etc/issue ]]; then        operating_system+=" $(cat /etc/issue | sed 's/ \\n \\l//g')"      fi      ### Condition _If this kind of script is available already somewhere else, a user profile "sanitised" not to contain any personally identifiable info, useful to a support centre, I have picked the wrong project. Much better to use an existing framework and direct my learner's energies somewhere else._


How to run "find -exec <script> {}\;

I have a script that changes the properties of the files for a folder. Here is the example tree:               dir 1         --file 1         --file 2         --file 3     dir 2         --file 1         --file 2     dir 3         --file 1         --file 2         --file 3      I am running this command on the terminal for which I wan to run the shell script (script.sh) for every directory               find . -type d -exec ./script.sh {}\;      it does not run and errors' this:               find: missing argument to `-exec'      What am I missing here?


Can't yum WINE from repo - No package wine available

I'm trying to install WINE on Centos 5.10 as per some instructions I wrote last year using this instruction:               # yum install wine      However when run, it can't find any package under that name:               # yum install wine      Loaded plugins: fastestmirror, security      Loading mirror speeds from cached hostfile      * base: mirror.mhd.uk.as44574.net      * extras: mirror.sov.uk.goscomb.net      * updates: mirror.sov.uk.goscomb.net     Setting up Install Process     No package wine available.     Nothing to do      I tried saving the RPMs from the Centos 5.10 livecd locally and using them as a repo but it's not found there either. How can I install WINE via yum without having to resort to RPMs?


Increase brightness in a part of the display

I have a laptop with a damaged screen: while it displays an image, one half of it is darker than the other half. Is there any tool to increase the brightness of only a single part of the display? I managed to make things slightly better by playing with `xgamma`, but it's not quite what I want.


How to do df only on root partition?

How can get df results only for `/` partition. The partition name/identification (`/dev/sda2`, `/dev/cciss/c0d0p1`) could vary on different computers.


Do Solaris 10 and 11 still use slab allocation for their kernel memory allocator

If not, what do they use. Please provide a source.


I want completely remove Fedora 16 from PC

As my title says I want to remove Fedora 16 from my system and reinstall later. I have dual boot to Windows. So can anyone help me to get out of this?


Install Edimax EW-7612UAn wireless on CentOS 6.5

Does anyone know how to install the driver for Edimax EW-7612UAn on CentOS 6.5? I've tried to install it on Ubuntu, but I never gotten it to work. EDIT: Here is an attempt building a downloaded driver from the answer from slm:               Authentication requested [root] for make driver:     make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/2.6.32-431.11.2.el6.x86_64/build M=/home/kristjan/Downloads/RTL8192CU_linux_v3.0.2164.20110715_EDIMAX EW-7612UAn V2/RTL8192CU_8188CUS_8188CE-VAU_linux_v3.0.2164.20110715/driver/rtl8192_8188CU_linux_v3.0.2164.20110715  modules     make[1]: Entering directory `/usr/src/kernels/2.6.32-431.11.2.el6.x86_64'     make[1]: *** No rule to make target `EW-7612UAn'.  Stop.     make[1]: Leaving directory `/usr/src/kernels/2.6.32-431.11.2.el6.x86_64'     make: *** [modules] Error 2     Compile make driver error: 2, Please check error Mesg


Public key problem when installing ovirt on aws

I started an instance on AWS with centos 6.4. I ran the following two commands:               $ yum localinstall http://resources.ovirt.org/releases/ovirt-release.noarch.rpm     $ yum -y install ovirt-engine      I got the following messages: > warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: > NOKEY > > Public key for python-websockify-0.5.1-1.el6.noarch.rpm is not installed How can I solve this public key problem?


Daemons fall into what category?

Above system call, there are library routines, utilities and applications. Do daemons fall into any of these categories or they have their own category?


Software RAID 10 + LVM on mixed drives, sector alignment?

I have 4 2.5" 7.2k drives lying about and I'd like to build some RAID arrays for a bit of VM storage on my KVM lab box. There are 2x 320GB drives and 2x 500GB drives. I'm looking to create a RAID 10 array using 4x 320GB partitions. Then the remaining 180GB on the 500GB drives I'll build into a RAID 5 partition with another spare drive. I realise that performance will take a hit because there'll be contention on 2 of the drives in the RAID 10 array and using non-matched drives is also not-optimal but this is solely for a lab/test environment. Initially I thought I would just create 4 matching partitions, create the RAID 10 array, LVM on top of that and done. But once I started looking into LVM on top of raid and 4k disks the subject of sector/block alignment came up and now I don't know where to start. The 320GB drives report Sector size (logical/physical): 512 bytes / 512 bytes The 500GB drives report Sector size (logical/physical): 512 bytes / 4096 bytes So from some reading there are the following variables that I need to take into account for this:   * Partition start/alignment   * RAID stripe size   * RAID superblock position (?)   * LVM PV --dataalignment   * then alignment of any file systems in the LVs Here are the resources that I am basing this on: http://askubuntu.com/a/19572 and http://tytso.livejournal.com/2009/02/20 In some brief exchanges on IRC I have also received conflicing advice, that mdadm, the LVM tools and even fdisk are clever enough these days to take this into account and that I shouldn't worry. Is that the case? Is anyone able to run through what I'd need to do in this specific case to get optimal alignment/sector/stripe size? Please try and ignore the fact that the mixed drives mean the whole thing isn't optimal to start with, as I said, this is a test/lab environment.


apt-get doesn't upgrade openssl on debian 7

I'm facing the following problem. If I run the command `sudo apt-get upgrade`, I get:               Reading package lists... Done     Building dependency tree            Reading state information... Done     The following packages have been kept back:       libssl1.0.0:i386     0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.      and if I run `sudo apt-get install libssl1.0.0:i386`               Reading package lists... Done     Building dependency tree            Reading state information... Done     Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:      apache2-mpm-prefork : Depends: apache2.2-bin (= 2.2.22-13+deb7u1) but it is not going to be installed      apache2.2-common : Depends: apache2.2-bin (= 2.2.22-13+deb7u1) but it is not going to be installed                     Depends: apache2-utils but it is not going to be installed                     Recommends: ssl-cert but it is not going to be installed      libssl1.0.0 : Breaks: libssl1.0.0:i386 (!= 1.0.1e-2+deb7u6) but 1.0.1e 2+deb7u7 is to be installed      libssl1.0.0:i386 : Breaks: libssl1.0.0 (!= 1.0.1e-2+deb7u7) but 1.0.1e-2+deb7u6 is to be installed     E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.      I'm using Debian 7 64. Could you please explain what's really going on? Is there somethign wrong in my server? Thank you.


Can't get upstart service to honor capabilities(7)

I am developing a daemon started by `upstart` (Ubuntu 14.04) which needs to run as a non-privileged user (for security), but bind privileged port 443. I am using `setcap` to set the `CAP_NET_BIND_SERVICE` capability for the executable (it's not a script). I am setting it in Permitted, Effective, and Inherited sets (`setcap 'cap_net_bind_service+eip' EXEC`). I can `su` to the non-privileged user, and run it directly, and it works perfectly. It correctly binds the port, and `/proc/PID/status` shows the proper capabilities masks with `0x400` bit set. But when I start the service via `upstart` it does not run with the capabilities specified for the binary, and the `bind()` fails (`EPERM`). `/proc/PID/status` shows capabilities masks are all 0. Any ideas?


Connect to the Internet on a VPN connected server without Internet

I've a remote server which is not connected to the internet, but I can connect from via SSH to it through a VPN tunnel. On this client I got internet. Is it possible 'get internet' from the client through the VPN conection? The server is a Debian 7 machine.


Kill all queued jobs

I need to kill all the queued and running jobs on my ID. I have tried                  at -l | awk '{print $1}'| at -r {}      But I keep getting                  {} does not exist      Which leads me to believe that I am parsing the statement wrong. I have never worked with piping output, could someone help me out?


Find pattern and move

I'm wondering if anybody knows how to find a pattern and then move it to a different location. For example, I have many files named:               odbc.ini_20110630     odbc.ini_20110639     odbc.ini_20110643     etc... I want to search the pattern of just `odbc.ini` and move all of them to a different folder. I'm not too familiar with how to execute two commands at one time (piping).


Why does initramfs mount the root filesystem read-only

What is the reason for the root filesystem being mounted `ro` in the initramfs (and in initrd). For example the Gentoo initramfs guide mounts the root filesystem with:               mount -o ro /dev/sda1 /mnt/root      Why not the following?               mount -o rw /dev/sda1 /mnt/root      I can see that there is a probably a good reason (and it probably involves `switchroot`), however it does not seem to be documented anywhere.


Suspend from console without leaving authenticated terminam on wake up

I want to suspend my computer from terminal (one obtained by CTR+ALT+F1). If I call:               # echo -n mem > /sys/power/state       after wakeup I'm leaving authenticated console with (possibly) root credentials open to anyone. Is there any elegant way to suspend computer without leaving this console open? Background: Suspend button is not working on my XFCE desktop and because of many reasons I don`t want to fix it right now. So it is easier to just suspend from terminal.


How do I force yum to install without prompting the user, using bash?

I'm writing a bash script to install php5.4 and I'd like to automate this for a test VM. The rpm command I have is:               rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm     yum install php54w      Now, in the middle of this running, there is a user prompt to enter [Y/N] whether or not to download the dependencies. So I either need to:   1. Simulate the user input of [Y]; or   2. pass in a command for yum not to ask and assume [Y] What is the best method for a bash script and how do I accomplish both of the above?


Fedora 18 detecting non-existent monitor

I have an HP Envy dv7 with a dual boot setup of Win 8 and Fedora 18. On 07/22/2013 I updated all packages in Fedora 18 that had updates available. After a reboot, Fedora is now detecting that a second monitor is connected on the vga-2 port (according to `xrandr`) but I don't have a second monitor. Is there a way to prevent it from detecting this monitor? Edit: Thanks for the suggestion below @slm however that just gave me a blank screen. While working on that solution I realized that there is a new grub menu entry. I compared it to the old menu entry and the only difference is the kernel version. If I log in with the old version the problem isn't there but if I use the new version it is. If I run xrandr with the old kernel I get the following:               Screen 0: minimum 320 x 200, current 1600 x 900, maximum 8192 x 8192     LVDS1 connected 1600x900+0+0 (normal left inverted right x axis y axis) 382mm x 215mm        1600x900       60.0*+   40.0          1024x768       60.0          800x600        60.3     56.2          640x480        59.9       VGA1 disconnected (normal left inverted right x axis y axis)     HDMI1 disconnected (normal left inverted right x axis y axis)     DP1 disconnected (normal left inverted right x axis y axis)     VGA-2 disconnected (normal left inverted right x axis y axis)      However if I run it under the new kernel I get:               Screen 0: minimum 320 x 200, current 1600 x 900, maximum 8192 x 8192     LVDS1 connected primary 1600x900+0+0 (normal left inverted right x axis y axis) 382mm x 215mm        1600x900       60.0*+   40.0          1024x768       60.0          800x600        60.3     56.2          640x480        59.9       VGA1 disconnected (normal left inverted right x axis y axis)     HDMI1 disconnected (normal left inverted right x axis y axis)     DP1 disconnected (normal left inverted right x axis y axis)     VGA-2 connected (normal left inverted right x axis y axis)        1024x768       60.0          800x600        60.3     56.2          848x480        60.0          640x480        59.9         1024x768 (0x63)   65.0MHz             h: width  1024 start 1048 end 1184 total 1344 skew    0 clock   48.4KHz             v: height  768 start  771 end  777 total  806           clock   60.0Hz       800x600 (0x64)   40.0MHz             h: width   800 start  840 end  968 total 1056 skew    0 clock   37.9KHz             v: height  600 start  601 end  605 total  628           clock   60.3Hz       800x600 (0x65)   36.0MHz             h: width   800 start  824 end  896 total 1024 skew    0 clock   35.2KHz             v: height  600 start  601 end  603 total  625           clock   56.2Hz      Not sure what's causing this but since I can still use the old kernel, I'll just do that and see if Fedora pushes out an update that fixes it. Thanks again for the help.


How do I output a suggestion for a user to accept and use as input?

What can I do to leave the cursor on the same line of the suggestion in a Bash script? Bash version = 3.2.51 It's purpose is to suggest a string so that the user should only press Enter.               #!/bin/sh     echo "@@@@@@@@@@     @ Enter the new plarform name [for example: our-platform-7.26-2.17-res4]:     @@@@@@@@@@"     echo "our-platform-7.26-2.17-res4"     read SuggestDefaultPlatform          echo "Stored name: " ${SuggestDefaultPlatform}      which prompts:               @@@@@@@@@@     @ Enter the new plarform name [for example: our-platform-7.26-2.17-res4]:     @@@@@@@@@@      our-platform-7.26-2.17-res4     _      where the underscore "`_`" stands for the cursor. I don't want to use a "Y/n" logic workaround, assigning a default value to the "`SuggestDefaultPlatform`" variable               SuggestDefaultPlatform='our-platform-7.26-2.17-res4';      and then prompt a question like:               Are you okay with `'our-platform-7.26-2.17-res4'` as your platform name? [Y/n]...      Instead the user might want to change just a few digits of a prompted suggestion and press Enter. See below the cursor "`_`" at the end of the "`SuggestDefaultPlatform`" variable:               @@@@@@@@@@     @ Enter the new plarform name [for example: our-platform-7.26-2.17-res4]:     @@@@@@@@@@      our-platform-7.26-2.17-res4_      so that the user can move the cursor, modify the suggestion and/or press Enter.               our-platform-7.26-2.17-res_     our-platform-7.26-2.17-re_     our-platform-7.26-2.17-r_     our-platform-7.26-2.17-_     our-platform-7.26-2.17_     our-platform-7.26-2.1_     our-platform-7.26-2.18-alpha1_      Press Enter. which prompts:               Stored name: our-platform-7.26-2.18-alpha1


Is there way to close Guake tab by center click?

I want to close Guake's tab by mouse wheel click. As far as I see there is no configuration for it. Is there a way to do it? For example by configuring with a `~/.guakerc` file or so.


How to delete files only, but keep the directory structure?

I would like to delete every file, but keep the folder structure. Is there a way? NOTE: (I'm using GNU bash 4.1.5).


Replace value within single quotes in a line that contains certain word using sed command

I have a line as below in a html file,               shahar.push(['remoteUrl', 'staging.zazzercode.com']);      Depending upon environment, I want to replace the `remoteUrl` value with `sed` command. **eg,**               shahar.push(['remoteUrl', 'staging.zazzercode.com']);     shahar.push(['remoteUrl', 'production.zazzercode.com']);      I used               sed -i '/remoteUrl/c\shahar.push(['remoteUrl','staging.zazzercode.com']);' predict.html      It works but removing single quotes over `'remoteUrl'` and `'staging.zazzercode.com'` causing html error.               shahar.push([remoteUrl, staging.zazzercode.com]);      **So to be safe,** I want to change `sed` command just to change the value between two single quotes after `,` in a line with `remoteUrl`. Or I want other `sed` options than What I knew to replace whole line but with single quotes.


Extracting with grep/sed a first pattern and then a second pattern that occured some lines before and related to the first

I'm trying to extract a specific line from a `.htm` file when a pattern occur ("Event 100" in my example below) but at the same time I need to retrieve also another pattern which is related to the first but which comes from one of the lines above it. This second pattern represent the time at which the first pattern occurred: Example:               <AZ>207994</AZ>     <AZ>09:10:41.9</AZ>     <AZ>02/04</AZ>     <AZ>[990875]</AZ>
     <AZ>207995</AZ>     <AZ>09:10:56.4</AZ>     <AZ>02/04</AZ>     <AZ>[990876]</AZ>     <AZ>30718</AZ><AZ></AZ><AZ></AZ><AZ></AZ>     <AZ>TN (speed)  Event 3 occurred

     <AZ>30719	</AZ><AZ></AZ><AZ></AZ>     <AZ>TN (speed)  Event 100 occurred

     <AZ>30720</AZ><AZ></AZ><AZ></AZ><AZ></AZ>      I want the following result: 02/04 09:10:56.4 [990876] Event 100 occurred


Converting multiple image files from JPEG to PDF format

I want to convert some files from jpeg to pdf. I am using following command.               $ convert image1.jpg image1.pdf       But I have 100 images. How should I convert all of them to corresponding pdfs? I tried               $ convert image*.jpg image*.pdf       It doesn't work.


Are Debian- and RedHat-style repositories compromised by Heartbleed OpenSSL bug?

The Heartbleed exploit (CVE-2014-0160) makes SSL connections using OpenSSL vulnerable to private key leakage. Does it mean that official update channels in RHEL/CentOS/etc. and Debian/Ubuntu shall be considered compromised?


Can I set font face by file comments in Emacs?

I wonder if we can set the font in Emacs according to the comments in the file. E.g. > -*- fond: "my-font"; -*-


GNU Screen: Creating new window with title specified

Is there a way of creating new window in GNU screen with title specified while creating the window itself. I know that I can create a new window and then set the title using `^A A` but is there a way of mentioning tilte while creating the window itself.


Installing Virtual machine on a virtual Machine

I am implementing Oracle RAC using 11.2. For shared disc option and low cost, we are planning to use Virtual Machines. I have installed one virtual machine (PARENT) Specifications: Oracle Linux 5.8 (64 bit) RAM 16GB HDD 90GB CPU 1 After installing VM, I tried to install another VM (CHILD) using Oracle Virtual Box. Specification for CHILD vm Oracle Linux 5.8 (32 bit) [ as Oracle VM doesnt give a 64 bit option while installing Child virtual machine] RAM 2GB HDD 50GB CPU 1 Its giving error Starting udev:................................[Failed] Questions:   1. What is the possible the possible reason?   2. I want to use Oracle RAC using Linux 5.8. We have don't have other option than Linux. What is the procedure which I need to follow.   3. When I am installing Oracle VM Box on 64 bit machine. The option for 64 bit child machine is not available at the time of creating virtual machine. Thanks in advance :)