The second monitor displays with a resolution of 640x480

The system does not detect my second monitor connected the DVI. Appears in the settings of the words "digital device" and adjustment increase that I can set the resolution to 640x480. At D_SUB see each correctly. What do I need to do to properly operate the space of two monitors? system - Linux Mint 13,   Graphics Card - GeFroce GT520,   monitor 1 - ViewSonic VA1903wb (plugged into D_SUB),   monitor 2 - LG Flatron L1919S ( plugged into DVI using an adapter DVI--> D_SUB,   the nvidia drivers - version 304.60 Result of `xrandr -q` command.               xrandr -q          Screen 0: minimum 8 x 8, current 2080 x 900, maximum 16384 x 16384     DVI-I-0 connected 640x480+1440+0 (normal left inverted right x axis y axis) 0mm x 0mm        640x480        59.9*+        320x240       120.1       VGA-0 connected 1440x900+0+0 (normal left inverted right x axis y axis) 410mm x 256mm        1440x900       59.9*+   75.0          1280x1024      75.0     60.0          1280x960       60.0          1152x864       75.0          1024x768       75.0     70.1     60.0          800x600        75.0     72.2     60.3     56.2          640x480        75.0     72.8     59.9       DVI-I-1 disconnected (normal left inverted right x axis y axis)     HDMI-0 disconnected (normal left inverted right x axis y axis)      My xorg.conf               # nvidia-settings: X configuration file generated by nvidia-settings     # nvidia-settings:  version 304.60  (buildmeister@swio-display-x86-rhel47-13)  Sun Oct 14 21:19:07 PDT 2012          # nvidia-xconfig: X configuration file generated by nvidia-xconfig     # nvidia-xconfig:  version 304.60  (buildmeister@swio-display-x86-rhel47-13)  Sun Oct 14 21:19:18 PDT 2012          Section "ServerLayout"         Identifier     "Layout0"         Screen      0  "Screen0" 0 0         InputDevice    "Keyboard0" "CoreKeyboard"         InputDevice    "Mouse0" "CorePointer"         Option         "Xinerama" "0"     EndSection          Section "Files"     EndSection          Section "InputDevice"              # generated from default         Identifier     "Mouse0"         Driver         "mouse"         Option         "Protocol" "auto"         Option         "Device" "/dev/psaux"         Option         "Emulate3Buttons" "no"         Option         "ZAxisMapping" "4 5"     EndSection          Section "InputDevice"              # generated from default         Identifier     "Keyboard0"         Driver         "kbd"     EndSection          Section "Monitor"         Identifier     "Monitor0"         VendorName     "Unknown"         ModelName      "CRT-0"         HorizSync       28.0 - 33.0         VertRefresh     43.0 - 72.0         Option         "DPMS"     EndSection          Section "Device"         Identifier     "Device0"         Driver         "nvidia"         VendorName     "NVIDIA Corporation"         BoardName      "GeForce GT 520"     EndSection          Section "Screen"         Identifier     "Screen0"         Device         "Device0"         Monitor        "Monitor0"         DefaultDepth    24         Option         "Stereo" "0"         Option         "nvidiaXineramaInfoOrder" "CRT-1"         Option         "metamodes" "CRT-0: nvidia-auto-select +1440+0, CRT-1: nvidia-auto-select +0+0"         SubSection     "Display"             Depth       24         EndSubSection     EndSection      I tried to add the code below, but it did not help.               Identifier     "Monitor0"     VendorName     "Unknown"     ModelName      "LG Flatron L1919S"     HorizSync       28.0 - 33.0     VertRefresh     43.0 - 72.0     Modeline       "1280x960_60.00"  102.10  1280 1360 1496 1712  960 961 964 994  -HSync +Vsync     Option         "DPMS"      This may be due to the adapter?


ftp server log to include more information

I am implementing the ftp server on linux box (fedora 11, `vsftpd`). Everything works good so far but i need Ftp server log files to contain transfer rate information. At the moment when I use "get " or " put" command from client end , I got following message on ftp client example               ftp: 18 bytes received in 0.00seconds 18000.00kbytes/sec.      Is there is any way , I can get same message on ftp server side? Below is the sample of my xferlog file               Tue Oct 23 01:28:52 2012 1 10.65.112.55 1 /home/test/testfile b _ o r test ftp 0 * c      Tue Oct 23 01:32:46 2012 1 10.65.112.55 18 /home/test/uploadServer b _ i r test ftp 0 * c      Tue Oct 23 01:50:23 2012 1 192.168.10.27 1 /home/test/testfile a _ o r test ftp 0 * c      Tue Oct 23 01:50:36 2012 1 192.168.10.27 19 /home/test/test a _ i r test ftp 0 * c


Arithmetic operations in regex

I am using gedit regex plugin (Python style regex). I would like to do some arithmetic operation on a backreference to a group. For example:               PART 1 DATA MODELS Chapter       2 Entity-Relationship Model 27      I would like to change it to be               PART 1 DATA MODELS Chapter  25     2 Entity-Relationship Model 27      My regex is `^(PART.*)\n(.*\s(\d+))\n`, and I would like to replace it with `\1 \3-2\n\2\n`. But the replacing regex is not right.


Copy of full swap file is empty

I use a swap file (/mnt/swap). The swap works right. I need to get an access to the data stored in. When it's full of data in some part (which I can see typing "free" in terminal), I copy the file to another location and then open it in hex editor. The swap is full of "00" like it were empty (or it actually is?). I'm not advanced user of Linux and probably I'm doing something wrong, but all works when I do the same with /proc/kcore - I can see the data in the copy which was stored in ram during copying. Moreover, can I try to open my swap file in hex editor when the swap is working (only for read)? Isn't it dangerous?


How can I list LS_COLORS in colour?

I recall that `eval "dircolors -b"` used to display the colours that `LS_COLORS` was using, based on the file types or extensions. It was not simply the colour values that were displayed _but the colours themselves._ I could see the colour in which a `.png` or `.ogg` file would be displayed and change it if needed through a custom file. I find that the output of `eval "dircolors -b"` is no more in colour. Can someone kindly explain how I might get it back? Perhaps some environment variable is not getting set. Otherwise, is there a workaround?


Can I create a new partition from the free space inside my reiserfs-formatted /home partition?

Ok, I have Ubuntu installed but I want to install Windows also (dual-boot). Problem is, I don't have a free partition. I have my root partition (15 GB), and my /home partition (300 GB). The home partition has about 50 GB free space, and it's formatted reiserfs. I've heard about tools like resize_reiserfs, and I even tried it yesterday - I shrunk my /home partition (it's on /dev/sda6) with the command:               resize_reiserfs -s -20G /dev/sda6      After that gparted showed that the partition itself was 280 GB, but there was no way to create a new partition from the 20 GB. I ended up running               resize_reiserfs -s +20G /dev/sda6      to restore my /home partition to its previous size.


How to start several jobs in different screen sessions in a Bash-script?

The programm I want use can be started via               ./myprogram < input_part1.txt > output_part1.txt      How can I start four jobs of `myporgram` in a `BASH`-script where each job runs in a separate `SCREEN`-session? The sessions do not exist before I start the script. I tried:               #!/bin/bash     screen -mdS test1 ./myporgram < input_part1.txt > output_part1.txt     screen -mdS test2 ./myporgram < input_part2.txt > output_part2.txt     screen -mdS test3 ./myporgram < input_part3.txt > output_part3.txt     screen -mdS test4 ./myporgram < input_part4.txt > output_part4.txt      but this does not work. Why not?


How to write a very simple wrapper that provides default parameters?

Given a program that requires some parameters, e.g. `program -in file.in -out file.out`, what would be the simple-most approach to write a bash script that could be called with or without any of these parameters and use default values for each? `script -in otherfile` would run `program -in otherfile -out file.out`,   `script -out otherout -furtherswitch` would run `program -in file.in -out otherout -furtherswitch` etc.


Which processes swaps memory

I can see swap's total, used, free etc. sizes from `top` command.   But I can't figure out which process uses swap, is it possible to find out swap memory by process? I'm running CentOS 6.3.


SSD Crash Randomly on Linux Mint 17

I'm running Mint (17 Qiana 64bit) on a fresh install on a new laptop (Dell N5110) with a new Crucial MX100 SSD and twice now the whole system has frozen up. If I switch to a text terminal (as in ctrl-alt-f1) and attempt to login I get the message `end_request:I/O error, dev sda, sector XXXXXXXXX` I've run both the Short offline and Extended offline tests from `gsmartcontrol`, and both have come back Completed without error. The firmware on my SSD is MU01, I can't find anything on Crucial which says whether or not there's a firmware update available. Any ideas what I should look at next? Is the SSD faulty? Driver issue? Laptop issue? Firmware issue? Don't really know where to start....


Create directory if zip archive contains several files

If an archive contains several files in the root directory, I'd like to create a directory named after the file name (without extension). If an archive contains just a directory, then I'd like to simply extract it. Assume I have the following archive:               # file: withdir.zip     somedir/alpha     somedir/beta     somedir/gamma      If I extract it in the current directory I'd like to have it simply extracted (`unzip withdir.zip`):               somedir/alpha     somedir/beta     somedir/gamma      Now assume the following archive:               # file: nodir.zip     alpha     beta     gamma      When I run `unzip nodir.zip` I end up cluttering the current directory with the three files:               alpha     beta     gamma      I'd rather run `unzip -d nodir nodir.zip`:               nodir/alpha     nodir/beta     nodir/gamma      If I use nautilus and right click on “Extract Here”. It behaves exactly as it should. But unfortunately I haven't found a command line switch for `unzip` or `7z` which yield the same behaviour. How to achieve that? Are there other tools I can use instead (no GUI)?


How to print pcl or esc/p code on host-driven printer?

I have a host-based printer (HP Deskjet D2460) and have some printer language files (pcl codes) that I would like to print out. I saw that in cups there are some filters like rastertopcl, etc. which converts a raster format, for cups that is postscript into pcl... How to do the inverse? If it is not possible, how to convert pcl to ps or pdf? A good little executable or python/perl script (interested in free solutions)


Bad sector on a directory

I've a bad sector on my `/home/xyz` which make a folder with 10 GB data unreadable. As far as I can see in syslog there's only one badsector with may destruct 4K of data while I have no access to 10 GB of it's inner data, Any suggestion on how to recover the data inside it?


Is it possible for sudo to read password from gnome-keyring or similar

I'm currently using sudo a lot in a bunch of scripts, which is turning into a bit of a hassle, as some scripts does not allow interactive input (e.g., Makefiles). Instead of disabling sudo passwords altogether I'm thinking it would be nice if gnome-keyring or some similar keyring software could be used to rememeber the password. Is this a good idea? Is it possible? Any better solution?


Linux, Debugger program development

