title: Bash script for automatic tar backup of chosen files and directories

text: Within a given directory in linux environment, I need to pick all _files_ modified after a certain date (let's say 7 days) as well as all _directories_ (only in root directory, hence non recursively) created after the same date. After that, I have to take care of 3 directories which except the last given rule. For these, the process has to be recursive within each of them. In one of these directories, there's a file to be excluded no matter what. Finally, I have to add all the objects matching these patterns to a single .tar archive. Every file/directory must of course keep full relative path within the .tar file (starting from base directory). So let's assume we have:               myHome     |-- normalDir1                  //  older than 7 days     |   |-- blah.txt     |   |-- to_be_excluded_nmw.txt  //  should never be included anyways     |   `-- poems.txt     |-- normalDir2                  //  created yesterday     |   |-- blah2.txt               /*     |   |-- whatever2.txt            *  Since it's a normal directory,     |   |-- whatever3.txt            *  I want to exclude these files from .tar     |   `-- poems2.txt               */       |-- exceptionDirectory1         //  older than 7 days     |   |-- actions                 //  older than 7 days     |   |   `-- power.sh            //  older than 7 days     |   `-- events                  //  older than 7 days     |       |-- deploy.php          //  older than 7 days     |       `-- set.php             //  older than 7 days     |-- exceptionDirectory2         //  older than 7 days     |   |-- actions2     |   |   `-- power2.sh           //  created yesterday     |   `-- events2                 //  older than 7 days     |       |-- deploy2.php         //  created yesterday     |       `-- set2.php            //  older than 7 days     |-- file_to_be_updated.php      //  created yesterday     `-- file_NOT_to_be_updated.php  //  older than 7 days      the resulting .tar should contain:               ./normalDir2/     ./exceptionDirectory2/actions2/power2.sh     ./exceptionDirectory2/events2/deploy2.php     ./file_to_be_updated.php      I've created this script:               #!/bin/bash     TODAY=`date --rfc-3339=date`     FILENAME=$TODAY-package.tar     find ./require ! -name db_connection.php         ! -path ./require -mtime -7 -print | xargs tar cvf `date --rfc-3339=date`-package.tar     find ./img                                       ! -path ./img     -mtime -7 -print | xargs tar uvf `date --rfc-3339=date`-package.tar     find ./plugin                                    ! -path ./plugin  -mtime -7 -print | xargs tar uvf `date --rfc-3339=date`-package.tar     find . -maxdepth 1 ! -name $TODAY-package.tar.gz ! -path .         -mtime -7 -print | xargs tar uvf `date --rfc-3339=date`-package.tar      but it doesn't seem to work properly as it quits almost immediately with this error:               tar: ./img: Impossibile open: Is a directory      Notice "require", "img" and "plugin" being the three special directories to be treated recursively. What's wrong with the script? Thank you for your assistance.


title: When does `ls -s` print "0"

text: Of course, the standard way of testing if a file is empty is with `test -s FILE`, but one of our clients have received a script containing tests like this:               RETVAL=`ls -s ./log/cr_trig.log | awk '{print $1}'`     if test $RETVAL -ne 0     then         echo "Badness: Log not empty"         exit 25     fi      with claims from the supplier that it works in the two environments that they have tested it in. Needless to say, it failed badly on both two places that I tested it. So, I got curious. When does `ls -s` print `0` for empty files? This is my findings so far:   * GFS on Linux: 4    * ext4 on Linux: 0    * ZFS on Solaris: 1    * UFS on Solaris: 0    * jfs on AIX : 0   * VxFS on HP-UX: 0   * HFS on HP-UX: 0   * HFS on Mac OS X: 0 I haven't examined networked file systems yet. Question: How can I elegantly explain to the others that their scripts are _wrong_ ? In my opinion, the "correct" version would be:               if test ! -s ./log/cr_trig.log     then         echo "Badness: Log not empty"         exit 25     fi


title: Fix error in mp3 file

text: I have an `mp3` file that plays OK on computer but there is a problem to play it on `mp3 player`. ffmpeg shows this:               $ ffmpeg -i file.mp3     [mp3 @ 0x8de72a0] Invalid size in frame , skipping the rest of tag.     [mp3 @ 0x8de72a0] max_analyze_duration reached     [mp3 @ 0x8de72a0] Estimating duration from bitrate, this may be inaccurate     Input #0, mp3, from 'file.mp3':       Duration: 00:27:44.50, start: 0.000000, bitrate: 55 kb/s         Stream #0.0: Audio: mp3, 22050 Hz, mono, s16, 56 kb/s      Can I fix this problem with some utility? like `ffmpeg` or `mencoder`?


title: python-pam not working... How to dig for the error?

text: I have a django application where users should be able to login according to the system's shadow database. I found this login backend which uses python- pam, as far as I can tell. While installing the former makes the login work on my local machine (Arch linux) it doesn't on the server where I want the application to run (Debian Squeeze). The thing is, I don't know how to dig for the error. The authentication just returns false and I cannot find any log files for the PAM library on the system. Where would you start to dig? Update: I found that /var/log/auth.log is used by pam. The following appears when trying to login. (oli is my username):               Jan  4 15:09:13 pc13620 python: pam_tally(login:auth): unknown option: pam_faildelay.so     Jan  4 15:09:13 pc13620 python: pam_tally(login:auth): unknown option: delay=3000000     Jan  4 15:09:13 pc13620 python: pam_tally(login:auth): Error opening /var/log/faillog for update     Jan  4 15:09:13 pc13620 unix_chkpwd[8070]: check pass; user unknown     Jan  4 15:09:13 pc13620 unix_chkpwd[8070]: password check failed for user (oli)     Jan  4 15:09:13 pc13620 python: pam_unix(login:auth): authentication failure; logname=  uid=33 euid=33 tty= ruser= rhost=  user=oli     Jan  4 15:09:13 pc13620 unix_chkpwd[8071]: check pass; user unknown     Jan  4 15:09:13 pc13620 unix_chkpwd[8071]: password check failed for user (oli)


title: How do I extract with tar to a different directory?

text: This doesn't work:               tar xf /tmp/foo.tar.gz foo/bar     tar: foo/bar: Not found in archive      It's not obvious to me what would do this beyond extracting it in place and moving the files over.


title: Shockwave for Linux: The status today

text: I cannot for example, run this educational simulation in FF 7.01 Kubuntu 11.04 64-bit. Oh how Macromedia deprives us! I tried Gnash GNU but it doesn't seem to work... I and hundreds of thousands of users lament Macromedia's lack of support for Linux. Why are some companies like Oracle and Nvidia steadfastly committed to providing Linux support while Macromedia, despite calls to support Linux, remain stubbornly opposed? Even if they claim it is not financially viable, there is no excuse not to provide OS-independent support for Mozilla, or disclose source for the opensource community and we will happily do it on behalf of Macromedia. What is the status today, and what are practical solutions for those left out in the cold?


title: I need to transfer a very large folder over FTP, without creating a file first

text: I am running an Amazon EC2 instance that is limited in disk space. I have a very large folder that I need to FTP to my local machine, preferably without creating an intermediate tar file, since there might not be enough disk space. Can I use a pipe for this? If so, can someone help me with the command? **Note** While FTP isn't the best way of transferring the files, is my only option in this case.


title: Installing Arch Linux alongside OS X - Bootloader issues

text: I have installed Arch Linux alongside my OS X install on my MBP 11,1 using the guide found here, however on the last three commands of the boot loader section I get the error `/usr/sbin/grub2-probe: error: failed to get canonical path of 'rootfs'` Thus when I attempt to boot my Linux partition I get the error `error: file '/vmlinuz-linux' not found. out of range pointer 0x20` Here is my partition setup: `/dev/disk0 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *121.3 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_CoreStorage 80.7 GB disk0s2 3: Apple_Boot Recovery HD 650.0 MB disk0s3 4: Apple_HFS disk0s4 134.2 MB disk0s4 5: 0FC63DAF-8483-4772-8E79-3D69D8477DE4 209.7 MB disk0s5 6: 0FC63DAF-8483-4772-8E79-3D69D8477DE4 12.9 GB disk0s6 7: 0FC63DAF-8483-4772-8E79-3D69D8477DE4 26.4 GB disk0s7 /dev/disk1 #: TYPE NAME SIZE IDENTIFIER 0: Apple_HFS OS X *80.3 GB disk1` Anyone know how I can fix my bootloader setup to work? Or a different setup that would be better suited for my setup?


title: Problem with executing Firefox version 9.0.1

text: I cannot run firefox version 9.0.1. When i try to execute the binary `firefox` I get an error `-bash: ./firefox: cannot execute binary file`. The info returned by `file` is as follows:               firefox: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),     dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped      The system info returned by `uname -r` is:               2.6.37      It might be worth mentioning that I do not have administrator rights on this machine (I have a shell account). I am downloading the file from the following web page: http://www.mozilla.org/en-US/firefox/all.html (file name `firefox-9.0.1.tar.bz2`) Then I am extracting the file into my home folder using `tar xvf firefox-9.0.1.tar.bz2`. Then I go into the `firefox` directory and try to execute by typing `./firefox`. After that I get the aforementioned error. The file `firefox` of course have the rights to be executed (`x`). Does anyone have any idea why I cannot execute the browser?


title: Problem with meta key on Emacs

text: I have a problem with meta key in Emacs. I trying to use M-> or M-< but in fedora meta key is left Alt that is key change layout (alt+shift) when i press M->(alt+shift+>). How people solve this problem? (Conflict key problem)


title: How to edit authorized_keys?

text: What is the best method for editing the `/root/.ssh/authorized_keys` file? I mean if I need to append a new key to my `authorized_keys` file, than what are the best methods to do that?


title: How to start an application on a different workspace?

text: I need to start a GUI application [Lotus Symphony] on a workspace different from the currently used one. [ex.: there are 4 workspaces on a GNOME desktop.] Q: How do I do this? p.s.: It's needed because Lotus Symphony's first start after a reboot is very, very slow, but after it's been used once, it starts very quickly. I think it caches itself. That's why I want to start it at every boot on a different workspace, so it will be fast later if I need to use it.


title: su - username -c "./script.sh" -> no such file or directory

text: We have:   1. a user nico.   2. a folder `/home/nico/script_home` with some bash scripts:     1. `main.sh`     2. `subscripta.sh`     3. `sqlscripta.sh`   3. We connect as root and cd `/home/nico/script_home/`   4. Finally we run `./main.sh` We get as a result:   1. `subscripta.sh` - no such file or directory   2. The sql script works fine I noticed that `su - nico -c "pwd"` returns `/home/nico/` So I tried changing `main.sh` to `./script_home/subscripta.sh` but to no avail. What is the right syntax to avoid the no such file or directory error when running a script with su -?               #main.sh     su - nico -c "./subscripta.sh"     su - nico -c "sqlplus username/pass@some_oracle_db @script_home/sqlscripta.sql"


title: Giving some users only SSH and shell access with limited resource usage

text: I'm trying to make a user that can access my server through SSH and allow it to have a shell, limited to using only, say screen and irssi. And it shouldn't it be able to see other directories except it's home folder and sub directories within it. And the usage of memory/cpu should be limited to a certain amount. How should I go about implementing it on a Centos 6.1 server?


title: Fastest way to get list of all file sizes

text: I'm trying to create a graph of the distribution of file sizes on my ext4 system. I'm trying to write a script to scrape this information from my computer somehow. I don't care where the files are stored in the directory structure, only how much space each takes up. I know file sizes are stored in the inode metadata, and it seems like it might be pretty fast to read through the inode table, if such a thing exists. Does anyone know of a C API for accessing the size of files, or reading directly from the inode table? Does anyone know where the inode table is stored?


