systemd - umount device after service which depends on it finishes

I'm trying to implement a mechanism of automated backup using udev rules and systemd. The idea is to launch a backup routine upon hot-plugging a specific storage device, quite similar to this question, for which I provided an answer myself by the way, but here I'm interesteded in discussing some further tweaks. Namely I want the device to be umounted after the backup service finishes. **Some background:** So far I got it to work using udev to start up a systemd service which itself runs a backup routine. The relevant files follow: **backup.service**               [Unit]     Description=<DESCRIPTION HERE>     BindsTo=<STORAGE DEVICE UNIT HERE>.device mnt-backup.mount     After=<STORAGE DEVICE UNIT HERE>.device mnt-backup.mount          [Service]     ExecStart=<CALL TO BACKUP SCRIPT HERE>      **mnt-backup.mount**               [Unit]     DefaultDependencies=no     Conflicts=umount.target     Before=umount.target          [Mount]     What=/dev/disk/by-uuid/<DEVICE UUID HERE>      Where=/mnt/backup     Type=<FILESYSTEM HERE>      **90-backup.rules**               KERNEL=="sd*", ATTRS{serial}=="<HD SERIAL HERE>", TAG+="systemd", ENV{SYSTEMD_WANTS}+="backup.service"       **The question:** Now I want mnt-backup.mount to be stopped as soon as backup.service finishes. According to the documentation ExecStartPost= will be executed after the command in ExecStart=, so I tried adding               ExecStartPost=/usr/bin/systemctl stop mnt-backup.mount      to backup.service, even though I realise it stops mnt-backup.mount, to which it is itself bound, what, as far as I understand, effectively requires backup.service to be stoped before mnt-backup.mount for a graceful stop, hence creating a cyclic dependence. When testing this, it worked a couple of times before I experienced a kernel panic, the first I've seen on my machine, so it got me wondering if this was somehow the cause. In any case, **is my approach correct?**


Piping for loop output prevents local variable modification

I am trying to write a simple bash function that takes, as its arguments, a number of files and/or directories. It should:   1. Fully qualify the filenames.   2. Sort them.   3. Remove duplicates.   4. Print all that actually exist.   5. Return the number of non existant files. I have a script that almost does what I want, but falls down on the sorting. The return value of the script as it stands is correct, but the output is not (unsorted and duplicates). If I uncomment the `| sort -u` statement as indicated, the output is correct but the return value is always `0`. N.B. Simpler solutions to solve the problem are welcome but the question is really about why is this occuring in the code I have. That is, why does adding the pipe seemingly stop the script incrementing the variable `r`? Thankyou for your help. Here's the script:               function uniqfile     {         local r=0               for arg in "$@"         do               readlink -e "$arg" || (( ++r ))              done #| sort -u    ## remove that comment              return $r     }


Why is my variable being localized in one 'while read' loop, but not in another seemingly similar loop

Why do I get different values for $x from the snippets below?               #!/bin/bash          x=1     echo fred>junk ; while read var ; do x=55 ; done <junk     echo x=$x      #    x=55 .. I'd expect this result          x=1     cat junk | while read var ; do x=55 ; done     echo x=$x      #    x=1 .. but why?          x=1     echo fred | while read var ; do x=55 ; done     echo x=$x      #    x=1  .. but why?


bash script var not changed after the loop

I'm quite new to bash scripting, and I wrote the following script to emulate the `wc -c` command: (I know it doesn't count the end of the line)               #!/bin/bash          echo $1     len=0     cat $1 | while read line     do         let len+=${#line}         echo $len     done     echo $len      the output is the following:               xyz.sh     11     11     18     27     51     53     70     79     83     92     0      why doesn't `len` stays changed after the loop, and hoe to make it to do so?


question about a 'while' logics error

> **Possible Duplicate:**   >  Why is my variable being localized in one ‘while read’ loop, but not in > another seemingly similar loop I have a bash script that scraps URLs to feed a MySQL database. In my loop, I have a variable called query that gets filled ok, but when I try to output it, it always says it's empty!               #!/bin/bash          #   get path to here     [ -L $0 ] && P1=$(readlink $0) || P1=$0     P2=$(dirname $P1)          #   slugify the name of the city into URL format     function slugify() {         slug="$@"              echo    "$slug"             |         tr      '[A-Z]' '[a-z]'     |         sed     's/\s/-/g'     }          echo "Getting list of cities from csv file"          i=$(( 0 ))      #   lines read     g=$(( 0 ))      #   curl OK     f=$(( 0 ))      #   number of pages not found          #   total number of cities in CSV file     lines=$(wc -l  $P2/docs/cities.csv | cut -d' ' -f1)          #   Reading CSV file line by line     while read ROW     do         # getting city iso_code         city_iso_code=$(echo $ROW | cut -d, -f1| sed -e 's/.$//' | sed 's/^FR\([^A-Z0-9]\+\)//')         # getting city name         city_name=$(echo $ROW | cut -d, -f3 | sed "s/'/\\\'/g" | sed -e 's/.$//')              # stop after 1 good result to see if everything ok         # [[ "$city_name" == A* ]] || {         [ $g -gt 1 ] && {             echo 'Done for today'             # THIS IS WHERE query is empty when it should not!!             echo "Query: <$query>"                  exit         }              # slugify city name         city_slug=$(slugify $city_name)              # construct url to fetch         city_url="http://******/****$city_slug.html"              # visual teller         echo -en "\r$g ok, $f not found | $city_name | $city_url            "              # check if page exists, if so scrap it, else fill the Not found page         # I realize I am doing 2 curl Calls for every request :(         [ $(curl -s -o /dev/null -w "%{http_code}" $city_url) -eq 200 ] && {                  # increment the total of OK             g=$(( g + 1 ))                  # getting contents and scrapping it             curl 2>/dev/null $city_url  |                  sed     's/</\n/g'      |                  grep    'td id="r'      |                  cut     -d'>' -f 2      |                  sed     "s/'/\\\'/g"    |                  while read street                 do                     # constructing query                     query="$query insert into cc_streets (city_iso_code,street_name) values ('FR $city_iso_code','$street');"                 done             } || {                 # not found                 f=$(( f + 1 ))                 notfound="$notfound     FR $city_iso_code,$city_name,$city_url"         }               i=$(( i + 1 ))     done < $P2/docs/cities.csv      So in the WHILE loop,when I echo 'Done for today', and try to output the variable query, it says it's empty, but I know the query variable gets filled alright if I echo query in the second WHILE, so query gets reset at one moment in the loop but I can't quite get when. Anybody has a clue as why it does not work? Thanks for your insight!


Why does selecting text only "copy" it (as in copy and paste) circumstantially?

One of the most user-friendly features of Linux is that highlighting or selecting text will automatically _copy_ it so that it can be pasted upon a middle- click. However, this can also be a point of frustration because this behavior only works under certain conditions. For example, it works consistently in Chrome, in terminals, and many GTK apps, but strangely, not in LibreOffice. Is there any way to make selecting text _copy_ the text under every circumstance?


I have a cpp error on UNIX

Hans Lao@Hans ~     $ cd /home/ddscat130527/src          Hans Lao@Hans /home/ddscat130527/src     $ make ddscat     cpp -P -traditional-cpp -Dsp ddprecision.f90 \     ddprecision_cpp.f90     make: cpp: Command not found     Makefile:508: recipe for target 'ddprecision.mod' failed     make: *** [ddprecision.mod] Error 127          Hans Lao@Hans /home/ddscat130527/src     $      I need to install cpp but don't know how.


Default GNOME cursors package?

I installed a minimal version of Debian (wheezy), and then installed GNOME on top. However, it doesn't come with any special mouse cursors except for a non- descript black cursor. I was wondering if there was a package I could download that contained the cursor set that came default with GNOME?


Changing Unix group for files

I have a file that a colleague and I are editing together, on a Unix system. We are using Unix group permissions to edit it. We have one Unix group that we are both members of. Whenever I save the file, it changes the Unix group to one that he is not a member of. Is there any way to stop it from doing that?


Can I configure my Linux system for more aggressive file system caching?