We are trying to implement the debugger program which will takes either PID or Program name as input and Invoke the gdb by using PID. Below is two small programs are written, Not able to figure out what is the exact problem here... after passing PID, it shows 5000+ instructions are executed as a result. Debug.c               #include <stdio.h>     #include <stdarg.h>     #include <stdlib.h>     #include <signal.h>     #include <syscall.h>     #include <sys/ptrace.h>     #include <sys/types.h>     #include <sys/wait.h>     #include <sys/reg.h>     #include <sys/user.h>     #include <unistd.h>     #include <errno.h>               /* Print a message to stdout, prefixed by the process ID     */     void procmsg(const char* format, ...)     {         va_list ap;         fprintf(stdout, "[%d] ", getpid());         va_start(ap, format);         vfprintf(stdout, format, ap);         va_end(ap);     }               void run_target(const char* programname)     {         procmsg("target started. will run '%s'\n", programname);              /* Allow tracing of this process */         if (ptrace(PTRACE_TRACEME, 0, 0, 0) < 0) {             perror("ptrace");             return;         }              /* Replace this process's image with the given program */         execl(programname, programname, 0);     }               void run_debugger(pid_t child_pid)     {         int wait_status;         unsigned icounter = 0;         procmsg("debugger started\n");              /* Wait for child to stop on its first instruction */         wait(&wait_status);              while (WIFSTOPPED(wait_status)) {             icounter++;             struct user_regs_struct regs;             ptrace(PTRACE_GETREGS, child_pid, 0, &regs);             unsigned instr = ptrace(PTRACE_PEEKTEXT, child_pid, regs.eip, 0);                  procmsg("icounter = %u.  EIP = 0x%08x.  instr = 0x%08x\n",                         icounter, regs.eip, instr);                  /* Make the child execute another instruction */             if (ptrace(PTRACE_SINGLESTEP, child_pid, 0, 0) < 0) {                 perror("ptrace");                 return;             }                  /* Wait for child to stop on its next instruction */             wait(&wait_status);         }              procmsg("the child executed %u instructions\n", icounter);     }               int main(int argc, char** argv)     {         pid_t child_pid_attach;              if (argc < 2) {             fprintf(stderr, "Expected a program name as argument\n");             return -1;         }     sscanf(argv[1],"%d",&child_pid_attach);          //Attaching to running process     if(ptrace(PTRACE_ATTACH,child_pid_attach,0,0)<)     {     perror("ptrace");     return;     }     else     {     printf("%d",child_pid_attach);     }         if (child_pid_attach== 0)             run_target(argv[1]);         else if (child_pid_attach > 0)             run_debugger(child_pid_attach);         else {             perror("fork");             return -1;         }          ptrace(PTRACE_DETACH,child_pid_attach,0,0);         return 0;     }      The above program has been used to debug the process that is created by the following program (i.e sum of two numbers). test.c               #include<stdio.h>     void main()     {     int a, b, c;     scanf("%d", &a);     scanf("%d", &b);     printf("\n Sum of Two Numbers is:");     c=a+b;     printf("%d",c);     }      First, we are running ./test and then checking its pid. As a next step we are running ./Debug [pid]. As a result of the above execution, it is displaying that Child process has executed 5000+ instructions and it is printing the same instructions all the time. Please do let me know if there is any other way to do it and do let me know how to read the data of another process. In this case "How can I read the data (values of variables) of process that is created by ./test?".


What is the best linux distro for Google Apps development?

As there are just far too many distro's for an old RedHat user (in the 1990's,) to keep track of... I need to setup a few secure/reliable work stations to develop some basic google apps type programs. I'm new to the whole andriod/chromebook type OS, but I do enjoy how amazing the ~3.6v Gnome-shell is. I was thinking something like Solaris or Fedora, maybe? It will be running on a new Xenon server, so it doesn't need to be light at all! And I use a lot of Oracle VM's. Any advice would be appreciated.


Decrypt file using gpg in batch mode when passphrase includes a "!"?

I am trying to decrypt a file in a script with gpg batch mode, but command is not executed because the passphrase contains a "!"               echo "m!pass"|gpg --batch --passphrase-fd 0 --decrypt-file plain.gpg     bash: !pass": event not found      or               gpg --batch --passphrase "m!pass" -d plain.gpg      bash: !pass": event not found      I guess bash is interpreting the exclamation mark as a reference to the command execution history. Which would be the right way to do it in GPG batch mode?


How to splice sections of a video with avconv?

I have figured out so far that you can cut a section from a video with avconv with a command like this (cuts from 1:00-3:00):               avconv -ss 00:01:00 -i "input.avi" -t 00:02:00 -c:v libx264 -crf 23 "output.mp4"      But how would I cut two (or more) sections from the video and combine them into one video? For example, taking 1:00-3:00 as above, plus 8:00-10:00, making a final 4 minute video. I guess I can do them separately _then_ concatenate them, but is there a simpler way?


ifconfig -a in a shell script

I am writing a shell script to start my network in my virtual machine on boot, since it does not do this right away for some reason with a snapshot of a virtual machine. Since the `eth` device starts as being down, I have to get that device name with the following script and then start the device as well:               gateway=ifconfig -a | awk '/eth/ {print $1}'     dhclient $gateway      However I keep getting the following error, `line 1: -a: command not found`. `ifconfig -a` works however from the command line. Is there a way to get `ifconfig -a` to work in my shell script?


Pulseaudio over network - change output on-the-fly

I successfully configured PulseAudio server and client to send audio over network. It uses direct connection: http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Network/#index1h2 I'd like to have a possibility to switch between client and server sound card i.e. temporarily disable network stream and go back to internal sound device. Using module-tunnel-sink I could simply move sink-input to desired device but is not an option since it doesn't work well with Flash: > they lead me to believe that Flash is somehow sending the sound to > PulseAudio in such a way that it creates a lot of network traffic (think > lots of tiny packets, not bandwidth); this overwhelms the network "tunnel" > PulseAudio With direct connection I have to restart the application every time I want to switch the output. Any idea how can I solve this?


RPM skipping files on install

I am installing an rpm package and it appears to be skipping certain files without giving me any notice as to what the issue is. When I execute               rpm -ivh package_name.rpm      the rpm provides me with no indication that the installation failed. After executing this, I verify the installation:               rpm -V package_name      And I see that some files are reported as missing missing `/path/to/some/crucial/file` When I look into my / directory, I see that a few files were created which start with `u2dtmp*`. These are the files which do not get created. I have attempted to remove old locks from my rpm installation and cleaned the database `rpm --rebuilddb`, but nothing seems to allow these files to be installed successfully. This issue only appears on a single machine. It installs successfully on other linux machines which have the same os.


How interpret kworker threads names?

On a Linux kernel 3.11.0-13-generic running on top of a dual socket Xeon X5650 hexa core board running htop show different kworker threads. Sorted by names (I tweaked the result I am showing here a little bit to have the threads on core 2 before the ones on core 10) , the result is the following one:               kworker/0:0H     kworker/0:1     kworker/0:2     kworker/1:0     kworker/1:0H     kworker/1:1     kworker/2:0     kworker/2:0H     kworker/2:1     .....     kworker/11:0     kworker/11:0H     kworker/11:1     kworker/u48:0     kworker/u49:4     kworker/u49:5     kworker/u50:1     kworker/u50:2     .......      The threads which name start with a number are pinned to the core with the same number. So the first number is the core running the thread and I am wondering what the symbol after the `:` symbol (`0` or `0H` or `1`) is for these threads ? I am also wondering what is the meaning of the `uXX:Y` symbols ? I have only a vague knowledge of what kworker threads do: they are responsible to handle asynchronous events caused by system calls performing I/O. I couldn't find any documentation on them, is there such a document somewhere ?


How to interact with program from command line

Is there any method to interact with a program directly from the commmand line? For example, I've a program, `data.o`, which produces a file `mydata.out` and then I want to plot it with `gnuplot`. I can open the plotting program with `gnuplot &` and then I would like the shell to write somehow in this job/background shell I just opened `plot mydata.out`. (`gnuplot` is just an example, the question would be similar for executing some Macros or Hotkeys in every program I can open from the command line without leaving it).


Dmenu Processes Forked by Bash?

I was looking at the output of `pstree`, and realised that processes that I started using `dmenu` seem to fork from `bash`. What is the reasoning behind this? And is there any way I can make `dmenu` behave like `gmrun` and other application launchers and only launch the process? * * * **EDIT:** The `dmenu` manpage says that the shell execution behavior is correct for `dmenu_run`. Figuring out how to not make the shell persist after launching the program is what I am still looking for.


Sed find and replace with slashes

I am having trouble using sed find/replace with slashes in the find parameter. Sample contents of test.sh               str=$(sed -n '/^user:/p' /tmp/shadowtest) # find "user:" line in /etc/shadowtest     arr=(${str//:/ }) # explode str with : as delimeter     arr=${arr[1]} # grab the 2nd element     sed -i 's|$arr|XXXXX|g' /tmp/shadowtest # Nothing gets replaced in shadowtest      Sample contents of /tmp/shadowtest               # junk here     user:$6$hcwp49Lr$BjcJYc/nwaufmsOIw4Tw/POaXO4j.0HDLU0:16310:0:99999:7:::     # junk here      When I run the script as is, nothing gets replaced in the shadowtest file. But if I change the sed command to something like               sed -i 's|99999|XXXXX|g' /tmp/shadowtest      it works fine.


Can't ping gateway after bridge

I am running CentOS 6.3 with NetworkManager disabled. I was trying to set up a network bridge to try out setting up guests w/ kvm. I was creating a bridge before setting up stuff with kvm, just since I wasn't too familiar with it. Something didn't go right and I couldn't ping the gateway ip or anything past it with the bridge in place. The ip, netmask, and gateway are all correct. Before this bridging, the network worked fine. I created the bridge (ifcfg-br0)               DEVICE=br0     BOOTPROTO=none     IPADDR=xx.xx.xx.xx     NETMASK=255.255.255.248     GATEWAY=xx.xx.xx.xx     ONBOOT=yes     TYPE=Bridge     STP=on     DELAY=0      then I edited the ifcfg-eth0 and removed the ip, netmask, gateway, from there and set it to bridge br0. I restarted network, then used `brctl show` to see that the bridge was made. It showed up in there. This is the point in which I couldn't ping my gateway or anything past. Since that didn't work, I figured I would just remove the bridge and not mess around with that anymore. I used `brctl delif br0 eth0` and `brctl delbr br0` to remove the bridge. Then I deleted the ifcfg-br0 file and added the ip, netmask, and gateway back into the ifcfg-eth0 file. Now, I still can't ping the gateway or anything past it from this machine. `route -n` shows the same route that was in place before I started adding a bridge. Currently, I am accessing the server console through ipmi. Any help with what to look for that could cause this hiccup?


mv deleted my directory. Why?

I was trying to correct the spelling on a directory, issued a _mv_ command, and the directory is now gone. I'd like to understand--specifically--what happened. Here's the command I ran:               mv micheal_franti_theme/ michael_franti_theme/      ~~I understand there the slashes shouldn't be included: I was moving fast and used auto-complete.~~ The command ran without any errors or warnings. I tried using _find_ for both the old and new spellings, but neither returned any results. So, what happened? What did _mv_ actually do? Any chance of recovering the directory and its contents? ext4 on CentOS 6.5; mv version 8.4 ## Additional Info Not sure why this is getting down votes. There was a directory named "micheal_franti_theme". I ran the above command, then ran _ls_. No more directory. No directory named "michael_franti_theme" existed anywhere on the file system when I ran that command. As you can see from the command, the context is within the same sub-directory, so _mv_ would have just updated the inode table (vs copying between file systems). I ran the following:               sudo find / -name micheal_franti_theme      No results. The directory is gone All commands posted in this question were copied directly from the command prompt. I've been using Linux regularly for over a decade. I've never seen this happen before, so I'm bringing it to serverfault. actual results are long gone from the scrollback buffer, but here are the relevant lines from _history_ :               1097  ls     1098  mv micheal_franti_theme/ michael_franti_theme/     1099  ls     1100  find / -name michael_franti_theme 2>/dev/null     1101  find / -name micheal_franti_theme 2>/dev/null     1102  sudo find / -name michael_franti_theme     1103  sudo find / -name micheal_franti_theme


Using pushd and popd