title: Install Rails on linux

text: I am trying to install Ruby on Rails and I have followed the following link for the install https://www.digitalocean.com/community/articles/how-to- install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm. This link was helpful; I was able to run it, and everything, however as soon has I restarted the computer I then go into my apps and run it again with rails and this message occurs.               The program 'rails' is currently not installed.  You can install it by typing:     sudo apt-get install rails      But work before, what should I do, do I need to set the path of somesort? I am not that great in Linux so bear with me. I am using Ubuntu 12.04 desktop and my user is `john`.


title: Debian 7 black screen after loading OS

text: I have laptop Sony Vaio VPCCA with Debian Wheezy(7.1) installed as second OS. It worked fine for few weeks but now if I try to start Debian, there is all the loading stuff and when the GUI should start, the screen just goes black. Somebody has recomended me to check the `/var/log/X*log` file in recovery mode but I didn't find anything bad in it. Here's the `/var/log/X*log`               [    34.965]      X.Org X Server 1.12.4     Release Date: 2012-08-27     [    34.965] X Protocol Version 11, Revision 0     [    34.965] Build Operating System: Linux 3.10-3-amd64 x86_64 Debian     [    34.965] Current Operating System: Linux debian-vaico 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64     [    34.965] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.2.0-4-amd64 root=UUID=a5652e6e-7a3f-4b9e-a33e-b2000ae46c1e ro quiet     [    34.965] Build Date: 21 October 2013  04:49:48PM     [    34.965] xorg-server 2:1.12.4-6+deb7u1 (Moritz Muehlenhoff <jmm@debian.org>)      [    34.965] Current version of pixman: 0.26.0     [    34.965]    Before reporting problems, check http://wiki.x.org         to make sure that you have the latest version.     [    34.965] Markers: (--) probed, (**) from config file, (==) default setting,         (++) from command line, (!!) notice, (II) informational,         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.     [    34.965] (==) Log file: "/var/log/Xorg.0.log", Time: Sun Dec 15 09:28:41 2013     [    35.100] (==) Using config file: "/etc/X11/xorg.conf"     [    35.100] (==) Using system config directory "/usr/share/X11/xorg.conf.d"     [    35.273] (==) ServerLayout "aticonfig Layout"     [    35.273] (**) |-->Screen "aticonfig-Screen[0]-0" (0)     [    35.273] (**) |   |-->Monitor "aticonfig-Monitor[0]-0"     [    35.274] (**) |   |-->Device "aticonfig-Device[0]-0"     [    35.274] (==) Automatically adding devices     [    35.274] (==) Automatically enabling devices     [    35.458] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.     [    35.458]    Entry deleted from font path.     [    35.483] (WW) The directory "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" does not exist.     [    35.483]    Entry deleted from font path.     [    35.483] (==) FontPath set to:         /usr/share/fonts/X11/misc,         /usr/share/fonts/X11/100dpi/:unscaled,         /usr/share/fonts/X11/75dpi/:unscaled,         /usr/share/fonts/X11/Type1,         /usr/share/fonts/X11/100dpi,         /usr/share/fonts/X11/75dpi,         built-ins     [    35.483] (==) ModulePath set to "/usr/lib/xorg/modules"     [    35.483] (II) The server relies on udev to provide the list of input devices.         If no devices become available, reconfigure udev or disable AutoAddDevices.     [    35.483] (II) Loader magic: 0x7fc315dfeae0     [    35.483] (II) Module ABI versions:     [    35.483]    X.Org ANSI C Emulation: 0.4     [    35.483]    X.Org Video Driver: 12.1     [    35.483]    X.Org XInput driver : 16.0     [    35.483]    X.Org Server Extension : 6.0     [    35.485] (--) PCI:*(0:1:0:0) 1002:6760:104d:9081 rev 0, Mem @ 0xe0000000/268435456, 0xf7e20000/131072, I/O @ 0x0000d000/256, BIOS @ 0x????????/131072     [    35.485] (II) Open ACPI successful (/var/run/acpid.socket)     [    35.485] (II) "extmod" will be loaded by default.     [    35.485] (II) "dbe" will be loaded by default.     [    35.485] (II) "glx" will be loaded by default.     [    35.485] (II) "record" will be loaded by default.     [    35.485] (II) "dri" will be loaded by default.     [    35.485] (II) "dri2" will be loaded by default.     [    35.485] (II) LoadModule: "extmod"     [    35.690] (II) Loading /usr/lib/xorg/modules/extensions/libextmod.so     [    35.729] (II) Module extmod: vendor="X.Org Foundation"     [    35.729]    compiled for 1.12.4, module version = 1.0.0     [    35.729]    Module class: X.Org Server Extension     [    35.729]    ABI class: X.Org Server Extension, version 6.0     [    35.729] (II) Loading extension SELinux     [    35.729] (II) Loading extension MIT-SCREEN-SAVER     [    35.729] (II) Loading extension XFree86-VidModeExtension     [    35.729] (II) Loading extension XFree86-DGA     [    35.730] (II) Loading extension DPMS     [    35.730] (II) Loading extension XVideo     [    35.730] (II) Loading extension XVideo-MotionCompensation     [    35.730] (II) Loading extension X-Resource     [    35.730] (II) LoadModule: "dbe"     [    35.730] (II) Loading /usr/lib/xorg/modules/extensions/libdbe.so     [    35.752] (II) Module dbe: vendor="X.Org Foundation"     [    35.752]    compiled for 1.12.4, module version = 1.0.0     [    35.752]    Module class: X.Org Server Extension     [    35.752]    ABI class: X.Org Server Extension, version 6.0     [    35.752] (II) Loading extension DOUBLE-BUFFER     [    35.752] (II) LoadModule: "glx"     [    35.752] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so     [    36.010] (II) Module glx: vendor="X.Org Foundation"     [    36.010]    compiled for 1.12.4, module version = 1.0.0     [    36.010]    ABI class: X.Org Server Extension, version 6.0     [    36.010] (==) AIGLX enabled     [    36.013] (II) Loading extension GLX     [    36.013] (II) LoadModule: "record"     [    36.014] (II) Loading /usr/lib/xorg/modules/extensions/librecord.so     [    36.031] (II) Module record: vendor="X.Org Foundation"     [    36.031]    compiled for 1.12.4, module version = 1.13.0     [    36.031]    Module class: X.Org Server Extension     [    36.031]    ABI class: X.Org Server Extension, version 6.0     [    36.031] (II) Loading extension RECORD     [    36.031] (II) LoadModule: "dri"     [    36.031] (II) Loading /usr/lib/xorg/modules/extensions/libdri.so     [    36.063] (II) Module dri: vendor="X.Org Foundation"     [    36.063]    compiled for 1.12.4, module version = 1.0.0     [    36.063]    ABI class: X.Org Server Extension, version 6.0     [    36.063] (II) Loading extension XFree86-DRI     [    36.063] (II) LoadModule: "dri2"     [    36.063] (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so     [    36.064] (II) Module dri2: vendor="X.Org Foundation"     [    36.064]    compiled for 1.12.4, module version = 1.2.0     [    36.064]    ABI class: X.Org Server Extension, version 6.0     [    36.064] (II) Loading extension DRI2     [    36.064] (II) LoadModule: "fglrx"     [    36.064] (II) Loading /usr/lib/xorg/modules/drivers/fglrx_drv.so     [    36.374] (II) Module fglrx: vendor="FireGL - AMD Technologies Inc."     [    36.374]    compiled for 1.4.99.906, module version = 12.10.5     [    36.374]    Module class: X.Org Video Driver     [    36.375] (II) Loading sub module "fglrxdrm"     [    36.375] (II) LoadModule: "fglrxdrm"     [    36.375] (II) Loading /usr/lib/xorg/modules/linux/libfglrxdrm.so     [    36.406] (II) Module fglrxdrm: vendor="FireGL - AMD Technologies Inc."     [    36.406]    compiled for 1.4.99.906, module version = 12.10.5     [    36.406] (II) AMD Proprietary Linux Driver Version Identifier:12.10.05     [    36.406] (II) AMD Proprietary Linux Driver Release Identifier: 12.104                                    [    36.406] (II) AMD Proprietary Linux Driver Build Date: Mar 28 2013 21:07:25     [    36.406] (++) using VT number 7          [    36.416] (WW) Falling back to old probe method for fglrx     [    36.612] (II) Loading PCS database from /etc/ati/amdpcsdb /etc/ati/amdpcsdb.default     [    36.632] ukiDynamicMajor: found major device number 252     [    36.632] ukiDynamicMajor: found major device number 252     [    36.632] ukiOpenByBusid: Searching for BusID PCI:1:0:0     [    36.632] ukiOpenDevice: node name is /dev/ati/card0     [    36.632] ukiOpenDevice: open result is 8, (OK)     [    37.447] ukiOpenByBusid: ukiOpenMinor returns 8     [    37.447] ukiOpenByBusid: ukiGetBusid reports PCI:1:0:0     [    37.540] (--) Chipset Supported AMD Graphics Processor (0x6760) found     [    37.551] (WW) fglrx: No matching Device section for instance (BusID PCI:0@1:0:1) found     [    37.552] (II) AMD Video driver is running on a device belonging to a group targeted for this release     [    37.552] (II) AMD Video driver is signed     [    37.553] (II) fglrx(0): pEnt->device->identifier=0x7fc31790ba10     [    37.553] (II) fglrx(0): === [xdl_xs112_atiddxPreInit] === begin     [    37.553] (II) Loading sub module "vgahw"     [    37.553] (II) LoadModule: "vgahw"     [    37.553] (II) Loading /usr/lib/xorg/modules/libvgahw.so     [    37.573] (II) Module vgahw: vendor="X.Org Foundation"     [    37.573]    compiled for 1.12.4, module version = 0.1.0     [    37.573]    ABI class: X.Org Video Driver, version 12.1     [    37.573] (**) fglrx(0): Depth 24, (--) framebuffer bpp 32     [    37.573] (II) fglrx(0): Pixel depth = 24 bits stored in 4 bytes (32 bpp pixmaps)     [    37.573] (==) fglrx(0): Default visual is TrueColor     [    37.573] (**) fglrx(0): Option "DPMS" "true"     [    37.573] (==) fglrx(0): RGB weight 888     [    37.573] (II) fglrx(0): Using 8 bits per RGB      [    37.573] (==) fglrx(0): Buffer Tiling is ON     [    37.574] (II) Loading sub module "fglrxdrm"     [    37.574] (II) LoadModule: "fglrxdrm"     [    37.574] (II) Loading /usr/lib/xorg/modules/linux/libfglrxdrm.so     [    37.574] (II) Module fglrxdrm: vendor="FireGL - AMD Technologies Inc."     [    37.574]    compiled for 1.4.99.906, module version = 12.10.5     [    37.578] ukiDynamicMajor: found major device number 252     [    37.578] ukiDynamicMajor: found major device number 252     [    37.578] ukiOpenByBusid: Searching for BusID PCI:1:0:0     [    37.578] ukiOpenDevice: node name is /dev/ati/card0     [    37.578] ukiOpenDevice: open result is 11, (OK)     [    37.578] ukiOpenByBusid: ukiOpenMinor returns 11     [    37.578] ukiOpenByBusid: ukiGetBusid reports PCI:1:0:0     [    37.578] (**) fglrx(0): NoAccel = NO     [    37.578] (**) fglrx(0): AMD 2D Acceleration Architecture enabled     [    37.578] (--) fglrx(0): Chipset: "AMD Radeon HD 6400M Series" (Chipset = 0x6760)     [    37.578] (--) fglrx(0): (PciSubVendor = 0x104d, PciSubDevice = 0x9081)     [    37.578] (==) fglrx(0): board vendor info: third party graphics adapter - NOT original AMD     [    37.578] (--) fglrx(0): Linear framebuffer (phys) at 0xe0000000     [    37.578] (--) fglrx(0): MMIO registers at 0xf7e20000     [    37.579] (--) fglrx(0): I/O port at 0x0000d000     [    37.579] (==) fglrx(0): ROM-BIOS at 0x000c0000     [    37.591] (II) fglrx(0): AC Adapter is used     [    37.620] (II) fglrx(0): Primary V_BIOS segment is: 0xc000     [    37.705] (II) Loading sub module "vbe"     [    37.705] (II) LoadModule: "vbe"     [    37.706] (II) Loading /usr/lib/xorg/modules/libvbe.so     [    37.719] (II) Module vbe: vendor="X.Org Foundation"     [    37.719]    compiled for 1.12.4, module version = 1.1.0     [    37.719]    ABI class: X.Org Video Driver, version 12.1     [    37.720] (II) fglrx(0): VESA BIOS detected     [    37.720] (II) fglrx(0): VESA VBE Version 3.0     [    37.720] (II) fglrx(0): VESA VBE Total Mem: 16384 kB     [    37.721] (II) fglrx(0): VESA VBE OEM: AMD ATOMBIOS     [    37.721] (II) fglrx(0): VESA VBE OEM Software Rev: 13.9     [    37.721] (II) fglrx(0): VESA VBE OEM Vendor: (C) 1988-2010, AMD Technologies Inc.      [    37.721] (II) fglrx(0): VESA VBE OEM Product: SEYMOUR     [    37.721] (II) fglrx(0): VESA VBE OEM Product Rev: 01.00     [    37.721] (II) fglrx(0): AMD Video BIOS revision 9 or later detected     [    37.721] (--) fglrx(0): Video RAM: 524288 kByte, Type: DDR3     [    37.721] (II) fglrx(0): PCIE card detected     [    37.721] (--) fglrx(0): Using per-process page tables (PPPT) as GART.     [    37.721] (WW) fglrx(0): board is an unknown third party board, chipset is supported     [    37.721] (II) fglrx(0): [FB] MC range(MCFBBase = 0xf00000000, MCFBSize = 0x20000000)     [    37.721] (II) fglrx(0): RandR 1.2 support is enabled!     [    37.721] (II) fglrx(0): RandR 1.2 rotation support is enabled!     [    37.721] (==) fglrx(0): Center Mode is disabled      [    37.721] (II) Loading sub module "fb"     [    37.721] (II) LoadModule: "fb"     [    37.721] (II) Loading /usr/lib/xorg/modules/libfb.so     [    37.735] (II) Module fb: vendor="X.Org Foundation"     [    37.735]    compiled for 1.12.4, module version = 1.0.0     [    37.735]    ABI class: X.Org ANSI C Emulation, version 0.4     [    37.735] (II) Loading sub module "ddc"     [    37.735] (II) LoadModule: "ddc"     [    37.735] (II) Module "ddc" already built-in     [    37.961] (II) fglrx(0): Output LVDS using monitor section aticonfig-Monitor[0]-0     [    37.961] (II) fglrx(0): Output DFP1 has no monitor section     [    37.961] (II) fglrx(0): Output CRT1 has no monitor section     [    37.961] (II) Loading sub module "ddc"     [    37.961] (II) LoadModule: "ddc"     [    37.961] (II) Module "ddc" already built-in     [    37.961] (II) fglrx(0): Connected Display0: LVDS     [    37.961] (II) fglrx(0):  Display0: Failed to get EDID information.      [    37.962] (II) fglrx(0): EDID for output LVDS     [    37.962] (II) fglrx(0): Manufacturer: AUO  Model: 223c  Serial#: 0     [    37.962] (II) fglrx(0): Year: 2010  Week: 0     [    37.962] (II) fglrx(0): EDID Version: 1.3     [    37.962] (II) fglrx(0): Digital Display Input     [    37.962] (II) fglrx(0): Max Image Size [cm]: horiz.: 31  vert.: 17     [    37.962] (II) fglrx(0): Gamma: 2.20     [    37.962] (II) fglrx(0): No DPMS capabilities specified     [    37.962] (II) fglrx(0): Supported color encodings: RGB 4:4:4 YCrCb 4:4:4      [    37.962] (II) fglrx(0): First detailed timing is preferred mode     [    37.962] (II) fglrx(0): redX: 0.590 redY: 0.345   greenX: 0.340 greenY: 0.570     [    37.962] (II) fglrx(0): blueX: 0.150 blueY: 0.120   whiteX: 0.313 whiteY: 0.329     [    37.962] (II) fglrx(0): Manufacturer's mask: 0     [    37.962] (II) fglrx(0): Supported detailed timing:     [    37.962] (II) fglrx(0): clock: 72.0 MHz   Image Size:  309 x 173 mm     [    37.962] (II) fglrx(0): h_active: 1366  h_sync: 1404  h_sync_end 1426 h_blank_end 1466 h_border: 0     [    37.962] (II) fglrx(0): v_active: 768  v_sync: 771  v_sync_end 777 v_blanking: 818 v_border: 0     [    37.962] (II) fglrx(0): Unknown vendor-specific block f     [    37.962] (II) fglrx(0):  AUO     [    37.962] (II) fglrx(0):  B140XW02 V2     [    37.962] (II) fglrx(0): EDID (in hex):     [    37.962] (II) fglrx(0):     00ffffffffffff0006af3c2200000000     [    37.962] (II) fglrx(0):     00140103801f11780a10b59758579226     [    37.962] (II) fglrx(0):     1e505400000001010101010101010101     [    37.962] (II) fglrx(0):     010101010101201c5664500032302616     [    37.962] (II) fglrx(0):     360035ad100000180000000f00000000     [    37.962] (II) fglrx(0):     00000000000000000020000000fe0041     [    37.962] (II) fglrx(0):     554f0a202020202020202020000000fe     [    37.962] (II) fglrx(0):     004231343058573032205632200a00fc     [    37.962] (II) fglrx(0): EDID vendor "AUO", prod id 8764     [    37.962] (II) fglrx(0): Printing DDC gathered Modelines:     [    37.962] (II) fglrx(0): Modeline "1366x768"x0.0   72.00  1366 1404 1426 1466  768 771 777 818 -hsync -vsync (49.1 kHz eP)     [    37.962] (II) fglrx(0): Printing probed modes for output LVDS     [    37.962] (II) fglrx(0): Modeline "1366x768"x60.0   72.00  1366 1404 1426 1466  768 771 777 818 -hsync -vsync (49.1 kHz)     [    37.962] (II) fglrx(0): Modeline "1360x768"x60.0   72.00  1360 1404 1426 1466  768 771 777 818 -hsync -vsync (49.1 kHz)     [    37.962] (II) fglrx(0): Modeline "1280x768"x60.0   72.00  1280 1404 1426 1466  768 771 777 818 -hsync -vsync (49.1 kHz)     [    37.962] (II) fglrx(0): Modeline "1280x720"x60.0   72.00  1280 1404 1426 1466  720 771 777 818 -hsync -vsync (49.1 kHz)     [    37.962] (II) fglrx(0): Modeline "1024x768"x60.0   72.00  1024 1404 1426 1466  768 771 777 818 -hsync -vsync (49.1 kHz)     [    37.962] (II) fglrx(0): Modeline "1024x600"x60.0   72.00  1024 1404 1426 1466  600 771 777 818 -hsync -vsync (49.1 kHz)     [    37.962] (II) fglrx(0): Modeline "800x600"x60.0   72.00  800 1404 1426 1466  600 771 777 818 -hsync -vsync (49.1 kHz)     [    37.962] (II) fglrx(0): Modeline "800x480"x60.0   72.00  800 1404 1426 1466  480 771 777 818 -hsync -vsync (49.1 kHz)     [    37.962] (II) fglrx(0): Modeline "640x480"x60.0   72.00  640 1404 1426 1466  480 771 777 818 -hsync -vsync (49.1 kHz)     [    37.962] (II) fglrx(0): EDID for output DFP1     [    37.962] (II) fglrx(0): EDID for output CRT1     [    37.962] (II) fglrx(0): Output LVDS connected     [    37.962] (II) fglrx(0): Output DFP1 disconnected     [    37.962] (II) fglrx(0): Output CRT1 disconnected     [    37.962] (II) fglrx(0): Using exact sizes for initial modes     [    37.962] (II) fglrx(0): Output LVDS using initial mode 1366x768     [    37.962] (II) fglrx(0): Display dimensions: (310, 170) mm     [    37.962] (II) fglrx(0): DPI set to (111, 114)     [    37.962] (II) fglrx(0): Eyefinity capable adapter detected.     [    37.963] (II) fglrx(0): Adapter AMD Radeon HD 6400M Series has 4 configurable heads and 1 displays connected.     [    37.963] (==) fglrx(0):  PseudoColor visuals disabled     [    37.963] (II) Loading sub module "ramdac"     [    37.963] (II) LoadModule: "ramdac"     [    37.963] (II) Module "ramdac" already built-in     [    37.963] (==) fglrx(0): NoDRI = NO     [    37.963] (==) fglrx(0): Capabilities: 0x00000000     [    37.963] (==) fglrx(0): CapabilitiesEx: 0x00000000     [    37.963] (==) fglrx(0): OpenGL ClientDriverName: "fglrx_dri.so"     [    37.963] (==) fglrx(0): UseFastTLS=0     [    37.963] (II) fglrx(0): Shadow Primary option: ShadowPrimary is enabled     [    37.963] (--) Depth 24 pixmap format is 32 bpp     [    37.963] (II) Loading extension ATIFGLRXDRI     [    37.963] (II) fglrx(0): doing swlDriScreenInit     [    37.963] (II) fglrx(0): swlDriScreenInit for fglrx driver     [    37.963] ukiDynamicMajor: found major device number 252     [    37.963] ukiDynamicMajor: found major device number 252     [    37.963] ukiDynamicMajor: found major device number 252     [    37.963] ukiOpenByBusid: Searching for BusID PCI:1:0:0     [    37.963] ukiOpenDevice: node name is /dev/ati/card0     [    37.963] ukiOpenDevice: open result is 12, (OK)     [    37.963] ukiOpenByBusid: ukiOpenMinor returns 12     [    37.963] ukiOpenByBusid: ukiGetBusid reports PCI:1:0:0     [    37.963] (II) fglrx(0): [uki] DRM interface version 1.0     [    37.963] (II) fglrx(0): [uki] created "fglrx" driver at busid "PCI:1:0:0"     [    37.963] (II) fglrx(0): [uki] added 8192 byte SAREA at 0x2000     [    37.963] (II) fglrx(0): [uki] mapped SAREA 0x2000 to 0x7fc315a0c000     [    37.963] (II) fglrx(0): [uki] framebuffer handle = 0x3000     [    37.963] (II) fglrx(0): [uki] added 1 reserved context for kernel     [    37.963] (II) fglrx(0): swlDriScreenInit done     [    37.963] (II) fglrx(0): Kernel Module Version Information:     [    37.963] (II) fglrx(0):     Name: fglrx     [    37.963] (II) fglrx(0):     Version: 12.10.5     [    37.963] (II) fglrx(0):     Date: Mar 28 2013     [    37.963] (II) fglrx(0):     Desc: AMD FireGL DRM kernel module     [    37.963] (II) fglrx(0): Kernel Module version matches driver.     [    37.963] (II) fglrx(0): Kernel Module Build Time Information:     [    37.963] (II) fglrx(0):     Build-Kernel UTS_RELEASE:        3.2.0-4-amd64     [    37.963] (II) fglrx(0):     Build-Kernel MODVERSIONS:        yes     [    37.963] (II) fglrx(0):     Build-Kernel __SMP__:            yes     [    37.963] (II) fglrx(0):     Build-Kernel PAGE_SIZE:          0x1000     [    37.963] (II) fglrx(0): [uki] register handle = 0x00004000     [    37.987] (II) fglrx(0): DRI initialization successfull     [    38.015] (II) fglrx(0): FBADPhys: 0xf00000000 FBMappedSize: 0x01004000