I am neither concerned about RAM usage (as I've got enough) nor about losing data in case of an accidental shut-down (as my power is backed, the system is reliable and the data are not critical). But I do a lot of file processing and could use some performance boost. That's why I'd like to set the system up to use more RAM for file system read and write caching, to prefetch files aggressively (e.g. read-ahead the whole file accessed by an application in case the file is of sane size or at least read-ahead a big chunk of it otherwise) and to flush writing buffers less frequently. How to achieve this (may it be possible)? I use ext3 and ntfs (I use ntfs a lot!) file systems with XUbuntu 11.10 x86.


pure-ftpd floods /var/log/messages

My `/var/log/messages` is full of messages like:               Jan 29 01:00:02 vm2147 pure-ftpd: (?@::1) [INFO] New connection from ::1     Jan 29 01:00:02 vm2147 pure-ftpd: (?@::1) [INFO] Logout.     Jan 29 01:05:02 vm2147 pure-ftpd: (?@::1) [INFO] New connection from ::1     Jan 29 01:05:02 vm2147 pure-ftpd: (?@::1) [INFO] Logout.      These messages are generated every five minutes. What do they mean and is it a problem? How can I prevent them? My system is `2.6.35.12-90.fc14.x86_64`.


strange logs in /var/log/messages

My `/var/log/messages` contain lots of messages like this:               Jan 22 05:45:05 vm kernel: hdc: drive_cmd: status=0x41 { DriveReady Error }     Jan 22 05:45:05 vm kernel: hdc: drive_cmd: error=0x04 { AbortedCommand }     Jan 22 05:45:05 vm kernel: ide: failed opcode was: 0xec      I do not even have `hdc` on my system. What can be the cause of them? My system is `2.6.18-194.32.1.el5.centos.plus`.


How to avoid escape sequence attacks in terminals?

Reading the details of CVE-2009-4487 (which is about the danger of escape sequences in log files) I am a bit surprised. To quote CVE-2009-4487: > nginx 0.7.64 writes data to a log file without sanitizing non-printable > characters, which might allow remote attackers to modify a window's title, > or possibly execute arbitrary commands or overwrite files, via an HTTP > request containing an escape sequence for a terminal emulator. Clearly, this is not really about a security hole in nginx, but in the terminal emulators. Sure, perhaps `cat`ing a log file to the terminal happens only by accident, but `grep`ing a logfile is quite common. `less` perhaps sanitizes escape sequences, but who knows what shell commands don't change escape sequences ... I tend to agree with the Varnish response: > The wisdom of terminal-response-escapes in general have been questioned at > regular intervals, but still none of the major terminal emulation programs > have seen fit to discard these sequences, probably in a misguided attempt at > compatibility with no longer used 1970'es technology. [..] Instead of > blaming any and all programs which writes logfiles, it would be much more > productive, from a security point of view, to get the terminal emulation > programs to stop doing stupid things, and thus fix this and other security > problems once and for all. Thus my questions: How can I secure my xterm, such that it is not possible anymore to execute commands or overwrite files via escape sequences? What terminal emulators for X are secured against this attack?


Error with gedit can't save any file

meraj@meraj-SATELLITE-C850-A785:~$ sudo gedit /etc/php5/apache2/php.ini          (gedit:16243): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files      whenever I save the file in gedit it is not saved what should I do? I have ubuntu 14.04


Is is possible to store Nautilus' thumbnails along with the original files?

By default Nautilus stores thumbnails in ~/.cache/thumbnails folder. It has many advantages, but one place it doesn't work well is with network shares full of multimedia accessed by WiFi by several clients. It would be much better to let the file server generate the thumbnails locally and store it along the original files (just like Windows is doing with its `thumbs.db` file), so clients wouldn't have to download much of the folders' contents just to generate the previews. Is this option available at all? If not Nautillus, then maybe Thunar? Nemo? Whatever?...


How to suspend from Gnome3 using systemd

**Brief background information:** I just installed Fedora 18 with Gnome 3.6.3.1 on my computer. It is connected to a Windows share (CIFS) containing music, which I play using Clementine. If I suspend the computer while Clementine is playing a song from the CIFS mount, upon resuming, it (Clementine) hangs. Eventually, if I try to restart/power off, the whole computer hangs. My workaround to this is to stop playback upon suspension. **My problem:** I've created a script in `/usr/lib/systemd/system-sleep` to stop playback (using MPRIS). The script successfully runs before suspend if I execute               systemctl suspend      However, it does not run if I click on Suspend from the User menu in Gnome3. Doing some legwork, I uncovered that Gnome3 relies on UPower, which itself, it seems, simply uses DBus to issue the "Suspend" command. I'm not savvy enough to follow the trail any further, but from what I can see, the script never gets executed. **My question:** How can I make the Suspend menu item in Gnome3 use systemd to call my script?


telnet to localhost and loopback device IP works, but not LAN ip (Xen + Ubuntu)

I have set up Xen + Ubuntu per the instructions at https://help.ubuntu.com/community/XenProposed. I am now ready to install a HVM guest OS (Ubuntu Desktop 12.04). After I start my HVM guest OS               xen create ubuntu-hvm.cfg      I need to now connect to it. I am connecting to the HVM guest OS on a Windows box using VNC Viewer. However, I can't connect:               unable to connect to host: Connection refused (10061)      On the Xen+Ubuntu box, Dom0, the LAN IP is 192.168.0.201. Just as a sanity test, I pinged the following addresses while on the Dom0 console               ping localhost     ping 127.0.0.1     ping 192.168.0.201      All pings were successful. Then I tried to telnet via port 5900.               telnet localhost 5900     telnet 127.0.0.1 5900     telnet 192.168.0.201 5900      The last telnet to the LAN IP does not work:               telnet: Unable to connect to remote host: Connection refused      I also checked to make sure port 5900 was opened.               sudo netstat -tcp --listening --programs      I got the following information.               Proto Recv-Q Send-Q Local_Address        Foreign_Address State  PID/Program_name     tcp   0      0      localhost:5900       *:*             LISTEN 2097/qemu-dm     tcp   0      0      192.168.122.1:domain *:*             LISTEN 5653/dnsmasq     tcp   0      0      *:ssh                *:*             LISTEN 1198/sshd     tcp   0      0      [::]:ssh             [::]:*          LISTEN 1198/sshd      On my Windows box, a ping to 192.168.0.201 works, but a telnet 192.168.0.201 5900 does not work. Any help is appreciated.


Undefined reference to gzopen64 when building samtools

I am trying to install the software package samtools0.1.19. When I run `make`, I get errors:               gcc -g -Wall -O2 -o samtools bam_tview.o bam_plcmd.o sam_view.o bam_rmdup.o bam_rmdupse.o bam_mate.o bam_stat.o bam_color.o bamtk.o kaln.o bam2bcf.o bam2bcf_indel.o errmod.o sample.o cut_target.o phase.o bam2depth.o padding.o bedcov.o bamshuf.o bam_tview_curses.o bam_tview_html.o  libbam.a -Lbcftools -lbcf  -lcurses  -lm -lz -lpthread     phase.o: In function `loadpos':     /illumina/data/galaxy/apps/samtools-0.1.19/phase.c:475: undefined reference to `gzopen64'     bedcov.o: In function `main_bedcov':     /illumina/data/galaxy/apps/samtools-0.1.19/bedcov.c:69: undefined reference to `gzopen64'     libbam.a(bam_import.o): In function `__bam_get_lines':     /illumina/data/galaxy/apps/samtools-0.1.19/bam_import.c:76: undefined reference to `gzopen64'     libbam.a(bam_import.o): In function `sam_open':     /illumina/data/galaxy/apps/samtools-0.1.19/bam_import.c:472: undefined reference to `gzopen64'     libbam.a(bam_import.o): In function `sam_header_read2':     /illumina/data/galaxy/apps/samtools-0.1.19/bam_import.c:126: undefined reference to `gzopen64'     libbam.a(bedidx.o):/illumina/data/galaxy/apps/samtools-0.1.19/bedidx.c:107: more undefined references to `gzopen64' follow     collect2: ld returned 1 exit status     make[1]: *** [samtools] Error 1     make[1]: Leaving directory `/illumina/data/galaxy/apps/samtools-0.1.19'     make: *** [all-recur] Error 1      I tried installing the packages it depends on, and even used elrepo for Red Hat Linux but it doesn't work.


How to restrict rm -rf / in CentOS machine?

I would like to know how we can restrict `rm -rf /`on CentOS machines?


Menus don't show properly in latest Linux Mint

I'm using the last version of Mint and I'm having, sometimes, problems with some menus. I can't take a PrintScreen because it happens with the right button function. If I'm right clicking on a item down the screen, the last options, like "Property" for instance, do not appear so I have to use the keyboard arrows to get to the option. My resolution is 1366 x 768 (16:9). Any ideas?


can't start x11vnc without attached monitor

I'd like to setup `x11vnc` (or any other vnc server) to start at boot-time. The display manager is `kdm`, the distribution is Ubuntu 12.04.2 LTS. When I try to start x11vnc, I'm getting this errors:               $ x11vnc -rfbauth /var/run/xauth/A:0-crWk72  -rfbport 5901      passing arg to libvncserver: -rfbauth      passing arg to libvncserver: /var/run/xauth/A:0-crWk72      passing arg to libvncserver: -rfbport      passing arg to libvncserver: 5901      x11vnc version: 0.9.12 lastmod: 2010-09-09  pid: 2828      XOpenDisplay("") failed.      Trying again with XAUTHLOCALHOSTNAME=localhost ...           *** XOpenDisplay failed. No -display or DISPLAY.      *** Trying ":0" in 4 seconds.  Press Ctrl-C to abort.      *** 1 2 3 4       XOpenDisplay(":0") failed.      Trying again with XAUTHLOCALHOSTNAME=localhost ...      XOpenDisplay(":0") failed.      Trying again with unset XAUTHLOCALHOSTNAME ...      I've tried installing `xserver-xorg-video-dummy` in order to avoid issues with no screen attached, but so far with no success.


Tool for measuring entropy quality?

Is there a tool available for Linux systems that can measure the "quality" of entropy on the system? I know how to count the entropy:               cat /proc/sys/kernel/random/entropy_avail      And I know that some systems have "good" sources of entropy (hardware entropy keys), and some don't (virtual machines). But is there a tool that can provide a metric as to the "quality" of the entropy on the system?


SSH Failing to fork with sshpass

I've a problem with port forwarding command using sshpass. Problem is that it's working on one server and does not work on another. Both are Debian 7 x64 boxes.               sshpass -p password ssh -f -D 0.0.0.0:2002  -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=debug root@5.5.5.5 -T -N      This command works with no problems on server 1 but does not work on server 2. Debug output from failing server:               Authenticated to 5.5.5.5 ([5.5.5.5]:22).     debug1: Local connections to 0.0.0.0:2002 forwarded to remote address socks:0     debug1: Local forwarding listening on 0.0.0.0 port 2002.     debug1: channel 0: new [port listener]     debug1: forking to background      Debug output from working server:               Authenticated to 5.5.5.5 ([5.5.5.5]:22).     debug1: Local connections to 0.0.0.0:2002 forwarded to remote address socks:0     debug1: Local forwarding listening on 0.0.0.0 port 2002.     debug1: channel 0: new [port listener]     debug1: forking to background     debug1: Entering interactive session.      Sshpass and ssh binaries are equal on both servers. I've checked this using md5sum. Does anyone have an idea what could be wrong? I'm loosing my mind trying to solve this mystery.


After a recent upgrade in my Arch Linux x64 system, I keep getting this warning message after installing or removing packages with `pacman`.               (gconftool-2:5207): GConf-WARNING **: Client failed to connect to the D-BUS daemon:     /usr/bin/dbus-launch terminated abnormally with the following error: No protocol specified     Autolaunch error: X11 initialization failed.      So, far I have not seen any ill effects from this (that I know of), but I would like to make this warning go away. **EDIT** I can consistently reproduce this by installing or uninstalling GNOME Do. Both of the following commands result in the output above.               $ sudo pacman -S gnome-do     $ sudo pacman -Rns gnome-do      Running `xhost +` seems to temporarily alleviate the warning (at least until I reboot). I can run `xhost -` and the warning returns. **UPDATE** This problem went away after a few upgrades (i.e. `pacman -Syu`).


How to search for files by size and extension ?

I want to delete all empty files with a particular extension from a directory and all its subdirectories.


find files which have a higher permission than xxx

I want to find all files which have a higher permission than e.g. 640. Perhaps this would work with a find and exec command. But my knowledge isn't sufficient for such a task.


Bash: Use an alias in a variable

I am writing a bash script that runs each of its arguments as a command. This works for commands in my `PATH`, but not for aliases. I can directly call an alias in the script, but I can't call an alias that has been passed as an argument. The problem (I assume) is that aliases are expanded before variables. Is there a way to run aliases from a variable? Sample script:               #!/bin/bash     # File: runall          shopt -s expand_aliases     source ~/.aliases          while (( "$#" )); do         $1         shift     done      `runall "echo test"` works, but `runall "myalias"` gives `runall: line 8: myalias: command not found`


Java "Could not reserve enough space for object heap" even though there is enough RAM

I am currently having some issues running Java. It won't start because of heap issues. But I have more than 9 GB Ram free (or even 16 GB if you assumed the cache would be empty). This is the error I get (and the `free` command)               root@server: ~ # java     Error occurred during initialization of VM     Could not reserve enough space for object heap     Error: Could not create the Java Virtual Machine.     Error: A fatal exception has occurred. Program will exit.          root@server: ~ # free                  total       used       free     shared    buffers     cached     Mem:      25165824   15941148    9224676          0          0    7082176     -/+ buffers/cache:    8858972   16306852     Swap:            0          0          0      I am running a 64 bit Debian on a virtualized server. The virtualization software is OpenVZ. This is my Java version _(I can execute this command after I stop two of my VM's (4 currently running))_ :               root@server: ~ # java -version     java version "1.7.0_45"     Java(TM) SE Runtime Environment (build 1.7.0_45-b18)     Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)      What could I do? * * * **As requested:**               root@server: ~ # cat /proc/meminfo     MemTotal:       25165824 kB     MemFree:        11723412 kB     Cached:          4597552 kB     Active:          9692308 kB     Inactive:        3322544 kB     Active(anon):    7411960 kB     Inactive(anon):  1005340 kB     Active(file):    2280348 kB     Inactive(file):  2317204 kB     Unevictable:           0 kB     Mlocked:               0 kB     SwapTotal:             0 kB     SwapFree:              0 kB     Dirty:               960 kB     Writeback:             0 kB     AnonPages:       8417300 kB     Shmem:             21504 kB     Slab:             427452 kB     SReclaimable:     383424 kB     SUnreclaim:        44028 kB      * * * **Reguest2:**               root@server: ~ # cat /proc/user_beancounters     Version: 2.5            uid  resource                     held              maxheld              barrier                limit              failcnt      10023468:  kmemsize                399250512            506245120           5053325720           5558658292                    0                 lockedpages                     0                    8               246744               246744                    0                 privvmpages               6005602              6291447              6291456              6291456                  221                 shmpages                     8576                 8608               579124         579124289562                    0                 dummy                           0                    0  9223372036854775807  9223372036854775807                    0                 numproc                       598                 1236                30000                30000                    0                 physpages                 4634494              6291456              6291456              6291456                    0                 vmguarpages                     0                    0              6291456  9223372036854775807                    0                 oomguarpages              1529371              2144671              6291456  9223372036854775807                    0                 numtcpsock                     62                  164                30000                30000                    0                 numflock                       25                   39                 1000                 1100                    0                 numpty                         13                   24                  512                  512                    0                 numsiginfo                     10                   75                 1024                 1024                    0                 tcpsndbuf                 3330352              4153232           1179110194           1684441906                    0                 tcprcvbuf                 1216896             34410032           1179110194           1684441906                    0                 othersockbuf               270504               537552            589555096           1094886808                    0                 dgramrcvbuf                     0                67048            589555096            589555096                    0                 numothersock                  287                  333                30000                30000                    0                 dcachesize              355559855            446054103           1103879952           1136996352                    0                 numfile                      4766                 7745               250000               250000                    0                 dummy                           0                    0  9223372036854775807  9223372036854775807                    0                 dummy                           0                    0  9223372036854775807  9223372036854775807                    0                 dummy                           0                    0  9223372036854775807  9223372036854775807                    0                 numiptent                      14                   14                 1000                 1000                    0          root@server: ~ # java     Error occurred during initialization of VM     Could not reserve enough space for object heap     Error: Could not create the Java Virtual Machine.     Error: A fatal exception has occurred. Program will exit.          root@server: ~ # cat /proc/user_beancounters     Version: 2.5            uid  resource                     held              maxheld              barrier                limit              failcnt      10023468:  kmemsize                399246622            506245120           5053325720           5558658292                    0                 lockedpages                     0                    8               246744               246744                    0                 privvmpages               6005601              6291447              6291456              6291456                  233                 shmpages                     8576                 8608               579124         579124289562                    0                 dummy                           0                    0  9223372036854775807  9223372036854775807                    0                 numproc                       598                 1236                30000                30000                    0                 physpages                 4635460              6291456              6291456              6291456                    0                 vmguarpages                     0                    0              6291456  9223372036854775807                    0                 oomguarpages              1529376              2144671              6291456  9223372036854775807                    0                 numtcpsock                     64                  164                30000                30000                    0                 numflock                       25                   39                 1000                 1100                    0                 numpty                         13                   24                  512                  512                    0                 numsiginfo                     10                   75                 1024                 1024                    0                 tcpsndbuf                 3365232              4153232           1179110194           1684441906                    0                 tcprcvbuf                 1249664             34410032           1179110194           1684441906                    0                 othersockbuf               270504               537552            589555096           1094886808                    0                 dgramrcvbuf                     0                67048            589555096            589555096                    0                 numothersock                  287                  333                30000                30000                    0                 dcachesize              355559855            446054103           1103879952           1136996352                    0                 numfile                      4768                 7745               250000               250000                    0                 dummy                           0                    0  9223372036854775807  9223372036854775807                    0                 dummy                           0                    0  9223372036854775807  9223372036854775807                    0                 dummy                           0                    0  9223372036854775807  9223372036854775807                    0                 numiptent                      14                   14                 1000                 1000                    0