Say I do the following:               cd ~     pushd .     cd /bin/     pushd .     dirs     "/bin/ ~/     cd ~/Downloads/     pushd .     dirs     ~/Downloads /bin/ ~"      How would I `popd` back to something a while ago, say from downloads to the home directory`~`?


Find directories with a certain name

How can I loop through each directory recursively and whenever it finds a folder called VIDEO_TS, let Genisoimage convert that folder's content to an dvd-video iso image, the name of the iso would be the parent folder's name. The command that I use for a single directory:               genisoimage -o movie_1.iso -dvd-video /shares/media/movies/Movie 1      And this is the script I got:               #!/bin/bash     parent_path=""     full_path=""          for file in $(find /shares/media/ -type d -name 'VIDEO_TS')     do          parent_path="$(dirname -- "$file")"     full_path="$file"          done      So I got the parent path and the full path to the VIDEO_TS directory.               parent_path="/shares/media/Movie One/"     full_path="/shares/media/Movie One/VIDEO_TS/"      How can I get only the Movie One from parent_path? And when I use sprintf to echo both variables, either spaces get removed or replaced with a line break. Is it safe to use those variables with the command?


Kde: how to bind permanently an application to a desktop/activity?

Im pretty new to Kde 4.8 and i can not figure out how to get this behaviour that i used to have in Gnome:   1. Desktop 1: developer/misc (browser, editor/ide, diff, etc..)   2. Desktop 2: virtual machines (vbox)   3. Desktop 3: graphic (gimp, inkscape, phatch)   4. Desktop 4: file management (ftp, ssh, etc..) In gnome is possible to configure the windows to **always** appear in a specific desktop, and this is what i want to achieve in Kde. I googled around so much, and looks like activities cant do that (yet), becose using the window's menu only works for the current session, and get lost after reboot. By the way, I suppose that activities _can_ do that, becose in the default activities that come with Kde 4.8 Gimp used to show only in the _photo_ activity (I gave a look to the activity configuration but I didnt find anything about this behavior)... Onestly, my goal is to obtain this scenario, if is not possible with activities but with desktops, for me is ok. So, any idea on how to obtain this behavior in Kde 4.8? I already read this similar question, but im looking for a _permanent_ solution...


How do I remove a directory and all its subdirectories?

I'm trying to learn some directory navigagtion with bash and all I know is that               rmdir directoryname      will remove the directory but not if it's containing something. Is there a way to force it to remove the subdirectories, even if they're not empty?


Error cross compiling linux kernel using buildroot

I am trying to build a kernel bt in cross compiling the kernel when I ran following command               make CROSS_COMPILE=i686-linux- ARCH=x86      I got the following error:               UCLIB_EXTRA_CFLAGS="" \     install_runtime install_dev     make[1]: /home/abc/Desktop/softwares/buildroot-2012.08-rc1/output/host/usr/bin/x86-unknown-linux-uclibc-gcc: Command not found     make[1]: Entering directory `/home/abc/Desktop/softwares/buildroot-2012.08-rc1/output/toolchain/uClibc-0.9.33.2'     /bin/sh: /home/abc/Desktop/softwares/buildroot-2012.08-rc1/output/host/usr/bin/x86-unknown-linux-uclibc-gcc: not found     make[1]: /home/abc/Desktop/softwares/buildroot-2012.08-rc1/output/host/usr/bin/x86-unknown-linux-uclibc-gcc: Command not found     make[1]: /home/abcDesktop/softwares/buildroot-2012.08-rc1/output/host/usr/bin/x86-unknown-linux-uclibc-gcc: Command not found     make[1]: Circular libpthread/nptl/sysdeps/i386/gen_tcb-offsets.s <- libpthread/nptl/sysdeps/i386/tcb-offsets.h dependency dropped.     CC libpthread/nptl/sysdeps/unix/sysv/linux/gen_pthread-pi-defines.s     /bin/sh: /home/abc/Desktop/softwares/buildroot-2012.08-rc1/output/host/usr/bin/x86-unknown-linux-uclibc-gcc: not found     make[1]: *** [libpthread/nptl/sysdeps/unix/sysv/linux/gen_pthread-pi-defines.s] Error 127     make[1]: Leaving directory `/home/abc/Desktop/softwares/buildroot-2012.08-rc1/output/toolchain/uClibc-0.9.33.2'     make: *** [/home/abc/Desktop/softwares/buildroot-2012.08-rc1/output/host/usr/x86-unknown-linux-uclibc/sysroot/usr/lib/libc.a] Error 2      Any suggestions?


How can swapoff be that slow?

Somehow I happened to swap out 14 GB of memory. After having killed the culprit, I have tons of free memory again, so I thought I could bring in the important data again. So with 5 GB out of 32 GB used and 14 GB of swap space used, I ran `swapoff -a`.... and 4 hours later about half of the work was finished. This means less that 1 MB/s, while I can easily copy 200 MB/s. My swap is encrypted but so are all normal partitions and with aes-ni it leads to no noticeable CPU load (and filling the swap space took only a few minutes). I see that there's no special reason to optimize `swapoff`, however I wonder how it could get that slow? * * * Just adding some more data: My main memory is 32 GB and I have 32 GB swap space on each of 4 harddisks (surely an overkill, but who cares?). The whole swap space can be (decrypted and) read in less than 5 minutes:               time -p sudo sh -c 'for i in /dev/mapper/cryptswap?; do md5sum $i & done; wait'     014a2b7ef300e11094134785e1d882af  /dev/mapper/cryptswap1     a6d8ef09203c1d8d459109ff93b6627c  /dev/mapper/cryptswap4     05aff81f8d276ddf07cf26619726a405  /dev/mapper/cryptswap3     e7f606449327b9a016e88d46049c0c9a  /dev/mapper/cryptswap2     real 264.27      Reading a part of a partition can't be slower than reading it all. Yet reading about 1/10th of it takes about 100 times longer. I observed that during `swapoff` both the CPU was mostly idle (maybe 10% of one core) and so were the disks ("measured" by the LEDs). I also saw that the swap spaces were turned off one after the other.


Issues with Vim while using ZSH

I just changed my shell to ZSH. However, when I tried to edit a .py file in vim I got a strange error: > "test.py" [New File] Error detected while processing > /usr/local/share/vim/vim73/ftplugin/python.vim: line 21: E492: Not an editor > command: def)') line 22: E492: Not an editor command: def)') line 23: E492: > Not an editor command: def)') line   >  24: E492: Not an editor command: def)') line 42: E10: \ should be followed > by /, ? or & However, if I comment out > filetype indent plugin on in my .vimrc the message goes away, unfortunately so does my smart indentation. Does anyone know why vim would be effected by a change in shell? Or have a workaround?


Prevent internet connection if VPN drops

When using DD-WRT firmware (on a LINKSYS CISCO E4200 if it matters) is there any way to stop all outgoing internet traffic when the VPN connection drops, and force the VPN to auto redial?


How do you get fgrep to find the literal "--help"?

fgrep --help | fgrep "--help"      returns just the whole fgrep --help, how do I return just the lines that have the literal "--help" in them? The quotes don't do anything, nor does `\-\-help`.


How does the Linux file structure work?

I see the different folders bin, dev, mnt, proc, srv, sys, etc. What are the properties of all these different folders? What are there purposes? Are there files in some of them that I should not touch? Should I be touching files in the other folders? Final question, in a Unix environment, do folders = directories? I apologize for all the questions.


What is not shell specific?

Under some answers, I see comments that recommend avoiding shell specific commands in answers. How do I know which commands, operators, etc exist in all shells? Is there a list of standards?   * `man builtins` gives a list of commands. Are those the only commands that I can use in a portable shell script that works in all shells?   * Can a built-in be shell specific?   * Do the standards for Linux differ from that of other Unixes?   * What about syntax? Can punctuation, operators, etc be different in some shells?


How can I add an array of arguments inside my rsync call inside a script?

I want to copy a folder to another location, while excluding some specific files Here is my current script:               #!/bin/bash          if [ -n "$2" ]     then         source=$(readlink -f $1)         destination=$(readlink -f $2)     else         printf "\nProper syntax: my_copy source_folder destination_folder\n"             exit     fi               params=(         --exclude='.git'         --exclude='deploy'         --exclude='app/config/database.php'         --exclude='app/config/config.php'     )               cd $source     rsync " -a ${params[@]} $source/* $destination"      When I run my script, I get this error:               rsync: link_stat "-a --exclude=.git" failed: No such file or directory (2)     rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1070) [sender=3.0.9]      What am I doing wrong?


Serial communication not working in both directions

I am working with a SOM mounted on a carrier board running Ubuntu 14.04 with the generic 3.13 kernel. While testing out the peripherals, I hit a problem with serial communication. Basically, I can transmit data from the custom platform to an external Linux machine, but I can not properly receive data from the external Linux machine to the custom platform. Through my research I have messed with all sorts of BIOS settings, baud rates, hardware flow control, parity, etc. Nothing has worked. Most info I have found online just says "Make sure your baud rates and other settings match", and they do. It is not my first time working with Linux serial ports. But it is my first time encountering a problem like this. **Does anyone have any suggestions, recommendations, or has anyone ever seen an issue like this before?** More info: We are running a quad-core Intel Atom micro with a custom serial breakout interface. The serial port is at /dev/ttyS0. To reiterate: I can properly send data FROM the custom board TO the external Linux box, but not the other way around.


Can't figure out why ssh_exchange_identification: Connection closed by remote host appear