title: Error while building Linux module of a wireless driver

text: I have recently installed Debian Wheezy onto one of my old computers to test it out and to become more familiar with Unix. To my surprise I enjoy the interface very much so far, but I have run into a problem. My problem is that when I go to install my wireless driver I get an error when I type `make`. I have installed the `build-essential` and the `linux-headers` packages, but I still get the problem. My terminal looks like               root@debian:/Wireless-Driver/rtl8192u_linux_2.6.0006.1031.2008# make     make[1]: Entering directory `/usr/src/linux-headers-3.2.0-4-686-pae'     CC [M]  /Wireless-Driver/rtl8192u_linux_2.6.0006.1031.2008/ieee80211/ieee80211_rx.o     In file included from /Wireless-river/rtl8192u_linux_2.6.0006.1031.2008/ieee80211/ieee80211_rx.c:46:0:     /Wireless-Driver/rtl8192u_linux_2.6.0006.1031.2008/ieee80211/ieee80211.h:2107:24: error: field ‘ps_task’ has incomplete type         make[4]: *** [/Wireless-Driver/rtl8192u_linux_2.6.0006.1031.2008/ieee80211/ieee80211_rx.o] Error 1     make[3]: *** [_module_/Wireless-Driver/rtl8192u_linux_2.6.0006.1031.2008/ieee80211] Error 2     make[2]: *** [sub-make] Error 2     make[1]: *** [all] Error 2     make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-4-686-pae'     make: *** [all] Error 2      Sorry in advance for the horrible style. My wireless adapter is a D'link DWA 130C


