title: Selecting latest files and grouping by name

text: I have a directory containing files of the following name structure.               <device>.<yyyy-mm-dd-hh-mm-ss>       I am working on a script that will retain the the last X copies of these configuration backups per each device. What kind of select magic do I need in order to make this happen? I was thinking BASH but I'm really language agnostic.


title: Is it possible to restrict certain commands from being run in a directory?

text: I have two directories: `src` and `projects`. I would like to prevent myself from running `git ...` unless I am specifically inside `src` or `projects`. Is this possible?


title: Why don't the following commands work to limit traffic to port 21 using tc?

text: In my quest to find a way to limit outgoing bandwidth for a running instance of bitcoind, I came across this guide that explains how to rate limit traffic to a particular destination IP:               tc qdisc add dev $DEV root handle 1: cbq avpkt 1000 bandwidth 10mbit      tc class add dev $DEV parent 1: classid 1:1 cbq rate 512kbit allot 1500 prio 5 bounded isolated      tc filter add dev $DEV parent 1: protocol ip prio 16 u32 match ip dst 195.96.96.97 flowid 1:1      I'm not trying to limit traffic to a certain destination IP, though, but to and from a specific port, so I found this guide which tells me how to match traffic by source and destination port:               tc filter add dev eth0 protocol ip parent 10: prio 1 u32 match ip dport 22 0xffff flowid 10:1     tc filter add dev eth0 protocol ip parent 10: prio 1 u32 match ip sport 80 0xffff flowid 10:1      The combination of the first script with the port matching of the second script leads me to the following set of commands that should limit outgoing traffic to port 21 to 160 kbit/s. I'm testing the setup using FTP first, because limiting bitcoind, which uses port 8333, isn't optimal for testing since I can't decide when traffic is sent.               tc qdisc add dev eth0 root handle 1: cbq avpkt 1000 bandwidth 800kbit      tc class add dev eth0 parent 1: classid 1:1 cbq rate 160kbit allot 1500 prio 5 bounded isolated     tc filter add dev eth0 parent 1: protocol ip prio 16 u32 match ip dport 21 0xffff flowid 1:1      As far as I can see, this should limit outgoing traffic to port 21 on the eth0 interface with an outgoing bandwidth of 800kbit/s to 160kbit/s, but it's not working:               NetHogs version 0.8.0            PID USER     PROGRAM                      DEV        SENT      RECEIVED            23653 rune     filezilla                    eth0     102.609       2.978 KB/sec      The FTP connection consists of two connections to port 21:               $ netstat -n|grep "21 "     tcp        0      0 192.168.1.33:59967      194.192.207.26:21       ESTABLISHED     tcp        0      0 192.168.1.33:59974      194.192.207.26:21       ESTABLISHED      What am I doing wrong? I'm running Ubuntu Raring, in case that's relevant.


title: Modifying zsh globbing patterns to use with cp

text: I'm trying to write a script to copy files recursively from a particular folder except files `A.extn`, `B/*.extn` and `C/*` where `B` and `C` are directories and `extn` is just some generic extension. This is what I have:               #!/usr/local/bin/zsh     setopt EXTENDED_GLOB     TMPDIR=/tmp/test          cp -pR $(dirname $0)/**~(*.foo/*|*/bar.txt|*.abc|qux.txt) $TMPDIR      However this doesn't do the negation of the pattern as expected. I think I do know why — although the pattern is correct (as seen with `echo`), `cp -R` is not aware of the pattern, and enters a directory that it is "not supposed to", and once in there, the pattern is no longer valid. How do I modify the above to do what I want? I guess it is possible with `find` and `xargs`, but I'm drawn towards the clarity of the above and would prefer something similar (but if it's the wrong way to do it, I'd be perfectly happy with a different solution).


title: Do kernel counters for jiffies in state exist in Linux?

text: I am looking to get time/jiffie stats on the state of a daemon process. The states I'm referring to are mentioned in the Linux Kernel Proc Filesystem document. Running, Sleeping, uninterruptible sleep, Zombie, Traced/stopped. Table 1-4 mentions jiffie time counters for user, kernel, user w/childs, and kernel w/childs, but no mention of jiffies in state. Are there standard counters that track time spent in these states? Example: in `/proc/[pid]/stat` there are user (`utime`), kernel (`stime`), and guest(`gtime`) counters measured in jiffies. Do process counters exist for time spent in states: [`R`]unning, [`S`]leeping, [`D`]eep sleeping in an uninterruptible wait, [`Z`]ombie, [`T`]raced or stopped measured in jiffies?


title: udev rule for usb attach/detach not triggering

text: I'm running RHEL6 and I'm trying to write a udev rule that is triggered upon plugging in and removing usb devices. I created a file called `80-usb.rules` in `/etc/udev/rules.d/` and I gave it the following contents (so far nothing too specific, just want to test):               ACTION=="add", SUBSYSTEMS=="usb", RUN+="touch /tmp/test"      I saved the file and plugged in a USB drive to test. However, the file `/tmp/test` was not created. I figure my udev rule should match my USB drive, since I can run `udevadm info` on the USB drive and at least one of the parent devices has the attribute `SUBSYSTEMS=="usb"`. Why might the udev rule not get triggered? **edit/update:** This problem is still bugging me. I tried to run `udevadm test --action=add /path/to/device` and it is clear that the `.rules` file that I wrote is being processed and that my rules are being matched. Here are a few relevant lines from the output:               parse_file: reading '/etc/udev/rules.d/80-usb.rules' as rules file     udev_rules_apply_to_event: RUN '/bin/touch /tmp/test' /etc/udev/rules.d/80-usb.rules:1     udevadm_test: run: '/bin/touch /tmp/test'      But still, `/tmp/test` does not exist. I am so confused. Clearly this rule is being matched and the rules are being applied. So why doesn't the command specified by `RUN` execute?


title: Can we use the exe files in RedHat 6 as we do in UBUNTU

text: in Ubuntu we can use .exe file using wine software. Is there any such software in RedHat so that we can use .exe files?


title: for + array + args

text: I have problem with my for cycle, this is what I want:               for arg     do     array[index]=(`find $arg -type l -maxdepth $depth -printf "%p\n" `)      index++     done     fi      `arg` \- positional arguments, only directories This cycle go through the arguments and finds symbolic links and I want them to be stored in an array. If I run script with only one directory it works okay, but when I enter two or more directories it does not work. Any help ? I want to work it like this, for example: There are two arguments, each one is directory. Cycle first set arg to first directory and then array is filled with symbolic links for example it will find 2 symbolic links so array[0] array[1] will be that links and then it should continue with second arg and there are for example 3 symbolic links and it should set them to array[2] array[3] array[4]


title: Error with a .gz file decompression in Mint, but works perfectly in Windows, so the file is not corrupt

text: I've downloaded some `.csv` files from the OECD Stats website, since I need them to plot some graphs with `gnuplot`. When I open them with File Roller 3.4.1 (the default program to handle archive files), there's a file that seems empty (0 byte). When I try on the terminal, I get:               gunzip Financial\ Indicators\ –\ Stocks.gz          gzip: Financial Indicators – Stocks.gz: invalid compressed data--length error     gzip: Financial Indicators – Stocks.gz has more than one entry -- unchanged      So the file seems corrupted, but I sent it to a friend who uses Windows. He extracted the file on his computer and sent me the output: it's a zip files which, in turn, contains two `.csv` files. So the file is not corrupt, there must be a problem with the packages used to handle them. Any suggestion?


title: Memory management - how memblock_reserve works

text: I am new to Linux kernel and I am studying the Linux memory management framework. I have few doubts on this. I am working on Marvel PXA986 boards and in board file I can see few memory reservation code using `memblock_reserve`. But immediately after `memblock_reserve`, I can see the `memblock_free` and `memblock_remove` getting called. I am quite perplexed with this. When we reserve memory whats the point removing it immediately? Also if anyone can throw light upon memblock API's working it will be of great help.


title: how to convert float value to int in bash

text: I will get value like 2743410360.320 and I want value like 2743410360 to a variable. I tried               INTValueOfGB=$ echo "($gb+0.5)/1" | bc      But I am getting `(standard_in) 1: syntax error`


title: lsusb partially fails, is the problem with the USB bus or with the command?

text: What does > Couldn't get configuration descriptor 0, some information will be missing mean? **Did the Host fail to get the descriptor from the device, or the command`lsusb` failed to fetch that information?** Surely the device couldn't have enumerated successfully if the mandatory Configuration Descriptor was unsuccessfully missing! Context: This is a USB 3.0 device, that I am currently programming. It should represent itself as two different speaker channels (playback and recording interfaces with each a single Isochronous asynchronious endpoint). The device enumerates successfully under Windows 7 64 bit. System: Ubuntu 13.04 64-bit.               sw3@pc90313-sw3:/dev/bus/usb/004$ sudo lsusb -D 009     [sudo] password for sw3:      Device: ID aaaa:bbbb       Device Descriptor:       bLength                18       bDescriptorType         1       bcdUSB               3.00       bDeviceClass            0 (Defined at Interface level)       bDeviceSubClass         0        bDeviceProtocol         0        bMaxPacketSize0         9       idVendor           0xaaaa        idProduct          0xbbbb        bcdDevice            0.01       iManufacturer           1 Cypress       iProduct                2 FX3       iSerial                 0        bNumConfigurations      1     Couldn't get configuration descriptor 0, some information will be missing     Couldn't get configuration descriptor 0, some information will be missing     Binary Object Store Descriptor:       bLength                 5       bDescriptorType        15       wTotalLength           22       bNumDeviceCaps          2       USB 2.0 Extension Device Capability:         bLength                 7         bDescriptorType        16         bDevCapabilityType      2         bmAttributes   0x00000002           Link Power Management (LPM) Supported       SuperSpeed USB Device Capability:         bLength                10         bDescriptorType        16         bDevCapabilityType      3         bmAttributes         0x00           Latency Tolerance Messages (LTM) Supported         wSpeedsSupported   0x000e           Device can operate at Full Speed (12Mbps)           Device can operate at High Speed (480Mbps)           Device can operate at SuperSpeed (5Gbps)         bFunctionalitySupport   3           Lowest fully-functional device speed is SuperSpeed (5Gbps)         bU1DevExitLat           0 micro seconds         bU2DevExitLat           0 micro seconds     Device Status:     0x0000       (Bus Powered)


title: How to dump SSHD process and search for strings

text: Symantec has disclosed details on an SSHD backdoor and suggests to dump the SSHD process and search for some particular strings. **NOTE:** Background here: Symantec report on Linux Back Door I have no idea how to perform the steps to dump the SSHD process and search the dump. Hoping someone can describe the steps one would follow to do this on a Linux system such as Fedora.


title: FTP transfer: I can see files on remote machine, but remote user can't