dircolors: modify color settings globaly

I understand `ls` uses `dircolors` to display colored output. `dircolors` has default database of colors associated with file extensions, which can be printed wiht the command               dircolors --print-database      From `man dir_colors` I read, the system-wide database should be located in `/etc/DIR_COLORS`. But this file does not exist on my system (Debian). How can I modify system-wide color settings for `dircolors`? Where does the command `dircolors --print-database` take the settings from, when no file exists. I am aware that user can have user-specific file `~/.dir_colors` with his settings, but this is not suitable for me, since I need to change the settings for everybody. A second questions is, whether it is possible to use 8-bit colors for dircolors. My terminal is `xterm-256color`.


Why do the data and code segments completely overlap in Linux?

Context: I'm reading "Understanding the Linux kernel, 3d ed", which uses the 2.6.11 kernel. Question: As I understand, the physical address is obtained by translating the linear address, which is obtained by translating the logical address. The logical address consists of a segment selector, which identifies a segment in a Description Table The Linux Global Description Table includes, amongst other segments, a user code and data segment. But the base address of both segments is `0x0`, and their size is also the same. So they completely overlap. So as I understand, the logical address `cs + offset` is identical to the logical address `ds + offset`, where `cs` and `ds` are the CPU registers that hold respectively the code segment selector and data segment selector. I think this is the case because both segments have the same base address, which is incremented with the offset to get the linear address. If this is the case and they both map to the same linear address, don't they also map to the same physical address? If so, what is the use of having seperate `cs` and `ds` registers?


Some garbage characters in Linux terminal

My embedded linux app sometimes outputs the text like this:               root@variscite /mnt/nfs$ ./test      > GPIO_IMX6_C: i=1 cannot open GPIO device file /sys/class/gpio/gð½Å¢ j¤Ôè > Uêêª eú5¥Jõ¹¹2¥±zåÍ½±Í?:e½½:e½Å¢j¤Ôè Uêêª 2¥±zåÍ½±Í?:e½½:e½åj¤Ôè > eú5¥Jõº¹¹½?zU¹:A%="? Uêêª 2¥±zåÍ½±Í?:e½½:e½åj¤Ôè eú5¥JõÂ¹¹½?zU¹:A%="? Uêêª > 2¥±zåÍ½±Í?:e½½:e½Å¢Âj¤ÔÈªWKV.¤ËR-k®W«U¹:A%="? ×¤¬,]Z»Y1 DEBUG[0700]: Fan > Control Board: Fan control Write byte ... call CreateServerSocket...9600 Set attrib Any ideas, what could cause this?


Why is return is ignored during output in bash?

When I start a program that runs for a bit, say `make`, I could just type the next command in bash even before I got a prompt back and when the first command finished, the second one was executed as if I had typed it later. But suddenly this doesn't work any more. The additional command will be shown at the prompt after the first one finished but is not executed. If I type more commands, they are all shown at the prompt (without any space or newline between them). Any idea what is at fault here or how I can figure it out myself?


Are there any full featured pdf readers that integrate comment function?

I'm needing reading some research papers whose formats are almost pdf.However I cannot find a good pdf reader which can make some notes while reading. Currently I use **xournal** however there seems not many choices when I want to make different comments. There exists another problem:the comments made is actually on another layer so other pdf readers cannot recongnize it. "Export to PDF" seems a little rude for me.


How to get a previous date using a reference to a file with the date command?