title: What are the differences between socket polling mechanisms of kqueue and epolling?

text: kqueue socket polling mechanism is used in FreeBSD and epolling in Linux. I would like to know what are the differences between the two mechanisms?


title: Package `varka' not found when installing Marlin of Fedora 17

text: I'm trying to install the Marlin file browser. I've already installed many required packages but I don't know what to do about this varka error. Here is the output from cmake (the previous step) and make (the error-producing step).               [zzz@localhost build]$ cmake ..     -- checking for a minimum Vala version of 0.16.0     --   found Vala, version 0.16.1     -- checking for module 'unity>=4.0.0'     --   package 'unity>=4.0.0' not found     -- checking for a minimum Vala version of 0.11.3     --   found Vala, version 0.16.1     -- checking for a minimum Vala version of 0.16.0     --   found Vala, version 0.16.1     -- checking for a minimum Vala version of 0.16.0     --   found Vala, version 0.16.1     -- checking for a minimum Vala version of 0.12.0     --   found Vala, version 0.16.1     -- checking for a minimum Vala version of 0.16.0     --   found Vala, version 0.16.1     -- GSettings schemas will be installed locally.     -- GSettings shemas will be compiled.     -- GSettings schemas will be installed into /usr/local/share/glib-2.0/schemas/     -- GSettings schemas will be installed into /usr/local/share/glib-2.0/schemas/     -- Configuring done     -- Generating done     -- Build files have been written to: /home/eric/Downloads/marlin/build          [zzz@localhost build]$ make     [  1%] Generating LocationBar.c, BreadcrumbsElements.c, BreadcrumbsEntry.c, marlinwidgets.vapi, marlinwidgets.h, marlinwidgets_internal.h     error: Package `varka' not found in specified Vala API directories or GObject-Introspection GIR directories     Compilation failed: 1 error(s), 0 warning(s)     make[2]: *** [libwidgets/LocationBar.c] Error 1     make[1]: *** [libwidgets/CMakeFiles/marlinwidgets.dir/all] Error 2     make: *** [all] Error 2


title: Tablet evdev button event calibration

text: I have a tablet (Genius G-Pen 340 or UC-LOGIC Tablet WP4030U), it's detected and initialized as 'evdev tablet catchall'. Problem is that button event 1, simulated on axis 2, is triggered in very inconvenient way. Here is some lines from 'xinput test':               motion a[2]=6      button press   1      motion a[2]=0      button release 1       As you can see, button 1 press happens when axis 2 (Z axis) has value more than 6 and released when its less or equal 0. But that level is about 1 cm above tablet surface, so these events triggered all the time and I can't move mouse cursor without causing button events. Is there any way to calibrate event triggering threshold for axis? Thank you.


title: Is there a workaround for a lack of scheduler in qbittorrent?

text: Unlike many other torrent clients, qbittorrent comes without a scheduling tool. Ideally, one can throttle downloads over a certain time of the day, on given days. Is there a workaround for this? Is there a separate scheduling tool I can use to stage qbittorrent? If not, what would be the best scripting solution?


title: Update kernel at fedora 16 to 17 - How to remove unused files?

text: I want to update kernel at fedora 16 to 17. So I need to delete unused files.               find /etc /var -name '*?.rpm?*'      Is that enough or need more extensions?


title: Delete backward until met a char, like alt + bksp

text: Say my current line was: `/tmp/path/to/file:123` Now I'm at the end of this line, now I want to delete `:123` by pressing some key combination, was that possible? (colon was merely mentioned as an example, it could be other chars, just wondering if I could bind keys to do that) It's similar to what `alt` + `Backspace` does, but more specific on the word separator. Bash or zsh are all welcomed.


title: Partitioning a 2tb drive

text: Im new to linux Im planning to install Squeeze on a 2tb hard drive a follows:   * / - 10gb   * swap   * remaining space will contain /home, around 1.9tb i hope, i will try to use as lvm to add my old 1tb drive later My question is: do i have to use GPT? or MBR will be just fine if GPT needed this scheme is good?   * /boot - 150mb   * / - 10gb   * swap   * /home (lvm with remaining space) motherboard is an ASRock G41 btw wich i think doesnt support EFI


title: How do I find out if I am sudoer?

text: How does Linux system behave when I am not sudoer? Here is what happens if I try to use sudo:               server:/tmp>$ sudo cal     [sudo] password for user:     Sorry, try again.      Is it possible that I just don't know my password or does this mean that I am not sudoer? (On another machine system printed out that I'm no sudoer and the incident will be reported)


title: Fedora 17 Freezes on Boot

text: I have been having issues with Fedora 17 not booting after the latest round of updates. I am able to enter the pass for my disk encryption, the boot logo acts normally but after the animation is complete, the boot fails to progress further. I checked the diagnostics and it seems that there is an issue in plymouth- quit-wait.service. When I check systemctl status on this service, I am informed that the service has been loaded but timed out when start was attempted. I have tried disabling the system using systemctl disable plymouth-quit- wait.service with and without the force option, with no success. I am really lost here, I'm not even sure what exactly isn't working. What can I do to fix this issue, or at least troubleshoot it further?


title: Linux USB Boot results in black screen

text: I'm trying to install Linux alongside Windows 8 on my new Asus Zenbook UX32VD, which has both an Intel HD 4000 and a NVidia 620M I've been having quite a few problems booting up linux via USB so I can install it. So far, I've tried Linux Mint Debian edition, Crunchbang, Debian, and Ubuntu. What usually happens is that after the initial loading, I see the mouse cursor for a couple of seconds, and then the screen goes black, for good. The rest of the system seems to keep going, but I have no image whatsoever, and have to shutdown the hard way. However, in some of my attempts with Ubuntu and Mint, I managed to boot. What changed those times? I have no clue. In one of those attempts, I finished the instalation of Mint, but after rebooting to the installed system, the same problem occurred I also tried adding boot options, particularly `nomodeset`, and `i915.modeset=1 driver=intel`. The first time I tried each of them, Mint booted correctly, making me think it was the solution. But later attempts resulted in the same black screen But with Debian, it seems everything goes well, and I managed to install it. But I'm currently having some problems configuring the system, particularly the `Fn` keys (any tips on that?) So, my question is, how should I proceed in order to boot correctly, knowing that this is probably some kind of problem with detecting the graphics card? I realize that newer laptops are very likely to have problems like these, but if there's a solution for it already, I couldn't find it anywhere.


title: how to restore a logical partition to it's original ext4 format

text: This question is following Unable to mount /home/ partition after reinstalling grub after reinstalling windows 7 where the diagnostic was that installing windows 7 deleted my /home partion, lovingly call /dev/sda3. Since almost nothing have been done with this computer since the incident, we can expect that the content of the partition is still intact and that it is only unusable for the moment. The mission is to try to rescue the files that were inside this partition by restoring it to it's original ext4 format. Does anyone know how to proceed?


title: What does `*` mean using hexdump -C?

text: I've been doing an exersice in attempt to understanding some of what's going on under the hood of a program. I wrote a small C program, and compiled it on i386 Linux (Ubuntu 12.04) using `gcc`. I then did a `hexdump -C` on the output to text file. I noticed that there were some gaps on the offset with an `*`:               00000670  00 3f 1a 3b 2a 32 24 22  1c 00 00 00 40 00 00 00  |.?.;*2$"....@...|     00000680  94 fd ff ff 05 01 00 00  00 41 0e 08 85 02 42 0d  |.........A....B.|     00000690  05 03 01 01 c5 0c 04 04  38 00 00 00 60 00 00 00  |........8...`...|     000006a0  80 fe ff ff 61 00 00 00  00 41 0e 08 85 02 41 0e  |....a....A....A.|     000006b0  0c 87 03 41 0e 10 86 04  41 0e 14 83 05 4e 0e 30  |...A....A....N.0|     000006c0  02 4a 0e 14 41 0e 10 c3  41 0e 0c c6 41 0e 08 c7  |.J..A...A...A...|     000006d0  41 0e 04 c5 10 00 00 00  9c 00 00 00 b4 fe ff ff  |A...............|     000006e0  02 00 00 00 00 00 00 00  10 00 00 00 b0 00 00 00  |................|     000006f0  a2 fe ff ff 04 00 00 00  00 00 00 00 00 00 00 00  |................|     00000700  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|     *     00000f10  00 00 00 00 ff ff ff ff  00 00 00 00 ff ff ff ff  |................|     00000f20  00 00 00 00 00 00 00 00  01 00 00 00 10 00 00 00  |................|     00000f30  0c 00 00 00 d4 82 04 08  0d 00 00 00 cc 85 04 08  |................|     00000f40  f5 fe ff 6f ac 81 04 08  05 00 00 00 2c 82 04 08  |...o........,...|     00000f50  06 00 00 00 cc 81 04 08  0a 00 00 00 54 00 00 00  |............T...|     00000f60  0b 00 00 00 10 00 00 00  15 00 00 00 00 00 00 00  |................|     00000f70  03 00 00 00 f4 9f 04 08  02 00 00 00 20 00 00 00  |............ ...|     00000f80  14 00 00 00 11 00 00 00  17 00 00 00 b4 82 04 08  |................|     00000f90  11 00 00 00 ac 82 04 08  12 00 00 00 08 00 00 00  |................|     00000fa0  13 00 00 00 08 00 00 00  fe ff ff 6f 8c 82 04 08  |...........o....|     00000fb0  ff ff ff 6f 01 00 00 00  f0 ff ff 6f 80 82 04 08  |...o.......o....|     00000fc0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|     *     00000ff0  00 00 00 00 28 9f 04 08  00 00 00 00 00 00 00 00  |....(...........|     00001000  26 83 04 08 36 83 04 08  46 83 04 08 56 83 04 08  |&...6...F...V...|     00001010  00 00 00 00 00 00 00 00  47 43 43 3a 20 28 55 62  |........GCC: (Ub|     00001020  75 6e 74 75 2f 4c 69 6e  61 72 6f 20 34 2e 36 2e  |untu/Linaro 4.6.|     00001030  33 2d 31 75 62 75 6e 74  75 35 29 20 34 2e 36 2e  |3-1ubuntu5) 4.6.|     00001040  33 00 00 2e 73 79 6d 74  61 62 00 2e 73 74 72 74  |3...symtab..strt|     00001050  61 62 00 2e 73 68 73 74  72 74 61 62 00 2e 69 6e  |ab..shstrtab..in|     00001060  74 65 72 70 00 2e 6e 6f  74 65 2e 41 42 49 2d 74  |terp..note.ABI-t|     00001070  61 67 00 2e 6e 6f 74 65  2e 67 6e 75 2e 62 75 69  |ag..note.gnu.bui|     00001080  6c 64 2d 69 64 00 2e 67  6e 75 2e 68 61 73 68 00  |ld-id..gnu.hash.|     00001090  2e 64 79 6e 73 79 6d 00  2e 64 79 6e 73 74 72 00  |.dynsym..dynstr.|      My question is, how should I interpret the `*`? I assume it means there's a gap in the file, but then the question turns to why does a gap exist? Is this part of the standard format of an ELF file?