text: I had to transfer a few videos and photoes on a FTP server. For that, the person on the remote machine gave me the IP address of that machine where I had to transfer. He told me to transfer by FTP. _And he provided me with username and password for the same._ He was expecting that I have Windows OS here locally and so he told me how to install a FTP application on my local box. But actually I have Ubuntu13.04 here. Now, I opened a terminal and typed `ftp` and then the IP address of the remote box. I got connected **without** being prompted for the username and password. Then I transferred the files via FTP. Two days later, I `ftp`ed to that machine I was able to see the files that I had transferred. But, the remote user told me he didn't receive any! Till now I was thinking that it's his mistake that he hasn't checked properly his machine because I was 100 % sure that the files are in his system as I had confirmed earlier by doing FTP to that machine. It occurred to me today that he may also be right and the issue is that he is not seeing the files may be something related to the username and password that he had sent me. As I didn't use his username (the one he provided me) to log in via FTP, is that the reason that he was expecting the file to be uploaded at a particular location that is different than the location where I transferred? In other words, are the files uploaded on location depending on the username I have used, i.e., the location is dependent on the username? If so, then how to use `ftp` specifying a particular username?


title: How to print only the duplicate values from a text file?

text: Suppose there is a column of numeric values like following: File1:               1      2     3     3     3     4     4     4     5     6 I want the output:               3       4 That is, only the repeated lines. Is there any command line tools to find this out in Linux? (NB: The values are numerically sorted).


title: Tools that monitor the network bandwidth based on IP?

text: In a networked environment, such as SOHO, is there any tools that can monitor the network bandwidth usage based on the computer's IP or mac address? So that we can know which user has the highest bandwidth usage. If possible also come out statistics of each computer usage based on IP or mac address.


title: My Debian freezes

text: I installed a fresh Debian 7 install, but it freezes from time to time, and when it happens (quite often indeed) only the mouse can move around but everything is blocked. All I can do is restart.   * I would like to debug this problem, where should I look?   * I'm using gnome3.   * I have activated X kill by `Ctrl`+`Alt`+`BackSpace` and it does not work.   * `Ctrl`+`Alt`+`F2` does not do anything either.   * But I can reboot with `Alt`+`SysRq`+`B` * * * output from `~/.xsession_errors`               /etc/gdm3/Xsession: Beginning session setup...     localuser:simona being added to access control list     openConnection: connect: No such file or directory     cannot connect to brltty at :0     GNOME_KEYRING_CONTROL=/home/simona/.cache/keyring-tnSq4q     GNOME_KEYRING_CONTROL=/home/simona/.cache/keyring-tnSq4q     GPG_AGENT_INFO=/home/simona/.cache/keyring-tnSq4q/gpg:0:1     GNOME_KEYRING_CONTROL=/home/simona/.cache/keyring-tnSq4q     GPG_AGENT_INFO=/home/simona/.cache/keyring-tnSq4q/gpg:0:1     SSH_AUTH_SOCK=/home/simona/.cache/keyring-tnSq4q/ssh     GNOME_KEYRING_CONTROL=/home/simona/.cache/keyring-tnSq4q     GPG_AGENT_INFO=/home/simona/.cache/keyring-tnSq4q/gpg:0:1     SSH_AUTH_SOCK=/home/simona/.cache/keyring-tnSq4q/ssh     Initializing tracker-store...     Tracker-Message: Setting up monitor for changes to config file:'/home/simona/.config/tracker/tracker-store.cfg'     ** Message: applet now removed from the notification area     Initializing tracker-miner-fs...     Tracker-Message: Setting up monitor for changes to config file:'/home/simona/.config/tracker/tracker-miner-fs.cfg'     Starting log:       File:'/home/simona/.local/share/tracker/tracker-miner-fs.log'     Tracker-Message: Setting up monitor for changes to config file:'/home/simona/.config/tracker/tracker-store.cfg'     Starting log:       File:'/home/simona/.local/share/tracker/tracker-store.log'     ** Message: Stopping applet secret agent because GNOME Shell appeared     ** Message: applet now embedded in the notification area     Window manager warning: CurrentTime used to choose focus window; focus window may not be correct.     Window manager warning: Got a request to focus the no_focus_window with a timestamp of 0.  This shouldn't happen!     Fontconfig warning: Directory/file mtime in the future. New fonts may not be detected     Fontconfig warning: Directory/file mtime in the future. New fonts may not be detected     Fontconfig warning: Directory/file mtime in the future. New fonts may not be detected     WARNING : Testing for expected AutostartCondition failed: Got (None)     Traceback (most recent call last):       File "/usr/lib/python2.7/dist-packages/gtweak/utils.py", line 152, in uses_autostart_condition     return asc.split(" ", 1)[0] == autostart_type     AttributeError: 'NoneType' object has no attribute 'split'          (gnome-tweak-tool:3655): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed          (gnome-tweak-tool:3655): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed          (gnome-tweak-tool:3655): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed          (gnome-tweak-tool:3655): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed          (gnome-tweak-tool:3655): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed          (gnome-tweak-tool:3655): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed          (gnome-tweak-tool:3655): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed          (gnome-tweak-tool:3655): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed          (gnome-tweak-tool:3655): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed          (gnome-tweak-tool:3655): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed          (gnome-tweak-tool:3655): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed          (gnome-tweak-tool:3655): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed          (gnome-tweak-tool:3655): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed          (gnome-tweak-tool:3655): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed          (gnome-tweak-tool:3655): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion `width >= 0' failed          (gnome-settings-daemon:3345): PackageKit-WARNING **: couldn't parse execption 'GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._pk_5ftransaction_5ferror.Code4: GetDistroUpgrades not supported by backend', please report          (gnome-settings-daemon:3345): updates-plugin-WARNING **: failed to get upgrades: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._pk_5ftransaction_5ferror.Code4: GetDistroUpgrades not supported by backend     Fontconfig warning: Directory/file mtime in the future. New fonts may not be detected          * * * output from `/var/log/Xorg.0.log` http://www.fileswap.com/dl/IdLDxQnQ5N/ * * * output from lspci | grep VGA | cut -d' ' -f1 | xargs -n1 lspci -v -s               00:10.0 VGA compatible controller: NVIDIA Corporation C73 [GeForce 7100 / nForce 630i] (rev a2) (prog-if 00 [VGA controller])         Subsystem: Samsung Electronics Co Ltd Device b04e         Flags: bus master, 66MHz, fast devsel, latency 0, IRQ 10         Memory at f1000000 (32-bit, non-prefetchable) [size=16M]         Memory at d0000000 (64-bit, prefetchable) [size=256M]         Memory at f0000000 (64-bit, non-prefetchable) [size=16M]         [virtual] Expansion ROM at 80000000 [disabled] [size=128K]         Capabilities: <access denied>         Kernel driver in use: nouveau      * * * **Solution:** I think I have solved my problem, by installing the proprietary nvidia drivers, with a lot of help from alex! My debian has not freezed yet.


title: Not able to ftp remote server anonymously

text: I was not able to ftp to my remote server. I read Ubuntu doc to see how to resolve: https://help.ubuntu.com/10.04/serverguide/ftp-server.html Just now I installed vsftpd on my remote machine. Now when I run               ftp rs      it's saying :               ravbholua@ravbholua-Aspire-5315:~$ ftp rs     Connected to ravi.com.     220 (vsFTPd 3.0.2)     331 Please specify the password.     530 Login incorrect.     Login failed.     ftp>       You see here it says to specify a password but it is not waiting for me to input password. Automatically it proceeds ahead and messages login failed. How to resolve? (Also I would appreciate if any material/link can be provided to me) > EDIT @dru please see the content of the configuration file               $ cat /etc/vsftpd.conf          # Example config file /etc/vsftpd.conf     #     # The default compiled in settings are fairly paranoid. This sample file     # loosens things up a bit, to make the ftp daemon more usable.     # Please see vsftpd.conf.5 for all compiled in defaults.     #     # READ THIS: This example file is NOT an exhaustive list of vsftpd options.     # Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's     # capabilities.     #     #     # Run standalone?  vsftpd can run either from an inetd or as a standalone     # daemon started from an initscript.     listen=YES     #     # Run standalone with IPv6?     # Like the listen parameter, except vsftpd will listen on an IPv6 socket     # instead of an IPv4 one. This parameter and the listen parameter are mutually     # exclusive.     #listen_ipv6=YES     #     # Allow anonymous FTP? (Disabled by default)     anonymous_enable=NO     #     # Uncomment this to allow local users to log in.     local_enable=YES     #     # Uncomment this to enable any form of FTP write command.     #write_enable=YES     #     # Default umask for local users is 077. You may wish to change this to 022,     # if your users expect that (022 is used by most other ftpd's)     #local_umask=022     #     # Uncomment this to allow the anonymous FTP user to upload files. This only     # has an effect if the above global write enable is activated. Also, you will     # obviously need to create a directory writable by the FTP user.     #anon_upload_enable=YES     #     # Uncomment this if you want the anonymous FTP user to be able to create     # new directories.     #anon_mkdir_write_enable=YES     #     # Activate directory messages - messages given to remote users when they     # go into a certain directory.     dirmessage_enable=YES     #     # If enabled, vsftpd will display directory listings with the time     # in  your  local  time  zone.  The default is to display GMT. The     # times returned by the MDTM FTP command are also affected by this     # option.     use_localtime=YES     #     # Activate logging of uploads/downloads.     xferlog_enable=YES     #     # Make sure PORT transfer connections originate from port 20 (ftp-data).     connect_from_port_20=YES     #     # If you want, you can arrange for uploaded anonymous files to be owned by     # a different user. Note! Using "root" for uploaded files is not     # recommended!     #chown_uploads=YES     #chown_username=whoever     #     # You may override where the log file goes if you like. The default is shown     # below.     #xferlog_file=/var/log/vsftpd.log     #     # If you want, you can have your log file in standard ftpd xferlog format.     # Note that the default log file location is /var/log/xferlog in this case.     #xferlog_std_format=YES     #     # You may change the default value for timing out an idle session.     #idle_session_timeout=600     #     # You may change the default value for timing out a data connection.     #data_connection_timeout=120     #     # It is recommended that you define on your system a unique user which the     # ftp server can use as a totally isolated and unprivileged user.     #nopriv_user=ftpsecure     #     # Enable this and the server will recognise asynchronous ABOR requests. Not     # recommended for security (the code is non-trivial). Not enabling it,     # however, may confuse older FTP clients.     #async_abor_enable=YES     #     # By default the server will pretend to allow ASCII mode but in fact ignore     # the request. Turn on the below options to have the server actually do ASCII     # mangling on files when in ASCII mode.     # Beware that on some FTP servers, ASCII support allows a denial of service     # attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd     # predicted this attack and has always been safe, reporting the size of the     # raw file.     # ASCII mangling is a horrible feature of the protocol.     #ascii_upload_enable=YES     #ascii_download_enable=YES     #     # You may fully customise the login banner string:     #ftpd_banner=Welcome to blah FTP service.     #     # You may specify a file of disallowed anonymous e-mail addresses. Apparently     # useful for combatting certain DoS attacks.     #deny_email_enable=YES     # (default follows)     #banned_email_file=/etc/vsftpd.banned_emails     #     # You may restrict local users to their home directories.  See the FAQ for     # the possible risks in this before using chroot_local_user or     # chroot_list_enable below.     #chroot_local_user=YES     #     # You may specify an explicit list of local users to chroot() to their home     # directory. If chroot_local_user is YES, then this list becomes a list of     # users to NOT chroot().     # (Warning! chroot'ing can be very dangerous. If using chroot, make sure that     # the user does not have write access to the top level directory within the     # chroot)     #chroot_local_user=YES     #chroot_list_enable=YES     # (default follows)     #chroot_list_file=/etc/vsftpd.chroot_list     #     # You may activate the "-R" option to the builtin ls. This is disabled by     # default to avoid remote users being able to cause excessive I/O on large     # sites. However, some broken FTP clients such as "ncftp" and "mirror" assume     # the presence of the "-R" option, so there is a strong case for enabling it.     #ls_recurse_enable=YES     #     # Customization     #     # Some of vsftpd's settings don't fit the filesystem layout by     # default.     #     # This option should be the name of a directory which is empty.  Also, the     # directory should not be writable by the ftp user. This directory is used     # as a secure chroot() jail at times vsftpd does not require filesystem     # access.     secure_chroot_dir=/var/run/vsftpd/empty     #     # This string is the name of the PAM service vsftpd will use.     pam_service_name=vsftpd     #     # This option specifies the location of the RSA certificate to use for SSL     # encrypted connections.     rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem     # This option specifies the location of the RSA key to use for SSL     # encrypted connections.     rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key


title: CrunchBang - Install option not working

text: I've put CrunchBang on my USB device. Live Session is working, but when I choose "Install" it directly returns to the CrunchBang boot options. What can I do?


title: How come the postfix user can't even read its own files?

text: I have a Postfix configuration file. Let's assume it's named `/etc/postfix/somefile.cf`. I have run the following command as root to change ownership of the file to the `postfix (105)` user:               root@server:~# chown postfix:postfix /etc/postfix/somefile.cf      I can even confirm this succeeded with:               root@server:~# stat /etc/postfix/somefile.cf       File: `somefile.cf'       Size: 153         Blocks: 8          IO Block: 4096   regular file     Device: fd00h/64768d    Inode: 787112      Links: 1     Access: (0644/-rw-r--r--)  Uid: (  105/ postfix)   Gid: (  108/ postfix)     Access: 2013-10-03 20:29:33.738464160 -0700     Modify: 2013-10-03 20:01:35.410464508 -0700     Change: 2013-10-03 20:29:58.482464670 -0700      Birth: -      However, the `postfix` user **cannot access this file**. Watch what happens when I attempt to read its contents:               root@server:~# sudo -u postfix cat /etc/postfix/somefile.cf     cat: /etc/postfix/somefile.cf: Permission denied      What makes this even weirder is the fact that the file has permissions `0644` \- so _anyone_ should be able to read it. What's going on here? * * * **Edit:** I should also clarify - this is a stock installation of Ubuntu Server 12.04 32-bit.