At home, I have setup a Raspberry Pi with the latest version of Raspbian and with `ssh` enabled. I also use a Mac Book Pro with OS X 10.9.3. I use `ssh pi@192.168.0.22` to do some work on the Raspberry Pi, so far no problems. Then I configured my router, so that the `ssh` Port of the Raspberry Pi is also available on the Internet. In my office, I tried to access the Raspberry Pi with `ssh` over the Internet by `ssh pi@myhomepie.at` and I get as a result:               ssh_exchange_identification: Connection closed by remote host       So, I took another machine in my office with `Putty` on it and I could login with the same command without problem. I tried even an `ssh` client on my iPad and even that one could connect. Only the Mac Book is not working, from the outside. At home, I attached my Macbook to the LAN and I could access the Raspberry Pi. So I edited `/etc/hosts.allow` on the Raspberry Pi by placing `SSHD: ALL` Than I set the `sshd LogLevel` to `debug` and I checked if my MacBook shows up in `/etc/hosts.deny`, but there was nothing. Why does the Mac Book, as the only device, receive the error message:               ssh_exchange_identification: Connection closed by remote host while trying to access from remote.      * * * `ssh -Y -p 80 -i ~/bin/keys/pie.rsa -vvv pi@myhomepie.at`:               OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011     debug1: Reading configuration data /Users/piuser/.ssh/config     debug1: /Users/piuser/.ssh/config line 2: Applying options for *     debug1: Reading configuration data /etc/ssh_config     debug1: /etc/ssh_config line 20: Applying options for *     debug1: /etc/ssh_config line 53: Applying options for *     debug2: ssh_connect: needpriv 0     debug1: Connecting to myhomepie.at [xx.x.xxx.xxx] port 80.     debug1: Connection established.     debug3: Incorrect RSA1 identifier     debug3: Could not load "/Users/piuser/bin/keys/pie.rsa" as a RSA1 public key     debug1: identity file /Users/piuser/bin/keys/pie.rsa type -1     debug1: identity file /Users/piuser/bin/keys/pie.rsa-cert type -1     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_6.2     ssh_exchange_identification: Connection closed by remote host      * * * Some Update: I installed a SLES on the OS X in a VM wit NAT and if I try to connect, I get the same Error. After changed to Bridged, I can connect with the SLES Machine from the VM. Soooooo, as I see that there are only two possible ways. 1.) Somehow my Mac is blocking the access to the Raspberry Pi from the outside orrrrrr 2.) Somewhere on the Raspberry Pi there is the Mac Address of my WLAN or my Eth0 blocked :( but because there is no Firewall right now on and there is nothing within /etc/hosts.deny sooooooo, is there a place within Raspbian where my Mac could be blocked? * * * So, some Update, I changed the Hosname of my OS X, still no progress. Than, I decided to spoof my Mac Address, which I use to connect from my OS X to the local Router, odd thing I get this, the first time I try to connect by ssh:               ssh: Could not resolve hostname mypi.dyndns.org: nodename nor servname provided, or not known      The Second time I try I get again:               ssh_exchange_identification: Connection closed by remote host      So, right now I _grep -r_ the _mac address_ and the _hostname_ on the Raspberry Pi, I will also look for the local _IP_ my box uses within my Intranet.


Controlling bash script concurrency, flock inheritance

I have a bash deployment script that handles deploying updated code to a Tomcat instance on CentOS, however, both Chef and RunDeck may invoke the script, and since Chef runs periodically there is a chance of a collision. How do I prevent the deployment script from running twice concurrently? The standard answer looks to be to wrap the deploy logic in a `flock`. However, since the deploy restarts tomcat that isn't working -- the new java process inherits the lock and prevents any further deploy scripts from executing. Is there another way to prevent concurrent execution or a way to prevent `flock` inheritance?


Why does the root user have control over mysql directories but not show as a member of the mysql group?

Sorry if this is a duplicate. It seems somewhat similar to the question here but I think what I'm asking is a little different. I've got a CentOS 5.x box running with mysql on it. The `root` linux user can edit/modify files in `/var/lib/mysql/` sub-directories but most (if not all) of these directories have file system ownerships of `mysql:mysql`. When I run `groups root` I see:               [root@foo ~]# groups root     root : root bin daemon sys adm disk wheel      I get that `root` is a privileged account and can/will have access to everything but why don't I see `mysql` in the list of groups it belongs to?


Replace a string in a file and overwrite the file

I wrote my script using the the directory `~/deleted` (it's a long script). after using `~/deleted` for the whole script. I want to let the user choose the directory by putting the path in `~/.rm.cfg`. My file starts like this:               #!/bin/bash          defaultpath=~/deleted          if [ -s ~/.rm.cfg ]     then         defaultpath=$(head -1 ~/.rm.cfg)     fi      I need to replace every `~/deleted` with `$defaultpath` in my script. Is there a way to do it in command line such that it saves and replaces the original file? I can't get either perl or sed to work.


How to create KVM guest with SPICE graphics but TLS disabled using virt-install?

I am using `virt-install` (see below) to create a guest. All seems fine up to the point where it complains about auto-allocation of the SPICE TLS port. Here's what I am running and the full output:               # sudo virt-install --name vmname --ram 1024 --os-type=linux --os-variant=ubuntutrusty --disk path=/data/vm/vmname_sda.qcow2,bus=virtio,size=10,sparse=false --noautoconsole --console pty,target_type=virtio --accelerate --hvm --network=network:default --graphics spice,port=20001,listen=127.0.0.1          Starting install...     Retrieving file MANIFEST...                                                                                | 2.1 kB     00:00 ...     Retrieving file MANIFEST...                                                                                | 2.1 kB     00:00 ...     Retrieving file linux...                                                                                |  11 MB     00:00 ...     Retrieving file initrd.gz...                                                                                |  41 MB     00:00 ...     ERROR    unsupported configuration: Auto allocation of spice TLS port requested but spice TLS is disabled in qemu.conf     Domain installation does not appear to have been successful.     If it was, you can restart your domain by running:       virsh --connect qemu:///system start vmname     otherwise, please restart your installation.      The error is: > ERROR unsupported configuration: Auto allocation of spice TLS port requested > but spice TLS is disabled in qemu.conf and indeed in my `/etc/libvirt/qemu.conf` I have:               spice_tls = 0      (and intentionally so). So how can I create a KVM guest using the SPICE protocol for graphics, **but with TLS disabled**? I doubt it is of relevance, but the reason I want to disable TLS is because I am tunneling the connection to SPICE via SSH already. No need for an extra layer of encryption. * * * The host system is Ubuntu 14.04.1. Package versions are:   * virtinst: 0.600.4-3ubuntu2   * qemu-kvm: 2.0.0+dfsg-2ubuntu1.2 (all up to date as far as `apt-get` is concerned)


Chrome sound issues v 36+

After upgrade of Google Chrome to version 36, running Ubuntu 12.10[1] i686, there has been some issues with the browser. * * * **_First_** problem was continued crashing. Typically after a short while the browser started to crash by the "Sorry, Jim", or what it is called, in various tabs. After some fiddling and searching I found increasing `ulimit` of _open files_ halted the problem. (Mentioning this if it is probable that it has any connection.) I currently use:               sudo sh -c "ulimit -n 8192 && exec su $LOGNAME"      and run Chrome from that terminal. This has ended the crashes. * * * **_Second_** problem is that _sometimes_ media is stuttering. Typically on Youtube and other streaming media. The sound goes in about 4-500ms _"bursts"_ with a lot of distortion. Making e.g. speech very difficult to decipher. Sometimes a simple refresh of the page (`F5`) fixes the issue, but usually I have to close down a lot of windows etc before it is going back to normal. The memory or CPU is _"normal"_ when this occurs. Have not had this problem with earlier versions, even when RAM go over in swap. Anyone having similar issues? Know what to do, how to track down cause etc.? Using Pulse Audio as sound server. * * * [1] _Note on Ubuntu version: Know it is EOL, (May 2014), but I have to invest in a HDD for backup etc. before I can do an upgrade (or likely install a different distro.) Stuck running UB 12.10 until then._


shell backup script, missing `]`

I'm putting together a simple backup script that will tar contents of a folder, then move that file to a backup server. The script makes sure that the tar file exists and is not zero bytes before moving around. The problem is that the script is dying on one of the IF lines               if [ -f /www/archives/pdf/pdf_201207021048.tar && 11294720 -gt 0 ]; then         echo "tar file exists and is greater than 0 bytes."     else         echo "tar file does not exist or is zero bytes"     fi      The error in the console is:               ./backup_pdf.sh: line 49: [: missing `]'      Line 49 is the if statement above. The script is successfully verified with               sh -n backup.sh      What's wrong that `sh` is seeing a missing ']', yet it passes the syntax check?


Server `A` exports directory `/srv` via NFS with option `nohide`. A subdirectory within `/srv`, `/srv/foo`, is a mount point for another location on the NFS server using `--bind` option, like > `server# mount --bind /bar/foo/ /srv/foo/` Client `B` imports `A:/srv` and mounts it on `/mnt/srv` using NFS. Contents of `/mnt/srv` are the contents of `A:/srv`. The problem is that `/mnt/srv/foo` is empty, while I'm expecting to see the contents of `A:/bar/foo/` there. How to properly export and import NFS shares that have subdirectories as mount points also?


Start SSH session in some other directory than their home directory and lock them there

I've set up a SSH server which I've let some friends log into, both via SSH and FileZilla. I put a symbolic link to two hard drives in their home directories so that they could access some files. This has proved to be too difficult for some of the FileZilla (Windows) users and they keep getting lost in the filesystem. My questions are:   * Is it possible to make SSH users start in some other directory than their home directory? Appending "cd some_dir" to their .bashrc only works for SSH, not FileZilla.    * Is it possible to lock the users within that directory and its subdirectories? Some users go up to / and can't find their way back, even though I keep explaining to them that they can just enter "/path/to/their/dir" in the target field.


Concise way to output to file if argument is given, to stdout otherwise

I'd like my script to output to stdout unless it gets a filename as an argument. An obvious way is like so:               if [ -e "$1" ]; then       command_with_output >$1     else       command_with_output     fi      It's pretty ugly and has repetition, so I'd like a more consice way to do it. I tried the following, but it doesn't work.               [ -e "$1" ] && outfile=$1 || outfile='&1'     command_with_output >$outfile      Edit: This doesn't change the relevancy of the answers, but I realized after I made the question that `touch "$1" && outfile=$1` is really what I need instead of `[ -e "$1" ] && outfile=$1` since the file may not already exist, and I want to make sure I can write to it or create it, not just that it exists. I'm not changing the question because it would put the answers out of sync.


User drive is not showing

I'll try my best explaining this:               /dev/disk0     /dev/disk0s1     /dev/disk0s2      disk0 does not show up at all, when I login even my desktop is completely blank with no dock nor toolbar so even to logout is impossible. I can only manually shut down. Then if I log in as Root everything works,even disk 'user' shows as a volume and I can access it but only after I mount the disk0. So switch users and login to my own account...yes? Nope still nothing So I go back to the root user and I mount it again, verify and change permissions on the volume and now some of my applications and programs on the ROOT username is shown as an alias and it's unusable because 'USER' must unlock his drive first but he can't even get into his own desktop. Terminal does not give any output nor visible responses to any commands - in the root user - and in my login 'user' there is no Utilities folder nor any programs although I do have my desktop but just the dock and the taskbar all the other listings in sidebar persists I don't have the needed permission to access them. I'm the admin account but even so if I change the permissions of 'user' it just goes back to 'custom' Any help?


How can I cd into a directory as root?

Let's say there's a directory that I don't have the privileges to access. Obviously `sudo cd foo` won't work, because `cd` is a shell builtin in every shell ever. So far, I've just been using `sudo bash` (yes I know there are better ways) to get a root prompt. Then, I can `cd` into the directory to poke around. Is there a better way to do this?


adding a site to Apache2 Ubuntu Linux

I am a newbie to Linux. I am trying to add a webiste on Ubunutu Linux server and following this tutorial http://www.hostly.com/hosting-info/build-website- using-apache-1658.html   * Created a webconfiguration file /etc/apache2/sites-available and it looks like this              <VirtualHost *:80>     # Basic setup     ServerName analys.ideometrics.se     DocumentRoot /home/micke/www/analys.ideometrics/     # Logfiles     ErrorLog  /home/micke/wwwlogs/apache2/error.log     CustomLog /home/micke/wwwlogs/apache2/access.log combined     </VirtualHost>        * created a index.html in the location /home/micke/www/analys.ideometrics/   * restarted apache webserver when I am trying to access the URL (analys.ideometrics.se), getting internal error. I am not sure, if have to edit host file. Can you please give me a clue. Thanks for your help !!


Helm (formerly anything) , Ido and similar tools for Emacs: Overlap and differences

Reading about Helm and Ido for Emacs I noticed that they support similar features. The EmacsWiki provides great info about both, but I still can't tell what sets them apart.   * What are the differences between these two tools?    * Are there any others that provide similar functionality?


syslinux / vesamenu.c32 - using highest available screen resolution?

I was wondering if there was a way to use the highest available resolution in the syslinux.cfg file? I know i can do:               MENU RESOLUTION 1024 768      but without knowing available resolutions beforehand, is there a way to just choose the highest and have multiple backgrounds for different sizes etc?


my OS (Ubuntu 12.04) started to load slowly. After I choose OS from GRUB, it takes like 50 seconds of loading to get to login screen. I google'd, that command dmesg can provide some useful output. Most important lines od dmsg output are:               [    3.256550] EXT3-fs (loop0): mounted filesystem with ordered data mode     [   54.410083] ADDRCONF(NETDEV_UP): eth0: link is not ready      Some people who got same error solved this by reconnecting devices connected to notebook, but I get this output even with nothing connected to my nb. Any advice, what should I do, or why does it behave this way? Thanks in advance


Quicker Way to Reference a Directory?

This one is probably easy for all of you, but I have never had to deal with such a nested local set of directories. If I have a path like: `/mnt/media2/Archived\ Files/_Transfer/` is there a way to "mount" that directory to `~/Transfer/` or `/mnt/transfer`? I was looking into `symlinks`, but it talks about "how it's not always a good idea on directories because of recursive commands, etc..." Thanks.


gnome-terminal overrides Vim color setting

I'm in gnome-terminal on Linux Mint 13. (Mate) Whatever color scheme I set for the terminal overrides the color scheme i have set for Vim. How can i stop that from happening? I have read this: http://vim.wikia.com/wiki/256_colors_setup_for_console_Vim at 'Overriding the terminal's default terminfo', but it's very fuzzy and I simply can't use it to solve this. What is it that I actually do to override the terminal's color settings?


How come "make install" can only be done on my target machine?

I have been given a customized kernel by a customer and asked to build it using the following commands:               make     sudo su     make modules_install     make install      This has to be done on my host machine, because the target machine is too slow. I chroot'ed into the target's hard drive (external hdd), and the first three commands went well, but the final step "make install" cannot work. I get this message:               grub-probe: error: cannot find a device for / (is /dev mounted?)      I fixed it by going back to the target machine, and completing the last command there. But could someone kindly explain to me what the error message means, and why this can't be done on my desktop machine?


How to make sure a loopfile is only mounted once?

When mounting a filesystem image via `mount -o loop`, is there any mechanism to prevent the same file to be mounted a second time?


Merging two internet connections from two network interfaces in order to obtain double speed

I have two network interfaces (one wired & one wireless). I have two internet accounts too (each 256 kBps; one from a modem that I use as wired connection & the other from a wireless network). Is it possible to connect to both networks and merge them and get twice the speed (512 kBps)?   How?   I'm using Ubuntu 10.04 (Lucid Lynx). Thanks


How to run 32 bit programs on 64 bit Fedora 17?

Although the Android Development Tools (ADT) bundle is available as a zip package for 'Linux 64 Bit' it states following requirements: > 64-bit distributions must be capable of running 32-bit applications. And indeed, just running the packaged eclipse on a Fedora 17 64 bit system results in errors, because it can't 'find' several development tools, e.g. `adb` or `aapt`: > Error executing aapt: Cannot run program "/home/juser/local/adt-bundle- > linux/sdk/platform-tools/aapt": error=2, No such file or directory: error=2, > No such file or directory The 'no such file' is misleading because it is there (under $HOME/local):               adt-bundle-linux/sdk/platform-tools/aapt      But I can't execute it on the shell:               ~/local $ ./adt-bundle-linux/sdk/platform-tools/aapt      zsh: no such file or directory: ./adt-bundle-linux/sdk/platform-tools/aapt      Looking at the file               $ file adt-bundle-linux/sdk/platform-tools/aapt     adt-bundle-linux/sdk/platform-tools/aapt: ELF 32-bit LSB executable, Intel 80386,      version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8,      not stripped      we see that it is a 32 binary. And it seems that my system (currently) is not capable of running 32-bit applications. How do I change that? How do I make a current Fedora 64 bit system capable of running 32 bit applications? (Of course one could also ask why someone ends up putting 32 bit binaries into a binary package called 'Linux 64 bit' ...)


Problem with using grep command with env variable containing special characters

I have a variable "abc" with value "xyz*!@#" in my unix account (`ksh`). I used `export` command to export this variable into the environment. When I use `grep` command as below               env |grep xyz      I get the output               abc=xyz*!@#      But when I use the following command               env | grep xyz*!      As expected I don't get the output as               abc=xyz*!@#      In fact, I don't get any output at all.


Including Linux Mint when selling hardware?

I'm wondering if the GNU License allows me to include the install file of any Linux Mint release as I wish in hardware that I'm profiting from?


Fedora 16 - Iptables installed, but no iptables service available

I'm trying to open ports on my fedora OS. In the past, this was as easy as adding an rule like               -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT      I went to restart my iptables service and there is none. I went to install iptables and yum says it's installed and up to date (version 1.4.x) How do I get the service? EDIT: The answer is below, but I also wanted to let people know, if you're having trouble adding the rule to the /etc/sysconfig/iptables config... I would recommend using the $> system-config-firewall command to bring up a gui port editor that appears to work with the command below to restart the ipstables service via systemctl


Using grep command and backreferencing

This is a pretty basic question, but I can't get my head around it. I'm learning Linux and one of the questions i've been given is; > *The word sentimentalment includes the same three characters (e.g. "ent") > which appear three times. The word "blayblapblam" also contains the same > three characters repeated three time (e.g. "bla"). > > How many words can you find which contain any three characters repeated > three times, like the examples "sentimentalment" and "blayblapblam", but > which also begin with lower case "d". Use /usr/share/dict/words as your list > of possible words and grep to find the answer. The "d" is not one of the > characters considered when detecting the three-character strings.* So far, I can return instances where the same three letters appear twice;               grep -E '^d(...).*\1' /usr/share/dict/words > output      Which to me reads, look for a word beginning with 'd', then combination of three letters, 0 or more characters before the same group (1) appearing again. I've tried the following;               grep -E '^d(...).*\1.*\1' /usr/share/dict/words > output      Which if my understanding is correct (which it obviously isn't), returns group one, then zero or more characters, then group one again. Can someone point out where I'm going wrong? Any help is appreciated.


Perl confused with script

Write a perl script that takes one argument, the name of a file or directory. The script should call the stat function and print the resulting data along with a one line explanation of each field.               my $args;     $args=@ARGV;          if ($args<1)     {         die("Expecting a filename");     }          sub showstat     {           print " $_[0] dev, device number of filesystem\n";           print " $_[1] ino,      inode number\n";           print " $_[2] mode,     file mode  (type and permissions)\n";           print " $_[3] nlink,    number of (hard) links to the file\n";     }          my $filename=$ARGV[0];     if (open (TESTFILE,$filename))     {         my @filedata= stat(TESTFILE);              &showstat(@filedata);         close (TESTFILE);     }     else     {         print "error on open $filename";     }      My question is if `$args=@ARGV`, shouldn't `$ARGV[0]` equal to `$args[0]` instead of `$filename=$ARGV[0]`? Why not? and under where it says `@showstat(@filedata)`, why do you put the ampersand? (i know by definition it is a subroutine), but can I get a clarification what the actual function do in here?


Qt programs have Greek fonts on one Debian account (QtConfig, Virtualbox and VLC)

**Update:** I have created a new user via `adduser` and Virtualbox fonts are OK there. This does _not_ solve my problem, however... I still don't know what is going on and I'd like my own user account to have the correct settings. In my fresh install of Debian with Xfce, programs such as QtConfig, VLC and Virtualbox, which presumably use the Qt GUI framework, all have Greek fonts. This is really annoying, and I'd like to change it to something understandable, preferably the system-wide font settings. Here are some screenshots: QtConfig: ![QtConfig](http://i.stack.imgur.com/wVyYk.png) Virtualbox: ![Virtualbox](http://i.stack.imgur.com/gO3zU.png) VLC: ![VLC](http://i.stack.imgur.com/HzQHn.png) How can I solve this? **Additional info:** `locale` says:               LANG=en_US.UTF-8     LANGUAGE=     LC_CTYPE="en_US.UTF-8"     LC_NUMERIC="en_US.UTF-8"     LC_TIME="en_US.UTF-8"     LC_COLLATE="en_US.UTF-8"     LC_MONETARY="en_US.UTF-8"     LC_MESSAGES="en_US.UTF-8"     LC_PAPER="en_US.UTF-8"     LC_NAME="en_US.UTF-8"     LC_ADDRESS="en_US.UTF-8"     LC_TELEPHONE="en_US.UTF-8"     LC_MEASUREMENT="en_US.UTF-8"     LC_IDENTIFICATION="en_US.UTF-8"     LC_ALL=      `egrep '^[^#]' /etc/locale.gen` says:               en_US.UTF-8 UTF-8


How to configure xorg.conf for widescreen VNC on headless Linux/Ubuntu?

I have a Ubuntu 12.10 Box configured to run headless. I've managed to boot X headless by a lot of trial and error but I still have a glitch:      When booting using the monitor, it all works ok, widescreen resolution and all, when booting headless it will stick with 4:3 resolutions, I suspect that it has something to do with the vesa driver. Specs:   * video card intel HD 4000 (i7 integrated)   * ubuntu 12.10 (latest updates) here is my /etc/X11/`xorg.conf`:               Section "Device"             ### Available Driver options are:-             ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",             ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",             ### <percent>: "<f>%"             ### [arg]: arg optional             #Option     "NoAccel"               # [<bool>]             #Option     "AccelMethod"           # <str>             #Option     "Backlight"             # <str>             #Option     "DRI"                   # <str>             #Option     "ColorKey"              # <i>             #Option     "VideoKey"              # <i>             #Option     "Tiling"                # [<bool>]             #Option     "LinearFramebuffer"     # [<bool>]             #Option     "SwapbuffersWait"       # [<bool>]             #Option     "TripleBuffer"          # [<bool>]             #Option     "XvPreferOverlay"       # [<bool>]             #Option     "HotPlug"               # [<bool>]             #Option     "RelaxedFencing"        # [<bool>]             #Option     "XvMC"                  # [<bool>]             #Option     "ZaphodHeads"           # <str>             #Option     "TearFree"              # [<bool>]             #Option     "PerCrtcPixmaps"        # [<bool>]             #Option     "FallbackDebug"         # [<bool>]             #Option     "DebugFlushBatches"     # [<bool>]             #Option     "DebugFlushCaches"      # [<bool>]             #Option     "DebugWait"             # [<bool>]             #Option     "BufferCache"           # [<bool>]         Identifier  "intelCard"         Driver      "intel"         BusID       "PCI:0:2:0"          Option      "ConnectedMonitor" "SME2220NW"         Option      "CustomEDID" "SME2220NW:/etc/X11/samsung.edid"     EndSection          Section "Monitor"         Identifier "SME2220NW"         VendorName "SAM"         ModelName "SME2220NW"         # Block type: 2:0 3:fd         HorizSync 30-81         VertRefresh 56-75         # Max dot clock (video bandwidth) 150 MHz         # Block type: 2:0 3:fc         # Block type: 2:0 3:ff         # DPMS capabilities: Active off:yes  Suspend:no  Standby:no              Mode    "1680x1050" # vfreq 59.883Hz, hfreq 64.674kHz             DotClock    119.000000             HTimings    1680 1728 1760 1840             VTimings    1050 1053 1059 1080             Flags   "-HSync" "+VSync"         EndMode                Option   "enable" "true"         Option   "Preferred Mode" "1680x1050"     EndSection          Section "Screen"         Identifier  "Default Screen"         Monitor     "SME2220NW"         Device      "intelCard"         Option         "TwinView" "0"         Option         "TwinViewXineramaInfoOrder" "CRT-0"         Option         "metamodes" "1680x1050 +0+0; 1440x900 +0+0; 1280x1024 +0+0; 1280x960 +0+0; 1280x800 +0+0; 1024x768 +0+0; 800x600 +0+0; 640x480 +0+0"         SubSection     "Display"             Depth       24         EndSubSection     EndSection      here is my /var/log/`xorg.0.log`:               [  8841.997]      X.Org X Server 1.13.1.901 (1.13.2 RC 1)     Release Date: 2013-01-03     [  8841.997] X Protocol Version 11, Revision 0     [  8841.997] Build Operating System: Linux 2.6.24-32-xen x86_64 Ubuntu     [  8841.997] Current Operating System: Linux L2 3.7.0-7-generic #15-Ubuntu SMP Sat Dec 15 16:34:25 UTC 2012 x86_64     [  8841.997] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.7.0-7-generic root=UUID=58d10bfd-8c7c-4308-98eb-7002337b7510 ro nomodeset     [  8841.997] Build Date: 04 January 2013  11:17:34AM     [  8841.997] xorg-server 2:1.13.1.901+git20130104+server-1.13-branch.3a8c618a-0ubuntu0ricotz~quantal (For technical support please see http://www.ubuntu.com/support)      [  8841.997] Current version of pixman: 0.28.2     [  8841.997]    Before reporting problems, check http://wiki.x.org         to make sure that you have the latest version.     [  8841.997] Markers: (--) probed, (**) from config file, (==) default setting,         (++) from command line, (!!) notice, (II) informational,         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.     [  8841.997] (==) Log file: "/var/log/Xorg.0.log", Time: Wed Jan 30 12:23:13 2013     [  8841.997] (==) Using config file: "/etc/X11/xorg.conf"     [  8841.997] (==) Using system config directory "/usr/share/X11/xorg.conf.d"     [  8841.998] (==) No Layout section.  Using the first Screen section.     [  8841.998] (**) |-->Screen "Default Screen" (0)     [  8841.998] (**) |   |-->Monitor "SME2220NW"     [  8841.998] (**) |   |-->Device "intelCard"     [  8841.998] (==) Automatically adding devices     [  8841.998] (==) Automatically enabling devices     [  8841.998] (==) Automatically adding GPU devices     [  8841.998] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.     [  8841.998]    Entry deleted from font path.     [  8841.998] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.     [  8841.998]    Entry deleted from font path.     [  8841.998] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.     [  8841.998]    Entry deleted from font path.     [  8841.998] (WW) The directory "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" does not exist.     [  8841.998]    Entry deleted from font path.     [  8841.998] (==) FontPath set to:         /usr/share/fonts/X11/misc,         /usr/share/fonts/X11/100dpi/:unscaled,         /usr/share/fonts/X11/Type1,         /usr/share/fonts/X11/100dpi,         built-ins     [  8841.998] (==) ModulePath set to "/usr/lib/x86_64-linux-gnu/xorg/extra-modules,/usr/lib/xorg/extra-modules,/usr/lib/xorg/modules"     [  8841.998] (II) The server relies on udev to provide the list of input devices.         If no devices become available, reconfigure udev or disable AutoAddDevices.     [  8841.998] (II) Loader magic: 0x7ff68004ac40     [  8841.998] (II) Module ABI versions:     [  8841.998]    X.Org ANSI C Emulation: 0.4     [  8841.998]    X.Org Video Driver: 13.1     [  8841.998]    X.Org XInput driver : 18.0     [  8841.998]    X.Org Server Extension : 7.0     [  8841.999] (--) PCI:*(0:0:2:0) 8086:0162:1043:84ca rev 9, Mem @ 0xf7800000/4194304, 0xe0000000/268435456, I/O @ 0x0000f000/64     [  8841.999] (II) Open ACPI successful (/var/run/acpid.socket)     [  8841.999] Initializing built-in extension Generic Event Extension     [  8841.999] Initializing built-in extension SHAPE     [  8841.999] Initializing built-in extension MIT-SHM     [  8841.999] Initializing built-in extension XInputExtension     [  8841.999] Initializing built-in extension XTEST     [  8841.999] Initializing built-in extension BIG-REQUESTS     [  8841.999] Initializing built-in extension SYNC     [  8841.999] Initializing built-in extension XKEYBOARD     [  8841.999] Initializing built-in extension XC-MISC     [  8841.999] Initializing built-in extension SECURITY     [  8841.999] Initializing built-in extension XINERAMA     [  8841.999] Initializing built-in extension XFIXES     [  8841.999] Initializing built-in extension RENDER     [  8841.999] Initializing built-in extension RANDR     [  8841.999] Initializing built-in extension COMPOSITE     [  8841.999] Initializing built-in extension DAMAGE     [  8841.999] Initializing built-in extension MIT-SCREEN-SAVER     [  8841.999] Initializing built-in extension DOUBLE-BUFFER     [  8841.999] Initializing built-in extension RECORD     [  8841.999] Initializing built-in extension DPMS     [  8841.999] Initializing built-in extension X-Resource     [  8841.999] Initializing built-in extension XVideo     [  8841.999] Initializing built-in extension XVideo-MotionCompensation     [  8841.999] Initializing built-in extension XFree86-VidModeExtension     [  8841.999] Initializing built-in extension XFree86-DGA     [  8841.999] Initializing built-in extension XFree86-DRI     [  8841.999] Initializing built-in extension DRI2     [  8841.999] (II) LoadModule: "glx"     [  8842.000] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so     [  8842.000] (II) Module glx: vendor="X.Org Foundation"     [  8842.000]    compiled for 1.13.1.901, module version = 1.0.0     [  8842.000]    ABI class: X.Org Server Extension, version 7.0     [  8842.000] (==) AIGLX enabled     [  8842.000] Loading extension GLX     [  8842.000] (II) LoadModule: "intel"     [  8842.000] (II) Loading /usr/lib/xorg/modules/drivers/intel_drv.so     [  8842.000] (II) Module intel: vendor="X.Org Foundation"     [  8842.000]    compiled for 1.13.1.901, module version = 2.20.19     [  8842.000]    Module class: X.Org Video Driver     [  8842.000]    ABI class: X.Org Video Driver, version 13.1     [  8842.000] (II) intel: Driver for Intel Integrated Graphics Chipsets: i810,         i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G, 915G,         E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM, Pineview G,         965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33, GM45,         4 Series, G45/G43, Q45/Q43, G41, B43, B43, Clarkdale, Arrandale,         Sandybridge Desktop (GT1), Sandybridge Desktop (GT2),         Sandybridge Desktop (GT2+), Sandybridge Mobile (GT1),         Sandybridge Mobile (GT2), Sandybridge Mobile (GT2+),         Sandybridge Server, Ivybridge Mobile (GT1), Ivybridge Mobile (GT2),         Ivybridge Desktop (GT1), Ivybridge Desktop (GT2), Ivybridge Server,         Ivybridge Server (GT2), Haswell Desktop (GT1), Haswell Desktop (GT2),         Haswell Desktop (GT2+), Haswell Mobile (GT1), Haswell Mobile (GT2),         Haswell Mobile (GT2+), Haswell Server (GT1), Haswell Server (GT2),         Haswell Server (GT2+), Haswell SDV Desktop (GT1),         Haswell SDV Desktop (GT2), Haswell SDV Desktop (GT2+),         Haswell SDV Mobile (GT1), Haswell SDV Mobile (GT2),         Haswell SDV Mobile (GT2+), Haswell SDV Server (GT1),         Haswell SDV Server (GT2), Haswell SDV Server (GT2+),         Haswell ULT Desktop (GT1), Haswell ULT Desktop (GT2),         Haswell ULT Desktop (GT2+), Haswell ULT Mobile (GT1),         Haswell ULT Mobile (GT2), Haswell ULT Mobile (GT2+),         Haswell ULT Server (GT1), Haswell ULT Server (GT2),         Haswell ULT Server (GT2+), Haswell CRW Desktop (GT1),         Haswell CRW Desktop (GT2), Haswell CRW Desktop (GT2+),         Haswell CRW Mobile (GT1), Haswell CRW Mobile (GT2),         Haswell CRW Mobile (GT2+), Haswell CRW Server (GT1),         Haswell CRW Server (GT2), Haswell CRW Server (GT2+),         ValleyView PO board     [  8842.001] (++) using VT number 7          [  8842.004] (EE) No devices detected.     [  8842.004] (==) Matched intel as autoconfigured driver 0     [  8842.004] (==) Matched vesa as autoconfigured driver 1     [  8842.004] (==) Matched modesetting as autoconfigured driver 2     [  8842.004] (==) Matched fbdev as autoconfigured driver 3     [  8842.004] (==) Assigned the driver to the xf86ConfigLayout     [  8842.004] (II) LoadModule: "intel"     [  8842.004] (II) Loading /usr/lib/xorg/modules/drivers/intel_drv.so     [  8842.004] (II) Module intel: vendor="X.Org Foundation"     [  8842.004]    compiled for 1.13.1.901, module version = 2.20.19     [  8842.004]    Module class: X.Org Video Driver     [  8842.004]    ABI class: X.Org Video Driver, version 13.1     [  8842.004] (II) UnloadModule: "intel"     [  8842.004] (II) Unloading intel     [  8842.004] (II) Failed to load module "intel" (already loaded, 32758)     [  8842.004] (II) LoadModule: "vesa"     [  8842.005] (II) Loading /usr/lib/xorg/modules/drivers/vesa_drv.so     [  8842.005] (II) Module vesa: vendor="X.Org Foundation"     [  8842.005]    compiled for 1.13.0, module version = 2.3.2     [  8842.005]    Module class: X.Org Video Driver     [  8842.005]    ABI class: X.Org Video Driver, version 13.0     [  8842.005] (II) LoadModule: "modesetting"     [  8842.005] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so     [  8842.005] (II) Module modesetting: vendor="X.Org Foundation"     [  8842.005]    compiled for 1.13.0, module version = 0.5.0     [  8842.005]    Module class: X.Org Video Driver     [  8842.005]    ABI class: X.Org Video Driver, version 13.0     [  8842.005] (II) LoadModule: "fbdev"     [  8842.005] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so     [  8842.005] (II) Module fbdev: vendor="X.Org Foundation"     [  8842.005]    compiled for 1.12.99.903, module version = 0.4.3     [  8842.005]    Module class: X.Org Video Driver     [  8842.005]    ABI class: X.Org Video Driver, version 13.0     [  8842.005] (II) intel: Driver for Intel Integrated Graphics Chipsets: i810,         i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G, 915G,         E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM, Pineview G,         965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33, GM45,         4 Series, G45/G43, Q45/Q43, G41, B43, B43, Clarkdale, Arrandale,         Sandybridge Desktop (GT1), Sandybridge Desktop (GT2),         Sandybridge Desktop (GT2+), Sandybridge Mobile (GT1),         Sandybridge Mobile (GT2), Sandybridge Mobile (GT2+),         Sandybridge Server, Ivybridge Mobile (GT1), Ivybridge Mobile (GT2),         Ivybridge Desktop (GT1), Ivybridge Desktop (GT2), Ivybridge Server,         Ivybridge Server (GT2), Haswell Desktop (GT1), Haswell Desktop (GT2),         Haswell Desktop (GT2+), Haswell Mobile (GT1), Haswell Mobile (GT2),         Haswell Mobile (GT2+), Haswell Server (GT1), Haswell Server (GT2),         Haswell Server (GT2+), Haswell SDV Desktop (GT1),         Haswell SDV Desktop (GT2), Haswell SDV Desktop (GT2+),         Haswell SDV Mobile (GT1), Haswell SDV Mobile (GT2),         Haswell SDV Mobile (GT2+), Haswell SDV Server (GT1),         Haswell SDV Server (GT2), Haswell SDV Server (GT2+),         Haswell ULT Desktop (GT1), Haswell ULT Desktop (GT2),         Haswell ULT Desktop (GT2+), Haswell ULT Mobile (GT1),         Haswell ULT Mobile (GT2), Haswell ULT Mobile (GT2+),         Haswell ULT Server (GT1), Haswell ULT Server (GT2),         Haswell ULT Server (GT2+), Haswell CRW Desktop (GT1),         Haswell CRW Desktop (GT2), Haswell CRW Desktop (GT2+),         Haswell CRW Mobile (GT1), Haswell CRW Mobile (GT2),         Haswell CRW Mobile (GT2+), Haswell CRW Server (GT1),         Haswell CRW Server (GT2), Haswell CRW Server (GT2+),         ValleyView PO board     [  8842.006] (II) VESA: driver for VESA chipsets: vesa     [  8842.006] (II) modesetting: Driver for Modesetting Kernel Drivers: kms     [  8842.006] (II) FBDEV: driver for framebuffer: fbdev     [  8842.006] (++) using VT number 7          [  8842.006] (WW) xf86OpenConsole: setpgid failed: Operation not permitted     [  8842.006] (WW) xf86OpenConsole: setsid failed: Operation not permitted     [  8842.008] (WW) Falling back to old probe method for modesetting     [  8842.008] (EE) open /dev/dri/card0: No such file or directory     [  8842.008] (WW) Falling back to old probe method for fbdev     [  8842.008] (II) Loading sub module "fbdevhw"     [  8842.008] (II) LoadModule: "fbdevhw"     [  8842.008] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so     [  8842.008] (II) Module fbdevhw: vendor="X.Org Foundation"     [  8842.008]    compiled for 1.13.1.901, module version = 0.0.2     [  8842.008]    ABI class: X.Org Video Driver, version 13.1     [  8842.008] (EE) open /dev/fb0: No such file or directory     [  8842.008] (II) Loading sub module "vbe"     [  8842.008] (II) LoadModule: "vbe"     [  8842.009] (II) Loading /usr/lib/xorg/modules/libvbe.so     [  8842.009] (II) Module vbe: vendor="X.Org Foundation"     [  8842.009]    compiled for 1.13.1.901, module version = 1.1.0     [  8842.009]    ABI class: X.Org Video Driver, version 13.1     [  8842.009] (II) Loading sub module "int10"     [  8842.009] (II) LoadModule: "int10"     [  8842.009] (II) Loading /usr/lib/xorg/modules/libint10.so     [  8842.009] (II) Module int10: vendor="X.Org Foundation"     [  8842.009]    compiled for 1.13.1.901, module version = 1.0.0     [  8842.009]    ABI class: X.Org Video Driver, version 13.1     [  8842.009] (II) VESA(0): initializing int10     [  8842.009] (II) VESA(0): Primary V_BIOS segment is: 0xc000     [  8842.010] (II) VESA(0): VESA BIOS detected     [  8842.010] (II) VESA(0): VESA VBE Version 3.0     [  8842.010] (II) VESA(0): VESA VBE Total Mem: 262080 kB     [  8842.010] (II) VESA(0): VESA VBE OEM: Intel(R) Sandybridge/Ivybridge Graphics Chipset Accelerated VGA BIOS     [  8842.010] (II) VESA(0): VESA VBE OEM Software Rev: 1.0     [  8842.010] (II) VESA(0): VESA VBE OEM Vendor: Intel Corporation     [  8842.010] (II) VESA(0): VESA VBE OEM Product: Intel(R) Sandybridge/Ivybridge Graphics Controller     [  8842.010] (II) VESA(0): VESA VBE OEM Product Rev: Hardware Version 0.0     [  8842.023] (==) VESA(0): Depth 24, (--) framebuffer bpp 32     [  8842.023] (==) VESA(0): RGB weight 888     [  8842.023] (==) VESA(0): Default visual is TrueColor     [  8842.023] (==) VESA(0): Using gamma correction (1.0, 1.0, 1.0)     [  8842.023] (II) Loading sub module "ddc"     [  8842.023] (II) LoadModule: "ddc"     [  8842.023] (II) Module "ddc" already built-in     [  8842.029] (II) VESA(0): VESA VBE DDC supported     [  8842.029] (II) VESA(0): VESA VBE DDC Level none     [  8842.029] (II) VESA(0): VESA VBE DDC transfer in appr. 0 sec.     [  8842.030] (II) VESA(0): VESA VBE DDC read failed     [  8842.030] (II) VESA(0): Searching for matching VESA mode(s):     [  8842.030] Mode: 160 (0x0)     [  8842.030]    ModeAttributes: 0x0     [  8842.030]    WinAAttributes: 0x0     [  8842.030]    WinBAttributes: 0x0     ...     [  8842.043] (II) VESA(0): Total Memory: 4095 64KB banks (262080kB)     [  8842.043] (II) VESA(0): SME2220NW: Using hsync range of 30.00-81.00 kHz     [  8842.043] (II) VESA(0): SME2220NW: Using vrefresh range of 56.00-75.00 Hz     [  8842.043] (WW) VESA(0): Unable to estimate virtual size     [  8842.043] (II) VESA(0): Not using built-in mode "1920x1440" (no mode of this name)     [  8842.043] (II) VESA(0): Not using built-in mode "1600x1200" (no mode of this name)     [  8842.043] (II) VESA(0): Not using built-in mode "1280x1024" (no mode of this name)     [  8842.043] (II) VESA(0): Not using built-in mode "1024x768" (no mode of this name)     [  8842.043] (II) VESA(0): Not using built-in mode "1024x768" (no mode of this name)     [  8842.043] (II) VESA(0): Not using built-in mode "800x600" (no mode of this name)     [  8842.043] (II) VESA(0): Not using built-in mode "640x480" (no mode of this name)     [  8842.043] (WW) VESA(0): No valid modes left. Trying less strict filter...     [  8842.043] (II) VESA(0): SME2220NW: Using hsync range of 30.00-81.00 kHz     [  8842.043] (II) VESA(0): SME2220NW: Using vrefresh range of 56.00-75.00 Hz     [  8842.043] (WW) VESA(0): Unable to estimate virtual size     [  8842.043] (II) VESA(0): Not using built-in mode "1920x1440" (hsync out of range)     [  8842.043] (--) VESA(0): Virtual size is 1600x1200 (pitch 1600)     [  8842.043] (**) VESA(0): *Built-in mode "1600x1200"     [  8842.043] (**) VESA(0): *Built-in mode "1280x1024"     [  8842.043] (**) VESA(0): *Built-in mode "1024x768"     [  8842.043] (**) VESA(0): *Built-in mode "1024x768"     [  8842.043] (**) VESA(0): *Built-in mode "800x600"     [  8842.043] (**) VESA(0): *Built-in mode "640x480"     [  8842.043] (==) VESA(0): DPI set to (96, 96)     [  8842.043] (II) VESA(0): Attempting to use 65Hz refresh for mode "1600x1200" (15a)     [  8842.044] (II) VESA(0): Attempting to use 75Hz refresh for mode "1280x1024" (11b)     [  8842.044] (II) VESA(0): Attempting to use 75Hz refresh for mode "1024x768" (118)     [  8842.044] (II) VESA(0): Attempting to use 75Hz refresh for mode "1024x768" (17f)     [  8842.044] (II) VESA(0): Attempting to use 72Hz refresh for mode "800x600" (115)     [  8842.044] (II) VESA(0): Attempting to use 73Hz refresh for mode "640x480" (112)     [  8842.045] (**) VESA(0): Using "Shadow Framebuffer"     [  8842.045] (II) Loading sub module "shadow"     [  8842.045] (II) LoadModule: "shadow"     [  8842.045] (II) Loading /usr/lib/xorg/modules/libshadow.so     [  8842.045] (II) Module shadow: vendor="X.Org Foundation"     [  8842.045]    compiled for 1.13.1.901, module version = 1.1.0     [  8842.045]    ABI class: X.Org ANSI C Emulation, version 0.4     [  8842.045] (II) Loading sub module "fb"     [  8842.045] (II) LoadModule: "fb"     [  8842.045] (II) Loading /usr/lib/xorg/modules/libfb.so     [  8842.045] (II) Module fb: vendor="X.Org Foundation"     [  8842.045]    compiled for 1.13.1.901, module version = 1.0.0     [  8842.045]    ABI class: X.Org ANSI C Emulation, version 0.4     [  8842.045] (II) UnloadModule: "modesetting"     [  8842.045] (II) Unloading modesetting     [  8842.045] (II) UnloadModule: "fbdev"     [  8842.045] (II) Unloading fbdev     [  8842.045] (II) UnloadSubModule: "fbdevhw"     [  8842.045] (II) Unloading fbdevhw     [  8842.045] (==) Depth 24 pixmap format is 32 bpp     [  8842.045] (II) Loading sub module "int10"     [  8842.045] (II) LoadModule: "int10"     [  8842.045] (II) Loading /usr/lib/xorg/modules/libint10.so     [  8842.045] (II) Module int10: vendor="X.Org Foundation"     [  8842.045]    compiled for 1.13.1.901, module version = 1.0.0     [  8842.045]    ABI class: X.Org Video Driver, version 13.1     [  8842.045] (II) VESA(0): initializing int10     [  8842.045] (II) VESA(0): Primary V_BIOS segment is: 0xc000     [  8842.045] (II) VESA(0): VESA BIOS detected     [  8842.045] (II) VESA(0): VESA VBE Version 3.0     [  8842.045] (II) VESA(0): VESA VBE Total Mem: 262080 kB     [  8842.045] (II) VESA(0): VESA VBE OEM: Intel(R) Sandybridge/Ivybridge Graphics Chipset Accelerated VGA BIOS     [  8842.045] (II) VESA(0): VESA VBE OEM Software Rev: 1.0     [  8842.045] (II) VESA(0): VESA VBE OEM Vendor: Intel Corporation     [  8842.045] (II) VESA(0): VESA VBE OEM Product: Intel(R) Sandybridge/Ivybridge Graphics Controller     [  8842.045] (II) VESA(0): VESA VBE OEM Product Rev: Hardware Version 0.0     [  8842.048] (II) VESA(0): virtual address = 0x7ff66b6ab000,         physical address = 0xe0000000, size = 268369920     [  8842.054] (II) VESA(0): Setting up VESA Mode 0x15A (1600x1200)     [  8842.126] (==) VESA(0): Default visual is TrueColor     [  8842.126] (==) VESA(0): Backing store disabled     [  8842.127] (==) VESA(0): DPMS enabled     [  8842.127] (WW) VESA(0): Option "ConnectedMonitor" is not used     [  8842.127] (WW) VESA(0): Option "CustomEDID" is not used     [  8842.127] (WW) VESA(0): Option "enable" is not used     [  8842.127] (WW) VESA(0): Option "Preferred Mode" is not used     [  8842.127] (WW) VESA(0): Option "TwinView" is not used     [  8842.127] (WW) VESA(0): Option "TwinViewXineramaInfoOrder" is not used     [  8842.127] (WW) VESA(0): Option "metamodes" is not used     [  8842.127] (==) RandR enabled     [  8842.129] (II) AIGLX: Screen 0 is not DRI2 capable     [  8842.129] (II) AIGLX: Screen 0 is not DRI capable     [  8842.133] (II) AIGLX: Loaded and initialized swrast     [  8842.133] (II) GLX: Initialized DRISWRAST GL provider for screen 0     [  8842.149] (II) XKB: reuse xkmfile /var/lib/xkb/server-B20D7FC79C7F597315E3E501AEF10E0D866E8E92.xkm     [  8842.150] (II) config/udev: Adding input device Power Button (/dev/input/event1)     [  8842.150] (**) Power Button: Applying InputClass "evdev keyboard catchall"     [  8842.150] (II) LoadModule: "evdev"     [  8842.150] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so     [  8842.150] (II) Module evdev: vendor="X.Org Foundation"     [  8842.150]    compiled for 1.13.0, module version = 2.7.3     [  8842.150]    Module class: X.Org XInput Driver     [  8842.150]    ABI class: X.Org XInput driver, version 18.0     [  8842.150] (II) Using input driver 'evdev' for 'Power Button'     [  8842.150] (**) Power Button: always reports core events     [  8842.150] (**) evdev: Power Button: Device: "/dev/input/event1"     [  8842.150] (--) evdev: Power Button: Vendor 0 Product 0x1     [  8842.150] (--) evdev: Power Button: Found keys     [  8842.150] (II) evdev: Power Button: Configuring as keyboard     [  8842.150] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input1/event1"     [  8842.150] (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD, id 6)     [  8842.150] (**) Option "xkb_rules" "evdev"     [  8842.150] (**) Option "xkb_model" "pc105"     [  8842.150] (**) Option "xkb_layout" "us"     [  8842.150] (II) config/udev: Adding input device Power Button (/dev/input/event0)     [  8842.150] (**) Power Button: Applying InputClass "evdev keyboard catchall"     [  8842.150] (II) Using input driver 'evdev' for 'Power Button'     [  8842.150] (**) Power Button: always reports core events     [  8842.150] (**) evdev: Power Button: Device: "/dev/input/event0"     [  8842.150] (--) evdev: Power Button: Vendor 0 Product 0x1     [  8842.150] (--) evdev: Power Button: Found keys     [  8842.150] (II) evdev: Power Button: Configuring as keyboard     [  8842.150] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input0/event0"     [  8842.150] (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD, id 7)     [  8842.150] (**) Option "xkb_rules" "evdev"     [  8842.150] (**) Option "xkb_model" "pc105"     [  8842.150] (**) Option "xkb_layout" "us"     [  8842.150] (II) config/udev: Adding input device HDA Intel PCH HDMI/DP,pcm=3 (/dev/input/event3)     [  8842.150] (II) No input driver specified, ignoring this device.     [  8842.150] (II) This device may have been added with another device file.     [  8842.151] (II) config/udev: Adding input device HDA Intel PCH Line (/dev/input/event4)     [  8842.151] (II) No input driver specified, ignoring this device.     [  8842.151] (II) This device may have been added with another device file.     [  8842.151] (II) config/udev: Adding input device HDA Intel PCH Front Mic (/dev/input/event5)     [  8842.151] (II) No input driver specified, ignoring this device.     [  8842.151] (II) This device may have been added with another device file.     [  8842.151] (II) config/udev: Adding input device HDA Intel PCH Rear Mic (/dev/input/event6)     [  8842.151] (II) No input driver specified, ignoring this device.     [  8842.151] (II) This device may have been added with another device file.     [  8842.151] (II) config/udev: Adding input device HDA Intel PCH Front Headphone (/dev/input/event7)     [  8842.151] (II) No input driver specified, ignoring this device.     [  8842.151] (II) This device may have been added with another device file.     [  8842.151] (II) config/udev: Adding input device HDA Intel PCH Line Out (/dev/input/event8)     [  8842.151] (II) No input driver specified, ignoring this device.     [  8842.151] (II) This device may have been added with another device file.     [  8842.151] (II) config/udev: Adding input device Eee PC WMI hotkeys (/dev/input/event2)     [  8842.151] (**) Eee PC WMI hotkeys: Applying InputClass "evdev keyboard catchall"     [  8842.151] (II) Using input driver 'evdev' for 'Eee PC WMI hotkeys'     [  8842.151] (**) Eee PC WMI hotkeys: always reports core events     [  8842.151] (**) evdev: Eee PC WMI hotkeys: Device: "/dev/input/event2"     [  8842.151] (--) evdev: Eee PC WMI hotkeys: Vendor 0 Product 0     [  8842.151] (--) evdev: Eee PC WMI hotkeys: Found keys     [  8842.151] (II) evdev: Eee PC WMI hotkeys: Configuring as keyboard     [  8842.151] (**) Option "config_info" "udev:/sys/devices/platform/eeepc-wmi/input/input2/event2"     [  8842.151] (II) XINPUT: Adding extended input device "Eee PC WMI hotkeys" (type: KEYBOARD, id 8)     [  8842.151] (**) Option "xkb_rules" "evdev"     [  8842.151] (**) Option "xkb_model" "pc105"     [  8842.151] (**) Option "xkb_layout" "us"


How to monitor all executions of an executable over a time period

I know how to monitor a _process_. Commands like `top` and so forth can monitor the CPU time and memory usage for a given process instance. But say I expect a given executable to be run several times in the next hour, and I want to measure how many times it is run and the CPU time it has consumed. What's a command for that?


How to add an iso file as APT source

Say I have this line in " **/etc/fstab** ":               /iso/apt.iso /mnt/apt iso9660 loop 0 0      And I run these commands as root:               mount --all     apt-cdrom add --no-mount --cdrom /mnt/apt      I expected the disk to be added as APT source, but nothing happens. What's missing? **UPDATE** : I followed this advice and now I'm getting this:               Using CD-ROM mount point /media/cdrom/     Identifying.. [61c5dd7c11a32dc999e655c235cd698e-2]     Scanning disc for index files..     Found 0 package indexes, 0 source indexes, 0 translation indexes and 0 signatures     W: Failed to mount '/dev/sr0' to '/media/cdrom/'     E: Unable to locate any package files, perhaps this is not a Debian Disc or the wrong architecture?      This happens with or without " **/etc/apt/apt.conf** " changes.


Video playlists with start and end times

Is there a good GUI-application (for example an mplayer GUI or something like banshee) for linux which allows to make and edit playlists (for video files) with different starting and stopping times for each video on the list? **Added** : At the moment I make manually files which contain something like that:               video.avi -ss 2440 -endpos 210     #some comment          video2.mp4 -ss 112 -endpos 2112      Then I have a wrapper script for: `mplayer -fs $(grep -v "^ #" $1)` Furthermore I have written some emacs functions which simplify the editing of such files a little bit. (Like converting starting and end time from hh:mm:ss format to seconds and endtime to relative position (endtime - starttime) as required by -endpos (I can post the macros if someone is interested). However, that's still too uncomfortable. So my question is if there is a nice GUI for doing this (for example which allows you to mark in a video timeline the start and end times for the playlist and so on).


accessing substrings from lines in a text file and storing them

I have a text file like this               chr1:16840617-16840780    RNU1-1             (2 columns are tab separated)     chr3:142139047-142139211    RNU1-100P     ............     ............      I want to loop over the lines of text file and save column 1 and column 2 in sep variables, something like this :               OLDIFS=$IFS; IFS=$'\n'; for line in $(cat test.txt);do LOC="save location";NAME="save name";done      After saving name and location I have to do couple of steps more to get my desired output but as of now I want to store them.


hibernate to disk not restoring, but suspend to ram is working

I have Debian 6, I have also seen this under Ubuntu (can not remember how I fixed it). I can hibernate, but when I switch on the system cold boots (it does not restore previous session). * * * _**Note suspend works fine._** Have looked in `/var/log/pm-suspend.log` Shows for each `suspend suspend` block a `resume suspend` block, but `hibernate hibernate' is not followed by`resume hibernate` ( I assume that is what is expected. * * * Installed package hibernate, as was thinking it may be needed, but made no difference. * * * I just started looking and can't find `/usr/lib/hal/scripts/linux/hal-system- power-hibernate-linux` or `/usr/lib/hal` I searched for power files (is it all there?:               find /usr/lib -iname "*power*"     /usr/lib/libupower-glib.so.1     /usr/lib/klibc/bin/poweroff     /usr/lib/python2.6/dist-packages/axiom/test/test_powerup.pyc     /usr/lib/python2.6/dist-packages/axiom/test/test_powerup.py     /usr/lib/upower     /usr/lib/upower/upowerd     /usr/lib/libupower-glib.so.1.0.1     /usr/lib/gnome-power-manager     /usr/lib/pymodules/python2.6/OpenGL/raw/GL/ARB/texture_non_power_of_two.pyc     /usr/lib/pymodules/python2.6/OpenGL/raw/GL/ARB/texture_non_power_of_two.py     /usr/lib/pymodules/python2.6/OpenGL/GL/ARB/texture_non_power_of_two.pyc     /usr/lib/pymodules/python2.6/OpenGL/GL/ARB/texture_non_power_of_two.py     /usr/lib/pymodules/python2.6/coherence/upnp/services/servers/switch_power_server.py     /usr/lib/pymodules/python2.6/coherence/upnp/services/servers/switch_power_server.pyc     /usr/lib/pymodules/python2.6/coherence/upnp/services/clients/switch_power_client.pyc     /usr/lib/pymodules/python2.6/coherence/upnp/services/clients/test/test_switch_power_client.py     /usr/lib/pymodules/python2.6/coherence/upnp/services/clients/test/test_switch_power_client.pyc     /usr/lib/pymodules/python2.6/coherence/upnp/services/clients/switch_power_client.py     /usr/lib/pymodules/python2.6/coherence/upnp/core/xml-service-descriptions/SwitchPower1.xml     /usr/lib/pm-utils/power.d     /usr/lib/pm-utils/power.d/sched-powersave     /usr/lib/pm-utils/sleep.d/00powersave     /usr/lib/rhythmbox/plugins/power-manager     /usr/lib/rhythmbox/plugins/power-manager/libpower-manager.so     /usr/lib/rhythmbox/plugins/power-manager/power-manager.rb-plugin


How can I recover deleted data from a partition

I want to recover deleted data from a partition with the help of a Python program. I know that on deletion, only the inode information of that file is deleted, but the bits are not overwritten by zeroes on deletion. However, how do I access the partition and retrieve data from there? I want to deal with file deletion. I am using ext4 filesystem. This is part of an assignment in a course called Cyber Forensics. However, my teacher doesn't know how to perform this task. We are being asked to use ready-made tools for recovery, which doesn't make any sense for us as students, as we don't get to see the source. So, I want to be able to write an equivalent recovery tool.


Is nameif deprecated? If so is there an equivalent replacement?

I read that the `nameif` is deprecated, although I still see it on my Ubuntu 14.04 system. If this command is deprecated, is the command cited for removal or will it still be available? This command is extremely useful when trying to make consistent interface names particularly when your NIC's are constantly changing. Modifying udev (`/etc/udev/rules.d/70-persistent-net.rules`) is only useful when your NIC configuration is static. In my case, the NIC's on my system are changing as it is a test bed and I have a startup script which reads the system mac addresses and NIC mac addresses, generates `/etc/mactab` file and runs `nameif` to make my interface names consistent. It seems that `ip link` command is the replacement for `nameif` although it only seems to change interface names based on another interface name: `ip link set { dev DEVICE } [ name NEWNAME ]` This is not as friendly because first you have to find the mapping between mac address and interface name, and then perform your changes (see `ip link help`). **Is there a replacement command like`nameif` where the interface name can be set on the fly by the mac address? If not, is it ok to continue to use `nameif`?**


application to see the cpu architecture in a figure

I remember there was an application that showed, in the console, or in a simple picture, the memory architecture of the system: what caches were shared by which processors, etc. but I can't remember that command. Does any of you remember off the top of your head?