title: Can't read a file although it's in my group and permissions for group read are set

text: I encounter a strange problem on a unix/linux machine: I'm member of a group, let's call it group A and a certain file (which has a different owner) belongs to group A as well. The permissions of that file are               -rw-rw----      so I'd expect I should be able to open that file, but I am not: I'll get the "Permission denied" error message when I try to look at the file's content (using cat). Since the permissions seem to be correct, what else could be causing this? Are there "overriding" permission restrictions in place? If so, how would I find out?


title: Are the SSH manual pages wrong?

text: The ssh manual pages states the following:                -L [bind_address:]port:host:hostport              Specifies that the given port on the local (client) host is to be              forwarded to the given host and port on the remote side.            -R [bind_address:]port:host:hostport              Specifies that the given port on the remote (server) host is to              be forwarded to the given host and port on the local side.      Aren't those two descriptions mixed up? When I use `ssh -L` it takes a remote port and "binds" (or forwards) it to a port on my local machine so that I can talk to some remote machine by talking to myself (localhost:port). When I use `ssh -R` it takes a port from a computer on my local network and "binds" (or forwards) it to a port on the remote machine (ssh server). Then when I'm on the server, I can talk to the port of a computer on the same network as the computer that I just connected from using (localhost:port). This also explains the use of L for local and R for remote (wherever the port is being bound to). (I don't know if i'm using the word "bind" correctly. That't what I'm trying to imply with the quotes)


title: Keyboard combination to insert non keyboard characters

text: on windows one could with `Alt`+235 print ë into (any) textfield. I tried the same on linux and it seems to be not working. Depending on the application the result is different, but never the wanted one. Is there a similiar combination on linux available?


title: Sed : Delete between the first n lines the ones with a given string in them

text: I have given a string and a file. I have to delete between the first 30 lines the ones having the given string. Tried something like **`sed -i '/pattern/1,30d' filename`** Yet it gives errors. More specifically what I want is sed to analyze only the first 30 lines, and if it finds the pattern given, to delete the line.


title: FreeBSD ipfw keepstate vs setup keep-state

text: A lot of examples where people are using keep-state with setup together. For example:               ipfw add 1 allow tcp from any to me 22 setup keep-state      Because of setup, this rule will allow only SYN packets, which are first packets in TCP handshake. OK. But, why is this so necessary? Why not just using keep-state without setup? What's the profit?


I was asked to do it "Configure SSL Mutual (Two-way) Authentication" and I don't know where to start or how to test it .   server and many clients . they can access code on server only if they have a signed certificate from server . and server can generate those certificates and disable them here a tutorial but I'm so scared of losing connection with server I'm working on because it's the main server if I re-generate new keys .   do I have to be a root user ?   is there's any bash for this ?   any information would be appreciated .


title: Cannot connect to belkin router through linux mint

text: I recently installed Linux Mint 13 alongside windows 7. I have a Realtek RTL8191SEvB Wireless Card. This work's fine with any router. However when I try to connect to a Belkin G Wireless Router it constantly says the passwords or encryption type are incorrect. They are not. I can connect to the Belkin router when I start my laptop (a toshiba satelite) with windows. Any ideas?


title: Gnome Terminal---hide the tilde files produced by Emacs

text: Editing text file using Emacs will make Emacs make a companion file for its own purpose. For example, after first editing a file called `test.c`, Emacs will leave a file called `test.c~` in the same directory. This can be a little annoying when visualizing all files cluttered with the `~` files in a console Any way to get rid of seeing these `~` files in a console, like the Gnome Terminal? **Update** Thanks to @don_crisst's comment below: use `ls -B` to hide the ~ files when displaying file names. The command line switches, `-B` or `\--ignore-backups`, do not list implied entries ending with ~.


title: Quoted vs unquoted string expansion

text: 1. `for i in $(xrandr); do echo "$i" ; done`   2. `for i in "$(xrandr)"; do echo "$i"; done`   3. `for i in "$(xrandr)"; do echo $i; done` I understand why 1 differs from 2. But why does 3 give a different output from 2? Please explain the output too. How do quotes work on newlines?


title: Booting encrypted root partion fails after system update

text: I have a problem booting my Debian Linux server. After a system update, GRUB loads the initrd and the system should ask for the password, but it doesn't. Instead, I get dropped to BusyBox. After trying to mount the encrypted volume manually with `cryptsetup luksOpen`, I get this error:               device-mapper: table: 254:0: crypt: Error allocating crypto tfm     device-mapper: reload ioctl failed: Invalid argument     Failed to setup dm-crypt key mapping for device /dev/sda3     Check that the kernel supports aes-cbc-essiv:sha256 cipher (check syslog for more info).      Images


title: Run a command when system is idle and when is active again

text: I want to run a command when the user becomes inactive (the system is idle). For example:               echo "You started to be inactive."      Also, when the user becomes active again (the system is not idle anymore):               echo "You started to be active, again."      I need a shell script that will do this. Is this possible without a timer/interval? Maybe some system events?


title: How can I be sure that access to my home server from my home network is not done via Internet?

text: As advised in this question: Network file-sharing between Linux and Android, I have decided to use ownCloud to store files on my home cloud server. However, my needs have changed a bit. I want to be able to access my cloud from the Internet, not just my home network. For that, I need dynamic DNS software. I have that taken care of (domain name and everything) - I will be using DynDNS. However, when I'm at home, is it possible to configure the server/client so that when I try to access my files it is done through my home network (192.168. _._ ) and not via Internet (querying DynDNS and what not), without having to keep the system thinking that there are two different servers?


title: VLC - gapless cue support

text: Most of my music is ripped `flac`'s with `cue`'s. I listen to albums with `cue` mainly because of _last.fm_ scrobbling, but I want the same experience of gapless playback as listening to whole `flac` using VLC (I very like it's simplicity). Is there any solution for this?


title: Kill user processess on logout

text: I have a Ubuntu server that handles remote X sessions from users. However, I don't want to allow users to run any kind of background processes - so here is my question: How do I prevent users from having any background process or is there any simple way to kill processes of users that aren't logged in?


title: Using file system call

text: I'm trying to learn system calls for open,write and close a file. I use this sample and the result is:               gcc: error trying to exec 'cc1plus': execvp: No such file or directory      Here's my program:               #include <stdio.h>     #include <string.h>     #include <stdlib.h>     #include <fcntl.h>     #include <unistd.h>          int main (int argc, char *argv[])     {         int fd1;         char buf[128];         fd1 = open("Desktop/this.txt", O_WRONLY);         if (fd1 == -1) {             perror("File cannot be opened");             return EXIT_FAILURE;         }              /* Enter the data to be written into the file */         scanf("%127s", buf);              write(fd1, buf, strlen(buf)); /* fd1 is the file descriptor, buf is the character array used to      hold the data, strlen(buf) informs the function that the number of bytes equal to the length of the      string in the buffer need to be copied */              close(fdl);              return 0;     }


I'm getting the same error that other questions mention, such as:   * Installation Error: Kernel Panic - not syncing   * http://askubuntu.com/questions/41930/kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unknown-block0-0 However, I don't think their solutions would fit my scenario. This has started happening when I tried to install an Ubuntu 12.04 into a new partition (/dev/sda5). The system has two hard disks (sda and sdb), and both have already other two OSs: a Windows8 in sda, an Ubuntu 13.04 in sdb. So when I installed Ubuntu12.04 I told it to install the boot loader in sdb (thinking it would overwrite the existing one), but it failed. So I told it to use sda instead and then it apparently didn't fail. However, when starting up the computer, the previous boot I had from Ubuntu 13.04 starts, so then the entry for the new Ubuntu 12.04 was not there. Tried to start manually from the other HD (sda) and it starts Windows, so I guess the boot loader couldn't be installed anywhere in the end. So, to make the sdb bootloader recognize the new Ubuntu12.04 partition I started Ubuntu 13.04 and did `sudo update grub` from there, and this command found the new OS, and there's a new entry in grub now. But when I try to run it, I get:               error: no such device: 15ee4fac-ec5d-409b-88c2-7350e76d2e98     Press any key to continue...      Then I press a key, and then:               Kernel Panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)      The solutions that others have provided in other questions I guess that don't really apply to me because I have many partitions with different OSs, and the other questions seemed to focus on just one Linux OS, so I'm not sure I can run `update-initramfs -u -k <version>` happily, or from where to run it (LiveCD?), or how to guess the proper kernel version.


title: Xen/KVM/LXC for testing packages

text: On Debian Stable, I would like to be able to create a new instance of the OS, use apt-get to install some Unstable packages with dependencies, then cleanly delete the whole thing when I'm done. VirtualBox or QEMU would work, but Xen/KVM/LXC seem to be lighter and faster. How do they compare for this use? Edit: To clarify, in this case, I want to set up to be able to install-use- remove dangerous things without messing up the base system. Looking for what would be most lightweight/fast.


title: qmake looking for lib files named *.pc

text: I'm trying to compile some software (FocusWriter) on openSUSE 11.3, (linux 2.6.34.7-0.5-desktop). (I can't find an actual download link to the alleged openSUSE RPM...just lots of metadata about the RPMs). So I unpacked the source from git, and, following instructions, ran `qmake`. I get this:               Package ao was not found in the pkg-config search path.     Perhaps you should add the directory containing `ao.pc'     to the PKG_CONFIG_PATH environment variable     No package 'ao' found     Package hunspell was not found in the pkg-config search path.     Perhaps you should add the directory containing `hunspell.pc'     to the PKG_CONFIG_PATH environment variable     No package 'hunspell' found     Package libzip was not found in the pkg-config search path.     Perhaps you should add the directory containing `libzip.pc'     to the PKG_CONFIG_PATH environment variable     No package 'libzip' found     Package ao was not found in the pkg-config search path.     Perhaps you should add the directory containing `ao.pc'     to the PKG_CONFIG_PATH environment variable     No package 'ao' found     Package hunspell was not found in the pkg-config search path.     Perhaps you should add the directory containing `hunspell.pc'     to the PKG_CONFIG_PATH environment variable     No package 'hunspell' found     Package libzip was not found in the pkg-config search path.     Perhaps you should add the directory containing `libzip.pc'     to the PKG_CONFIG_PATH environment variable     No package 'libzip' found I know that all those packages are in fact installed, according to both YaST and zypper. `/usr/lib64/` contains files such as libao.20.2 and libzip.so.1 and libzip.so.1.0.0 -- but nowhere on the harddrive can I find anything called ao.pc, hunspell.pc, or libzip.pc. Any suggestions what I'm missing here? Thanks.