title: Linux guest VM on mac host - Keyboard

text: I use a Mac as a development box, but am slowly transitioning to Linux. So I am spending the majority of my time in the Linux guest VM while working. But I still spend a fair amount of time in Mac OS X, for things like email and such. One issue I am having is changing contexts between the two keyboard layouts. I'm constantly hitting the other OS's keyboard shortcut to go to the start of a terminal line, or getting `Command`-`C` and `Ctrl`-`C` mixed up depending on what OS I am in. Can anyone point me in the right direction to bring the Mac OS X and Linux (am using CentOS 6.3) basic OS keymappings into alignment? Since my ultimate goal is to move from OS X to Linux entirely, I would prefer changing OS x to match Linux, but am open to other alternatives.


title: Install GCC at a custom location without machine prefix

text: When installing GCC, libraries, header files and some executables are placed in directories similar to `/usr/lib/gcc/i686-pc-linux-gnu/4.5.4/` and `/usr/libexec/gcc/i686-pc-linux-gnu/4.5.4/`. I'm building a native compiler on a custom system and would like to place executables in `/bin`, header files in `/include/gcc` and anything else in `/lib/gcc` (no paths containing the target machine name nor the gcc version). Unfortunately this seems to be impossible considering the available options of the gcc configure script. Simply relocating all the installed files is no problem, but then the gcc executable won't be able to find those anymore. The search directories look as follows on my system (pretty ugly in my point of view, a lot of useless paths):               $ gcc -print-search-dirs     install: /usr/lib/gcc/i686-pc-linux-gnu/4.5.4/     programs: =/usr/libexec/gcc/i686-pc-linux-gnu/4.5.4/:/usr/libexec/gcc/i686-pc-linux-gnu/4.5.4/:/usr/libexec/gcc/i686-pc-linux-gnu/:/usr/lib/gcc/i686-pc-linux-gnu/4.5.4/:/usr/lib/gcc/i686-pc-linux-gnu/:/usr/lib/gcc/i686-pc-linux-gnu/4.5.4/../../../../i686-pc-linux-gnu/bin/i686-pc-linux-gnu/4.5.4/:/usr/lib/gcc/i686-pc-linux-gnu/4.5.4/../../../../i686-pc-linux-gnu/bin/     libraries: =/usr/lib/gcc/i686-pc-linux-gnu/4.5.4/:/usr/lib/gcc/i686-pc-linux-gnu/4.5.4/../../../../i686-pc-linux-gnu/lib/i686-pc-linux-gnu/4.5.4/:/usr/lib/gcc/i686-pc-linux-gnu/4.5.4/../../../../i686-pc-linux-gnu/lib/../lib/:/usr/lib/gcc/i686-pc-linux-gnu/4.5.4/../../../i686-pc-linux-gnu/4.5.4/:/usr/lib/gcc/i686-pc-linux-gnu/4.5.4/../../../../lib/:/lib/i686-pc-linux-gnu/4.5.4/:/lib/../lib/:/usr/lib/i686-pc-linux-gnu/4.5.4/:/usr/lib/../lib/:/usr/lib/gcc/i686-pc-linux-gnu/4.5.4/../../../../i686-pc-linux-gnu/lib/:/usr/lib/gcc/i686-pc-linux-gnu/4.5.4/../../../:/lib/:/usr/lib/      I've looked at the source of gcc, but to me it seems that a lot would have to be changed in order to achieve what I want; the structure of those paths are actually hardcoded. Manipulating `DEFAULT_TARGET_MACHINE` or `DEFAULT_TARGET_VERSION` in `gcc/Makefile.in` prior to configuration would do, but that will break other things for sure. Any help/ideas appreciated.


title: eth0 not getting disabled after setting up br0 interface

text: On debian squeeze, I setup a bridge based on eth0. My `/etc/network/interfaces` is               # The loopback network interface     auto lo     iface lo inet loopback          # The primary network interface     #allow-hotplug eth1     #auto eth0     iface eth0 inet manual     iface eth0 inet6 manual          auto br0     iface br0 inet dhcp         bridge_ports    eth0         bridge_stp      off     #    bridge_maxwait  0         bridge_fd       9     bridge_hello 2     bridge_maxage 12           Despite setting eth0 to manual, it get's an ip address via DHCP. Setting `ifconfig eth0 down` explicitly, disables the interface for a few seconds before it comes back up again. How can I disable eth0 and use br0 has my only network interface?


title: Creating an user without a password

text: I'm trying to create user without password like this:               sudo adduser \        --system \        --shell /bin/bash \        --gecos ‘User for managing of git version control’ \        --group \        --disabled-password \        --home /home/git \        git      It's created fine. But when I try to login under the git user I'm getting the password entering:               su git     Password:...      When I leave it empty I get an error:               su: Authentication failed      What's wrong?


title: Linux installation stops working after a few reboots