I'm trying to get Previous date of reference file. What I've tried :               [rahul@testsrv]$ date +%F -r /tmp/ftpbkp.log     2013-08-27          [rahul@testsrv]$ date +%F -r /tmp/ftpbkp.log -d "1 day ago"     date: the options to specify dates for printing are mutually exclusive     Try `date --help' for more information.


After ubuntu install + software raid 0 config, we see: rejecting I/O to offline device

I'm trying to pin down what this error `rejecting I/O to offline device` is, as seen towards the end of this syslog. Ideas:   * Problem with RAID-0 configuration (we have 2 4TB disks in RAID-0 and I do see a warning about it)   * Virtual CD - there is no CD on this server, but I did have a virtual CD attached over an IPMI/KVM tool for the installation. That should not be attached now though, but I see some messages about it. Other than the above notes, this is a new installation of ubuntu 12.04 that was done over netboot and via the IPMI/KVM console.               Apr 12 19:42:46 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3     Apr 12 19:42:46 ubuntu dhclient: DHCPREQUEST of 10.1.5.255 on eth0 to 255.255.255.255 port 67     Apr 12 19:42:46 ubuntu dhclient: DHCPOFFER of 10.1.5.255 from 10.1.0.1     Apr 12 19:42:46 ubuntu dhclient: DHCPOFFER from 10.1.3.48 rejected by rule 10.1.3.48 mask 255.255.255.255.     Apr 12 19:42:46 ubuntu dhclient: DHCPACK of 10.1.5.255 from 10.1.0.1     Apr 12 19:42:46 ubuntu dhclient: bound to 10.1.5.255 -- renewal in 43104 seconds.     Apr 12 19:42:46 ubuntu kernel: [    8.512887] init: failsafe main process (745) killed by TERM signal     Apr 12 19:42:46 ubuntu kernel: [    8.551401] type=1400 audit(1365820966.336:8): apparmor="STATUS" operation="profile_replace" name="/sbin/dhclient" pid=866 comm="apparmor_parser"     Apr 12 19:42:46 ubuntu kernel: [    8.552253] type=1400 audit(1365820966.340:9): apparmor="STATUS" operation="profile_replace" name="/usr/lib/NetworkManager/nm-dhcp-client.action" pid=866 comm="apparmor_parser"     Apr 12 19:42:46 ubuntu kernel: [    8.552723] type=1400 audit(1365820966.340:10): apparmor="STATUS" operation="profile_replace" name="/usr/lib/connman/scripts/dhclient-script" pid=866 comm="apparmor_parser"     Apr 12 19:42:46 ubuntu kernel: [    8.562192] type=1400 audit(1365820966.348:11): apparmor="STATUS" operation="profile_load" name="/usr/sbin/tcpdump" pid=868 comm="apparmor_parser"     Apr 12 19:42:46 ubuntu cron[895]: (CRON) INFO (pidfile fd = 3)     Apr 12 19:42:46 ubuntu mdadm[910]: DeviceDisappeared event detected on md device /dev/md/0, component device Wrong-Level     Apr 12 19:42:46 ubuntu cron[920]: (CRON) STARTUP (fork ok)     Apr 12 19:42:46 ubuntu cron[920]: (CRON) INFO (Running @reboot jobs)     Apr 12 19:42:54 ubuntu ntpdate[818]: adjust time server 91.189.94.4 offset 0.188979 sec     Apr 12 19:42:56 ubuntu kernel: [   18.721994] eth0: no IPv6 routers present     Apr 12 19:43:12 ubuntu kernel: [   35.070907] usb 1-5.3: reset high-speed USB device number 4 using ehci_hcd     Apr 12 19:43:23 ubuntu kernel: [   45.212938] usb 1-5.3: reset high-speed USB device number 4 using ehci_hcd     Apr 12 19:43:39 ubuntu kernel: [   61.354018] usb 1-5.3: reset high-speed USB device number 4 using ehci_hcd     Apr 12 19:43:39 ubuntu kernel: [   61.521613] usb 1-5.3: reset high-speed USB device number 4 using ehci_hcd     Apr 12 19:43:49 ubuntu kernel: [   71.663780] usb 1-5.3: reset high-speed USB device number 4 using ehci_hcd     Apr 12 19:43:49 ubuntu kernel: [   71.756135] sr 6:0:0:0: Device offlined - not ready after error recovery     Apr 12 19:43:49 ubuntu kernel: [   71.756166] sr 6:0:0:0: rejecting I/O to offline device     Apr 12 19:43:49 ubuntu kernel: [   71.756722] sr0: scsi3-mmc drive: 0x/0x caddy     Apr 12 19:43:49 ubuntu kernel: [   71.756726] cdrom: Uniform CD-ROM driver Revision: 3.20     Apr 12 19:43:49 ubuntu kernel: [   71.756951] sr 6:0:0:0: Attached scsi CD-ROM sr0     Apr 12 19:43:49 ubuntu kernel: [   71.757034] sr 6:0:0:0: rejecting I/O to offline device     Apr 12 19:43:49 ubuntu kernel: [   71.757643] sr 6:0:0:0: Attached scsi generic sg2 type 5     Apr 12 19:43:49 ubuntu kernel: [   71.778813] sr 6:0:0:0: rejecting I/O to offline device     Apr 12 19:43:49 ubuntu kernel: [   71.779394] sr 6:0:0:0: rejecting I/O to offline device     Apr 12 19:43:49 ubuntu kernel: [   71.779972] sr 6:0:0:0: rejecting I/O to offline device     Apr 12 19:43:49 ubuntu kernel: [   71.780829] sr 6:0:0:0: rejecting I/O to offline device      * * * **Update:** @jordanm & others - correct, I just confirmed that this is the CDROM device, but this is a "virtual cd" that was created by a previous KVM session via IPMI on the server. It doesn't exist any more, any idea how can I get rid of it? Or not attempt to access it, I'm not sure why it's there.


Shortcut to minimize all windows?

In Windows systems, I use the keyboard shortcut `Start`-`D` (show desktop) a lot. I'm using Linux Mint, and I wonder: Can I create a keyboard shortcut that will do the same? **edit** after the comment from `Gert van den Berg` - if you could explain how to make a short-cut equivalent to `Start`-`M` that well do. I think the windows manager is KDE.


what is the difference between if and [[ in bash?

I see that               if cmd     then     echo Hi     fi      works differently from               if [[ $(cmd) ]]     then     echo Hi     fi      So what happens when there is a [[ and when there is not?


Getting no tty present and no askpass program specified when using git over ssh

I'm trying to push a `git commit` from my laptop to my server but keep getting the following error message:               remote: sudo: no tty present and no askpass program specified      To ssh://git@example.com/~/site_hub      I have the following in my sudoers:               Defaults:git !requiretty     git ALL=(apache) NOPASSWD: /usr/bin/git      Not sure why I'm getting that error message. I've Googled around but I'm not finding the solution.


vsftpd: 550 Failed to change directory

I'm using ubuntu 12.04. and `ftp` service I've installed `vsftpd` and it's working fine. But may I'm facing some user complexity. My system directory like:               -/     --/home     ----/rony     --/vol      When I list directories through `ftp`, it's going to `/rony` first. But when I `cd /vol` or `cd ..`, it's showing `550 Failed to change directory` error.


Creating an HTTPS tunnel

I have a VPS. How do I connect to my server through HTTPS protocol and redirect my browser connections to the HTTPS connection? Currently I use SSH tunnel but it's too slow.


FreeBSD on ARM architecture?

Can FreeBSD be used for ARM architecture devices? Also, is there a camera driver for FreeBSD?


What is wget idiom for curl -o?

So I use code in some function like               if [ ! -e $DOWNLOADS/$1 ]; then         echo_run curl -L http://$4/$5/$1 -o $DOWNLOADS/$1     fi      I wonder how to achieve the same thing without curl?


Will yum remove mysql-server delete my databases?

My MySQL server has broken down, and I can't figure out why. Trying to do a yum reinstall I get this: Error: mysql-server conflicts with mysql-server I figure that's because the server already had the mysql server, and when I ran the upgrade, everything got messed up. I'm unable to access MySQL, so I can't even do a mysqldump. How can I reinstall without compromising my existing databases?


autoconf save ./configure command line to config.h

Some binaries save the command line used to configure them inside the binary (I don't remember any that do, otherwise I'd check the source). Is there a way to obtain the command line used as a macro in configure.ac? For example, if I compile my code with               ./configure --foo bar CXX=g++      I would like to save **--foo bar CXX=g++** to a macro in config.h so it can be output by the binary using a flag               ./myprogram -V     Version 1.0, compiled using: "./configure --foo bar CXX=g++"


Setting gnome themes inside xfce

I have a few apps (such as Aisleriot) that are GNOME based, therefore they use the gnome defaults (which is some light theme), but I use xfce4 with compiz. My xfce theme is a dark one (atolm to be exact). How do I make the theme for these GNOME applications the same as my xfce4 theme? I already tried starting in gnome, setting the theme then switching back, this doesn't fix the problem.


How can you mirror the stdout of one terminal to another one?

I'm not sure if I'm phrasing the question correctly, but let's say that I have two virtual terminals open, and if I typed `ls` in one of them, I'd get the contents of the directory in **both** of them (the second one doesn't have to be writable, it only needs to display the stdout of the first one). How would I go about achieving this?


SSH tunnel: "channel x: will not send data after close"

When I work with ssh tunnel, I get the following message repeatedly: `debug3: channel x(a number): will not send data after close` What does it mean? I also get the following messages:               debug2: channel 3: open confirm rwindow 2097152 rmax 32768     debug2: channel 4: open confirm rwindow 2097152 rmax 32768     debug2: channel 3: rcvd eof     debug2: channel 3: output open -> drain     debug2: channel 7: rcvd eof     debug2: channel 7: output open -> drain     debug2: channel 7: obuf empty     debug2: channel 7: close_write     debug2: channel 7: output drain -> closed     debug2: channel 7: rcvd close     debug2: channel 4: rcvd eof     debug2: channel 4: output open -> drain     debug2: channel 31: rcvd close     debug2: channel 34: rcvd close     debug2: channel 35: rcvd close     debug2: channel 18: rcvd eof     debug2: channel 18: output open -> drain     debug2: channel 18: obuf empty     debug2: channel 18: close_write     debug2: channel 18: output drain -> closed     debug2: channel 18: rcvd close     debug3: channel 7: will not send data after close     debug3: channel 18: will not send data after close     debug3: channel 31: will not send data after close     debug3: channel 34: will not send data after close     debug3: channel 35: will not send data after close     debug2: channel 7: send close     debug2: channel 7: is dead     debug2: channel 7: garbage collecting`      Is there anything wrong?


General problem solving steps when print jobs hang in AIX?

What should I do if jobs are getting stuck in the print queue even after restarting spooling?               $ stopsrc -g spooler     $ startsrc -g spooler     $ lpstat -oQUEUENAME | wc -l; sleep 30; lpstat -oQUEUENAME | wc -l     139     139          $ oslevel     6.1.0.0


space utilization

I need to show space utilisation on the system, and find the largest 3 files on /home (or any other folder) I've been using 2 different command lines               df -m -a -h     df -m -h /home      I still can't manage to get it to show me only the 3 largest files on that folder


remote desktop view of a Debian Lenny Machine

Let me give a summary of my project specification. I have a windows server and bunch of debian clients on the same LAN, Debian machines do not have x window system, they are bound to command line use. I am running a QT application on system start so user only interacts with my GUI before he sees anything else. According to my project requirements, we should allow system admins to view what end user is doing in debian machines at any time, therefore he should be able to see their screens at any time. He will be using a windows machine to do that. Therefore I am wondering if it is possible to share debian's screen with a windows server, and what would be involved in that. Do I need VNC server setup on debian machines to accomplish that? Is there any other way?


No incoming connections on Fedora 17, except on port 80

All incoming connections seem to be refused on my Fedora machine, except on port 80 with apache. The ports I have tried are 8111 and 1111, neither does work. I have done the forwarding on my hardware router and configured the firewall (iptables, using the GUI) to allow connections on those ports. However, it is still not working. When I run a small HTTP server (the node.js hello-world) on one of these ports and try to curl it, it only works on localhost but not with the public ip address. Using the public address, I immediately get `curl: (7) couldn't connect to host`. Without the port forwarding or the firewall exception, this takes a while and does not appear immediately - so i think that that's not the problem. I also tried using the web browser instead of curl, without any difference. I have tried a tool named `tcptrack`, which shows this whenever I try to curl using the public address (I changed the public address here, 192.168.0.2 is the local one):               215.17.123.60:52014   192.168.0.2:1111      RESET        16s    0 B/s     192.168.0.2:52014     215.17.123.60:1111    RESET        16s    0 B/s      So I am receiving the packages but they are rejected somehow (I don't know exactly what RESET means). Is there another firewall or something? Like I said, port 80 works fine.


Network Disabled

I have just installed ubuntu server edition in order to create a home network. But I am not able to find IP of the machine through ifconfig (showing only localhost). Then I tried                lspci | grep -i ethernet      output:               09:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8040 PCI-E Fast Ethernet Controller (rev 13)      lshw -C Network Then output was `*-network DISABLED`


How to mount multiple directories on the same partition?

I am installing an SSD and would like to put `/` on the SSD and `/home`, `/var`, and `/tmp` on the HDD. My current distro is Kubuntu but I would not mind trying another distro if this procedure can be accomplished easier there. I have installed many different Linux OSes on multiple partitions, however I know of no installer that lets one mount multiple directories on a single partition. I would rather not use three separate partitions as particularly `/home`, `/var`, and `/tmp` are prone to large changes in size and it is not practical to allot each of them some arbitrary maximum. Note that I am discussing a new install, not moving the current system to the SSD / HD split.


Starting Linux from power off at predetermined time (and executing command)?

To put it simply, I'm trying to use my computer as an alarm clock. It's slightly old and noisy, so I'd like it to start from power off at a scheduled time and then execute a command, such as playing an MP3 file. I'm running Linux Mint Nadia. How would I go about this?


Check what process is spiking the average load with atop

In trying to find the culprit of a high load average on a system during night (which does not seem to be related to logrotate) I installed atop to write a raw file with a specific interval. While reading the file, it seems the processlist stands still, can I somehow go back and forth between the samples to see what sticks out, and further sort by any column (like cpu usage)?


WBC_ERR_DOMAIN_NOT_FOUND only for a specific account