title: iptables redirect outside requests to 127.0.0.1

text: I have a service running on 127.0.0.1 with port 2222. I need to forward all requests to 192.168.2.2:2222 (outside IP) **only from** subnet 192.168.1.0/24 to 127.0.0.1:2222. I'm trying to use this, but it's not working.               $ iptables -t nat -I PREROUTING -p tcp -d 192.168.1.0/24 --dport 2222 -j DNAT --to-destination 127.0.0.1:2222      How can I get this to work? UPD: Edit address scheme.


Ok I am back to where I started now red5 is working again but have since noticed the admin jar causes the service to fail on shutdown so have removed it until can find out why. I am using RC2 on Centos 6.4 linux vps Anyway I downloaded the admin panel demo and when I go to input new user I get the following error: Error in db setup Table/View 'APPUSER' does not exist.


title: Recommendation for kernel config UEVENT_HELPER_PATH?

text: I use Gentoo Linux. Historically the kernel configuration UEVENT_HELPER_PATH to `hotplug`, then later to `udevadm`. Mine has been set to `/path/to/udevadm`, but I've had problems in the past on Gentoo because the exact location changes from time to time. Now the lvm2 package recommends removing it (set it to empty string). I can't seem to find any good explanation as to what is the best recommendation for what to set this value to. I currently have it as `/bin/udevadm`, at least until that changes again. It works now, but what happens if it is empty? Is there any authoritative discussion on what is the best practice for this? Any recommendation?


title: What is the /dev/disk/by-uuid/ and why does it use all free space on the disk

text: I have the following Debian that works in Virtual Box:               $ uname -a     Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux      Recently I notice that I don't have any free space:               $ df     Filesystem                                             1K-blocks    Used Available Use% Mounted on     rootfs                                                   1922060 1921964         0 100% /     udev                                                       10240       0     10240   0% /dev     tmpfs                                                     206128     296    205832   1% /run     /dev/disk/by-uuid/ef55765f-dae5-426f-82c4-0d98265c5f21   1922060 1921964         0 100% /     tmpfs                                                       5120       0      5120   0% /run/lock     tmpfs                                                     511980       0    511980   0% /run/shm     /dev/sda3                                                5841936  163548   5381636   3% /home     tmpfs                                                     511980      12    511968   1% /tmp      What is the /dev/disk/by-uuid/ef55765f-dae5-426f-82c4-0d98265c5f21? Why does it use all free space on the disk?


title: Find out screen id

text: I want to start a program with SSH using PHP, which works fine, but now I want to kill the screen with PHP, but the only thing I know is the name of the screen. How do I find out the screen ID (automatically)?


title: Stuck process: is it a bad sign?

text: Sometimes a few process are in a stuck state. For example:               PID    COMMAND          %CPU TIME     #TH  #WQ  #POR #MREGS RPRVT  RSHRD  RSIZE  VPRVT  VSIZE  PGRP  PPID  STATE     99357  plugin-container 0.1  12:07.07 10   1    224  2097   40M    84M    66M    82M    2757M  91688 99346 sleeping     99346  firefox          0.4  48:54.20 29   1    265  16250  467M   172M   799M   538M   4210M  91688 1     sleeping      88029- Aquamacs       1.2  31:24.12 4    3    126  268    19M    49M    32M    36M    777M   88029 152   stuck      Is it part of the normal life cycle of process ? Why this process in particular ? What does it mean exactly ?


title: Why does Linux have poor battery life by default compared to Windows?

text: Is there something inherent to Linux operating systems that makes them poor managers of battery power by default? I would have thought a light distro like Lubuntu would have a clear battery life advantage over Windows, yet this doesn't seem to be the case. Is it a hardware vendor issue - are laptops just designed to work more power efficiently with Windows OSes? For example, in my experience on the same laptop, a given linux distribution always seems to have poor battery life compared to Windows. My old laptop (a Thinkpad X61) lasted nearly half as long when booted into Lubuntu than it did when using Windows XP. On a newer model, I get a similar poor performance using Fedora 20 vs Windows 8.1.


title: How to distribute my debian system?

text: I have a Debian (Wheezy) system that I have configured by installing/removing packages and editing some conf files. I would like to distribute an (almost) exact replica of my system to others programmer on my team. My first instinct is to create an iso but I'm willing to listen to other suggestions. What's the easiest way to create an installable image of my system to replicate across several computers? **Answers I'm looking for**   * On one hand, I would like to know if there're apps that do this automatically, but I think it'd be more interesting to have a step-by-step explanation on how to do this using native Unix tools (cp? dd? cat? fdisk?)   * Making the iso bootable as LiveCD would be cool addition, but isn't really an important step.   * Bonus points if the solution is not limited to Debian only. **What I found so far**   * remastersys claims to do this, but it looks a bit outdated and unmaintained.


title: Modify /etc/xdg/lxsession/LXDE/autostart before boot

text: I have some parameters that I would like to change in `/etc/xdg/lxsession/LXDE/autostart`, before it is run. I get the parameters from a grep command. I would like to feed them to the `autostart` file but am not sure how. Currently, what I have is `grep "stuff" /file/one` which outputs 1234. I want to put 1234 in the `autostart` file like               ....     @program 1234     ....


title: CMake Error "Cannot open options file specified with @"

text: I am having trouble OpenCV with the installation of OpenCV on my machine. I run Ubuntu 12.04. When I run the `make` command, the computer returns at some point this error:               moc: Cannot open options file specified with @      and then terminates. I have also installed all the required dependencies. I know that it has to do with CMake which is used to generate the build files for OpenCV but I haven't found a way to solve it. I use an 64-bit system.


title: Moving a folder to a NAS mount

text: I currently have a small Centos VPS which has some local SSD disk - I am getting close to my storage limit as I am storing a lot of flat files which are accessed very infrequently so I am looking at getting some NAS disk and moving the files to it as it is much cheaper than getting more SSD and will still perform just as well. The challenge is I don't want to have to update all my application references to point to a new location - is there any way I can have the current folder (lets call it /home/user/public_html/folder) pointing to a new location (for example /mnt/new_folder) without having to update anything so /folder/file.doc, ../folder/file.doc or www.example.com/folder/file.doc etc will still point to the files in question? Will a symlink allow me to do that?


title: can't wget rpm oracle on centos linux

text: Forgotten how I did this last time. Tried the following 2 methods that I thought had worked for me in the past: _method #1_               $ wget \         http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.rpm      _method #2_               $ wget --no-cookies \         --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" \         "yourversion.rpm" \         -O /opt/jdk-7u51-linux-i586.rpm --no-check-certificate      But neither worked. For the time being I'll just download it the old fashion way but I'd like to be able to download it using `wget` as well.


title: Timezone setting in Linux

text: I'm setting the timezone to GMT+6 on my Linux machine by copying the zoneinfo file to `/etc/localtime`, but the `date` command is still showing the time as `UTCtime-6`. Can any one explain to me this behavior? I'm assuming the `date` command should display `UTCtime+6` time. Here are steps I'm following:               date     Wed Jan 22 17:29:01 IST 2014          date -u     Wed Jan 22 11:59:01 UTC 2014          cp /usr/share/zoneinfo/Etc/GMT+6 /etc/localtime          date     Wed Jan 22 05:59:21 GMT+6 2014          date -u     Wed Jan 22 11:59:01 UTC 2014


title: iptables rule for local network with free internet blocking unrequested connection from internet to server?

text: I have a home server (with slackware 13) with a eth0 for the local network and a eth1 for the internet (cable modem with dynamic ip). While I do want to learn more about iptables I am still on the proccess and I need some rules done and can't until a learn to do it as I dont wish my server to get compromised at this stage. I currently have a vm where I play with my rules and everything and would appreciate if some one could wrap me a firewall rule for iptables to do the below:   1. Allow all users from my dhcp server on eth0 to have full access to internet and server, in other words eth0 should have no restrictions within the network and server.   2. Allow all users to be able to create a server, for example if they are playing a game such as for example warcraft, and they create a game, the firewall should allow the negotiation of those connections to go thru.   3. Block any requests from internet to server unless it was initiated by the server or an users from the network.


title: What priorities can be used in cgroups net_prio module?

text: Cgroups has a module called `net_prio`, and by using this module I can set the priority of network traffic generated by various applications. As you can read here, this can be achieved by setting something similar to the following:               echo "eth0 5" > /sys/fs/cgroups/net_prio/iscsi/net_prio.ifpriomap      But there's no info as to what range of priorities I can use. Let's say there's a program in my system that should have the lowest network priority. What should I use in the pace of 5 ? Are the priorities similar to `nice` priorities?


title: kill process in script while writing file behavior

text: in my php script which runs as a cron job, I have               foreach($sites as $site)     {         exec('./wkhtmltoimage-amd64 ' . $site . ' somefile.png');         exec('./zopflipng -y somefile.png somefile.png');     }      to generate screenshots monthly for each site. Now, this cron job runs once a month, and in the unlikely event that someone wanted to delete the image while this job ran, I'm not too sure what would happen. Would the image just not get deleted since it's in use? If that's the case, then how do I make it delete after it's no longer in use? I've thought of a solution where I could just kill the process, but I am unsure of the outcome too. If I use               lsof -t somefile.png      that will give me the PID of the process. With that, I can kill the process within the delete function of the site using               exec('lsof -t somefile.png | kill -15');      After killing, will the original script near the top of this post still go on? Will the job be canceled? Does the cron job error out? I'd like for it to just be able to move on to the next site.


title: How to get back a lost session in RHEL : Using NoMachine

text: I logged in remotely to RHEL using NoMachine. Suddenly it got stuck and I have to close the NoMachine client. When I logged in again using NoMachine I can't see the old session (I can't see same application opened in desktop) Now I want to get it back so that I can close all the application. One more thing, since Eclipse workspace is opened in the lost session I cannot open the same workspace from another session. How can I: A. Either get the lost session(interactive).   B. Or close the eclipse from different session. Note: Just to clarify, NoMachine is a remote desktop tool. I use it to connect with RHEL from Windows laptop.


title: ssh fails for an unix server due to dual layer of authentication

text: I have a server which has dual authentication layer. Meaning first a user has to login to the box using his userid and then use a group id to access the development folder (say). Now I have a script which uses ssh to copy a file to the development folder. What should be the command for this? Normal ssh commands such as as `ssh $user@host $cmd` where `$cmd` is something like `cp ~user/Test.txt ~grp/` won't work because we are using user's id to copy to group's directory which is not allowed. And if we use group id to login it will be denied permission. Any suggestions?