text: I'm trying to set up a dualboot Win8/Linux on my HP tablet (touchsmart tm2-1050ez). However, when I'm finished setting it all up, after a few more reboots, I'm not able to boot to Linux anymore, as I keep getting the error BUG: soft lockup - CPU#0 stuck for 23s! [swapper/0:1] over and over again right after GRUB. I've left it sit for an hour, only to retrieve a screenful of these messages (only varying slightly in the time it's been stuck). Even recovery mode won't work. So far I've tried Fedora 17, Ubuntu 12.10 and most recently Mint MATE 14, all of which have died in this exact fashion within a day of the original setup. I've googled the problem, but all I could come up with was to run a BIOS update, which I already did and didn't help anything. Help would be much appreciated.


title: How is network mounted software executed?

text: I would like to understand how network mounted software works. For example, at my place of work, we have a software server. Each client machine (hundreds of them) automatically mounts directories from the software server on boot. For example, a program like Matlab is installed just once on the software server, but each client machine can start up an instance of Matlab. What is going on under the hood? Let's say I run `/opt/bin/matlab` and `/opt/` is mounted from the software server, what happens when I press Enter to execute Matlab on a client machine? The process is on the client machine, and I've already narrowed down that there isn't any implicit or hidden file transfer (i.e. copying Matlab to my machine temporarily for that session) by running Matlab on a computer with nearly zero disk space (i.e. not enough room to transfer).   * Since Matlab was installed on the server, how is my client computer executing it?    * What mechanism is controlling this?   * What is happening behind the scenes?


title: Can't open default desktop settings in mint kde

text: I was in the default desktop settings, just playing around, and I made it so that when I right click on the desktop an activities menu opens up. How do I change this?


title: How to do a recursive download with gwget (wget frontend)?

text: I usually run `wget` with the `-np -r` options, but it doesn't include a preview of the queue size, so I'm checking out the `wget` frontend `gwget` (on debian). I can't get the recursive option to work; does anybody know how to do it?


title: Diagnosing xmodmap errors

text: I'm getting this error when trying to use `xmodmap` to get rid of caps lock:               $ xmodmap -e 'clear Lock'     X Error of failed request:  BadValue (integer parameter out of range for operation)       Major opcode of failed request:  118 (X_SetModifierMapping)       Value in failed request:  0x17       Serial number of failed request:  8       Current serial number in output stream:  8      I'm running xfce. This problem did not occur before I added the Keyboard Layouts applet to a panel; before doing that, I was able to run my xmodmap script to swap Esc and CapsLock:               !Remap Caps_Lock as Escape     remove Lock = Caps_Lock     keysym Caps_Lock = Escape      It may be relevant that I chose alt-capslock as the keyboard switch combo in the Keyboard Layouts preferences. I've had a similar problem before, on a different machine, running openbox. On that machine, this problem started when I upgraded to Lucid. I reported a bug in xorg. However, it remains unclear whether it's really a problem with xorg, or if I'm just doing something wrong with my configuration. Have other people experienced this problem? Can someone shed some light on what's going on here? It seems there are quite a few layers involved, and I don't understand any of them particularly well, so any information would be helpful. **update** I've discovered that the problem is specifically triggered by adding the Canada layout variant "Multilingual" (ca-multix). If I instead add the variant "Multilingual (first part)" (ca-multi), the problem does not occur. I think this will probably end up being a usable workaround, but I don't yet know what the difference between these variants is. I've filed a freedesktop issue, and am commenting on a related ubuntu issue.


title: Problem with NIS

text: > **Possible Duplicate:**   >  NIS and autofs error I have one server and one client machine. In Server, I have configured NIS, and /home/guest/nis1 is shared through NFS. Both NFS and NIS are configured in same server. In client, I have configured autofs to export home directory of NIS user. When I try to login in client from nis1 username then I got the following error message. Could not chdir to home directory /home/guest/nis1: Permission denied -bash: /home/guest/nis1/.bash_profile: Permission denied -bash-3.1$ How Can i troubleshot??


title: How to disable flashing file names in rlogin

text: I have a strange problem with my rhel 6.4 system. If I do a `rlogin` to any of my machines, all the files in the remore machine will be flashing and it is so annoying. Can somebody please tell me how can I disable this?


title: gnome-terminal cmd leaving processes open after closing parent window

text: The following simple command should demonstrate my issue:               gnome-terminal --tab -t "Tab 1" -e "/bin/bash" --tab -t "Tab 2" -e "/bin/bash"      This should open a new window with two tabs and an active bash shell. If I immediately close this new window using the GUI [x] and then execute a `ps` command, one (in this case) sub process (`/bin/bash`) will be left open. I have found out that this corresponds to all inactive tabs that have never been made active (by clicking on them) at some point in time. So if we crafted a new command similar to the example above but with 5 tabs instead of 2 and you immediately closed this window after running the command, 4 sub-processes will be left running. Here is the peculiar part...if you click on each tab to make it active and then close the window, all of the sub-processes will be killed, as one would expect. Is this a bug in gnome-terminal? How can I ensure these processes are closed and not left open? After further investigation it appears that the parent process ID of the process(es) left open is the PID of the terminal from which the command above is executed. I would expect that closing the newly spawned window would be enough to kill the sub-processes corresponding to each tab (regardless of whether it has been made active or not), not having to kill the original, source terminal. Hope that made sense.


title: How to count the number of active windows open apart from that of the window manager?

text: I would like to count the number of active windows open apart from that of the window manager I am using. I am aware that wmctrl can do this, however, when I do the following:               wmctrl -l      on my Ubuntu 14.04 64-bit desktop using unity as the window manager, the output I get is:               0x03c00002  0 stepup XdndCollectionWindowImp     0x03c00005  0 stepup unity-launcher     0x03c00008  0 stepup unity-panel     0x03c0000b  0 stepup unity-dash     0x03c0000c  0 stepup Hud     0x02c0000a  0 stepup Desktop     0x02e000b3  0 stepup How to count the number of active windows open irrespective of window manager? - Unix & Linux Stack Exchange - Mozilla Firefox     0x0340000c  0 stepup Terminal      However, I would want to ignore the windows that unity/gnome/KDE, etc. uses and count just the windows the user has opened on his own. How do I this?


title: How to slow down the web

text: You may think that your internet connection is anyway too slow, but here I have the opposite problem. I am not very good at concentration, and I believe that part of the problem is the ease with which which one can get all the interesting stuff from the Web. It can be quite distracting, and I am certainly not the first one to notice it. Switching the internet connection off is one possible solution, but often I need at least _some_ connectivity. An example is reading and writing email. So I thought that a slow web connection might be another compromise. (There is research that the texts written in a difficult typeface is read with more concentration than normal text. This is another reason why I think that making the web more difficult to access might be good for concentration.) So what do I think of?   * I would like to be able to set the maximal speed of the HTTP connections to any value I like, because I do not yet know which speed (if any) is good.   * Other connections, like emails, should not be affected.   * Bonus points if it is also possible to exempt specific web addresses - such that dowmloading Debian packages via HTTP is still fast.   * If possible, it should require only modifications of my own machine. A possible solution could involve a proxy server, with the right configuration. Do you know a solution? Or even better, had you already the same problem and solved it?


title: CentOS kernel version 2.6.32-431.el6.x86_64 bugs

text: As far as I updated my centos ver 6.4 to 6.5, the new kernel (2.6.32- **431**.el6.x86_64) disappointed me! It hangs when I want to plug my external hard to laptop or hangs when I start virtual windows 7 under VMWARE 9.0.1! I don't have these problems when I boot linux with kernel version 2.6.32- **358**.23.2.el6.x86_64 (Previous version). Did any one face to these problems? And what is solution? **Update:** Pluging external hard drive fixed with formating... But booting win7 under vmware in kernel version 431 still remains! **Update 2:** Problem exist even with updating kernel to 2.6.32-431.1.2.0.1.el6.x86_64!


title: pkill process containing special characters

text: trying to run pkill on file with "+" in the name               pkill -SIGTERM -f "auth+live+ec575698789349860987088t897906769878968970"      if i take out this part "auth+live+" I am successful I've tried putting it in quotes , without , single and double as well, is there any way to get this to work


title: Why doesn't putting elinks in background and then resuming with `fg` work reliably?

text: The `elinks` program takes over the terminal to let you browse the web. But its behavior in the context of job control is wonky.   1. If I CTRL-Z suspend an `elinks` session, and then try to resume it with `fg`, it works.   2. If I CTRL-Z suspend an `elinks` session, and then run some other program to completion (e.g. `find`), and then try to resume it with `fg`, it just prints `elinks` or `elinks [the URL I invoked it with]` to STDOUT and hangs. Then if I to CTRL-Z suspend again and `fg` a second time, `elinks` resumes for real, taking over the screen. What explains this behavior? Is there a way to fix it?


title: Why doesn't an orphan process receive signals?

text: I have two shell scripts: `launch_job.sh` and `sub_job.sh`. If `launch_job.sh` uses the following method to run `sub_job.sh`:               nohup sub_job.sh &      `sub_job.sh` becomes an orphan, i.e. with PPID 1.   I discovered that such process doesn't receive signals, except SIGKILL. I guess there is some explanation for this, but I couldn't find it. Any ideas?


title: Pxe Insallation

text: I Want Document For pxe boot server install in kvm on ubuntu 12.04. I am configuration but got that error:               Jul  4 15:36:57 ubuntu dhclient: No DHCPOFFERS received.          Jul  4 15:36:57 ubuntu dhclient: No working leases in persistent database - sleeping.      I am Configuration Bxe-boot Serve Document for Working on VirtualBox. but dosn`t work for kvm. This Is My Configuration Document:               allow booting;     allow bootp;     filename "gpxelinux.0";          subnet 11.5.5.0 netmask 255.255.255.0 {       range 11.5.5.5 11.5.5.50;             option domain-name-servers ns1.opexlabs.local.net;       option domain-name "opexlabs.local.net";       option subnet-mask 255.255.255.0;       option routers 11.5.5.1;       option broadcast-address 11.5.5.255;       default-lease-time 43200;       max-lease-time 86400;     }               host pex-server {         hardware ethernet xx:xx:xx:XX:xx:XX;         fixed-address 11.5.5.1;     }


title: How can I compare two files based on the value of the first column?

text: I want to compare two files based on the value of their first column: file1               aaa 23 3     bbb 56 6     ccc 45 2      file2               bbb m a     aaa a m     ccc m m      The output file should be:               aaa  a m     bbb  m a     ccc  m m      i.e., we need to print the 2nd and 3rd columns of the 2nd file with the first column order of first file. Can anybody suggest an awk script for this?


title: Get pid of long running command executed via at

text: I would like to spawn a persistent `netcat` server. My command of choice is the following:               echo "bash -c \"while [ 1 ]; do nc -l -p 1111 >> check; done\"" | at now      I am wondering how I can get the PID of the process created by `at` so that I can easily put the server to sleep when needed.


title: OSX/Darwin ACL Format

text: In OS X, if you want to view the ACL information on a file, you can do so with the `-e` option of `ls.               $ ls -lde app/cache     drwxrwxr-x+ 7 alanstorm  staff  238 Apr  1 10:02 app/cache      0: user:alanstorm allow add_file,delete,add_subdirectory,file_inherit,directory_inherit      1: user:root allow add_file,delete,add_subdirectory,file_inherit,directory_inherit      2: user:_www allow add_file,delete,add_subdirectory,file_inherit,directory_inherit      What's the format of the individual `ACE` lines? Is this documented anywhere? I couldn't find anything in the `chmod` or `ls` man pages, and most internet articles did a lot of "and there's your ACL/ACE entries" hand waving once they taught you the `-e` option. I can start to guess at the meanings — the last column is obviously the individual permissions, the first is either a user or group, etc., but I don't know what the meaning of `allow`/`deny` is in OS X ACL talk, and I don't know if the `0`, `1`, `2` carry any semantic meaning, and (most importantly) I don't know what else I don't know. For example, there's an inherited column that shows up if a file's inherited permissions               0: user:alanstorm allow add_file,delete,add_subdirectory,file_inherit,directory_inherit      vs.     0: user:alanstorm inherited allow add_file,delete,add_subdirectory,file_inherit,directory_inherit       This screws up straight whitespace parsing, and I'd like to know if there's other places where stuff like this pops up. If anyone here could help clear up the individual questions I have about column 1 and column 3, or more generally describe the format, I'd appreciated it. Long time unix user here, but I'm not really up to speed on ACL stuff. Bitmasks, `chmod`, pry from my cold dead hand, etc.


title: Removal of HDD causes kernel panic

text: I recently added a 2nd HDD to a system and then proceeded to do a clean install on to this 2nd HDD of CentOS 6.5. The original system was CentOS 5.9. My plan was to leave the original HDD in place so that I could pull data off of it as needed as we migrated several KVMs from **HDD #1** to **HDD #2**. All this went uneventfully, and I didn't even bother to remove **HDD #1** , figuring we'd "get around to it". So fast forward to today and I actually attempted to remove **HDD #1** and lo and behold I can't. Booting CentOS 6.5 off of **HDD #2** seems to "know" about the original HDD and kernel panics when **HDD #1** is removed.     ![ss #1](http://i.stack.imgur.com/s2Jn7.png)     ![ss #2](http://i.stack.imgur.com/9gbeh.png) The setup of this box is vanilla CentOS 6.5 with the "Virtualization*" YUM groups installed. There is no reference to **HDD #1** in **HDD #2** 's `/etc/fstab`. The only area where I would consider digging deeper is with LVM, since CentOS installs (all Red Hat distros for that matter) make use of LVM when setting up their HDDs. Here's the stanza from `/etc/grub.conf` in case that might be helpful:               title CentOS (2.6.32-431.17.1.el6.x86_64)         root (hd0,0)         kernel /vmlinuz-2.6.32-431.17.1.el6.x86_64 ro root=/dev/mapper/vg_catbus-lv_root rd_NO_LUKS rd_LVM_LV=vg_catbus/lv_root LANG=en_US.UTF-8 rd_LV     M_LV=vg_catbus/lv_swap rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto rd_LVM_LV=VolGroup00/LogVol01  KEYBOARDTYPE=pc KEYTABLE=us rd_NO     _DM         initrd /initramfs-2.6.32-431.17.1.el6.x86_64.img      Here too is the LVM setup:               $ sudo vgs       VG         #PV #LV #SN Attr   VSize   VFree       VolGroup00   1   3   0 wz--n- 465.66g    0        vg_catbus    1   3   0 wz--n-   1.82t    0           $ sudo lvs       LV       VG         Attr       LSize   Pool Origin Data%  Move Log Cpy%Sync Convert       LogVol00 VolGroup00 -wi-a----- 442.19g                                                    LogVol01 VolGroup00 -wi-ao----  13.69g                                                    LogVol02 VolGroup00 -wi-a-----   9.78g                                                    lv_home  vg_catbus  -wi-ao----   1.76t                                                    lv_root  vg_catbus  -wi-ao----  50.00g                                                    lv_swap  vg_catbus  -wi-ao----  13.77g                     $ sudo pvs       PV         VG         Fmt  Attr PSize   PFree       /dev/sda2  vg_catbus  lvm2 a--    1.82t    0        /dev/sdb2  VolGroup00 lvm2 a--  465.66g    0       ### Key points   * System crashes when I shutdown down the system, physically disconnect **HDD #1** , and then power the system back up.   * The 500GB HDD is what I'm calling **HDD #1** , the 2TB HDD is what I'm calling **HDD #2**.   * With **HDD #1** connected, I can boot the system just fine.


title: Connection to tigervnc gets closed immediately

text: I want to use VNC for remote access to a local Centos 6.4 desktop. I've installed tigervnc server, set a password for the user, opened port 5901 in the firewall, and started the vnc server. I tried to connect from another desktop, but get the message:               connection to host 192.168.1.23 was closed      When I try from the commandline, I get this:               vncviewer: ConnectToTcpAddr: connect: No route to host      Searching for an answer, I found that I should change the server settings to `allow users to view desktop`. I can't find a GUI tool to change this, and am not sure if this is the problem. How can I get this working? * * * Update: Below the code from ~/.vnc/xstartup (from the user)               #!/bin/sh          [ -r /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n     export LANG     export SYSFONT     vncconfig -iconic &     #unset SESSION_MANAGER     unset DBUS_SESSION_BUS_ADDRESS     OS=`uname -s`     if [ $OS = 'Linux' ]; then       case "$WINDOWMANAGER" in         *gnome*)           if [ -e /etc/SuSE-release ]; then             PATH=$PATH:/opt/gnome/bin             export PATH           fi           ;;       esac     fi     if [ -x /etc/X11/xinit/xinitrc ]; then       exec /etc/X11/xinit/xinitrc     fi     if [ -f /etc/X11/xinit/xinitrc ]; then       exec sh /etc/X11/xinit/xinitrc     fi     [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources     xsetroot -solid grey     xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &     twm &


title: Pentesting from a virtual machine, hiding the host

text: I want to install Kali Linux as a virtual machine in VirtualBox for pentesting wireless routers and network hosts. I want to hide my host OS, which is Windows 8, so that other machines see my computer as a Linux computer only. What kind of network connection do I need to configure in the VM? Bridge adapter? How should I configure it to hide the host?


title: Count files in a directory by extension

text: For the purpose of testing, I'd like count how many images files are inside a directory, separating each image file type by file extension (jpg="yes". This because later it will be useful for another script that will execute an action on each file extension). Can I use something like the following for only JPEG files?               jpg=""     count=`ls -1 *.jpg 2>/dev/null | wc -l`     if [ $count != 0 ]     then     echo jpg files found: $count ; jpg="yes"     fi      Considering file extensions jpg, png, bmp, raw and others, should I use a `while` cycle to do this?


title: DNS works half of the time in Oracle VirtualBox and I can't even maintain /etc/hosts file

text: I have installed three Linuxes on same laptop and same VirtualBox and this is my success ratio with DNS:   * HortonWorks & CentOS. Worked for 5 minutes and never after that again. VM image reinstallation from scratch didn't help.   * Talend, MapR & CentOS. Worked fine for a couple of days and then stopped working. First it stopped working everywhere except Firefox, and a few hours later Firefox stopped working as well. I know that Firefox has its own DNS cache, so I suppose it cached DNS server name or something like that for a while as well as it worked even for sites that I had never browsed.   * Cloudera & RHEL/RedHat works perfectly all the time (with this issue, but it has some other issues). Then `/etc/hosts` maintenance works differently also:   * HortonWorks CentOS - works fine, no issues with it. This is the only way I get anything done despite the DNS issue.   * Talend CentOS - it resets file immediately back. When I update the file with vi, vi complains that someone has changed the file already when I get to the point of saving my changes. And what "someone" is doing there is that this "nice" service is reverting it back constantly. I haven't yet tried to revert back to previous snapshot with Talend CentOS as I am hoping to understand first what I did "wrong", so that I wouldn't repeat the same mistake and break the DNS service again. This is assuming that there is some logic as to when this gets broken and when it works. I am using the only option that works at all with VirtualBox network settings: NAT. And yes, I do try to turn it off and on back again to fix it. And that helps to occasional problems when the Windows host has got a new network address (= every morning). DHCP client id is empty in settings, so it should be default:               /sbin/dhclient -d -4 -sf /usr/libexec/nm-dhcp-client.action -pf /var/run/dhclient-eth0.pid -lf /var/lib/dhclient/dhclient-13e5cc85-010e-45e6-0000-f9b4015d5abc-eth0.lease -cf /var/run/nm-dhclient-eth0.conf eth0      DHCP settings (System Preferences --> Network Connections --> System eth0 --> Edit... --> IPv4 & IPv6) are by default set to (fully) automatic. I also tested to set with the localhost IP address found from `/etc/hosts`, DNS & gateway that I found with `ipconfig -all` (in Windows host) and with netmask 255.255.255.0. But that didn't help. If I kill DHCP `kill 20610`, then DNS works for perhaps 10 minutes until it fails again. I found a clue. When DNS functions properly then `/etc/resolv.conf` file contents are               # Generated by NetworkManager     search local               # No nameservers found; try putting DNS servers into your     # ifcfg files in /etc/sysconfig/network-scripts like so:     #     # DNS1=xxx.xxx.xxx.xxx     # DNS2=xxx.xxx.xxx.xxx     # DOMAIN=lab.foo.com bar.foo.com      And when DNS is broken, then same file has               nameserver 8.8.8.8      Googling it up explained that this is DNS server of Google themselves and that is often used as a backup DNS server. So some service decides to use that address as DNS server for whatever reason and that doesn't work from my Windows host either. It is apparently blocked by the company I work in. Copied/moved this discussion to CentOS site: https://www.centos.org/forums/viewtopic.php?f=16&t=47539&p=202100#p202100


title: Avoid pause during dm-raid initialization

text: On my CentOS 5 workstation I get a few seconds wait after dm-raid45 has been loaded ("Initializing Driver" or something like that). This seems to be part of the initrd. After that the system boots up. What is going on during those few seconds and what can I do to avoid this wait-time? I have currently no raid installed. Update 2011-12-14: Problem is still there - deleted previously described "dead" ends from my question. I hunted down the source of the message to these lines in the `init` script located in the **initrd** :               echo Waiting for driver initialization.     stabilized --hash --interval 1000 /proc/scsi/scsi     mkblkdevs     echo Scanning and configuring dmraid supported devices      So `stabilized` seems to be the line causing the delay. What the heck is that? I did not find any man-page for this and no binary with that name.


title: Only use mtime comparison with rsync?

text: Is it possible to sync files via `rsync` and let `rsync` only compare mtime informations? Or is there another tool for this job? That means that such a tool only copies src to destination if the src is newer than the destination. Comparable to GNU `cp --update` \- but also over ssh ...


title: Is there a log of past threads that are now closed?

text: Sometimes, I have a rogue Java process which takes up 100% of my CPU and makes it jump about 30C in temperature (usually resulting in a crash if not killed). Problem is, I can never really identify it (its got a long list of parameters and stuff) or analyze it because I have to kill it so quickly. Is there a sort of log I can look at to see the identity of past processes I have killed? If not, is there a way for me to catch that process next time it shows up? If it matters I'm OpenSuse 11.4.


title: Turning off gnome's Function key mapping

text: I recently upgraded to Fedora 18 with gnome. My function keys started to do things like open the cd player (F12) and turn the volume up (F11) and down (F10). I'd like to just pass those though to the app. How do I turn off gnome's interception of the function keys and just let the presses though to applications? The Keyboard system settings is empty in the "Custom Shortcuts" tab. I don't see any keys in "Navigation" that map to just function keys. "Sound and Media" has a bunch of mappings, but they don't mention keys, just functions and I can't seem to remove/deactivate them. "Windows" also don't have plan function keys, just modified ones like Alt+F7. **Results:** Turns out I had a multimedia keyboard and didn't know it. I must have hit a hotkey accidentally and switched it. A bit of searching and hotkey discovery solved the problem! It was keyboard issue. One helpful trick was to plug in another keyboard, which didn't have the same problems. This narrowed it down to the keyboard.


title: How to resize a PNG file from the command line?

text: Suppose I have a image named `1.png` which is currently               500px : height     1000px : width      I want to resize it to:               50px : height     100px : width      It must be output in PNG format, not JPG. An example would be highly appreciated.


title: Disable Touchpad automatically at startup

text: I'm running Mint 17 Mate on a new HP250 laptop. I can turn off the touchpad by typing the following from terminal: synclient TouchpadOff=1 Now I want to disable the touchpad automatically each time I log on. I tried adding the above line, exactly as shown, to /etc/rc.local by using sudo gedit, but the system still boots with an active touchpad. I'm not too hot on scripting and I don't know if I've used the incorrect format or if I've chosen the wrong file to add this command to. What is the most suitable script file to use and what should the command look like?


title: Software Source stops working when changing release name in the lsb_release file

text: Software source stops working when changing release name. I am on Linux Mint 10 Julia and when I change the 2 lines in the gksu gedit /etc/*release               DISTRIB_ID=LinuxMint     DISTRIB_CODENAME=julia      All the rest I can change no problem,what do I have to change in software sources for it to accept them and for the program to work..? I am making a customized version of Commodore OS 32-bit,adding this and that before releasing it. site is here http://cbmosvision.webs.com/ if you want to look.


title: detect process that executes portscans

text: I have to administer an ubuntu 12.04 server, where there seem to go portscans to the whole subnet. How can I find out the process that does the scans?               pstree     init─┬─acpid          ├─apache2───14*[apache2]          ├─atd          ├─avahi-daemon───avahi-daemon          ├─bluetoothd          ├─colord───2*[{colord}]          ├─console-kit-dae───64*[{console-kit-dae}]          ├─cron          ├─cupsd          ├─dbus-daemon          ├─fail2ban-server───2*[{fail2ban-server}]          ├─gam_server          ├─6*[getty]          ├─irqbalance          ├─kdm─┬─Xorg          │     └─kdm───kdm_greet───2*[{kdm_greet}]          ├─mysqld───27*[{mysqld}]          ├─ntpd          ├─polkitd───{polkitd}          ├─rsyslogd───3*[{rsyslogd}]          ├─smbd───smbd          ├─sshd───sshd───sshd───bash───su───bash───tmux          ├─tmux───bash───pstree          ├─udevd───2*[udevd]          ├─upstart-socket-          └─upstart-udev-br


title: Split the content of a file in linux

text: I have a text file which has content like this:               abc.tar^@xxx.tar^@yyy.tar^@       Say for example I have this content in a file named `abc.txt` and I want to split the content and write the first two entries into a new file. (e.g), the new file would look like this:               abc.tar^@xxx.tar^@      Is there any command to perform this operation? I'm new to this so please help me with explanation.


title: What is happening when a script encounters an error in one of the commands?

text: I used alien to convert an RPM to a .deb. I did NOT use alien's script conversion; I'm converting by hand. Indeed, the script did barf on some non- compatible syntax. My question is NOT about how to fix this incompatibilty, but rather about how the script continues to execute successfully, despite encountering an error. Here's the problematic section:               if [ "`/bin/echo '\c'`" == "" ]; then        ECHO_ESC="/bin/echo"     else        ECHO_ESC="/bin/echo -e"     fi      This causes the following "error":               ./avsetup_mcc: 11: [: \c: unexpected operator      Despite this, the script continues to execute perfectly. So, what's happening here?


title: Delete lines until a header with sed

text: I am incorporating SED into a Windows batch file. I've got it working for deleting the first seven lines of a text file:               SED "1,7d"      However, I'd like to make it a smarter statement. Essentially, I have a huge text file that I want to lop off the first few lines…and keep everything from the column heading and below. The first line of text I want is line 8 and is "Year" with quotes. I've tried the following and I'm receiving an error in the command window (running the batch file):               SED "1,/"Year"/!d"      I am putting in the input and output files after the expression.


title: Red hat enterprise linux how do i install apache with SSL HTTPS? i have CERTIFICATE, KEY, INTERMEDIATE (ROOT CA) from heart internet

text: How can i install SSL HTTPS in my apache webserver in Red hat enterprise linux? Only following is installed. And i have tried this website follow up but its not working it fails.               $ uname -a     2.6.32-358.6.1.el6.x86_64 #1 SMP Fri Mar 29 16:51:51 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux          [root@ip-10-210-144-105 conf]# pwd     /etc/httpd/conf     [root@ip-10-210-144-105 conf]# tree     .     ├── ca-bundle     │   └── root.crt     ├── httpd.conf     ├── magic     ├── ssl.crt     │   └── crt.crt     └── ssl.key         └── key.key          3 directories, 5 files      EDIT httpd.conf file applied               Listen 80     Listen 443          <VirtualHost *:80>      ServerName s.org      ServerAlias s.org www.s.org      DocumentRoot /var/www/html/s/public      <Directory /var/www/html/s/public>         #AddDefaultCharset utf-8         DirectoryIndex index.php         #AllowOverride FileInfo         AllowOverride All         Order allow,deny         Allow from all      </Directory>           #SSLEngine on      #SSLCertificateFile /etc/httpd/conf/ssl.crt/crt.crt      #SSLCertificateKeyFile /etc/httpd/conf/ssl.key/key.key      #SSLCertificateChainFile /etc/httpd/conf/ca-bundle/root.crt          </VirtualHost>          <VirtualHost *:443>      ServerName s.org      ServerAlias s.org www.s.org      DocumentRoot /var/www/html/s/public      <Directory /var/www/html/s/public>         #AddDefaultCharset utf-8         DirectoryIndex index.php         #AllowOverride FileInfo         AllowOverride All         Order allow,deny         Allow from all      </Directory>           #SSLEngine on      #SSLCertificateFile /etc/httpd/conf/ssl.crt/crt.crt      #SSLCertificateKeyFile /etc/httpd/conf/ssl.key/key.key      #SSLCertificateChainFile /etc/httpd/conf/ca-bundle/root.crt          </VirtualHost>      Fails               [root@ip-10-210-144-105 conf]# service httpd restart     Stopping httpd:                                            [FAILED]     Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:443                                                            [  OK  ]


title: CentOS 6.4 as VirtualBox guest under Windows 8 host, fullscreen mode causes unresponsive cursor

text: I apologize in advance if this is an inappropriate place to post this question. I've installed VirtualBox 4.1.26 in Windows 8 6.2 (I don't think I have Pro) and got CentOS 6.4 installed with Guest Additions. When I enter fullscreen mode, I can still move the cursor around the guest screen, but no clicks are registered. Works normally when I exit fullscreen. Anyone point me in the right direction to correct this (or tell me where I should be posting this)?


title: iostat am I okay?

text: This is the result of iostat               avg-cpu:  %user   %nice %system %iowait  %steal   %idle               13.65    0.00    9.98    3.86    2.22   70.29          Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util     xvdap1            0.00     9.00    0.00   14.40     0.00   140.00    19.44    27.48 5991.25  46.32  66.70     xvdap2            0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00          avg-cpu:  %user   %nice %system %iowait  %steal   %idle                4.19    0.00    3.93    6.69    0.03   85.15          Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util     xvdap1            0.00     3.00    0.00    0.00     0.00     0.00     0.00    19.08    0.00   0.00  45.44     xvdap2            0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00      iostat await sucks time is 7000. Does that mean process need to wait for 7 seconds before writing?


title: Autodelete old files

text: I've many shares on my samba server with recycle bin module activated. When deleting remote files from Windows I see `.Trash directory`. I'd like to automatically remove older files, i.e. 30 days or older. So I've added something like this to crontab:               00 01 * * * /usr/bin/find /share/share1/.Trash -atime +30 -print -type f -delete      However, if I've a file with last access 2 months ago and I delete it (samba will move that file to recycle bin), my script will delete that file at first run, because the last access was 2 months ago.


title: Why does the FreeBSD handbook recommend using a virtual console because of system messages?

text: Quoting from the FreeBSD Handbook, in section 4.2.1. “Virtual Consoles”: > While the system console can be used to interact with the system, a user > working from the command line at the keyboard of a FreeBSD system will > typically instead log into a virtual console. This is because system > messages are configured by default to display on the system console. These > messages will appear over the command or file that the user is working on, > making it difficult to concentrate on the work at hand. What does it mean: log into a VC as system messages will display on the system console and will appear over the command making it difficult?


title: Unix 'calendar' program upgraded to work with multiple years?

text: Many years ago, there was a Unix 'calendar' program. Every user would create their own ~/.calendar file and root would run 'calendar' once daily to send people email reminders from their ~/.calendar files. For identification, the first part of "man calendar" shows:               NAME           calendar - reminder service           SYNOPSIS           calendar [-ab] [-A num] [-B num] [-f calendarfile] [-t [[[cc]yy][mm]]dd]           DESCRIPTION           The calendar utility checks the current directory or the directory speci-           fied by the CALENDAR_DIR environment variable for a file named calendar           and displays lines that begin with either today’s date or tomorrow’s.  On           Fridays, events on Friday through Monday are displayed.       The problem: this program only lets you specify a month and day in the ~/.calendar file, and will alert you every year on that month and day. I want to alert myself to renew my driver's license Sep 13 2019 (one month before it expires). However, if I add "Sep 13" to my ~/.calendar file, it will remind me every Sep 13, not just Sep 13 2019. I realize there are many workarounds + newer programs that do something similar, but has the calendar program itself ever been upgraded to do this?


title: Multipath device name doesn't display correctly

text: I'm playing with iscsi and I'm trying to figure out why the vendor/product names aren't showing up correctly. I've restarted all the appropriate services along with a reboot. Listed below are the output along with an excerpt of the config file. Output:               LUN-48 (1IET_00020001) dm-0 IET,VIRTUAL-DISK     size=480M features='0' hwhandler='0' wp=rw     |-+- policy='round-robin 0' prio=0 status=enabled     | `- 3:0:0:1 sdb 8:16 failed faulty running     `-+- policy='round-robin 0' prio=1 status=active     `- 7:0:0:1 sdd 8:48 active ready  running     LUN-30 (1IET_00010001) dm-1 IET,VIRTUAL-DISK     size=300M features='0' hwhandler='0' wp=rw     |-+- policy='round-robin 0' prio=1 status=active     | `- 8:0:0:1 sdc 8:32 active ready  running     `-+- policy='round-robin 0' prio=0 status=enabled     `- 5:0:0:1 sde 8:64 failed faulty running      Here's an excerpt from `multipath.conf`               devices {         device {                 vendor "VMware"                 product "Virtual Disk"         }     }


title: Fedora now tries to connect to wireless at boot?

text: In my Fedora 16 installation I've recently noticed that it tries to connect to wireless at boot (I have kernel messages turned on at boot so I can see it trying). The issue though is that my wireless is very iffy, sometimes taking a very long time to associate which is just issues with my wireless card support and the large wireless network. I would really prefer Fedora to try connecting to the wireless AFTER I login, not during the bootup process. This should significantly speed up boot times and be useful for times when I don't want to use wireless immediately. Is there an option to make Fedora start associating with wireless after login, not at boot?


title: MySQL table is repeatedly crashing

text: I have xen virtual machine (Debian stable in PV mode) and I've Joomla on it. Several times in a day I see this message on the front page of my site.               jtablesession::Store Failed     DB function failed with error number 144     Table './database@002enet/hfd_session' is marked as crashed and last (automatic?) repair failed SQL=INSERT INTO `hfd_session`      ( `session_id`,`time`,`username`,`gid`,`guest`,`client_id` ) VALUES ( 'iae9qhmfhst464v4d0a6ho6nt3','1330628728','','0','1','0' )      I can't find the reason why it is crashing. mysql.log and mysql.err log are clear. There are only some records in the mysql slow log, but they seem not be connected with this table. It is only this table that is crashing. I tried to drop this table and to create it again, to restart system and to check disk with fsck (there was no error). But I still encounter this crash And I need to fix it manually every time I see it. Is there any way to fix this issue?                $ dpkg -l | grep mysql     ii  libdbd-mysql-perl                       4.016-1                         Perl5 database interface to the MySQL database     ii  libmysqlclient16                        5.1.49-3                        MySQL database client library     ii  mysql-client-5.1                        5.1.49-3                        MySQL database client binaries     ii  mysql-common                            5.1.49-3                        MySQL database common files, e.g. /etc/mysql/my.cnf     ii  mysql-server                            5.1.49-3                        MySQL database server (metapackage depending on the latest version)     ii  mysql-server-5.1                        5.1.49-3                        MySQL database server binaries and system database setup     ii  mysql-server-core-5.1                   5.1.49-3                        MySQL database server binaries     ii  php5-mysql                              5.3.3-7+squeeze3                MySQL module for php5


title: Compiling for old versions of Debian

text: Can I build packages for Debian 5.0 using Debian 6.0 or Debian Wheezy? I assume that I could do a complete chroot'ed installation of Debian 5.0 and do my builds there, but it might be nice to have something lighter-weight. For bonus points - can I build packages for Debian 5.0 using the version of g++ from Debian 6.0 or Debian Wheezy? I'm responsible for developing some Debian 5.0 software, but I'd like to start using C++11 features that aren't available in Debian 5.0's g++.


title: Can DNS identify hostnames dynamically if they're statically configured?

text: I've got a small environment of ~40 VMs with static IPs on 12 servers, it would be dandy if I could refer to each VM by name. We have a lot of VMs come and go, so maintaining one static list is a pain. Is there a way I can configure a DNS server to dynamically register the new names as they are created?


title: Creating Cron Task to kill stalled/failed runs in a system

text: I was given a task to create a `cron` which finds, kills and clears old `puppet` runs that were not successfully installed. I am more or less looking for a starting point.


title: "Only root can mount" error - but I am root

text: Yesterday I was able to mount my smb share with the following command:               sudo mount -t cifs //XXXX/share /media/share -o user=Ben,password=XXX,workgroup=WORKGROUP,ip=XXX.XX.XX,uid=ben,gid=ben,rw I don't know why it is not working anymore. (Maybe from system update). I got the following error :               mount: only root can mount //XXX.XXX.XXX/share on /home/ben/share      I don't know how to fix this problem.. I've also tried to mount it with su -, and Smbclient is working. I'm Running ArchLinux.


title: Determining LVM Extent numbers for given file

text: I'm currently engaged in a non-work related homework exercise. I have an ext4 filesystem sitting on a logical volume. I'm testing different performance tuning strategies and this idea occurred to me. Since pvmove can move individual and ranges of extents, is there a way to map out what physical extents hold a particular file (in theory it can be backing files for a database, or a large commonly accessed file share) and move them to a particular storage device (for example I have a regular HDD and an SSD drive in the same LVM Volume Group)? I thought of using "filefrag" but then it occurred to me that I wasn't 100% on whether the extent numbers would necessarily be used in sequential order (so knowing how many sectors in ext4 sees a file isn't necessarily going to let me figure out what which extent numbers/volumes the file is physically sitting on. Any ideas?


When I'm running `evince file.pdf` I got this error `Failed to get bus connection: Could not connect: Connection refused` `Ubuntu 12.04` I have to reboot. Can I repair this error without reboot?


title: Run domain on tomato/dd-wrt

text: it is there any way to run a domain on my router instead of running dyndns or other alternatives (Dynamic DNS) etc. on tomato or dd-wrt firmware ?


title: Occasional rsync error code 12 "Connection reset by peer (104)" from cron task that runs every 20 minutes

text: I have a script run by cron that rsync's various folders to a server in a different city to publish files to websites. In case it matters, the source server is within the corporate firewall and the destination server is outside. The script uses a locking system to prevent multiple instances of itself running at the same time. rsync is occasionally (up to 1-3 times per day) failing with the error:               rsync: read error: Connection reset by peer (104) rsync error: error in rsync protocol data stream (code 12) at io.c(604) [sender=2.6.9]      I found some advice suggesting that I specify a timeout value, so I added the flag --timeout=10 to the command. The result was a different error:               io timeout after 10 seconds -- exiting     rsync error: timeout in data send/receive (code 30) at io.c(165) [sender=2.6.9]      The receiving server likely has quite a heavy load, so that may be a factor. Does anyone have any suggestions for avoiding these errors?


title: Should I use the VirtualBox Guest Additions from the host ISO or the Debian pool?

text: I'm running VirtualBox 4.2.16 on a Mac OS X 10.8.4 host. Inside a virtual machine, I'm running Debian Sid, up-to-date as of today (7/23/13). I want to install Guest Additions. Should I install them from the Debian pool or from the virtual CD that VirtualBox provides (e.g. Devices > Install guest additions, then from the guest system, `sudo bash /media/cdrom0/VBoxLinuxAdditions.run`)? What are the differences and/or advantages/disadvantages to the two?


title: how to change places of two data fields/ columns in Linux

text: Question: I have the bellow data field               zzzzz: 4     afsdf: 5     sdfsd: 3      how do I change the places of two columns so I get e.g `4: zzzzz` using the `awk` or `sed` command? If possible please show multiple ways so I can explore further


title: Which Linux distro supports h264/avc, aac and mp3 out of the box?

text: That is, after installing (or live boot) I want to be able to access h264-aac videos and mp3 audio that I have saved, WITHOUT INTERNET connection, that is installing after OS-install from a repo on the web is not an option. related: In case of many distros, it is possible to install freely from repositories configured by default. Is that legally so different from installing as needed later? Why can't they just include those? related: Ubuntu's live image had a option "install restricted extras". Does that mean that those restricted extras were on the image already, and making them optional made the legal issues go away?


title: Run android app on debian without emulator

text: I'm trying to install a few android games on Debian. I've tried Bluestacks (via WINE), Genymotion, AndroVM, Android-x86 and I still can't get these few games (Samurai Siege, and Clash of the Clans). Is there any other way?


title: Debian - cannot find cdrom

text: Having a jessie/sid debian box on kernel 3.13 (had same issue on kernel 3.10) First thing I notices was that k3b didn't find any optical drives. Then: The optical drives (dvd-writers) are found in the bios (connected on pata - worked sometimes earlier, but I don't know what has been updated since that - quite a lot probably) but   * `dmsesg | grep CD` (or `grep cd` / `dvd` / `DVD`) does not show any trace of them   * `wodim -scanbus` returns a "Cannot open SCSI driver!"   * `lsmod` shows that `sr_mod` and `sd_mod` are loaded. Looking a bit closer in dmesg, I find:               [    0.629414] pata_jmicron 0000:05:00.1: enabling device (0000 -> 0001)     [    0.632751] scsi2 : pata_jmicron     [    0.634988] scsi3 : pata_jmicron     [    0.635060] ata3: PATA max UDMA/100 cmd 0xbf00 ctl 0xbe00 bmdma 0xbb00 irq 17     [    0.635063] ata4: PATA max UDMA/100 cmd 0xbd00 ctl 0xbc00 bmdma 0xbb08 irq 17      Where at last the PATA interface seems to be found. Only the optical drives are connected through pata, all hdds on this system are sata. lsmod | grep sr gives me:               morten@sorbus:~$ lsmod |grep sr     sr_mod                 21898  0      cdrom                  39232  1 sr_mod     scsi_mod              182938  6 sg,usb_storage,libata,sd_mod,sr_mod,firewire_sbp2      Are there any other modules I should try to load?


title: wvdial: The PPP daemon has died: Pty program error (exit code = 9)

text: I tried to configure AnyDATA ADU890-WH modem to work in Linux, but I have not succeeded. I am client of Czech carrier O2 and using Ubuntu 14.04. I have once managed to connect using Network Center, Mobile Broadband tab - but since then I have not succeeded. This is my `wvdial.conf`:               [Dialer Defaults]     Init2 = ATQ0 V1 E1 &C1 &D2 +FCLASS=0     Modem Type = Analog Modem     Phone = *99#     Stupid Mode = 1     ISDN = 0     Username = a     Init1 = ATZ     Password = a     Modem = /dev/ttyUSB0     Dial Command = ATDT     Baud = 9600          [Dialer CDMA]     Auto DNS = 0     Init1 = ATQ     Init2 = ATZ     Stupid Mode = 1     Phone = #777     Idle Seconds = 0     Modem = /dev/ttyUSB0     Username = 601xxxxxx@cz.o2.com     Dial Command = ATDT     Password = xxxxxx     Baud = 1500000               [Dialer three]     Init2 = ATZ     Init3 = ATQ0 V1 &D2 &C1 S0=0 +IFC=2,2     Init5 = AT+CGDCONT=1,"IP","internet"     ISDN = 0     Modem = /dev/ttyUSB0     Modem Type = Analog Modem      And this is important part of `/var/log/syslog` file:               Jul 23 20:25:07 wigos-hp-lx pppd[5524]: pppd 2.4.5 started by root, uid 0     Jul 23 20:25:07 wigos-hp-lx pppd[5524]: Using interface ppp0     Jul 23 20:25:07 wigos-hp-lx pppd[5524]: Connect: ppp0 <--> /dev/ttyUSB0     Jul 23 20:25:07 wigos-hp-lx NetworkManager[740]:    SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/ppp0, iface: ppp0)     Jul 23 20:25:07 wigos-hp-lx NetworkManager[740]:    SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/ppp0, iface: ppp0): no ifupdown configuration found.     Jul 23 20:25:07 wigos-hp-lx NetworkManager[740]: <warn> /sys/devices/virtual/net/ppp0: couldn't determine device driver; ignoring...     Jul 23 20:25:07 wigos-hp-lx pppd[5524]: MPPE required, but MS-CHAP[v2] nor EAP-TLS auth are performed.     Jul 23 20:25:07 wigos-hp-lx pppd[5524]: Connection terminated.     Jul 23 20:25:07 wigos-hp-lx NetworkManager[740]:    SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/ppp0, iface: ppp0)     Jul 23 20:25:07 wigos-hp-lx pppd[5524]: Exit.      I have also found some guides how to set up the connection without `wvdial` \- but these guides rely on starting the connection by `pon <connection-name>`, but when using this command, I get no output and nothing happens. The modem supports also CDMA network, but the error when using `wvdial` is the same.


title: Close all file descriptors in bash

text: Is there a way to close all the open file descriptors, without having an explicit list of them beforehand?


title: What is the difference between JAVA_HOME and update-alternatives?

text: I have been trying to figure out the best way to run OpenJDK Java Runtime as default Java for my Fedora box and use Oracle JDK 6 for Android development namely for running Android SDK Manager, Android Studio and Eclipse from Android Bundle. I installed OpenJDK Java Runtime from the Fedora repository which has setup alternatives as follow.               [donnie@fedora ~]$ alternatives --list | grep java     jre_openjdk             auto    /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.5.1.fc20.x86_64/jre     jre_1.7.0               auto    /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.5.1.fc20.x86_64/jre     java                    auto    /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.60-2.4.5.1.fc20.x86_64/jre/bin/java     libjavaplugin.so.x86_64 auto    /usr/lib64/IcedTeaPlugin.so      I have installed the Oracle JDK 6 using the rpm provided by Oracle. I could make Android Bundle and Studio make use of JAVA_HOME to run under Oracle JDK by sticking following in `.bashrc`.               export JAVA_HOME=/usr/java/jdk1.6.0_45/     export PATH=$JAVA_HOME/bin:$PATH      I noticed that Chrome still uses OpenJDK (as I still need to link the plugin). What are the difference between JAVA_HOME and using alternatives?


title: vim how to keep cursor position while copying text

text: I am (having to) using gvim in windows. I was used to the linux environment where when I select text using mouse the cursor position wont change. Now , with gvim in windows, My problem is something like this -   1. while I am editing in line 6    2. and when I am having to copy "hellovim" from line 3    3. and when I click with mouse on "hellovim" to copy it    4. then the cursor gets moved to "hellovim" on line 3   5. where as I would like the cursor to stay on line 6 How can I do this


title: How can I configure iptables for per application setup?

text: I am working on a project where we are building lots of micro-services. Each service is neatly packaged as an RPM. Ideally I'd like for us to have iptables enabled on all of our machines and it would be really nice that as packages are placed on the machine they configure iptables to open the appropriate ports for themselves. All I can think of is putting `iptables` commands with a `service iptables save` call in the post install script. It doesn't look like iptables supports snippets (i.e. conf.d directories of config). Is there a better way or am I thinking about this all wrong?


title: Change Alt-Tab icon size in mint

text: I have linux mint 16 cinnamon. Is it possible to change the size of icons in Alt-Tab?


title: SOCKS5 is there encryption between client and proxy server?

text: I've read the wikipedia article on socks and cannot find information about encryption between client and proxy-server. There is only information about authentication. Is socks5 connection a plain-text?


title: 403 forbidden issue - .htaccess

text: I am getting 'Forbidden' 403 problem with my website. Earlier today it worked. The only thing I did was try to access other folders (eg `bin`). I checked permissions, and it all seems to be looking right. Any ideas how to solve this? what I should be looking for or doing? Some of the suspicious error logs:               [Fri Mar 02 14:08:57 2012] [error] [client yyyyyyyy] script '/var/www/vhosts/example.com/httpdocs/file.php' not found or unable to stat     [Fri Mar 02 15:48:43 2012] [error] [client xxxxxxxx] (13)Permission denied: file permissions deny server access: /var/www/vhosts/example.com/httpdocs/index.html     [Fri Mar 02 15:45:33 2012] [crit] [client vvvvvvvvvvv] (13)Permission denied: /var/www/vhosts/example.com/httpdocs/folder/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable      I found that I had `.htaccess` file under `httpdocs`, and so I deleted it, but it didn't seem to help. The domain still doesn't work.


title: How can I set up a remote port forward on port 80 to my localhost with the help of setcap?

text: I'd like to accept connections briefly for development when I'm NATed, and so I'm attempting to do this:               $ ssh ubuntu@example.org -R 80:localhost:80      Which fails as I'm trying to bind a port that is to low:               Warning: remote port forwarding failed for listen port 80      So I've discovered that I can do `setcap 'cap_net_bind_service=+ep' /my/application` to allow it to listen to ports lower than 1024. So I've got this in my suders crontab:               @reboot setcap 'cap_net_bind_service=+ep' /usr/sbin/sshd      But it's still not letting me bind on port 80. What am I doing wrong? I'm just going to use nginx to proxy to 8080 or iptables or something instead, but I'm still curious why what I was trying to do didn't work.


title: Debian system - Network security tools

text: I am using Debian 6 and i need help on best GUI/CLI tools which can help me on port,IP scanning and stalking of I/O data though the network .


title: Is there a way to create cow-copies in ZFS?

text: I am trying to make cow-copies of some files/directories, but of the several ways I know of, all seem sub-optimal. For example, btrfs can, with the use of `cp --reflink=auto` quickly generate cow-copies of files. What I have tried:   1. Symlinks: No good. Renamed file, broken link.   2. Hardlinks: Better, but still no good. Changes to one file will change the other, and I don't necessarily want the other file changed.   3. Create a snapshot of the dataset, then clone the snapshot: This can work, but not well. Often I'm not looking for a copy of the whole dataset, or for the copies to act like another dataset. Then there are the parent/child relationships between the clone/snapshot/original, which as I understand it are hard, if not impossible to break.   4. Using `zfs send/receive`, and enabled dedup, replicate the dataset to a new dataset: This avoids the parent/child relationships of using a clone, but still needlessly creates another dataset, and still suffers from the slowness involved in the files having to be read 100% and the blocks referenced again instead of written.   5. Copy files and let dedup do its job: This works, but is slow because the file(s) have to be 100% read and then the blocks referenced again instead of writing. Slowness of zfs send/receive and physically copying or rsyncing is further exacerbated because most things are stored compressed, and have to be decompressed during read, then compressed before dedup kicks in to reference duplicate blocks. In all of my research, I have not been able to find anything remotely resembling the simplicity of --reflink in btrfs. So, is there a way to create cow-copies in ZFS? Or is "physically" copying and letting dedup do its job the only real option?


title: How can I generate /proc/vmcore?

text: I want to practice with makedumpfile. However, it needs `/proc/vmcore` which is the memory image of the currently running kernel. Also, reading the man page of `makedumpfile`, we also need 2 kernels: panicked kernel (crashed kernel) and capture kernel. Does this capture kernel run on the same machine or remotely?


title: How to kill a process with a single command?

text: I want to kill a process, after finding the id in a single step. I currently use these two commands:               pidof <name>     kill <#number_which_is_result_of_command>      How can I write a single command to do this?


title: Are there rc logs in arch?

text: One of my processes is failing to start fairly early in the boot process (I suspect mdadm and I suspect that it's just taking longer than the rc script allows for) but I can't quite catch/see it during boot and Arch clears the screen before the login prompt appears. Does Arch keep any logs of the init process that might show or is there any way to see what was on the screen before it clears or keep it from clearing the screen? _update_ I'm really talking about the rc scripts and output to the screen... This does not actually translate to things sent to the system logs or errors output by daemons unfortunately. Gentoo had a special log just for the boot output, but it wasn't enabled by default, I'm hoping Arch has something similar.


title: 802.1X authentication with NetworkManager

text: I have a plain DHCP wired connection at home, and a wired connection secured with 802.1X at the office. I need to use the right parameters in each location. I've configured both connections with NetworkManager, but now when I'm at home the NM GUI asks me to re-enter identity data, it doesn't try to establish an unsecured connection. How can I configure the NetworkManager to use the right connection in both locations? Are there any attributes for wired networks, like, a MAC of the DHCP server, or the availability of the authentication server? I can also use another utility instead of NM if it's easier.


title: Which process has PID 0?

text: I'm looking for the process started in Linux which has process ID 0. I know `init` has PID 1 , which is the first process in Linux, is there any process with PID 0?


title: How to use the same emacs daemon for user and root accounts?

text: I often work in both user and root accounts but I don't like that I have two emacs daemons running for each user. Is it possible to set the same, only one emacs daemon for user's and root's clients?


title: iptables rule to transfer UDP through a SSH tunnel

text: **The problem** I have two programs that runs on two distant computers and communicate through a specific protocol. All I know is that this protocol only communicates through UDP and uses the ports 1101 and 1102 and that both computers need to be on the same local network. I already managed to do this using a VPN (p2p), but I wonder if it is possible using iptables through SSH tunnel (SSH tunnel is mandatory here). I use two Linux Debian wheezy servers to open a tunnel over internet between the two programs. I managed to create a SSH tunnel that redirects UDP traffic from one side to the other (for all ports), but this does not work. To do so I use socat (here the representation for port 1101):               transmission from computer1 --> port 1101/server1 --> socat to port 61101 --->     ---> ssh tunnel --->      ---> socat from port 61101--> port 1101/server2 --> reception on computer2      My goal is to make "server2" behaves exactly as it was "computer1" from "computer2"'s point of view (and vice versa). IP addresses have to be translated correctly when transmitting packets and tranfered data have to be changed accordingly. SSH is configured with automated login using keyfiles. **My tunnel configuration** This is how I configured the tunnel in order to redirect both ports in both directions.               #From server1's shell      $ ssh -f -N -T -R51101:localhost:51101 login@server2 # reverse tunnel for port 1101     $ ssh -f -N -T -R51102:localhost:51102 login@server2 # reverse tunnel for port 1102     $ ssh -f -N -T -L61101:localhost:61101 login@server2 # tunnel for port 1101     $ ssh -f -N -T -L61102:localhost:61102 login@server2 # tunnel for port 1102          #socat redirection on server1     $ socat TCP4-LISTEN:51101,fork UDP4:server1:1101 #redirects from the tunnel to the local 1101 port     $ socat TCP4-LISTEN:51102,fork UDP4:server1:1102 #redirects from the tunnel to the local 1102 port     $ sudo socat -d -d UDP4-LISTEN:1101,fork,bind=1101 TCP4:localhost:61101  #redirects to both tunnel and local UDP port 1101     $ sudo socat -d -d UDP4-LISTEN:1102,fork,bind=1102 TCP4:localhost:61102  #redirects to both tunnel and local UDP port 1102          #From server2's shell      #socat redirection on server2     $ socat TCP4-LISTEN:61101,fork UDP4:server1:1101 #redirects from the tunnel to the local 1101 port     $ socat TCP4-LISTEN:61102,fork UDP4:server1:1102 #redirects from the tunnel to the local 1102 port     $ sudo socat -d -d UDP4-LISTEN:1101,fork,bind=1101 TCP4:localhost:51101  #redirects to both tunnel and local UDP port 1101     $ sudo socat -d -d UDP4-LISTEN:1102,fork,bind=1102 TCP4:localhost:51102  #redirects to both tunnel and local UDP port 1102      I think it possible to do this using iptables, but I don't know how to do this. Anyone having a solution ? Or a recipe on how to make correct address translation using iptables ?


title: Putting Linux processes on certain CPU cores

text: > **Possible Duplicate:**   >  How can I set the processor affinity of a process on Linux? Computer CPUs have many cores insde them nowadays. I have always wondered if there is a way to, when I start a process on the Linux command line, specify which particular core or cores that process might use? For example, can I start a massive grep task and say "use ALL of CPU2 for yourself". Or could I start a find task and say "never leave CPU3". Or maybe I could start a video decoding task and say "use whatever is available on CPU1 and CPU2" OR, is there no way to do this because it is not needed and the OS is doing this kind of stuff intelligently by itself (based on nice levels and general resource usage of the process etc) IfyouknowwhatImean


title: Duplicating a Linux installation (Yum-based)

text: Given an installation based on Yum (specifically in my case, a Scientific Linux 5.1 x86_64 installation), how would I duplicate the installed programs and utilities to a new machine based on Fedora Core x86_64? The hardware is very similar but not identical, and there's the obvious difference that SL5 is based on EL, not on Fedora; I'm largely aiming to duplicate the user experience from the original box (SL) to the new box (FC).


title: rm -fr not working

text: I have a directory that was generated by mistake by an application and this directory has a structure that involves more than 2000 directories, one inside a another, something like: Directory `aaaa` inside `bob` inside `ccc` inside `ddd` inside `eee` etc. These are 1000 levels deep and many of these directories have names where spaces are URL encoded (spaces are `%20` and `>` are `%3E` etc). If I try to remove that directory using `rm -fr` I get the message `directory is not empty`. I think the string necessary to remove a directory is too long for UNIX. Is there a way to delete this directory with `rm`? I am on Mac OS X Mountain Lion.