Platform: RHEL 5.10 Version: Samba 3.6.6-0.136 Only on a single VM, one of my co-workers is able to log into the VM using his AD credentials without issue, whereas my account appears to have trouble locating user information:               [root@ncxxxlwb05 ~]# wbinfo -i myDom.mjplakus     XXX.mjplakus:*:16777224:16777229::/home/XXX/mjplakus:/bin/bash     [root@ncxxxlwb05 ~]# wbinfo -i myDom.jadavis6     failed to call wbcGetpwnam: WBC_ERR_DOMAIN_NOT_FOUND     Could not get info for user xxx.jadavis6      Thinking that winbind could have just cached a negative return (for instance AD wasn't available when it had to refresh its cache entry for my user account) I set both `winbind cache time` and `idmap negative cache time` to be 1 second but I got the same results. Same results with above cache values and doing `net cache flush` several times. I didn't find anything in `/var/log/samba/*` under normal debug levels so I set `debug level = 8` and this started being printed in the logs when I tried to resolve my name:               [2013/12/05 14:21:59.795061,  3] winbindd/winbindd_getpwnam.c:56(winbindd_getpwnam_send)       getpwnam myDom.jadavis6     [2013/12/05 14:21:59.795161,  1] ../librpc/ndr/ndr.c:414(ndr_pull_error)       ndr_pull_error(13): value out of range     [2013/12/05 14:21:59.795219,  5] winbindd/winbindd_getpwnam.c:137(winbindd_getpwnam_recv)       Could not convert sid S-1-5-21-652622394-3291385539-1351089441-10771: NT_STATUS_INVALID_PARAMETER     [2013/12/05 14:21:59.795391,  6] winbindd/winbindd.c:869(winbind_client_request_read)       closing socket 29, client exited      Which seems like it contains the actual problem but I don't know how to read the error and would like some guidance on this. It seems like it doesn't like the SID associated with my AD account for some reason, but I don't know why or how to work around it. I'm present in the active directory domain referenced, but for some reason it's unable to pull only my account's information.


So what are logical cpu cores (as opposed to physical cpu cores)?

I was googling about how I could find the number of CPUs in a machine and I found some posts but I am confused as some mentioned that you get the logical cores vs physical cores etc.   So what is the difference between logical and physical cores and is there a way I could get the physical cores only? Or does it make sense to include logical cores in our count?


Automating pipes?

I find myself using basically the same line over and over again:               cat file | command1 | command2 | command3 > file      Is there a way I can put all these pipes into one script, so I can just run               automatic.sh file      and accomplish the same thing?


Method to check connectivity to other server