title: How to investigate cause of total hang?

text: My Arch machine sometimes hangs, suddenly not responding in any way to the mouse or the keyboard. The cursor is frozen. Ctrl-Alt-Backsp won't stop X11, and ctrl-alt-del does exactly nothing. The cpu, network, and disk activity plots in conky and icewm stop updating. In a few minutes the fan turns on. The only way to make the computer do anything at all is to turn off power. When it boots up, the CPU temperature monitors show 70 to 80C. Before the hang, I was usually doing low-intensity activity like web surfing getting around 50C. The logs show nothing special compared to a normal shutdown. Memory checker runs fine with zero defects. How can I investigate why it hung up? Is there extra information I can find for a clue? Is there anything less drastic than power-off to get some kind of action, if only some limited shell or just beeps, but might give a clue? The machine is a Gateway P6860 17" laptop (bulky but powerful) and it's running Arch 64bit, up to date (as of March 2011). I had Arch for a long time w/o this problem, switched to Ubuntu for about a week then retreated back to a fresh install of Arch. That's when the hangings started. UPDATE: Yeah, for sure it's overheating. At one temperature, the mouse and keyboard stop working, sometimes becoming functional after several minutes of cooling off. At a higher temperature, worse things happen, like total nonresponsiveness including ignoring SysRq. This condition is shortly followed by a sudden power-off. I have solved the problem by buying a new computer 8D


title: Which version of X introduced feature Y?

text: A big part of my daily job is developing software for use on machines with different versions of the same software, like `bash`, `find`, and `grep`. When encountering a feature which would be useful for example to simplify code, it is important to know whether this feature is available in the oldest installed tools. For critical stuff, it would also be useful to know whether this feature was new or has existed for years in the oldest installed tools. What are quick ways to answer this **authoritatively** for Linux tools, especially the GNU Core Utils? Some possibilities in order of decreasing accuracy:   * **Binary binary search** (sic) by running the different versions is of course the ultimate answer, but is by far the most time consuming. Older installations are often not available for security reasons.   * **Reading the code** is almost as good, but it can be prohibitively time consuming if the feature is vaguely named, the name doesn't correspond directly to variable/function/object names, or it was implemented before it was enabled.   * **Change logs** , when available, usually connect feature changes to software versions.   * **Commit logs** can provide hints, but do not know which version they will be included in.   * **man pages** rarely mention dates.   * The same applies to **Googling** , and you'd also have a hard time excluding all the non-authoritative sources.


title: Disable XDMCP on Linux

text: I am trying to disable XDMCP and I have edited `/etc/gdm/custom.conf` and set xdmcp `Enable=false`. However, I do not see a service for `gdm` to restart and turn off listening on port 177. What do I need to restart in order to turn off listening on port 177?


title: Rsync over SSH with authorized keys..but run 2 rsync commands

text: I just figured out how to automate my rsync backups using `authorized_keys` and the `command=` parameter so that my rsync script can't be modified by the user. So my authorized key file looks like this:               command="rsync --server -vlogDtprze.iLsf . /mybackupfolder/Pictures" ssh-rsa AAAAB3Nz…      The rsync script I run from the computer being backed up is:               rsync -avz -e ssh /home/me/Pictures tester@192.168.1.100:/mybackupfolder/Pictures </b>      What I want to do is back up `/home/me/Pictures` and `/home/me/Documents`. Just those two directories. How do I accomplish this but keep it secure? The thing I like about the authorized keys file setting is that the user can't change where the backup is going...just what is being backed up.


title: Installing mpd 0.17 or 0.16 on debian squeeze

text: How could I install mpd 0.17 or even 0.16 on debian squeeze? It's been suggested to me that I should use backports, but I did not quite understand what I should do in case of unmet dependencies. For instance, mpd 0.17 exists on wheezy-backports but it depends on libraries that are a greater version than what is available in the squeeze repos. Should I install every dependency one-by-one from the ready packages on the backports (if they exist)? Or should I install them from the wheezy repos? My sources.list file is:               #          # deb cdrom:[Debian GNU/Linux 6.0.0 _Squeeze_ - Official Snapshot amd64 LIVE/INSTALL Binary 20130824-13:07]/ squeeze main non-free          # deb cdrom:[Debian GNU/Linux 6.0.0 _Squeeze_ - Official Snapshot amd64 LIVE/INSTALL Binary 20130824-13:07]/ squeeze main non-free          deb http://ftp.gr.debian.org/debian/ squeeze main     deb-src http://ftp.gr.debian.org/debian/ squeeze main          deb http://security.debian.org/ squeeze/updates main non-free     deb-src http://security.debian.org/ squeeze/updates main non-free          # squeeze-updates, previously known as 'volatile'     deb http://ftp.gr.debian.org/debian/ squeeze-updates main non-free     deb-src http://ftp.gr.debian.org/debian/ squeeze-updates main non-free          # backports     deb http://ftp.gr.debian.org/debian wheezy-backports main contrib non-free     deb http://ftp.gr.debian.org/debian wheezy main contrib non-free     deb http://backports.debian.org/debian-backports/ squeeze-backports main contrib non-free      EDIT: I couldn't get the sources with `apt-get source mpd=0.17.6-1~bpo70+1`. apt was giving me this error:               E: Ignore unavailable version '0.17.6-1~bpo70+1' of package 'mpd'      E: Unable to find a source package for mpd      `apt-cache showsrc mpd` returned the only the squeeze version. EDIT 2: Trying to install version 0.16 from wheezy. I got the sources but when I ran `debuild -uc -us` it gave me errors about unmet dependecies. Building the deps with `apt-get build-deps mpd=0.16.7-2` returned that it required `libmp3lame0 (= 1:3.99.5)`, and I have `3.98.4+repack2-3~bpo60+1`.


title: How to run a script from another path, and know the script's path?

text: I need to run a script that access a file in the same path it is located. For example: I have the script in `/home/me/folder/script.sh`, and this script will access the file `/home/me/folder/myfile`. As the file is in the same path of the script, I just use the name `myfile`, not the full path. But if I run it from `/tmp/`, like:               /tmp$ /home/me/folder/script.sh      it gives me:               myfile: No such file or directory      So, how can I say in the script that the file is in the same path as the script itself?


title: Need to remove - (Minus) sign at the end in number from many columns and insert it on columns removed

text: I have a huge csv file which has - (Minus) sign at the end of numbers. Now I need to move these - minus signs to begin of the numbers, i.e I need to remove the last character if it has '-' sign and put the '-' sign to the front.               0.00,70440.19-,18.31-,0.00,451.59-,13788.77-,44.19-,6289.29-     1.03-,39.24-,0.11-,16.96-,0.00,72377.70-,0.00,146673.67-,59.11-,0.00      I tried the below one but if there is decimal value '.' character, then it adds the minus sign before that:               perl -pe 's#(\d{1,})(-)#$2$1#'g  file      output is below:               0.00,70440.-19,18.-31,0.00,451.-59,13788.-77,44.-19,6289.-29     1.-03,39.-24,0.-11,16.-96,0.00,72377.-70,0.00,146673.-67,59.-11,0.00      Please suggest any awk / sed / perl one liner to do this job? Regards, Vino.


title: "blocks" column in output of fdisk

text: On my machine, `fdisk -lu /dev/sda` displays following output:                  Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048    73947135    36972544   83  Linux     /dev/sda2        73949182    78139391     2095105    5  Extended     /dev/sda5        73949184    78139391     2095104   82  Linux swap / Solaris      What is this "blocks" unit? Is one "fdisk block" a 1KiB? Where does this unit come from?


title: Parsing process command-line arguments from pargs in a shell script

text: I get list of PIDs in my bash scripts (Java processes) and have to analyze their command-line arguments to determine which instance of server each PID corresponds to. At the moment I do it that way using sed/cut:                 PARGS=$(pargs -l $PID)       PARGS_ARR=($PARGS)       NODE='UNKNOWN'       for ARG in ${PARGS_ARR[@]}       do         # trim single quotes          ARG=$(echo $ARG | sed "s/'//g")              # split by equals sign         ARGL=$(echo $ARG | cut -f1 -d=)         ARGR=$(echo $ARG | cut -f2 -d=)              if [ "$ARGL" == "-DnodeId" ]; then           NODE=$ARGR         fi       done      But it works EXTREMELLY SLOW due to large number of command-line parameters (about 20-30 per each PID). Is there a way to somehow parse command-line parameters and get key=>value parse with a single command?


title: VIM Executing a key command in a function

text: I have a function, and I want to execute a key command, but I get the error Trailing characters:               function! MyFunction()       if condition         <C-W><C-W>       else         :some_other_command       endif     endfunction      It doesn't like the <C-W><C-W> What can I use instead?


title: How do I change the PCI device ID of my graphics card in the system? (to install Quadro driver on a GeForce)

text: I have a consumer GeForce GTX680. It's professional equivalent is Quadro K5000. Both cards have exactly the same chip inside (GK104), the hardware is nearly identical. The official driver for GTX680 can't do Quad-buffered stereo, but the one for K5000 can. One can unlock these "professional" features on the GTX680 by installing the K5000 driver on it. It has been successfully done on Windows. http://www.techarp.com/showarticle.aspx?artno=539&pgno=3 **How do I change the PCI device ID of the card in my system, so the installer thinks it's K5000, not GTX680?** I need to change the value of register 02 from 1180 to 11BA.               lspci | grep VGA     01:00.0 VGA compatible controller: NVIDIA Corporation GK104 [GeForce GTX 680] (rev a1)      Tells me the graphics card is on "01:00.0"               setpci --dumpregs         cap pos w name              00 W VENDOR_ID              02 W DEVICE_ID      Tells me 02 corresponds to device ID. To read the register I do:               sudo setpci -s 01:00.0 02.w         1180      "1180" Means "GTX680", I need to change it to "11BA" which means "K5000" so I'm changing 1180 to 11BA:               sudo setpci -s 01:00.0 02.w=11BA      **Goes through with no errors but when I try to read the value I just changed it's still showing 1180**               sudo setpci -s 01:00.0 02.w     1180      Also tried the same thing as sudo su (as sometimes sudo doesn't work)               [aaa@bbb ~]$ sudo su     [sudo] password for aaa:      [root@bbb aaa]# setpci -v -s 01:00.0 DEVICE_ID=11BA     0000:01:00.0 @02 11ba     [root@bbb aaa]# setpci -v -s 01:00.0 DEVICE_ID     0000:01:00.0 @02 = 1180      I understand this memory can't be really written into so this might be just something being done in the system and therefore not showing. I tried installing the Quadro driver and it's still installs the one for GTX680 (no quad-buffering features)


title: How do I email root?

text: I am on Debian squeeze and I'd like to forward my root emails to my real email. I setup exim to use gmail so when I write `mail myname@myemail.com` it sends to my email. However, now I'd like to email root and have it forward my emails to my real email address. `mail root` does not send an email to root. If I create a different user and use the root email to that person it works. But that person or root emailing root does not. Did I break root emails? How do i fix this? I am using exim4, which was the default.


title: Unable to import packages from debian iso to apt-cacher-ng

text: I installed a 32 bit Debian Wheezy on a PC (One PC in a lab of 24 computers).   I made it a dhcp PXE server with netboot images of Debian 7 32 bits.   It worked perfectly and all the 20 computers booted from network with the debian installer. The only problem was that all the packages had to be retrieved from the internet and bandwidth was a problem. So only one computer could be properly installed. So I tried to look for solutions on how to completely boot the 4.3 GB iso from the network, bypassing the internet mirrors completely. I asked a question on the debian user lists and was greeted with many solutions, among them was the apt-cacher-ng. So now I wanted to install 64 bit machines on the same lab, and the 32 bit server being the PXE server. So I installed the apt-cacher-ng package. All was set up. I mounted my iso file to a location, and created a symlink of the `/pool` folder to `/var/cache/apt-cacher-ng/_import` folder. Next I went to `localhost:3142/acng-report.html` and ran `import` and it gave me the following error:               Maintenance task (File Import), apt-cacher-ng version: 0.7.11 (Cancel)     Importing from /var/cache/apt-cacher-ng/_import directory.     Scanning local files...     Scanning, found 1 file...     Scanning, found 2 files...     Scanning, found 4 files...     Scanning, found 8 files...     Scanning, found 16 files...     Scanning, found 32 files...     Scanning, found 64 files...     Scanning, found 128 files...     Scanning, found 256 files...     Scanning, found 512 files...     Scanning, found 1024 files...     Scanning, found 2048 files...     No index files detected. Unable to continue, cannot map files to internal locations.       So I went ahead and tried to grasp the HOWTO for importing from iso, and it mentioned that you need to run apt-get update before importing the packages. Now since I wanted to cache all the 64 bits packages from the iso, I tweaked my `sources.list` to point to iso (The hyperlink is a method given by me on how to use iso's as apt-get repository). Now when I ran `apt-get update` it gave me an error that no i386 packages found (made sense since I was running it on 32 bits server, and looking for amd64 packages). So as a test, I installed apt-cacher-ng on my laptop running 64 bits debian, and it gave me the same index error. I even tried manually copying *deb packages from `/var/cache/apt/archives` to `/var/cache/apt-cacher-ng/_import` folder, but again same error! I am no champion of linux, nor of networking. I am just a student, trying to learn linux as much as he can, by asking his college to shift from windows to linux, and in the process learning the fundamentals of networking and linux. Any ideas?


title: On Unix how do I get the output from the diff command to look like a man page? Where I can press 'b' or 'f' to read further or back?

text: You know how when you use the man command to read the manual (e.g. `man ls`) and you get output that is paginated that you can read from top to bottom by pressing 'f' to go read further down and 'b' to read further up (assuming you're reading from top to bottom left to right) and you press 'q' to quit. I want the output from diff to behave the same way because sometimes I have a long list of differences to read but I find myself having to scroll all the way up in the terminal to read the beginning of the output. The Git diff command does this and I've come to like it (e.g. `git diff` ) but I don't always have the luxury of having all my files under version control. The best I can think off is piping the out put of the diff command to some other command but I'm not sure which. Can anyone help? Does this sort of output behavior provided (like man pages) have a name for future reference?


title: Skype connects to the internet but all my web browsers can't on Fedora 15

text: I've recently taken the plunge and gone from Ubuntu to Fedora. When connected to my wireless network my web browsers can't access any sites although skype works fine. I don't have the problem when connected to a network by a wire. I'm guessing it is some sort of DNS problem but I don't know how to fix it. Any suggestions?


title: Make some virtual MAC address

text: I want to make some virtual MAC addresses for my network adapter or wireless adapter, so I can connect to network with more than one IP address from one computer or laptop. How can I do it? (I know it's possible ,because one of my friends done it in university and have more than one - sometimes up to 255 - IP addresses on a network).


title: Filetype not detected

text: I'm using vim to try a template system named handlebars, and I installed a vim plugin to get some syntax-highlighting for *.handlebars. I can get coloration if I do this : `:set filetype=handlebars`, but when I open a template, it is monochrome. My .vim folder looks like this:               .     |-- autoload     |   `-- pathogen.vim     |-- bundle     |   |-- handlebars     |   |   |-- example.handlebars     |   |   |-- ftdetect     |   |   |   `-- handlebars.vim     |   |   |-- ftplugin     |   |   |   `-- handlebars.vim     |   |   |-- indent     |   |   |   `-- handlebars.vim     |   |   |-- MIT-LICENSE     |   |   |-- README.md     |   |   `-- syntax     |   |       `-- handlebars.vim      What can I try to get automatic filetype detection? Here is the content of handlebars.vim :               if has("autocmd")       au BufNewFile,BufRead *.handlebars,*.hbs set filetype=handlebars     endif      I think I have autocmd, because :autocmd outputs something. **UPDATE** Here is the content of my .vimrc :               call pathogen#runtime_append_all_bundles()     call pathogen#helptags()     syntax on     set softtabstop=2      set shiftwidth=2     set tabstop=2     set expandtab     set number     set background=dark     set laststatus=2      set statusline=%<%f\ %h%m%r%{fugitive#statusline()}%=%-14.(%l,%c%V%)\ %P     colorscheme solarized     filetype on     filetype plugin on      Here is my .vim folder if someone wants to take a look at it : https://github.com/greg0ire/dotvim


title: Does delimiter parameter on cut command, always expects it to be in between a string?

text: I noticed something with the `cut` command today, which somehow I had never noticed before, even though I have been using and working with them for a long time. From string `/users/developer/`, I wanted to extract `users`. So, what I did was,               echo `pwd` | cut -d '/' -f1      This was not returning me anything. My assumption was, since I had specified `/` as a delimiter, it should have returned me the first field after the delimiter is found. After a bit of tweaking, I realized that I can get my desired output, when I change my command to retrieve `f2`               echo `pwd` | cut -d '/' -f2      It led me thinking, that delimiter always expects _something_ to be on the left side of it, and that is why, on trying to retrieve the first field, it was not returning me anything, and when I tried to retrieve second field, I got what I was expecting. Logically, it makes sense for a `delimiter`. I just wanted to know, is that really how the delimiter parameter works in cut command? In other words, is my inference correct (that delimiter always expects something to be on the left of delimiter)


title: Deleting lots of files

text: I accidentally created 8 million files and every time I'm trying to delete them the server almost dies because of the rm process eating all disk IO (the server is remote without console). Should something like this work i.e. invoking ionice?               sudo find /var/lib/php5/ -type f -exec ionice -c3 rm -f {} \;


title: How do I stop PuTTY becoming unresponsive to input when displaying large amounts of text?

text: I use a windows 7 machine to `ssh` into a remote Linux machine using `PuTTY 0.62`. When I accidentally forget to stream the output to a file and run a program that prints a lot of data to the screen I find that putty becomes unresponsive to `Ctrl`+`C` and I just have to wait 5 minutes before my keystroke to be registered. Is there any way to limit the incoming data rate so I can still send keystrokes to the remote machine in the event that I get myself in this situation again? I should add that it's not really `PuTTY` _per se_ becoming unresponsive, but it's just not sending keystrokes, presumably because network throughput is being gobbled up by millions of lines of text being displayed on the screen. I am using `tmux`, and the session is equally slow to respond to `Ctrl`+`b` as to any other command.


title: How do I delete all files with a given name in all subdirectories?

text: I want to delete all files with a given name in all the subdirectories of my home directory. I tried:               rm -r file      in my home directory, but it didn't work because that file doesn't exist in that directory.


title: So, apparently i toasted this USB Thumbdrive, but is there still hope?

text: I'm having trouble with a USB thumbdrive which isn't recognizable under OSX Disk Utility. Device is not popping up, nor any partitions. Needless to say this is occuring on all USB ports and even on a different machine. What happened was that i accidently plugged it into my XBOX360 and saved a file on it, i guess the partition table got screwed over, or worse. But there is hope because the device is still popping up when running system_profiler SPUSBDataType ![2](http://i.imgur.com/HGvN1cc.png) running 'diskutil list' does not return the device, how am i going to mount this little bugger? ![1](http://i.imgur.com/Bg801sJ.png) Only possible drives to mount are my internal and other external USB drive, not the problemchild. It's technically breathing (as of first screenshot), but what surgery could be applied.


title: Connect Windows 7 domain member notebook to Samba 3.6

text: I have a Windows 7 notebook from work, using which I would like to map a file share on my samba NAS when at home. The NAS is meant to be fully open, and not require authentication at all:               security = user     client signing = auto     server signing = auto     map to guest = bad user     guest ok = yes      smbclient works fine. But when I map a network drive from the Win 7 notebook, I get messages such as "The specified server can not perform the requested operation." From googling, it seems that this message means that Windows requires signing but the server does not support it (even though it is configured to do so, above). Indeed, the Windows settings include these, and I can't change them:               Microsoft network client: Digitally sign communications (always)     Microsoft network server: Digitally sign communications (always)      Is there any way to get it to map a share on my machine, or configure samba to work? (If necessary and samba can't do it, I'm even willing to spin up a Windows VM to mount my NAS, and then share it out again to my workplace's Windows notebook... but I'd prefer to do it within samba if possible). Does samba need to be in a domain because it will perform server signing? Does samba need to be in the same domain before it will work? Or can it be in a different domain from my workplace?


title: SSH screen (CentOS) crashes

text: I use the screen command to run a Minecraft server on my CentOS 6.4 machine. However, once I end the SSH session, the Minecraft server and the screen will eventually simply stop such that when I come back to check on the server a few hours later and I try to resume the screen sessiom, there is "no screen to be resumed". I am unsure if this the screen will stop while the SSH session is active or if it is just a Minecraft/Java issue.


title: How can I get a base64 encoded shaX on the cli?

text: `sha1sum` outputs a hex encoded format of the actual sha. I would like to see a base64 encoded variant. possibly some command that outputs the binary version that I can pipe, like so: `echo -n "message" | <some command> | base64` or if it outputs it directly that's fine too.


title: grep to ignore patterns

text: I am extracting URLs from a website using cURL as below.               curl www.somesite.com | grep " new.txt      My new.txt file is as below.                                         However, I need to extract only the below information.                          I am trying to ignore the `<a href` which have **information** in them and whose title end with **NOTNEEDED**. How can I modify my grep statement?


title: grep command in curl

text: I am trying to extract some URLs from a web page using cURL command. Initially, I use the cURL command as below.               curl www.website.com/      Now, the website contains links to some other websites which am interested in extracting. So, I do a grep on the cURL command as below.               curl www.website.com/ | grep "<a href=" > new1.txt      It is extracting all lines which have `<a href=` in them. But am particularly interested only in lines which start with `<a href=` and end with `title=` How can I modify the grep command?


title: pulseaudio sink always suspended

text: I am on Debian Pulseaudio 2.0-6.1. Up to now never had any issues with sound. I made some experiments with remote sinks and now it seems pulse it totally messed up. I have only one sink. When I restart pulseaudio pactl shows the sink as IDLE. As soon as an application tries to output sound the state changes to SUSPENDED and stays that way. "pactl suspend-sink 0 0" does not change the state. I can only get it to IDLE by restarting pulse and the cycle starts again. After a reboot the problem persists.


title: What's the difference between a hard links and copied files?

text: RHEL 6 My understanding is that hard links include a copy of the original file and that I could delete a hard-linked file in one directory, and it would still exist in the other directory. If that's the case, why would I want to use hard links at all? Why not just have two separate files?


title: Crontab not triggered

text: I have a program written in C with OpenCV. It captures an image from the webcam and saves on the disk with the name given as an argument. I want to trigger it every minute, thus I inserted the following line to crontab.               * * * * * /home/mustafa/Desktop/capture2/capture2 `date +\%y\%m\%d\%H\%M` >> /home/mustafa/Desktop/webcam.log      This command runs as expected when I run it from the console. But it is not triggered by crontab. Are there any errors in my crontab syntax? Edit: it's Angström Linux