I want to check connectivity between 2 servers (i.e. if ssh will succeed). The main idea is to check the shortest way between server-a and server-b using a list of middle servers (for example if I'm on dev server and I want to connect to prod server - usually a direct ssh will fail). Because this can take a while, I prefer not to use SSH - rather I prefer to check first if I can connect and if so then try to connect through SSH. Some possible routes to get the idea:               server-a -> server-b     server-a -> middle-server-1 -> server-b     server-a -> middle-server-6 -> server-b     server-a -> middle-server-3 -> middle-server-2 -> server-b      Hope you understand what I'm looking for?


keyboard shortcut to jump cursor to prompt?

I often mistype a command. So I will type this               sublimetext myfile.txt      instead of               git add myfile.txt      When I do this, I hit up to restore the last command. But after doing so, my cursor is at the end of the previously typed line. Is there a keyboard short cut to jump back to the prompt?


Why can user have lower permissions than group or other? Who can change them?

It is my understanding that the owner of a file `user` can have lower permissions than `group` or `other`.   1. What is the justification for this?   2. Can only root and the owner change the permissions on a file?   3. If root removes permissions of the owner, can the owner add their permissions back with `chmod`?


Linux Mint Olivia doesn't detect HD4000 Intel graphic

I opened Mint after a week or so & soon welcomed by a notification saying something like 'CPU high usage will be experienced due to no Graphic module' i opened my system summary & instead of the previously written 'Ivy bridge controller' following was written ![enter image description here](http://i.stack.imgur.com/kh26U.png) All of the graphic module are present none is being changed then what might be the problem. Several terminal outputs are posted following ### inxi output               echo@echo ~ $ inxi -Gx     Graphics:  Card: Intel 3rd Gen Core processor Graphics Controller bus-ID: 00:02.0                 X.Org: 1.13.3 drivers: intel (unloaded: fbdev,vesa) Resolution: 1440x900@59.9hz                 GLX Renderer: Mesa DRI Intel Ivybridge Mobile x86/MMX/SSE2 GLX Version: 3.0 Mesa 9.1.4 Direct Rendering: Yes      ### glxinfo output               echo@echo ~ $ glxinfo     name of display: :0     display: :0  screen: 0     direct rendering: Yes     server glx vendor string: SGI     server glx version string: 1.4     server glx extensions:         GLX_ARB_create_context, GLX_ARB_create_context_profile,          GLX_ARB_multisample, GLX_EXT_create_context_es2_profile,          GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info,          GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, GLX_OML_swap_method,          GLX_SGI_swap_control, GLX_SGIS_multisample, GLX_SGIX_fbconfig,          GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, GLX_INTEL_swap_event     client glx vendor string: Mesa Project and SGI     client glx version string: 1.4     client glx extensions:         GLX_ARB_create_context, GLX_ARB_create_context_profile,          GLX_ARB_create_context_robustness, GLX_ARB_framebuffer_sRGB,          GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,          GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_framebuffer_sRGB,          GLX_EXT_create_context_es2_profile, GLX_MESA_copy_sub_buffer,          GLX_MESA_multithread_makecurrent, GLX_MESA_swap_control,          GLX_OML_swap_method, GLX_OML_sync_control, GLX_SGI_make_current_read,          GLX_SGI_swap_control, GLX_SGI_video_sync, GLX_SGIS_multisample,          GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group,          GLX_EXT_texture_from_pixmap, GLX_INTEL_swap_event     GLX version: 1.4     GLX extensions:         GLX_ARB_create_context, GLX_ARB_create_context_profile,          GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,          GLX_EXT_visual_info, GLX_EXT_visual_rating,          GLX_EXT_create_context_es2_profile, GLX_MESA_copy_sub_buffer,          GLX_MESA_multithread_makecurrent, GLX_MESA_swap_control,          GLX_OML_swap_method, GLX_OML_sync_control, GLX_SGI_make_current_read,          GLX_SGI_swap_control, GLX_SGI_video_sync, GLX_SGIS_multisample,          GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group,          GLX_EXT_texture_from_pixmap, GLX_INTEL_swap_event     OpenGL vendor string: Intel Open Source Technology Center     OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile x86/MMX/SSE2     OpenGL version string: 3.0 Mesa 9.1.4     OpenGL shading language version string: 1.30     OpenGL extensions:         GL_ARB_multisample, GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color,          GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_copy_texture,          GL_EXT_polygon_offset, GL_EXT_subtexture, GL_EXT_texture_object,          GL_EXT_vertex_array, GL_EXT_compiled_vertex_array, GL_EXT_texture,          GL_EXT_texture3D, GL_IBM_rasterpos_clip, GL_ARB_point_parameters,          GL_EXT_draw_range_elements, GL_EXT_packed_pixels, GL_EXT_point_parameters,          GL_EXT_rescale_normal, GL_EXT_separate_specular_color,          GL_EXT_texture_edge_clamp, GL_SGIS_generate_mipmap,          GL_SGIS_texture_border_clamp, GL_SGIS_texture_edge_clamp,          GL_SGIS_texture_lod, GL_ARB_framebuffer_sRGB, GL_ARB_multitexture,          GL_EXT_framebuffer_sRGB, GL_IBM_multimode_draw_arrays,          GL_IBM_texture_mirrored_repeat, GL_3DFX_texture_compression_FXT1,          GL_ARB_texture_cube_map, GL_ARB_texture_env_add, GL_ARB_transpose_matrix,          GL_EXT_blend_func_separate, GL_EXT_fog_coord, GL_EXT_multi_draw_arrays,          GL_EXT_secondary_color, GL_EXT_texture_env_add,          GL_EXT_texture_filter_anisotropic, GL_EXT_texture_lod_bias,          GL_INGR_blend_func_separate, GL_NV_blend_square, GL_NV_light_max_exponent,          GL_NV_texgen_reflection, GL_NV_texture_env_combine4, GL_S3_s3tc,          GL_SUN_multi_draw_arrays, GL_ARB_texture_border_clamp,          GL_ARB_texture_compression, GL_EXT_framebuffer_object,          GL_EXT_texture_compression_s3tc, GL_EXT_texture_env_combine,          GL_EXT_texture_env_dot3, GL_MESA_window_pos, GL_NV_packed_depth_stencil,          GL_NV_texture_rectangle, GL_ARB_depth_texture, GL_ARB_occlusion_query,          GL_ARB_shadow, GL_ARB_texture_env_combine, GL_ARB_texture_env_crossbar,          GL_ARB_texture_env_dot3, GL_ARB_texture_mirrored_repeat,          GL_ARB_window_pos, GL_ATI_envmap_bumpmap, GL_EXT_stencil_two_side,          GL_EXT_texture_cube_map, GL_NV_depth_clamp, GL_APPLE_packed_pixels,          GL_APPLE_vertex_array_object, GL_ARB_draw_buffers,          GL_ARB_fragment_program, GL_ARB_fragment_shader, GL_ARB_shader_objects,          GL_ARB_vertex_program, GL_ARB_vertex_shader, GL_ATI_draw_buffers,          GL_ATI_texture_env_combine3, GL_ATI_texture_float, GL_EXT_shadow_funcs,          GL_EXT_stencil_wrap, GL_MESA_pack_invert, GL_MESA_ycbcr_texture,          GL_NV_primitive_restart, GL_ARB_depth_clamp,          GL_ARB_fragment_program_shadow, GL_ARB_half_float_pixel,          GL_ARB_occlusion_query2, GL_ARB_point_sprite, GL_ARB_shading_language_100,          GL_ARB_sync, GL_ARB_texture_non_power_of_two, GL_ARB_vertex_buffer_object,          GL_ATI_blend_equation_separate, GL_EXT_blend_equation_separate,          GL_OES_read_format, GL_ARB_color_buffer_float, GL_ARB_pixel_buffer_object,          GL_ARB_texture_compression_rgtc, GL_ARB_texture_float,          GL_ARB_texture_rectangle, GL_EXT_packed_float, GL_EXT_pixel_buffer_object,          GL_EXT_texture_compression_dxt1, GL_EXT_texture_compression_rgtc,          GL_EXT_texture_rectangle, GL_EXT_texture_sRGB,          GL_EXT_texture_shared_exponent, GL_ARB_framebuffer_object,          GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample,          GL_EXT_packed_depth_stencil, GL_APPLE_object_purgeable,          GL_ARB_vertex_array_object, GL_ATI_separate_stencil, GL_EXT_draw_buffers2,          GL_EXT_draw_instanced, GL_EXT_gpu_program_parameters,          GL_EXT_texture_array, GL_EXT_texture_integer, GL_EXT_texture_sRGB_decode,          GL_EXT_timer_query, GL_OES_EGL_image, GL_MESA_texture_array,          GL_ARB_copy_buffer, GL_ARB_depth_buffer_float, GL_ARB_draw_instanced,          GL_ARB_half_float_vertex, GL_ARB_instanced_arrays,          GL_ARB_map_buffer_range, GL_ARB_texture_rg, GL_ARB_texture_swizzle,          GL_ARB_vertex_array_bgra, GL_EXT_separate_shader_objects,          GL_EXT_texture_swizzle, GL_EXT_vertex_array_bgra,          GL_NV_conditional_render, GL_AMD_draw_buffers_blend,          GL_ARB_ES2_compatibility, GL_ARB_blend_func_extended, GL_ARB_debug_output,          GL_ARB_draw_buffers_blend, GL_ARB_draw_elements_base_vertex,          GL_ARB_explicit_attrib_location, GL_ARB_fragment_coord_conventions,          GL_ARB_provoking_vertex, GL_ARB_sampler_objects, GL_ARB_seamless_cube_map,          GL_ARB_shader_texture_lod, GL_ARB_texture_cube_map_array,          GL_ARB_texture_rgb10_a2ui, GL_ARB_uniform_buffer_object,          GL_ARB_vertex_type_2_10_10_10_rev, GL_EXT_provoking_vertex,          GL_EXT_texture_snorm, GL_MESA_texture_signed_rgba,          GL_ARB_get_program_binary, GL_ARB_robustness, GL_ARB_shader_bit_encoding,          GL_ARB_timer_query, GL_ANGLE_texture_compression_dxt3,          GL_ANGLE_texture_compression_dxt5, GL_ARB_internalformat_query,          GL_ARB_shading_language_packing, GL_ARB_texture_storage,          GL_EXT_transform_feedback, GL_ARB_ES3_compatibility,          GL_ARB_invalidate_subdata


With mv, possible to put a time dependence on files mv'ed?

Let's say there's a specific time and date I have in mind. All files last edited before this date I want to keep in the directory but all files that have been edited since this date I want to `mv` somewhere else. The `man` page of `mv` doesn't show this being possible with `mv` directly. I thought some form of the the following should work:               ls -t | head -n $number       Where `$number` specifies the number of files that have been edited since the time and date I had in mind. I could then somehow feed this to `mv` to `mv` those files (haven't thought up exactly how to do that). The disadvantage of this is that I would have to count up how many files have been edited since the date and time I had in mind. Is there a way where I can just specify a date and time and let my computer figure out which files need to be `mv`ed and `mv` them for me? If not, then how would I complete the command I have written above to feed those file names to `mv` to have them all `mv`ed to the same location?


custom kernel and firmware loading

After I have compiled my kernel, and when I type `make modules_install`, not only are the modules copied into `/lib/modules/` but also firmware is copied into `/lib/firmware/`. The following is the end of the output after typing `make modules_install`:               MKDIR   /lib/firmware/radeon     INSTALL /lib/firmware/radeon/R100_cp.bin     INSTALL /lib/firmware/radeon/R200_cp.bin     INSTALL /lib/firmware/radeon/R300_cp.bin     INSTALL /lib/firmware/radeon/R420_cp.bin     INSTALL /lib/firmware/radeon/RS690_cp.bin     INSTALL /lib/firmware/radeon/RS600_cp.bin     INSTALL /lib/firmware/radeon/R520_cp.bin     INSTALL /lib/firmware/radeon/R600_pfp.bin     INSTALL /lib/firmware/radeon/R600_me.bin     INSTALL /lib/firmware/radeon/RV610_pfp.bin     INSTALL /lib/firmware/radeon/RV610_me.bin     INSTALL /lib/firmware/radeon/RV630_pfp.bin     INSTALL /lib/firmware/radeon/RV630_me.bin     INSTALL /lib/firmware/radeon/RV620_pfp.bin     INSTALL /lib/firmware/radeon/RV620_me.bin     INSTALL /lib/firmware/radeon/RV635_pfp.bin     INSTALL /lib/firmware/radeon/RV635_me.bin     INSTALL /lib/firmware/radeon/RV670_pfp.bin     INSTALL /lib/firmware/radeon/RV670_me.bin     INSTALL /lib/firmware/radeon/RS780_pfp.bin     INSTALL /lib/firmware/radeon/RS780_me.bin     INSTALL /lib/firmware/radeon/RV770_pfp.bin     INSTALL /lib/firmware/radeon/RV770_me.bin     INSTALL /lib/firmware/radeon/RV730_pfp.bin     INSTALL /lib/firmware/radeon/RV730_me.bin     INSTALL /lib/firmware/radeon/RV710_pfp.bin     INSTALL /lib/firmware/radeon/RV710_me.bin      As it happens, I need firmware for my ATI radeon graphic card. But I already had firmware in `/lib/firmware/` and I did not want that firmware be build. I have selected following options in my kernel:               [*] Select only drivers that don't need compile-time external firmware     [*] Prevent firmware from being built      So why is firmware being build anyway? And also, how do I find out which one of these firwares my card needs? I can see following message in my `dmesg`, but that does not tell me which file was loaded:               [drm] initializing kernel modesetting (RV620 0x1002:0x95CF 0x1002:0x2143).     [drm] Loading RV620 Microcode      Is there some way to list loaded firmwares, similarly as I would list loaded modules (`lsmod`) # CLARIFICATION: To sum up my question: I have `ATI RV620 (FirePro 2260)` graphics card and I am using kernel `3.12.20`. How can I find out exactly which firmware files my card needs to load?               # lspci | grep -i vga     01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI RV620 [FirePro 2260]


I'm not getting syntax coloring in vim (using Cygwin)

I've been so far unable to figure out why vim's syntax coloring is not working for _most_ files, and it's driving me batty. In case this is relevant: I'm working in Cygwin (more specifically/accurately the bash shell that comes with Git for Windows) because it's the only thing I've been able to smuggle into this Windows shop so far. (I sometimes bring in my MacBook Air but it is somewhat frowned upon. Also, as with most Windows shops they're paranoid about installing software, so a full Cygwin installation would need justification. Also, I'm not using gvim because I prefer to work with vim in a terminal.) I can get syntax coloring to work if I tell vim that the file is C++               :set syntax=cpp      or if it is a shell script, but not if I'm working in Ruby or PHP. I've ensured that syntax is turned on with both `:syntax on` and `:syntax enable`. I've tried installing vim syntax files in `~/.vim/syntax/<syntax-type>.vim` but this has not made a difference. I've ensured files had the standard file extension, so if working with a Vagrantfile I tried adding '.rb', and I've tried avoiding my .vimrc file (as well as tried other .vimrc files):               vim -u /dev/null Vagrantfile.rb      I've also ensured Ruby files had the normal 'shebang' line. Nothing has worked so far. What could prevent vim from properly coloring certain files?


Drive auto mounting as read only (errors=remount-ro)

My system (12.04 Ubuntu LTS) is auto-mounting as read only and I have no idea why. Output of fstab:               cat /etc/fstab     # /etc/fstab: static file system information.     #     # Use 'blkid' to print the universally unique identifier for a     # device; this may be used with UUID= as a more robust way to name devices     # that works even if disks are added and removed. See fstab(5).     #     # <file system> <mount point>   <type>  <options>       <dump>  <pass>     proc            /proc           proc    nodev,noexec,nosuid 0       0     # / was on /dev/sda1 during installation     UUID=28db2489-f60e-456c-9efd-7a961f3e970a /               ext4    errors=remount-ro 0       1     # swap was on /dev/sda5 during installation     UUID=106e4470-d734-4cec-98a6-c7859aaedf18 none            swap    sw              0       0     /dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0      Output of mount:               /dev/sda1 on / type ext4 (rw,errors=remount-ro)     proc on /proc type proc (rw,noexec,nosuid,nodev)     sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)     none on /sys/fs/fuse/connections type fusectl (rw)     none on /sys/kernel/debug type debugfs (rw)     none on /sys/kernel/security type securityfs (rw)     udev on /dev type devtmpfs (rw,mode=0755)     devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)     tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)     none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)     none on /run/shm type tmpfs (rw,nosuid,nodev)     I have searched all night including: Ubuntu 12.04 SSD root frequent random read only file system      I have no idea why this is going on. I did run fsck at boot and it didn't find errors. The disk is fine (500GB, user 38GB)


How do I highlight commas not followed by a space in vim?

I've gotten into the habit of not appending spaces after commas in lists, when coding. To break this habit, I thought I'd get `vim` to highlight any comma (`,`) that is not followed by a space. So I've added this to my `.vimrc`:               highlight SquishedCommas ctermbg=red guibg=red     match SquishedCommas /,(?! )/      However, it doesn't seem to highlight anything!


Is it possible to integrate Apple iCloud services (e.g. contacts, calendars) with Fedora 20?

I am a new laptop user after using an iMac desktop for about seven years. Over that time, I had become fairly reliant on Apple's services syncing between my iPhone and my iMac. Now that I'm on Fedora, I'm having to run two separate calendars and contact books, and manually update changes between the two. Is there a way I can integrate Apple's iCloud features (namely contacts and calendar) onto my laptop? It would make day-to-day computing much easier.


How to keep Debian internal clock synchronized (with NTP servers)?

I have a home server which runs an up to date Debian 7.5 (wheezy) installation. I just discovered that the server has its internal clock set to ± 3 minutes _in the future_. I knew that I can use NTP to synchronize Debian (and the motherboard internal clock) with NTP. So I installed NTP by following the steps described in the french Debian Wiki (the english page is less detailed). I use the following command to sync the internal clock:               ntpdate -B -q 192.168.0.254      The clock was succesfully adjusted. But this is a temporary solution, so I installed the NTP daemon and added a local server in the `/etc/ntp.conf` file:               # pool.ntp.org maps to about 1000 low-stratum NTP servers.  Your server will     # pick a different set every time it starts up.  Please consider joining the     # pool: <http://www.pool.ntp.org/join.html>          # added     server 192.168.0.254          server 0.debian.pool.ntp.org iburst     server 1.debian.pool.ntp.org iburst     server 2.debian.pool.ntp.org iburst     server 3.debian.pool.ntp.org iburst      Is it the right solution? In fact I was surprised to find that the `ntp` daemon wasn't already installed. So I'm wondering if the default installation of Debian installs a daemon to keep the internal clock synchronized. Are all the Debian installations time-shifting until their admins install `ntpd` ? Please tell me that the `ntp` daemon won't be useless because Debian has a built-in synchronization mecanism.


bash equivalent of zsh's $@[2,$#]

(NB: the motivation for this question is only to improve my `bash` programming know-how.) I want to know the `bash` equivalent of `zsh` expressions such as `$@[2,$#]`, which _directly_ address a range of a shell function's (or script's) command- line arguments array (`$@`). (All solutions I've found online for addressing ranges of `$@` in `bash` can be described as " _indirect_ addressing", since they all require first assigning `$@` to an intermediate variable. See example below.) For the sake of concreteness: what would be the `bash`-equivalent of the following `zsh` test function?               testfn () {       printf '>%s<\n' $@[2,$#]     }          % testfn a b c d     >b<     >c<     >d<      Below is the closest I've managed to come up with; as mentioned above, it requires the assignment of `$@` to an intermediate variable:               testfn () {       holdargs=( $@ )       printf '>%s<\n' "${holdargs[@]:1}"     }      All my attempts at something not requiring an intermediate variable fail with a `bad substitution` error.


Searching a text file with a single line using regular expressions

as far as i know all unix text processing utilities are reading one line at a time and performing one action on this line. I have a huge file with a single line of text which contains several tokens im concerned with. You can think of the content of the file as something like this: xzxzxzzxzxAxzzBxzxCzxxzxxzxzzxzxzAzBzxxxxzzCzxzxzxzxzxxzz I want to get the two strings between (A and B) and (B and C) for every occurrence of A.*B.*C. In this example my desired output would be this: xzz xzx z zxxxxzz How do i do this? edit: sorry, i didn't make it clear. A, B and C are long Strings that can only be identified by regular expressions.


Symbolic link of for my user, doesn't work for root

I am experimenting with the following scheme in order to share common data among different distributions. In Fedora I have created a symbolic link `/home` pointing to:               /run/media/arun/754ef10a-3f82-4c0b-bde4-a119f7cc472c/Fedora/      In BackTrack I have `/home` pointing to               /run/media/arun/754ef10a-3f82-4c0b-bde4-a119f7cc472c/BT-Linux/      And right now I am doing the same for OpenSuSE 12.3. The `/home` on each distro is a symbolic link to its respective directory on the partition. ie: Fedora, BT-Linux, SuSE. Each of these have `Documents`, `Downloads` and `Videos` folders that are again symbolic links to independent directories (not in `/run/media/...../Fedora` or `BT-Linux` or `Suse`), so I can access those directories right from the `/home` directory. The problem is that although the link is alive in my user account `arun`, the symbolic link is broken when I login as `root`. It is working fine as a normal user but not as `root`. I know the fact that `root` will have its own set of `Documents`, `Desktop`, `Videos` folders, all which needs to be linked too but, the symbolic link `/home` itself is broken. What could be the cause of this issue?               $ uname -a     Linux localhost.localdomain 3.9.5-301.fc19.x86_64 #1 SMP Tue Jun 11 19:39:38 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux


Quotes exercise - how to do ssh inside ssh whilst running sql inside second ssh?

> **Possible Duplicate:**   >  Quoting in ssh $host $FOO and ssh $host “sudo su user -c $FOO” type > constructs   >  Wrapping a command that includes single and double quotes for another > command I want to run sql over ssh from php . Below command runs nicely               ssh server1 "sudo -u db2inst1 sh -c '/opt/ibm/db2/V9.7/bin/db2 connect to RATIONAL; /opt/ibm/db2/V9.7/bin/db2 set schema Edumate; /opt/ibm/db2/V9.7/bin/db2 \"select * from edumate_settings\"'"      Now I need to do ssh from server1 to server2 and then run "sudo -u db2inst1 .... " there. Is there any easy way how to deal with quotes if I add additional server to this scenario? So it will start like               ssh server1 "ssh server2 "the rest is as above"      Note the I need to run above code from php.


Wrapping a command that includes single and double quotes for another command

I recently learned about watch, but am having trouble making it work with relatively sophisticated commands. For example, I would like to ask `watch` to run the following command on `zsh` every three seconds*:               for x in `command_1 | grep keyword | cut -d' ' -f1`; do command_2 "word[word=number]" $x; done      as you can see the line above includes single quotes, double quotes, among other special characters. So I tried:               watch -n 3 "for x in `my_command | grep keyword | cut -d' ' -f1`; do command2 "rusage[mem=7000]" $x; done"      but then I got: > no matches found for x in !@#$# ....; done I tried other combinations without success. Here's one of those attempts:               watch -n 3 "for x in $(bjobs -w | grep pre_seg | cut -d' ' -f1); do bmod -R "rusage[mem=7000]" $x; done"      which also results in a similar error. Any ideas how to make this work? * * * *I would also be intersted in solutions that work on `bash`


What is Wayland?

I was looking for a lightweight X server, but failed to find one. Then I found out about Wayland. I says that it aims to coexist with X, but can run standalone. When I try to compile it, it needs Mesa, which needs X. What exactly _is_ Wayland?


How to Remove Windows from dual boot setup?

I originally had Windows 7 Starter and Updated to the Windows 8 90 Day Trial. 30 Days into the trial I decided I absolutely hate it and wanted to try Linux Mint. I installed Linux Mint and found out I absolutely love it, and now I want to remove Windows 8. I have researched all over the web, using: `How to remove Windows 8 from Linux Mint`, but my search results always end up being `How to remove Linux Mint`. This is not what I want. I want to remove Windows 8 from my computer by using Linux Mint. What should I do to do this? I absolutely love Linux Mint.


ffmpeg -pattern_type glob -- not loading files in correct order

I have a dilemma.. I've had a script for a while now that downloads pictures from a webcam every few minutes. The naming convention just does `new_image((len(files(dir))+1) + '.jpg')` and that's all fine.. until today.. I've had a Python script that loads the images **based on creation date** and renders them and i take the OpenGL data and dump it into a movie, which isn't hard and it's all ok.. Except now i have a few thousand images and it's quite ineffective to go on about it this way (even tho it's cool because i can build my own GUI and overlay etc).. anyway, i'm using ffmpeg to combine the images into a slideshow, like so: `ffmpeg -f image2 -r 25 -pattern_type glob -i '*.jpg' -qscale 3 -s 1920x1080 -c:v wmv1 video.wmv` The ffmpeg works fine, except that `-pattern_type glob` takes the images in naming order which doesn't work because the way the files get fed is similar if not the same as `ls`, which looks like:               user@host:/storage/photos$ ls     0.jpg     1362.jpg  1724.jpg  2086.jpg  2448.jpg  280.jpg   3171.jpg  3533.jpg  3896.jpg  4257.jpg  4619.jpg  4981.jpg  5342.jpg  5704.jpg  6066.jpg  650.jpg     1000.jpg  1363.jpg  1725.jpg  2087.jpg  2449.jpg  2810.jpg  3172.jpg  3534.jpg  3897.jpg  4258.jpg  461.jpg   4982.jpg  5343.jpg  5705.jpg  6067.jpg  651.jpg      `0, 1000, 1, 2000, 2`... this is the logic of `ls` so the image sequence (timelapse) will be all f-ed up.. Any ideas on how to use ffmpeg to load the images in a more sorted manner?


What happens if I delete all user passwords?

I have a Fedora VPS with a root user that has no password. I login with SSH keys. I had another, less privileged account on that server, used for web administration. I've now deleted its password too. If there are no users with passwords on a server, what exactly would happen if I were to lose my SSH key, for example? Would the server become forever unavailable since there is no way to log in on it? Also, how does the `sudo` program behave when neither the root nor the calling user have passwords? I tried it and it didn't even ask me for a password: it just worked, since I have that `user ALL=(ALL) ALL` line in my sudoers file (should I change that?)


I stopped MiniSSDPD, will something bad happen?

I have been trying to harden my Debian system by stopping and disabling the 20 or so unnecessary services listening by default. One of them is called "minissdpd". Apparently this provides "discovery" services to plug-and-play devices, whatever that means. Seems kind of crazy to me that something intended to help local peripherals needs to be listening to Chinese hackers on the other side of the world. What does discovery services even mean? I looked in some vulnerability database, and sure enough minissdpd had a whole slew of vulnerabilities listed. How can they have this enabled in the default distribution? Seriously, its like install Debian, get hacked. Anyway, my main question is: now that I have disabled this service, is something bad going to happen (like plug something in and it won't work)?


Access through samba to link to different filesystem in shared directory (permission error)

I have a laptop with Dual Boot Lubuntu 14.04/Windows 7 I have a `BorrajaX` user in Lubuntu and another `Borrajax` user in Windows. In my Lubuntu `$HOME/Documents/` directory I created a link to the Windows `BorrajaX` user's documents, so I can store things there when in Linux and retrieve them when in Windows, and viceversa. In Lubuntu, the directory structure is:               /home/borrajax/    drwxr-xr-x  borrajax borrajax       |-> Downloads/     drwxr-xr-x  borrajax borrajax                   |-> Documents/     drwxr-xr-x  borrajax borrajax       |     |-> TestDir/    drwxrwxr-x borrajax borrajax       |     |-> Windows7_Documents -> /media/windows7/Documents and Settings/borrajax/Documents/    lrwxrwxrwx  borrajax borrajax       |           |-> Android Things/  drwxrwxr--  root  plugdev       |           |-> desktop.ini      -rwxrwxr--  root  plugdev       |           |-> My Pictures -> /media/windows7/Users/borrajax/Pictures  lrwxrwxrwx root plugdev       |-> Pictures/     drwxr-xr-x  borrajax borrajax      The link to `Windows7_Documents` is pointing to a directory in a different partition than where my `/home/borrajax` is mounted (my `$HOME` is on `/dev/sda5` while the Windows 7 partition is `/dev/sda3`) Everything works fine when I access the Windows filesystem locally through that `Windows7_Documents` link, but now I want to share my Linux `$HOME`, being able to access that `Windows7_Documents` remotely, and (here's the issue) I can't. I get a `Permission Denied` error. This is how my shared `$HOME/Documents/` directory shows on a Mac OS X that is accessing it through Samba: ![enter image description here](http://i.stack.imgur.com/hIW3F.png) From the Mac Os X I can properly create new files or directories within my Lubuntu's `$HOME/Documents/`, but I can't access the link in `$HOME/Documents/Windows7_Documents/` Below is the configuration of the Samba share in Lubuntu's config file (`/etc/samba/smb.conf`):               [borrajax]         path = /home/borrajax         writeable = yes         browseable = yes         valid users = borrajax         hosts allow = 192.168.1. 127.0.0.1          Is there a way to access the `Windows7_Documents` directory through samba? I suspect it might have something to do with all the files within the `Windows7_Documents` belonging to `root:plugdev` ? But if that's the case, how could I make the Samba users belong to the `plugdev` group (which I guess it would be the best solution? ) Thank you in advance,


Displaying and updating a counter in bash

I think it's something like this: (Fedora14/bash)               #!/bin/bash          for i in {0..10..1}; do echo -e "$i"'\c'     echo -e "\n\r"     sleep 1     done      But it doesn't work. Purpose: like this, but without the "clear":               #!/bin/bash          for i in {0..10..1}; do echo -e "$i"     sleep 1     clear     done      So a counting script that doesn't deletes the whole screen to output +1 number, instead it only deletes the line, where the counting is, so that there could be ex.: a beatifull "progress bar"..


Loop examples in bash

Any examples for "loop" in bash?               for i in {1..5}; do echo $i; done     1     2     3     4     5      AND               for i in 1 2 3 4 5; do echo "Welcome $i times"; done     Welcome 1 times     Welcome 2 times     Welcome 3 times     Welcome 4 times     Welcome 5 times      AND               # {START..END..INCREMENT}     for i in {0..10..2}; do echo "Welcome $i times"; done     Welcome 0 times     Welcome 2 times     Welcome 4 times     Welcome 6 times     Welcome 8 times     Welcome 10 times      AND               for i in $(seq 1 3 20); do echo "Welcome $i times"; done     Welcome 1 times     Welcome 4 times     Welcome 7 times     Welcome 10 times     Welcome 13 times     Welcome 16 times     Welcome 19 times      AND               for (( c=1; c<=5; c++ )); do echo "Welcome $c times..."; done     Welcome 1 times...     Welcome 2 times...     Welcome 3 times...     Welcome 4 times...     Welcome 5 times...


How to modify the output of tcpdump to be human-readable?

I have a tcpdump command:               tcpdump -i wlan0 dst port 80 and ! dst 192.168.1.201 and ! src 192.168.1.201 -vvv -s0 -w proba.txt      Which gives the following output:               root@SERVER:/tmp# egrep "GET|Host:" proba.txt | awk 'BEGIN {FS=" "}{print $2}'     emaffia.hu     /     google.hu     /     www.google.hu     emaffia.hu     /textinputassistant/tia.png     www.google.hu     /logos/2011/pierre_de_fermat-2011-hp.jpg     www.google.hu     /gb/images/b_8d5afc09.png     ssl.gstatic.com     /favicon.ico     www.google.hu     /     hwsw.hu     /js/mootools-1.2.5.1-more.js     www.hwsw.hu      How can I modify these lines to get this output?:               emaffia.hu/     google.hu/     www.google.hu     emaffia.hu/textinputassistant/tia.png     www.google.hu/logos/2011/pierre_de_fermat-2011-hp.jpg     www.google.hu/gb/images/b_8d5afc09.png     ssl.gstatic.com/favicon.ico     www.google.hu/     hwsw.hu/js/mootools-1.2.5.1-more.js     www.hwsw.hu      Is it possible?


expr help - managing strings

I need to take text like this:               A234321=http://www.google..... a normal URL      And pull out only the URL, getting rid of the first part. I think I can use `expr` to do it, but I can't figure out the right way The entire regex I can use is `http:[a-zA-Z0-9/_]+`


Human-readable ls output under AIX?

How can I get human-readable `ls` output under AIX? There is no `-h` parameter


Reducing packet loss in tc rate limiting

I use this tc command to limit upload speed on an interface:               tc qdisc add dev eth1 root tbf rate 2mbit burst 10kb latency 70ms peakrate 2.4mbit minburst 1540      But it results in heavy packet loss. If the data coming via `eth0` (WAN) is 7 GB, it will be 6.2 GB on the rate-limited interface `eth1`. Are there any other rate limiting solutions that cause lesser packet loss?


httpd start fails and shows up error

I installed Apache through `yum install httpd` in Fedora. When I try to start the service it shows the following error:               [root@localhost ~]# systemctl enable httpd.service      ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'           [root@localhost ~]# systemctl start httpd.service      Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.                    [root@localhost ~]# systemctl status httpd.service      httpd.service - The Apache HTTP Server              Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)         Active: failed (Result: exit-code) since Sat 2014-05-17 21:19:25 IST; 1h 13min ago        Process: 2622 ExecStop=/usr/sbin/httpd $OPTIONS -k graceful-stop (code=exited, status=1/FAILURE)             Process: 2620 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)                May 17 21:19:25 localhost.localdomain systemd[1]: Starting The Apache HTTP Se...      May 17 21:19:25 localhost.localdomain httpd[2620]: httpd: Syntax error on lin...      May 17 21:19:25 localhost.localdomain systemd[1]: httpd.service: main process...      May 17 21:19:25 localhost.localdomain httpd[2622]: httpd: Syntax error on lin...      May 17 21:19:25 localhost.localdomain systemd[1]: httpd.service: control proc...      May 17 21:19:25 localhost.localdomain systemd[1]: Failed to start The Apache ...      May 17 21:19:25 localhost.localdomain systemd[1]: Unit httpd.service entered ...      [root@localhost ~]#


OpenELEC, non-root user, home directory, SSH

I'm running OpenELEC on Raspberry Pi   As you know, directory `/storage` is a shared home folder between user `root` and user `openelec`   This makes a problem when you want to setup ssh key authentication for root   Because for that, you will have to change the owner of `/storage` from `openelec` to `root`, and change it's permission to `755` so that it wont be writable by non-root users including `openelec`   In other words, user `openelec` won't be able to write to his own home directory I have done that, and I want to make sure that wouldn't make a problem   When I look at the output of `ps aux` I can't find any process running by `openelec` user (so that it needs to write to his own home folder)   (the main process `xbmc` is running by root too) Now I have several questions: 1- Why does that user `openelec` exist in the first place?   2- Why it's using a common home directory with root?   3- Why `/storage` is not owned by root by default?   4- Have I done/understood something wrong?


Bad configuration option: ControlPersist while scp with control master?

I am using `SCP` with `ControlMaster` to copy the files but somehow I am getting this error back -               command-line: line 0: Bad configuration option: ControlPersist     command-line: line 0: Bad configuration option: ControlPersist     command-line: line 0: Bad configuration option: ControlPersist     command-line: line 0: Bad configuration option: ControlPersist     command-line: line 0: Bad configuration option: ControlPersist      Here is my shell script -               #!/bin/bash          export PRIMARY=/filetransfer/test01/primary     readonly SERVERS_LOCATION=(machineB machineC)     export SERVERS_LOCATION_1=${SERVERS_LOCATION[0]}     export SERVERS_LOCATION_2=${SERVERS_LOCATION[1]}     export MAPPED_LOCATION=/data/snapshot     FILE_PARTITION=(550 274)          export dir3=$MAPPED_LOCATION/20140510          find "$PRIMARY" -mindepth 1 -delete          do_CopyFiles() {       el=$1       scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 david@$SERVERS_LOCATION_1:$dir3/pp_week_1543_"$el"_200003_5.data $PRIMARY/. || scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 david@$SERVERS_LOCATION_2:$dir3/pp_week_1543_"$el"_200003_5.data $PRIMARY/.     }     export -f do_CopyFiles     parallel -j 5 do_CopyFiles ::: "${FILE_PARTITION[@]}"      Is there anything wrong I am doing? This is only happening to this machine in which I am running my shell script. Other machine in which I am running my same shell script, it works fine. So some setting configuration is different I guess in this machine which I am not aware of.


Is there a way to share a service listening on loopback of the host with an LXC guest?

I'm trying to provide a service to the LXC guests, but do not want to expose it from the host. I also don't want to put up firewall rules for the service, so loopback appears to be the most straightforward solution. Is there a way to have a service listening on `lo` (loopback) shared with LXC guests, e.g. similar to bind-mounting directories into place?


Problem with logical partition and recovery mode

After the installation of compiz with linux mint, I had a problem in my Linux Mint 14 . There is a blank screen after typing my login/password to enter my session. I tried some things to correct this. But at the end I decided to use unetbootin, and install Mint 15. I clicked on Install Mint 15 and I choosed : Install Mint15 at the same partition of Mint14, so it will erase everything on the system partition (not my home partition) . In the screen of choosing the country, I canceled the installation (it has not started, as far as I know) . After that, when checking for mounted partitions, I didn't found the home partition (sda5) . I just found the physical partition (sda1) which used to contain the boot loader and the whole system . ps: I used to have a home partition, which is a logical partition (sda5) Now I am trying to enter the recovery mode to make a scan and correct disk errors, but I can't since after clicking shift , the laptop enter a black screen and freezes . Any suggestion ? At least how to enter the recovery mode, this can help me . Edit : fdisk output image : ![enter image description here](http://i.stack.imgur.com/F4FqH.jpg)


rcs and graphical diff

I have a machine running Ubuntu 6.06. Source files under rcs (no git available). I need to visually compoare older revs of files with the checked out version. Until now I have moved the file and compared.               mv test.c tmptest.c     co -r1.16 test.c     xxdiff test.c tmptest.c     mv tmptest.c test.c      I know I can make this in a script, but is there a better way to do this? Without touching test.c?


Fedora - SELinux - livecd-tools

I'm using `livecd-tools` to build an image and I am able to consistently build images now, but upon bootup and login, I get "no shell - permission denied". After reading about that error, I saw it is related to SELinux. I'm guessing this may be because part of my installation involves copying files to the installation. I tried running `fixfiles`, but that errored out, is there something else I should run to fix this SELinux issue?


route traffic out different gateway by destination network

I have several gateways and would like to route some traffic out of different gateways based on its destination. I'm guessing I'd need to use a combination of iproute2 and iptables rules, but am not sure where to start.   Can someone provide an example?


How to list packages and their urls in yum repository?

How can I list all the packages and their download URLs in a yum repository? I tried               yum --disablerepo=* --enablerepo=google-chrome list available     Loaded plugins: langpacks, refresh-packagekit     Available Packages     google-chrome-beta.x86_64                32.0.1700.14-1            google-chrome     google-chrome-unstable.x86_64            33.0.1707.0-1             google-chrome      But that doesn't give the URLs and it's also missing one package that I happened to have installed (google-chrome-stable) I also tried a http request to the baseurl but I got a 404 error               $ http --headers get http://dl.google.com/linux/chrome/rpm/stable/x86_64       HTTP/1.1 404 Not Found      * * * This is the repo if you'd like to try to reproduce               [google-chrome]     name=google-chrome     baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64     enabled=1     gpgcheck=1


How to find processor speed on Linux w/throttling

My `/proc/cpuinfo` says my processor is 800Mhz, when I know the thing is actually 2.8Ghz. This is due to idle throttling where the cpu clock is slowed when idle to save power. Is there a way in Linux to find the **true** cpu speed?


How to see who is logged on to many workstations?

Before I go to work creating my own I would like to find an existing system to do the following:   * Provide a concise list of users logged on to any of the workstations   * Show workstation host name, IP, and user name   * Data should update frequently or when there is a change   * Web or console interface   * Run on a Debian/Squeeze machine   * Free/Libre software Situation:   * 60 Ubuntu 10.04 workstations spread over 3 sites   * Sites connected by 20Mbps WAN   * one server at each site running NFS and LDAP   * Workstations configured to authenticate users via LDAP and auto mount homes from local NFS server   * Users can log on to any machine they want


Replace a pattern in a file with a long string

I'm writing a little shell script to generate a directory listing. To make the output easily customizable, the script just builds a HTML-table and than should replace a specific token in a template file with that table and write it to `stdout`. **Example:**   Template file:               <!doctype html>     <html>         <head><title>Directory Listing</title></head>         <body>             {{LISTING}}         </body>     </html>      `{{LISTING}}` should be replaced with the listing (which is stored in a shell variable). The problem here is, that a simple `sed 's/{{LISTING}}/$listing/'` would be limited to the maximum argument length which doesn't work with long listings. How can I replace a pattern in a file with a long string using POSIX utilities? EDIT:   To add more clarification: My current solution is like that:               awk '{ gsub(A, B); print; }' A="{{LISTING}}" B="$listing" < $template      `$listing` gets expanded as awk is invoked, but this can exceed argument length limits, since `$listing` can be really long. For example, when generating a listing of `/usr/lib`, I get an error:               /bin/awk: Argument list too long      I'm thinking whether there is a solution to replace a pattern in a textfile with `stdin`.