title: pulse-audio does not recognise my Logitech mic and my Webcam mic

text: I use the (great) AK5370 microphone for Skype, but it is not recognized by my archlinux i86_64. It also fails to recognize the mic on my Logitech Webcam (PTZ, which I do not use). Both are connected through the monitor's built-in hub, and both work through hubs an another system. Both work on the same hardware with Ubuntu and Windows. Here they are on lsusb…                ~]# lsusb     Bus 001 Device 002: ID 03f0:2524 Hewlett-Packard LP3065 30" Monitor Hub     Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 001 Device 003: ID 1532:001c Razer USA, Ltd RZ01-0036 Optical Gaming Mouse [Abyssus]     Bus 001 Device 004: ID 04ca:002a Lite-On Technology Corp.      Bus 001 Device 005: ID 0556:0001 Asahi Kasei Microsystems Co., Ltd AK5370 I/F A/D Converter     Bus 001 Device 006: ID 046d:08cc Logitech, Inc. Mic (PTZ)      But not on aplay's list-devices...               ]$ aplay --list-devices     **** List of PLAYBACK Hardware Devices ****     card 0: NVidia [HDA NVidia], device 0: ALC1200 Analog [ALC1200 Analog]       Subdevices: 0/1       Subdevice #0: subdevice #0     card 0: NVidia [HDA NVidia], device 3: ALC1200 Digital [ALC1200 Digital]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 1: NVidia_1 [HDA NVidia], device 3: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 1: NVidia_1 [HDA NVidia], device 7: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 1: NVidia_1 [HDA NVidia], device 8: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 1: NVidia_1 [HDA NVidia], device 9: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: NVidia_2 [HDA NVidia], device 3: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: NVidia_2 [HDA NVidia], device 7: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: NVidia_2 [HDA NVidia], device 8: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 2: NVidia_2 [HDA NVidia], device 9: HDMI 0 [HDMI 0]       Subdevices: 1/1      note: card0 mobo card1&2 nvidia graphics (not used) PulseAudio Volume Control reports "No input device available". No problem with these devices on other systems Alas... pulseaudio 3.0-3 pavucontrol 2.0-1 skype 4.2.0.11-1 alsa-lib 1.0.27.1-1 * * * Note: the webcam (UVC) with the min (PTZ) is recognized and works. * * * Per _Ignacio Vazquez-Abrams_... (thanks)               ~]$ lsmod | grep '^snd' | column -t     snd_usb_audio          112569  0     snd_usbmidi_lib        18931   1   snd_usb_audio     snd_rawmidi            18742   1   snd_usbmidi_lib     snd_seq_device         5180    1   snd_rawmidi     snd_hda_codec_hdmi     29298   8     snd_hda_codec_realtek  30893   1     snd_hda_intel          35816   4     snd_hda_codec          145704  3   snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel     snd_hwdep              6364    2   snd_usb_audio,snd_hda_codec     snd_pcm                76860   4   snd_usb_audio,snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel     snd_page_alloc         7330    2   snd_pcm,snd_hda_intel     snd_timer              18687   1   snd_pcm     snd                    58893   19  snd_hda_codec_realtek,snd_usb_audio,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_rawmidi,snd_usbmidi_lib,snd_hda_codec,snd_hda_intel,snd_seq_device      And in addition...               ]# ls -l /dev/snd     total 0     drwxr-xr-x  2 root root      100 May 24 10:07 by-path     crw-rw----+ 1 root audio 116,  8 May 24 10:07 controlC0     crw-rw----+ 1 root audio 116, 17 May 24 10:07 controlC1     crw-rw----+ 1 root audio 116, 26 May 24 10:07 controlC2     crw-rw----+ 1 root audio 116,  7 May 24 10:07 hwC0D0     crw-rw----+ 1 root audio 116, 16 May 24 10:07 hwC1D0     crw-rw----+ 1 root audio 116, 15 May 24 10:07 hwC1D1     crw-rw----+ 1 root audio 116, 14 May 24 10:07 hwC1D2     crw-rw----+ 1 root audio 116, 13 May 24 10:07 hwC1D3     crw-rw----+ 1 root audio 116, 25 May 24 10:07 hwC2D0     crw-rw----+ 1 root audio 116, 24 May 24 10:07 hwC2D1     crw-rw----+ 1 root audio 116, 23 May 24 10:07 hwC2D2     crw-rw----+ 1 root audio 116, 22 May 24 10:07 hwC2D3     crw-rw----+ 1 root audio 116,  6 May 24 10:07 pcmC0D0c     crw-rw----+ 1 root audio 116,  5 May 24 14:51 pcmC0D0p     crw-rw----+ 1 root audio 116,  2 May 24 10:07 pcmC0D2c     crw-rw----+ 1 root audio 116,  4 May 24 10:07 pcmC0D3c     crw-rw----+ 1 root audio 116,  3 May 24 10:07 pcmC0D3p     crw-rw----+ 1 root audio 116, 12 May 24 10:07 pcmC1D3p     crw-rw----+ 1 root audio 116, 11 May 24 10:07 pcmC1D7p     crw-rw----+ 1 root audio 116, 10 May 24 10:07 pcmC1D8p     crw-rw----+ 1 root audio 116,  9 May 24 10:07 pcmC1D9p     crw-rw----+ 1 root audio 116, 21 May 24 10:07 pcmC2D3p     crw-rw----+ 1 root audio 116, 20 May 24 10:07 pcmC2D7p     crw-rw----+ 1 root audio 116, 19 May 24 10:07 pcmC2D8p     crw-rw----+ 1 root audio 116, 18 May 24 10:07 pcmC2D9p     crw-rw----  1 root audio 116,  1 May 24 10:06 seq     crw-rw----+ 1 root audio 116, 33 May 24 10:07 timer


title: How to fix Mint 16 Desktop crash/freeze after adding second toolbar and enabling/disabling monitor?

text: My operating system is Mint 16, forgot what flavor, probably KDE. My desktop crashed after I connected a second monitor, added a second toolbar to the second monitor and then disable the monitor, and then rebooted. After I rebooted, my desktop is now frozen, with a fuzzy blank toolbar. I forgot what the command is to open up the terminal outside of the desktop environment. The last time this happened to me, my friend explained to me that two desktops were running at the same time and a "watcher" program was disabling the second desktop environment while a "checker" was re-enabling the second desktop environment at the speed of the computer clock. My conky reports a 100% CPU usage, though I forgot to check the name of the top running programs. The power block was reporting 95 watts continuous. How do I fix my Mint 16 Desktop crash/freeze after adding a second toolbar and enabling/disabling monitor?


title: openSUSE Linux Kiosk Setup

text: Working on setting up a kiosk with openSUSE, where users can only view a single webpage. Obviously open to any Linux distro. Also would prefer to use Gnome. I'm wanting only Firefox to be available (which will be displaying a local webpage), a link on the desktop and the home page to open full screen when booted up and logged in automatically. Just interested in some guidance, or if there are any tools that could be used to 'lock down' the system. Thanks!


title: How to use the "source" command to do parallel computing?

text: For example, I have an executable called `ex01` (C++ program). And I have a text file that contains a set of invocations of this program with different arguments. The text file looks like this:               ./ex01 command1 > ex.dat  &     ./ex01 command2 >> ex.dat &     ./ex01 command3 >> ex.dat &     ...      I can use the `source` command to do this task automatically. But I was hoping to do this in parallel. How can I do that?


title: Installing a gedit plugin on Fedora

text: I have been trying to install a gedit plugin called RunC to compile C programs using the text editor. Although the instructions tell me to use ubuntu 9 or 10 for this, I'm currently running Fedora 16. I thought that I would not have much problems, but after running the shell script using the sh command to install the plugin, gedit showed no signs of the plugin being installed. I've made sure that gedit is updated to the current release. Is there something I'm missing from this installation? Additionally, does the file structure of various distributions differ greatly from each other? Will scripts that work for one distro be incompatible with another? Thanks for indulging me with my silly questions. Attached below is the RunC plugin for gedit: http://plg1.uwaterloo.ca/~gvcormac/RunC/


title: How to determine which sd* is usb?

text: > **Possible Duplicate:**   >  How to know if /dev/sdX is a connected USB or HDD? The output of `ls /dev/sd*` on my system is -               sda  sda1  sda2  sda3  sda4  sda5  sda6  sda7  sdb  sdc  sdc1  sdc2      How should I determine which drive is which?


title: Initramfs post-update hook

text: I need an initramfs hook to call a script after an initramfs has been generated. The Debian Linux Kernel Handbook mentions `/etc/initramfs/post-update.d/`: > Packages for boot loaders that need to be updated whenever the files they > load are modified must also install hook scripts in `/etc/initramfs/post- > update.d`. […] The arguments given to these hook scripts are the kernel ABI > version and the absolute path to the initramfs image. This is exactly what I need, but this directory doesn't exist on my system. Though the directory `/etc/initramfs-tools/` exists, but it doesn't contain a `post-update.d`. Where is the correct place to hook in such a script? OS: Debian sid


title: Installing a .deb package on Arch - Is it possible?

text: The problem is simple - I have a .deb package and I want to install it on my Arch Linux. Is this possible? If yes, how?


title: How to assign tasks to GPU

text: I have found a benchmark from computerbase.de (http://www.computerbase.de/artikel/grafikkarten/2013/intel-haswell-grafik- fuer-desktop-pcs-im-test/3/ in german) where in one case a task (here video transcoding) is done by the CPU and in the other case by the (integrated) GPU: ![enter image description here](http://i.stack.imgur.com/NlRjz.png) How can I assign a task (for example video transcoding) explicitly to the GPU in linux?


title: Debian Wheezy live - gparted, dmsg, fdisk etc. do not detect local hard drive but it is shown during installation

text: Yesterday I finished backing up my data and it was time to wipe that HDD of mine for good and freshly install Debian Wheezy stable with **Xfce** as a WM. I've booted into a live session to see if things like sound, wireless etc. work and they did without a problem. However I was surprised that after I installed gparted (again: live session) I was facing a single partition with approx 7.5GB (the size of my USB key). Okay, it automatically shows the device where the OS is booted from. However when I looked at the drop-down menu (top right) for selecting a device I saw that only **/dev/sda1 (7.48GB)** was available. No local hard drive at all. I opened the terminal and did               dmsg | less      after that               df -h      and finally               sudo  fdisk -l      but all was in vain. The only thing that I'm looking at was my USB key and that's all. Then I decided to see how the installation goes and if the same issue occurs. For my (delightful) surprise when I got to the _Detecting hardware_ and then to the _Partition hard disks_ part there it was - almost 500GB of space. The only thing that's bothering me is the amount of time the formatting takes. Is it normal for a 3 hours of formatting to do only 13% of the 500GB? I remember clearly when I installed Ubuntu 12.04 LTS years ago that it took much less even though back then I also had a dual boot with Win7 and multiple other partitions so the formated space was like 200GB. That's the reason why I wanted to use gparted in a live session in the first place because gparted is usually pretty fast when wiping stuff and at least that I could do in order to boost the installation process of my Debian. Any ideas why gparted, fdisk etc. are not showing my hard disk? I also clearly remember that back then when I installed Ubuntu I also checked the situation with gparted. Even though it was again a live session, everything showed as expected - both USB key and HDD.


title: Oldest binary working on Linux?

text: In a discussion on backwards-compatibility in Linux kernel and GUI ABIs, Alan Cox notes that " _my 3.6rc kernel will still run a Rogue binary built in 1992. X is back compatible to apps far older than Linux._ " So just how backwards-compatible are the Linux Application binary interfaces? _What is the oldest binary executable, actually written and compiled years ago, that will still run on a modern stock general-purpose Linux distribution?_ I'm sure all those words are subject to interpretation. My main notion is that it is not fair to run it via an emulator or specialized virtual machine or binary translator, but some such things are probably built into some modern distros, and learning about that is part of the fun here. Variations by hardware architecture, executable file format, language, and major library dynamic loading dependencies are also of interest. Note, when the rules are relaxed, here's one example of going further back. The 2002 web page Running a.out executables on modern Red Hat Linux talks about using _really_ old Linux pre-ELF a.out-format executables after doing `modprobe binfmt_aout` and obtaining `/lib/ld.so` and `libc.so.4` Again that's of peripheral interest for this question, but illustrates the sorts of things that can be involved when digging further back. **Update** for you BSD fans, it's great to see that iBCS2 was supporting old Xenix apps (like zork/dungeon-2.5.6 from 1990) and SCO OpenServer 5.0.x apps as recently as NetBSD 4.0.1 (from 2008): iBCS2 & NetBSD | Fun with virtualization. But the same thing seems broken in NetBSD 5.0.x. **Update 2** : One year later, after even getting an "Announcer" badge for this question, I'm still looking for an answer. And to clarify, since this is about APIs, it should be a "real" binary (non-zero length), that still at least mostly works in the original way.


title: PPTP with dhcp only for clients

text: I have a local network at home with a router and a small server. The router manages the local network (DHCP, etc) but does not support PPTP. On the server (Ubuntu 12.04) I set up pptpd and this is working fine ... except that the dhcp3 server started by pptpd is now conflicting with the router. My other systems get answers from two DHCP servers - and not all of them are able to handle it properly (namely my Android tablet). I have no idea where to start fixing this (except using static IP addresses for my VPN). Any ideas would be appreciated.


title: Find FreeBSD ports that depend on another port

text: I have a headless FreeBSD server where some port has installed tons of X11-related packages. I would like to find out what these ports are so I can get rid of the unwanted X-related packages. Is there a way to figure this out?


title: What is the best way to find a list of several strings within a large text file

text: The short, general question is: In Unix/Linux, what is the best way to find a list of several (about 150) strings within a large text file? I am asking this to all Unix/Linux experts as a general question, in the hopes that I can find a solution that pertains to my particular case: I have a feeling this is going to take a little tinkering. I have a large text file (actually, an MVS dataset) on an IBM Unix System Services (USS) machine-- I believe it is somewhere around 6GB. I also have a list of about 150 5-character identifiers in the format AAAAA that I need to find within this file-- that is, I'd like to extract rows from the file that contain any one of the 150 the specific identifers that I am looking for. The format of each line in the large file is:               00000000000A00000000000000000AAAAA\n      where 0 represents a digit, and A represents an alphanumeric character. The string that I'm searching for is always at the end of the row. Working with datasets seems to be a little awkward in USS, and I am not able to copy it over into the Unix environment because it is too large. The standard Unix utilities don't all operate on datasets (dd for example); however sed, awk, and grep seem to work to some degree (although the command line switches seem to be a bit different). I can grep the dataset as follows:               cat  "//'MVS.DATASET'" | grep -e"LOOKFOR1" -e"LOOKFOR2" -e"LOOKFOR3" > output_to_file.txt      However, it won't allow me to grep for all 150 items on one line; I could split it up and run it several times, but I feel like there should a better way. I tried using a sed script as follows, but I don't know sed at all, and I got an error that said "garbage after command". I saved the following in a file sed-script.txt:               s/AAA01/&/p     s/AAA30/&/p     s/AAA10/&/p     ... etc ...      and then ran `sed -f sed-script.txt "//'MVS.DATASET'"` Again, this failed with "sed: FSUM7294 garbage after command". So, 1. How would one normally tackle this problem in the "average" Unix environment, and 2. Do you have any specific insights to this particular case?


title: Problem creating a group in a repo : " yum-groups-manager: error: no such option: --default "

text: When you run:                yum groupinfo "Desktop"      you get 3 categories..   * Mandatory Packages   * Default Packages   * Optional Packages This is the command I ran:               yum-groups-manager -n "Desktop" --id=desktop --save=Desktop.xml \     --mandatory  \     NetworkManager \     NetworkManager-gnome  \     alsa-plugins-pulseaudio  \     at-spi  \     control-center  \     dbus  \     gdm  \     gdm-user-switch-applet  \     gnome-panel  \     gnome-power-manager  \     gnome-screensaver  \     gnome-session  \     gnome-terminal  \     gvfs-archive  \     gvfs-fuse  \     gvfs-smb \     metacity \     nautilus  \     notification-daemon  \     polkit-gnome  \     xdg-user-dirs-gtk  \     yelp \     --default  \     control-center-extra  \     eog  \     gdm-plugin-fingerprint  \     gnome-applets  \     gnome-media  \     gnome-packagekit  \     gnome-vfs2-smb  \     gok  \     openssh-askpass  \     orca  \     pulseaudio-module-gconf  \     pulseaudio-module-x11  \     rhn-setup-gnome  \     vino      This is the error message:               yum-groups-manager: error: no such option: --default      Why would this option not be available? Because if we are to run:                yum groupinfo "Desktop"      Here is the result:               Group: Desktop      Description: A minimal desktop that can also be used as a thin client.      Mandatory Packages:        NetworkManager        NetworkManager-gnome        alsa-plugins-pulseaudio        at-spi        control-center        dbus        gdm        gdm-user-switch-applet        gnome-panel        gnome-power-manager        gnome-screensaver        gnome-session        gnome-terminal        gvfs-archive        gvfs-fuse        gvfs-smb        metacity        nautilus        notification-daemon        polkit-gnome        xdg-user-dirs-gtk        yelp      Default Packages:        control-center-extra        eog        gdm-plugin-fingerprint        gnome-applets        gnome-media        gnome-packagekit        gnome-vfs2-smb        gok        openssh-askpass        orca        pulseaudio-module-gconf        pulseaudio-module-x11        rhn-setup-gnome        vino      Optional Packages:        sabayon-apply        tigervnc-server        xguest      As it can be seen, there is more than just the category called "mandatory". There is also "default" and "optional", and yet the attempt replicate this group fails above because it won't allow "default" category to be placed into the group that is being created. ### UPDATE I'm using CentOS Linux 6.4 desktop


title: NetworkManager connection sharing doesn't seem to NAT packets

text: After setting up network sharing the easy way on the Ubuntu machine, and getting an IP address via DHCP on the Arch Linux machine downstream, the Arch machine is able to `ssh` to the Ubuntu machine and resolve DNS, but not communicate with the Internet (`ping`, `pacman` time out). From the Arch Linux machine:               $ ip route show dev net0     default via 10.42.0.1 metric 202     10.42.0.0/24 proto kernel scope link src 10.42.0.15 metric 202     $ ip addr show dev net0     ...     inet 10.42.0.15/24 brd 10.42.0.255 scope global net0     ...      On the Ubuntu machine:               $ ip addr show dev eth0     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000         link/ether e8:11:32:66:e3:4d brd ff:ff:ff:ff:ff:ff         inet 10.42.0.1/24 brd 10.42.0.255 scope global eth0         inet6 fe80::ea11:32ff:fe66:e34d/64 scope link             valid_lft forever preferred_lft forever     $ ip addr show dev wlan0     3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000         link/ether 88:53:2e:1b:4b:1c brd ff:ff:ff:ff:ff:ff         inet 192.168.1.64/24 brd 192.168.1.255 scope global wlan0         inet6 fe80::8a53:2eff:fe1b:4b1c/64 scope link             valid_lft forever preferred_lft forever      Could it be that the automatic NAT setup on Ubuntu failed? I'm not sure how that works, so how would I detect that?


title: If I have a netbook, is the output of xrandr relevant for buying a large external monitor?

text: I have a netbook I want to use in order to do some video editing. I am planning to buy a bigger, wider screen. Presumably even if the wider screen runs in a different resolution than my netbook screen, that should be OK. But I want to make sure that the screen I buy works well with the netbook.               linux-3g16:/home/me # lspci     00:00.0 Host bridge: Intel Corporation N10 Family DMI Bridge     00:02.0 VGA compatible controller: Intel Corporation N10 Family Integrated Graphics Controller     00:02.1 Display controller: Intel Corporation N10 Family Integrated Graphics Controller          linux-3g16:/home/me # xrandr     Screen 0: minimum 320 x 200, current 1024 x 600, maximum 4096 x 4096     LVDS1 connected 1024x600+0+0 (normal left inverted right x axis y axis) 223mm x 125mm        1024x600       60.0*+        800x600        60.3     56.2          640x480        59.9       VGA1 disconnected (normal left inverted right x axis y axis)      So that tells me that the maximum resolution I can expect to get is 4096x4096, right? But how do I list all available display modes. The screen I want may be wider than usual.


title: Select code block in vim

text: Given a code like this:               588          while ($linecounter > 0) {     589             $token = " ";     590             while ($token != PHP_EOL) {     591                 if (fseek($handle, $pos, SEEK_END) == -1) {     592                     $beginning = true;     593                     break;     594                 }     595                 $token = fgetc($handle);     596                 $pos--;     597             }     598             $linecounter--;     599             if ($beginning) {     600                 rewind($handle);     601             }     602         }      The cursor is at the character `=` in the line 590. Which is the most efficient way to select the code block:   1. lines 590-597   2. lines 591-596 (just the inner part)


title: Apache 70007 and 70014 errors

text: I have a service where mobile phones send a big hash of data to our server which are sitting on AWS behind the ELB. Once in a while we receive 70007 and 70014 errors in the apache error logs, the requests shows on apache access.log but not in rails logs. I'm trying to figure out what these errors are. Our Theory right now is the phone gets disconnected and it happens before the send us the requests so it never hit the rails server. Errors are the following:               Unexpected error in mod_passenger: An error occurred while receiving HTTP upload data: The timeout specified has expired (70007)     Unexpected error in mod_passenger: An error occurred while receiving HTTP upload data: End of file found (70014)      From all the googleing I've done, This is what I've got: 70014: end of file error, which makes total sense according to our theory. 70007: Time out. I put %D on apache log format and I get the time is between 10-90 seconds. Our Apache Timeout setting is 300 seconds. Also a lot of the requests takes longer than 10 seconds and they don't time out. I also thought it could be TCP timeout, but after investigating realized the TCP timeout is et to 7200 seconds; so that's not it either. Any idea what this could be? where else I should be looking?


Why can't I sed two [or more..] empty lines to one empty line? What is the trick?               echo -e "hello\n\n\nhello2" | sed 's/^$\n^$/\n/g'     hello               hello2


title: Regarding generating intersection and union of two csv files

text: I have two csv files, there are some overlap columns between these two files. Assume one file is called as A.csv and another is called as B.csv. The intersection of A and B is called as C. I would like to generate three new csv files: C; the subset of B after subtracting C from it, which is called as D; the union of A and D, which is called as E. Are there any ways to do that in Linux/Unix using command without applying heavy weight programming languages?


title: compare two files get identical list

text: file1.txt (50 lines)               TERYUFV00000010753     TERYUFV00000009526       file2.txt (500 lines)               TERYUFV00000009526 refids_739_known_8/10_target     TERYUFV00000018907 refids_12023_known_21/22_target     TERYUFV00000010753 refids_11775_known_1/1_target      Output.txt               TERYUFV00000010753 refids_11775_known_1/1_target     TERYUFV00000009526 refids_739_known_8/10_target      Compare file1.txt (has 50 lines) with file2.txt (has 500 lines), get the list from file2.txt which are identical to file1.txt. I tried both join & fgrep command and it outputs empty file


title: Why are some file changes not shown in tail -f?

text: I tried to follow the mysql history file with:               tail -f ~/.mysql_history      in another window I entered as the same user:               mysql -u someotheruser -p      and none of the following commands are shown in my tail. when I exit the mysql console there is still nothing shown in the `tail -f`, although, when I `cat` the history file, I see, that there are new entries at the end of the file


title: What is the :0 terminal in the who command's output?

text: When I type `who` in my console terminal, I get the following output:               hubert   :0           2014-05-16 21:40 (:0)     hubert   pts/0        2014-05-16 21:46 (:0)      From `info who` I know that both `:0` and `pts/0` should name instances of the terminal. It is clear to me what `pts/0` means but I have no idea how to interpret the first line of the output. What is even more confusing, when I type who `hubert :0`, I get:               hubert   pts/0        2014-05-16 21:46 (:0)


title: How can I hook functionality to the "go to line"-command in Vim?

text: I just got the idea that I wanted to make it so that Vim centered around a line when I jump to it. Is there a way to make `zz` be executed automatically after I have called the colon command followed by only digits (`:175` for example)?


title: pam ldap authentication an AWS EC2 ami (Amazon's ami)

text: I have some custom built instances running in AWS EC2 that are configured with ldap authentication. I have now brought up one of the AWS-provided EC2 AMIs, and am trying to configure it to work with pam authentication. This is a relatively straight forward configuration, but for some reason, pam / ldap is not working. Here's a quick summary of how I have configured the instance, anything obvious I am missing? Installed software (yum / rpm, over and above default, relevant to this setup): pam_ldap nss-pam-ldapd Configuration: /etc/ldap.conf - configured with a copy of an ldap.conf from my custom-built AMI - identical parameters. The following parameters are used (values omitted, only relevant config shown - excluding ssl / tls config stuff):               uri     timelimit     base     scope     suffix     ldap_version 3     binddn     bindpw     rootbinddn          pam_filter     pam_login_attribute     pam_member_attribute     pam_password     pam_check_host_attr          nss_base_passwd (x 2 of these)     nss_base_shadow     nss_base_group     nss_base_hosts          nss_initgroups_ignoreusers      /etc/nsswitch.conf               passwd:     files ldap     shadow:     files ldap     group:      files ldap      /etc/openldap/ldap.conf               URI ldap://my-ldap-server     BASE dc=organization,dc=com      /etc/pam_ldap.conf - this file is only on the AWS-provided AMI. I copied the config from /etc/ldap.conf to this file to try get things working /etc/pam.d/system-auth (showing context of +1 and -1 lines. Added lines indicated with a "+"):               auth        sufficient    pam_unix.so nullok try_first_pass     + auth        sufficient    pam_ldap.so use_first_pass     auth        requisite     pam_succeed_if.so uid >= 500 quiet          account     sufficient    pam_localuser.so     + account     [default=bad success=ok user_unknown=ignore] pam_ldap.so     account     sufficient    pam_succeed_if.so uid < 500 quiet          password    sufficient    pam_unix.so sha512 shadow nullok try_first_pass use_authtok     + password    sufficient    pam_ldap.so use_authtok     password    required      pam_deny.so          session     required      pam_limits.so     + session     optional      pam_mkhomedir.so skel=/etc/skel umask=0077     session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid     session     required      pam_unix.so     + session     optional      pam_ldap.so      To test, I try `getend passwd` or `getent group` and don't see any of my ldap- based entries. any ideas as to where I am going wrong? /var/log/messages and secure don't give any indication of errors.


title: Concatenate in a PDF the first page of several odt files alphabetically

text: I have, in the same directory, several odt files. I'd like to have in one PDF document the first page of these odt files, sorted alphabetically based on their filename. For example, if I have these files:   * `a.odt`   * `b.odt`   * `c.odt` I would have a resulting PDF that has 3 pages: the first one of `a.odt`, then the first one of `b.odt` and then the first one of `c.pdf`. Does any one of you think about a command to do that?


title: What do the fields in ls -al output mean?

text: The `ls -al` command shows the following output;               -rwxrw-r--    10    root   root 2048    Jan 13 07:11 afile.exe      What are all the fields in the preceding display?


title: how to mirror four monitors with 2 nvidia cards on debian?

text: I have 2 nvidia GeForce GT 610 video cards with 2 monitors plugged to each one of them. I can mirror the A and B and C to D but I want them all to show A. pleas help =)


title: Special character '#' in Perl SSH command

text: I try to send command using SSH in my perl script with # but it gets truncated right at # Example: Input text is :               $message = "Product ID # STK000134"      The SSH command is :               $execute=`ssh -q id@host /usr/message/send -pin $pager_num -message $message`;      What pass through is :               ssh -q id@host /usr/message/send -pin $pager_num -message Product ID       Instead of :               ssh -q id@host /usr/message/send -pin $pager_num -message Product ID # STK000134      How to I ensure that # and all text behind # will get through?


title: Why don't Linux terminal emulators support full colors?

text: I just upgraded my gnome-terminal to use 256 colors, yet I am a bit puzzled on the reason why a terminal emulator can't support the full palette any modern desktop environment provides. I guess there's a technical reason for this, but I am not aware of it.


title: Avoid reformatting bullet lists with formatoptions+=a

text: I am using Vim with `formatoptions +=a` as described in Vim: word wrap for documents to format lines automatically while I write documents, expecially Markdown documents. My problem is that Vim wants to reformat also bullet lists because there is blank line between each bullet point. What happes is that vim reformats               This is wath we will do:          * task 1,     * task 2,     * task 3.      into               This is wath we will do:          * task 1,   task 2,   task 3.      (I also do not understand why the asterisks disappear in this reformatting process.) How can I make Vim stop reformatting these lists?


title: Where to start to learn OpenGL

text: As OpenGL evolves, it seems that there are three camps:   * OpenGL legacy, packed with "deprecated APIs"   * OpenGL ES, for embedded systems   * OpenGL "new stuff" which comes out every couple of months. If I wanted to learn OpenGL for modern systems, where should I start? And most importantly, is there a reason to go beyond OpenGL ES for someone that has never done OpenGL before?


title: Accessing a remote OSX system from OSX, Linux, Windows

text: Is it possible to connect to a remote OSX machine using OSX, Linux or Windows in a way similar to Windows' remote desktop?


title: 256 Colors in xterm and tmux [in FreeBSD 10]

text: So these past few days I am working to make Xterm and tmux show all the 256 colors available in them by default. I reach these conclusions:   * for tmux to show 256 colors you have to make xterm to show it.   * `export TERM=xterm-256color` in `~/.bashrc` make xterm to show all 256 color. but this is problematic; when you do that you set the whole terminal to xterm and even urxvt will report back its **$TERM** as Xterm not `rxvt-unicode-256color`. So I am looking for the way to just target the xterm. and leave other terminal emulators alone. PS: I had the same problem ith Urxvt but I solved it by tweaking its Makefile and removed `\--with-rxvt`


title: Dovecot: Corrupted index cache file

text: I received following error message in `/var/mail/mail.err`:               Jun 14 00:03:42 max dovecot: IMAP(bernhard):      Corrupted index cache file /home/bernhard/Mail/.indexes/.imap/INBOX/dovecot.index.cache:      Broken virtual size for mail UID 5618      What is the preferred way to restore the index?


title: debootstrap error in Ubuntu 13.04 raring

text: I'm trying to create a file system in Ubuntu with the command:               sudo debootstrap --foreign --no-check-gpg --include=ca-certificates --arch=armhf testing rootfs http://debian.raspbian.com/debian      but it got the following error:               /usr/sbin/debootstrap: 1294: /usr/sbin/debootstrap: cannot create /home/.../rootfs/test-dev-null: Permission denied     E: Cannot install into target '/home/.../rootfs' mounted with noexec or nodev      can anyone help me here?


title: vaio grub removal after default windows setup

text: After installing default factory windows xp from VAIO VGN-NR, and hence removing the Ubuntu on its hard drive, the grub does not allow the windows to boot up properly, giving the prompt: "no such partition" and grub rescue appears. The Windows can not be recovered by rescue mode, since the administrator password of newly installed default windows (from hidden drive on the laptop) is not known to me. Booting up with live-Ubuntu and trying to erase the MBR did not help a bit.               dd if=/dev/null of=/dev/sdX bs=446 count=1      I can simply install another windows on it, fixmbr and fixboot it and re- install the original factory windows. But I'm not like that. I want to find a way through, not around. Any suggestion?


title: What is the difference between `/sbin/ip route` and `/sbin/route`?

text: Linux comes with two utilities   * `/sbin/route`   * `/sbin/ip route` What is the difference between the two and what is the rule of thumb to use when you decide which one of the two you should use? I know they're both documented in two separate locations,   * `man 8 route`   * `man 8 ip-route`


title: What is the architecture of Mac OS X's windowing system?

text: I am familiar with how the X11 system works, where clients connect via a socket to the server process and send operations to the window server to perform certain operations on their behalf. But I do not understand (and I could not find good documents) describing how a GUI application interacts with the window system on Mac OS X. Some of the questions that I have include:   * How does an app receive events from the windowing system?   * Does the app need to register with the kernel, or some windowing system server?   * How does the windowing system request that an app update its display?   * How does an app trigger a re-display operation?   * Is there a socket-based protocol, or some other RPC system to the windowing system?   * Does the windowing system, or the application, have direct hardware access?    * What are the operations available between client apps and the windowing system?


title: Unix sed command to find multiple string patterns

text: Scenario here is I need to replace `"$$file_name="` value.. I have some 150 file names in a file as mentioned below.. Eg: $$file_name=abc.bbb.ccc to_be ---> $$file_name=abc.bbb.cccV1 AS_IS :               $$a=abc.txt     $$file_name=abc.ddd.aaa     $$directory=/uasdua/asdsas          $$a=c.txt     $$file_name=ac.dd.ac     $$directory=/uasdua/asdsas          $$a=b.txt     $$file_name=ee.d.a     $$directory=/uasdua/asdsas     .     .     .     .     .     .     $$a=b.txt     $$directory=/uasdua/asdsas     $$file_name=e.d.a      to_be:               $$a=abc.txt     $$file_name=abc.ddd.aaaV1     $$directory=/uasdua/asdsas          $$a=c.txt     $$file_name=ac.dd.acV1     $$directory=/uasdua/asdsas          $$a=b.txt     $$file_name=ee.d.aV1     $$directory=/uasdua/asdsas     .     .     .     .     .     .     $$a=b.txt     $$directory=/uasdua/asdsas     $$file_name=e.d.aV1      This is what i've tried               select NAME from xxx where DATE='07/12/1999' > Name_file          #version will be same for that day     FILE_VERSION=`db2 -x "select version from xxx where DATE='07/12/1999'"` > version_name     FILE_VER=`cat version_name | head -1`          while read filename      do         FILE_NAME1=`echo ${filename}${FILE_VER}`         sed -f pattern.txt input > output     done < file_name11      * * * pattern.txt               echo "$filename"     echo "$FILE_NAME1"     s/${filename}/${FILE_NAME1}/g ---> If I hardcode this one its not working..the value is not replaced..     s/ee.d.a/ee.d.aV1/g --> this is working      Do i need to explictly pass it..I have 150 such file names in a file ? * * *


title: PHPStorm Only runs on Gnome or KDE

text: Does anyone know why it is so? I was using unity... then i switched to LXDE and it wont run. I checked the requirements and it turned out that it requires either GNOME or KDE. So what exactly is it that the 2 DEs offer that LXDE and the others dont? what makes it compatible with gnome and kde but not with the others?


title: Why beep does not work in Ubuntu?

text: I've tried the below shell, but nothing happened.               #! /bin/sh           beep -f 500 -l 700      beep -f 480 -l 400      beep -f 470 -l 250      beep -f 530 -l 300 -D 100      beep -f 500 -l 300 -D 100      beep -f 500 -l 300      beep -f 400 -l 600      beep -f 300 -l 500      beep -f 350 -l 700      beep -f 250  -l 600       I issued the following command in terminal, but again nothing happened:               beep      What am I doing wrong? Is there something here that I'm missing? tnx. **EDIT:** Out put of `sudo modprobe pcspkr -vvv`:               libkmod: DEBUG ../libkmod/libkmod-module.c:519 kmod_module_new_from_lookup: input alias=pcspkr, normalized=pcspkr     libkmod: DEBUG ../libkmod/libkmod-module.c:525 kmod_module_new_from_lookup: lookup modules.dep pcspkr     libkmod: DEBUG ../libkmod/libkmod.c:542 kmod_search_moddep: use mmaped index 'modules.dep' modname=pcspkr     libkmod: DEBUG ../libkmod/libkmod.c:390 kmod_pool_get_module: get module name='pcspkr' found=(nil)     libkmod: DEBUG ../libkmod/libkmod.c:398 kmod_pool_add_module: add 0xb8adf2b8 key='pcspkr'     libkmod: DEBUG ../libkmod/libkmod-module.c:184 kmod_module_parse_depline: 0 dependencies for pcspkr     libkmod: DEBUG ../libkmod/libkmod-module.c:546 kmod_module_new_from_lookup: lookup pcspkr=0, list=0xb8adf340     libkmod: DEBUG ../libkmod/libkmod-module.c:435 kmod_module_unref: kmod_module 0xb8adf2b8 released     libkmod: DEBUG ../libkmod/libkmod.c:406 kmod_pool_del_module: del 0xb8adf2b8 key='pcspkr'     libkmod: INFO ../libkmod/libkmod.c:319 kmod_unref: context 0xb8adf140 released


title: Returning only the portion of a line after a matching pattern (Unix)

text: I have a parent folder (abeps) which contains several sub folders (1,2,3....25) where output file is located, one in which - all are the same name (opt.out). In this files there is an unpredictable output. This is an example of a line that I need to filter: > A\HF=-1378.9118397\RMSD=4.560e-09\RMSF=1.758e-05\Dipole=0.2110167,0.39 or > 978,3.8529967641,3.6669041122\Version=ES64L-G09RevD.01\State=1-A\HF=- so the thing is I'm interested in getting everything in between \HF= and till \ But they could be on different lines and even HF could be on different lines. So grep wont catch it. Then I tried to write result in a file               grep 'HF=-' abeps/*/opt.out > data      and as result get this > abeps/10/opt.out: 1-A\HF=-1378.9114895\RMSD=5.126e-09\RMSF=5.036 > > abeps/12/opt.out: \State=1-A\HF=-1378.9185518\RMSD=2.940e-09\RMSF > > abeps/13/opt.out: 33413\Version=ES64L-G09RevD.01\State=1-A\HF=-137


title: XBMC crash after selecting "play". Ubuntu 14.04 and 13.0 gotham. Link to crashlog

text: I have a brand new machine with fresh install of Ubuntu 14.04 and I'm trying to run Gotham 13.0 on it. I've already added the restricted multimedia codecs (just in case) to Ubuntu.                sudo apt-get install ubuntu-restricted-extras      As well as Unrestricted LibavCodec               sudo apt-get install libavcodec-extra      My graphics is AMD/ATI Tahiti (Radeon HD 7970) with a core i7. Here's the XBMC crashlog: http://xbmclogs.com/show.php?id=209365 Here's what's happening: I just download the appropriate PPA's etc. through the XBMC wiki.               sudo add-apt-repository ppa:team-xbmc          sudo apt-get update          sudo apt-get install xbmc      The first time I installed it on this machine, I went through installed Fusion and ran the Hub wizard Template/Setup. Everythings seems good, but when I select Al Jazeera, for example, I click "watch live", and then I get the "working" scroll in the bottom right for few seconds, and then the entire program force closes. The same happens with " The Daily Show" "Youtube" "UsTv Now" etc. I completly uninstalled XBMC               sudo apt-get purge xbmc xbmc-standalone      and started over. This time only installing one add on and trying it out. Still I get the same results. The music add-ons work though. I have this posted a few days on XBMC forums, and no replies yet. I'm not sure if this is an Ubuntu or XBMC issue ,at this point. ![enter image description here](http://i.stack.imgur.com/7y0qj.png)


title: hydra verification before stopping

text: I am getting false positives when I try a penetration test on my local service with `hydra`:               hydra -l admin -x 1:8:1 -t 1 -f -vV 127.0.0.1 http-form-post '/login.php:username=^USER^&password=^PASS^:Bad password'       I guess due to the fast rate of requests sometimes my server doesn't deliver the whole page and the part with "Bad password" is missing, so hydra thinks the password worked. Is there a way to tell hydra to verify the password and try it several times with success before stopping the whole pentest? * * * A solution I could imagine: you could write a loop somehow, that stores away the hydra.restore file often, and then if a solution is found try again with that solution and if it doesn't work start over at the point in the wordlist where you stopped - unfortunately the restore file is gone as soon as a solution seems to be found


title: Linux ssh launching GUI application and leaving it running?

text: I have `ssh` access to my own server with Ubuntu 13.10 on it installed. Via `ssh` I can launch GUI applications using this approach:               $ ssh -X my_login@address_of_sever      After that I can start any application by name, e.g. `gedit`, `firefox`, `google-chrome`, and it will be opened on my client machine (just the window, actually application works on the remote machine - i.e. on server). This is all fine. But when I close the GUI application on the client machine it gets closed on the server too (it seems to be legit). I can launch console applications using commands such as:               $ nohup php somefile.php &        and it will continue working after closing the connection. I wonder, is it possible to do the same with GUI application? Ideally it would be if it were possible to move opened window to server and take it back to client when it's necessary to see what is happening there, some kind of switching perhaps?


title: How to use awk through multiple files?

text: I want a solution for the general case (N folder) I'm using awk to process a file and extract its content and put it in a variable then echo it: This is the file:               H1 H2 H3 H4 H5 H6 H7 H8 H9     not important     not     not      This is the code:               $value1=awk '/H1/ { print $1}' file     $value2=awk '/H1/ { print $2}' file     $value3=awk '/H1/ { print $3}' file     echo $value1     echo $value2     echo $value3      I get the result:               H1     H2     H3      My question if I have multiple files with the same format (not the exact content, the same format) with the file and which is located in different folders but the same name:               /folder1     file     /folder2     file     /folder3     file      How can I echo the first 3 values of the H1 line but from each file in those folders so I get 9 results?


title: Automatically detect when a file has reached a size limit

text: I would like to send an email when a file reach a certain size limit. The only way I thought of doing this is by doing a cronjob which will check the file size and send the email if the file is bigger than the desired size. However, it seems like a bad solution for me to add a cronjob which would check ,for example every 15-30 min, the size of a file? I was wondering if there is a better way of doing this to automatically detect when the file is appended some text (event?) so I could then check the size and do the desired treatment.


title: Mint 17 boots to Welcome screen, but desktop is blank

text: I'm running Mint 17 Qiana MATE on a HP250 G laptop with 4GB of RAM and Intel on-board graphics. The host OS is Mint and Windows XP runs as guest using VirtualBox with 1GB RAM and 20GB reserved hard drive space. After working normally for a few days, the final boot process suddenly failed as follows: The laptop boots normally to the login screen, after logging in the Welcome window appears normally but with a blank (grey) desktop behind it. I can start Firefox or HexChat from the Welcome screen and both of these display normally, but I can't see a way to open Terminal. Where should I go from here? Should I boot from the LiveCD and try to fix it from there? I'm not sure what I did last to cause the problem, perhaps a file became corrupted? I don't have any backups as I was still getting started with my new laptop when this happened. Further information: I started Terminal using CTL+ALT+F1 at the login screen. Looking at bash_history shows that I probably killed the desktop with the following commands: sudo apt-get install openbox openbox --reconfigure Typing startx only gets me the blank desktop with the Welcome window again. Is this problem reversable?


title: Can the /home folder in Linux contain anything else but user folders?

text: Can the /home folder contain anything else but user folders? I have a folder I want to share between Windows and Arch - can it go in the home folder under a name not belonging to any existing user? E.g.               /home       |-/james (my home folder)       |-/shared (folder I want to share)


title: Installing and setting the default desktop environment in Debian

text: I recently installed Debian wheezy in my laptop using Debian netinst iso image. I would like to install latest gnome desktop environment but mistakenly downloaded the net installation iso and I also installed it in my system. So, is there any way to install and **automatically load gnome** without logging in and typing in the command `startx` each time to start the gnome environment? Or, is it better to download and install a live iso?


title: Fedora 15: em1 recently dissapeared and hostapd no longer serves internet to wirelessly connected devices

text: I have a laptop running hostapd, phpd, and mysql. This laptop uses an Ethernet connection to connect to the internet and acts as a wireless access point for my workplace's wifi devices. After installing some software and reconnecting my Ethernet elsewhere, my "em1" device is no longer present and wirelessly connected devices can no longer reach the internet. The software I recently installed is: pptp, pptpd, and updated some fedora libraries. I have also recently moved my desk and laptop to another location and thus had to reconnect the Ethernet elsewhere. Wifi devices no longer have access to the internet. Wirelessly connected devices are able to successfully log into the laptop, showing full strength, correct SSID, and uses the proper password. However, when I tried to connect to a site like google, the request times out. The device "em1" also no longer appears on my machine. Running: `# ifup em1` will give me the following output: `ERROR : [/etc/sysconfig/network- scripts/ifup-eth] Device em1 does not seem to be present, delaying initialization.` And running: `# dhclient em1` has the following output: `Cannot find device "em1"` When I run `# dmesg|grep renamed`, I get the following: `renamed network interface eth0 to p4p1`. I've tried to connect to the internet through p4p1 and was successful. However, my wireless devices connected to my laptop are no longer able to connect to the internet. I have uninstalled pptp and pptpd using `# yum erase ...` but the problem still persists. To install pptp I used: `# yum install pptp` To install pptpd I did the following:               # rpm -Uvh http://poptop.sourceforge.net/yum/stable/fc15/pptp-release-current.noarch.rpm     # yum install pptpd      To update my fedora libraries I used:               # yum check-update     # yum update      EDIT: Running `# route` produces the following results:               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     default         10.11.200.1     0.0.0.0         UG    0      0        0 p4p1     10.11.200.0     *               255.255.252.0   U     0      0        0 p4p1     172.16.100.0    *               255.255.255.0   U     0      0        0 wlan0


title: Linux reboot out of memory

text: I have a server with Intel(R) Atom(TM) CPU D525 and 1 GB memory. I noticed the server would shut down and restart automatically about every 7 days. I checked the memory usage and found that when the memory usage reached 90%, the kernel reboots. When I checked the kernel log in `/var/log/messages` file, I didn't find anything about the kernel shutting down, just a message about the kernel start. I checked the file `/proc/sys/vm/min_free_kbytes`, the value is "3765". * * * I guess when the available memory is very low, but doesn't get to the number the system starts reclaiming memory. Then the kernel can't do anything, so it then reboots. Can you give me some insight?


title: Can rpm handle an install of another OS into another Logical Volume?

text: I am trying to install fedora as a `domU` under a CentOS `dom0` using the method outlined in The Book of Xen. I have asked another question regarding a consistent error message of cpio: Bad magic when I try to run the rpm command on a fedora-release-15.1 rpm. That tutorial actually goes through an install of CentOS 5.2 into the logical volume. If I run `wget` on a similar CentOS install `rpm` then run the `rpm -i` command (as outlined) it works fine. So what is it about rpm and fedora under CentOS 5.6 that would cause an issue? running the `\--test` option returns the following:               [root@localhost fedRoot]# rpm -ivh --test --root /mnt/fedRoot fedora-release-15-1.noarch.rpm      warning: fedora-release-15-1.noarch.rpm: Header V3 RSA/SHA256 signature: NOKEY, key ID 069c8460     error: Failed dependencies:             fedora-release-rawhide = 15-1 is needed by fedora-release-15-1.noarch             rpmlib(FileDigests) <= 4.6.0-1 is needed by fedora-release-15-1.noarch             rpmlib(PayloadIsXz) <= 5.2-1 is needed by fedora-release-15-1.noarch      What do these failed dependencies mean? Is it even possible to do what I am trying to do (install fedora on a separate LV in an active CentOS system)? Is it possible to update these dependencies in my system? or is it time to call it quits on this particular path...


title: Is there an easy way to update information in known_hosts when you know that a hosts key has changed?

text: If a host's operating system has been re-installed and had its public key regenerated sshing to it will of course fail because the new key doesn't match the old one. Is there an easier way to tell ssh that you know that the host's key has changed and that you want it to be updated. I think it feels a bit error-prone to use a text editor or something like sed to remove the offending line.


title: Distributed package repository for Linux?

text: Many times I have seen the note telling users not to update their repositories too often (i.e more than once a day) because that will put a stress too large for the servers. Also I understand that it takes monstrous machines for such repositories. I am wondering if there is something like BitTorrent for package management? Or if there isn't, is it feasible to have such a system? (I'm thinking about a system where each user keeps the packages that they have and serve it in the same fashion as BitTorrent.)


title: What exactly do we mean when we say we are using Linux?

text: I was going through an article on GNU which goes something like below > There really is a Linux, and these people are using it, but it is just a > part of the system they use. Linux is the kernel: the program in the system > that allocates the machine's resources to the other programs that you run. > The kernel is an essential part of an operating system, but useless by > itself; it can only function in the context of a complete operating system. > Linux is normally used in combination with the GNU operating system: the > whole system is basically GNU with Linux added, or GNU/Linux. All the so- > called “Linux” distributions are really distributions of GNU/Linux. I always thought Linux as a kernel and Operating System but it looks like Linux = Linux kernel and GNU OS. Could someone point out the exact functionality of each in the "Linux" terminology we use in our day to day life. Also, according to the wiki, GNU's design is Unix-like but differs from Unix by being free software and containing no Unix code. I thought Unix is opensource. Isn't it?


title: gksudo not caching credentials

text: I've built a shell script for mounting ISO images in Nautilus, and it worked fine in earlier versions of Ubuntu. One of the many problems encountered in 11.04 is that `gksudo` doesn't seem to cache the credentials - There are three commands in the script which need to be run as root, but now for every command I get prompted for a password. Sudo privileges are cached when using plain `sudo`, so why not with `gksudo`?


title: xorg memory leaks

text: On my desktop Xorg leaks a lot of memory. I use to let this machine on for days (weeks, months ...), but about once a week I'm forced to restart xorg, because it is taking too much memory. Am I the only one affected by this issue? Why does this is happen?   Is it xorg to be _bugged_ , or is it something else (maybe some xorg modules)?   Can I do anything to avoid it? * * * Some more infos: I'm on ArchLinux, kernel 2.6.36, nvidia drivers 260.19.36, gnome 2.32.1. Anyway I've got this issue from a lot of time, like more than one year. * * * Here is how the Xorg process is shown by top after about 9 days of uptime...                PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND     1591 root      20   0  278m 229m 9364 S    2 11.8 244:38.73 Xorg      I've got only a few open windows. 229MB of resident memory looks like a lot to me (and it will keep growing with time). As soon as I reboot Xorg I'll also add process stats at the beginning of its life. * * * Here is as soon as my Gnome desktop gets up:                PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND      1573 root      20   0 89508  43m  11m S    1  2.2   0:03.53 Xorg


title: How can I update existing .crt file with new encrypted rsa .key file?

text: Suppose I have 2 files: an RSA key file `client.key` and a certification file `client.crt`. I have created them without pass-phrase and now I have encrypted `client.key` file with pass-phrase by command:               openssl rsa -des3 -in client.key -out client-enc.key      Now I want to re-create/update `client.crt` file with client-enc.key. How can I do that?


title: Installing Redmine on openSUSE

text: I installed `redmine-1.1.3-1.1` on a openSUSE 12.1 using the repositories http://download.opensuse.org/repositories/devel:/tools:/scm/openSUSE_12.1 . Anyway, after the installation: I edited the `database.yml` file to add the mysql location on other server. This way:               production:       adapter: mysql       database: redmine       host: <mysql-host>       username: redmine       password: <redmine.passwd.on.mysql>       encoding: utf8      then I started the redmine (rcredmine start)                # rcredmine start     redirecting to systemctl      an looks like it's working.                # rcredmine status     redirecting to systemctl     redmine.service - LSB: Redmine Web Server               Loaded: loaded (/etc/init.d/redmine)               Active: active (exited) since Mon, 05 Mar 2012 15:32:27 -0200; 9s ago              Process: 4601 ExecStop=/etc/init.d/redmine stop (code=exited, status=0/SUCCESS)              Process: 4683 ExecStart=/etc/init.d/redmine start (code=exited, status=0/SUCCESS)               CGroup: name=systemd:/system/redmine.service      when I watch the logs don't show me anything strange.                # tail -f /var/log/messages     Mar  5 15:32:27 redmine redmine[4683]: Starting Redmine daemon..done      There's no port at all               ~ # netstat -nat | grep 3000     ~ #       What I am missing?


title: How do I allow non-root access to Nexus 7 2013 LTE (deb) over adb and fastboot?

text: I need to access my Nexus 7 2013 LTE (deb) over `adb` and `fastboot`, but it seems that it's required to be `root` to be able to run the `adb` server to be able to access the device due to USB rules. How can I configure udev to allow access to this device as a non-root user for `adb` and `fastboot`?


title: Test for link with trailing slash?

text: I created in `/tmp/test/`               mkdir somedir     ln -s somedir/ somelink      I want to loop through only directories:               for file in */ ; do        if [[ -d "$file" && ! -L "$file" ]]; then         echo "$file is a directory";       fi;     done      but why does this show `somelink is a directory`? while without the slash it doesent?               for file in * ; do      ...      And is there a difference in zsh?


title: Rotating iptables logs, strange message about script being converted to upstart job

text: I use a script `/etc/logrotate.d/iptables` containing entries like:               /var/log/in_iptables.log     {             rotate 4             weekly             missingok             notifempty             compress             delaycompress             sharedscripts             postrotate                     invoke-rc.d rsyslog rotate > /dev/null             endscript     }      to keep my iptables logs rotated. It seems to have been doing its job, but today I got a message from `anacron`:               /etc/cron.daily/logrotate:     The script you are attempting to invoke has been converted to an Upstart     job, but rotate is not supported for Upstart jobs.     invoke-rc.d: initscript rsyslog, action "rotate" failed.     error: error running shared postrotate script for '/var/log/in_iptables.log     run-parts: /etc/cron.daily/logrotate exited with return code 1      Can anyone explain to me what this means exactly? Do I need to be worried or change anything in order for my logs to keep rotating?


title: How to turn my linux laptop into wireless repeater?

text: **I need to use my laptop to extend the range of my wireless router.** I have a Samsung laptop with FEdora19 installed (but those should be irrelevant for a good answer). My wireless card supports master mode (`iw list` listing includes `AP` mode). The card is:               01:00.0 Network controller: Qualcomm Atheros AR9485 Wireless Network Adapter (rev 01)      I am trying to follow this resource link, but am getting errors, and my knowledge is too limited to get me through the errors.               [sci@localhost ~]$ su -c "iwconfig wlp1s0 mode master"     Password:      Error for wireless request "Set Mode" (8B06) :         SET failed on device wlp1s0 ; Invalid argument.      Following the Atheros specific advice at the middle of the page:               modprobe: FATAL: Module ath_pci not found.      I am very surprised that the procedure is not trivial, and that a dedicated application doesn't exist. How should I approach this? Further reading is in order, if it is focused on the problem at hand!


title: using find, exec, sed to manipulate strings as args to another program

text: I can use find like this   `find -type f -path "./src*" -name "*.php"`   to find a list of files. For example ./src/Superuseradmin/Model/Mapper/UUID.php What I need to do is manipulate each string in the list like this:   file from find command: ./src/Superuseradmin/Model/Mapper/Mapper/UUID.php   manipulate into class: Superuseradmin\Model\Mapper\UUID   manipulate into test file: ./test/Superuseradmin/Model/Mapper/UUIDTest.php So that I can run this command for each one.   ` phpunit-skelgen.phar --test -- Superuseradmin\Model\Mapper\MyMapper ./src/Superuseradmin/Model/Mapper/MyMapper.php ./test/Superuseradmin/Model/Mapper/MyMapperTest.php ` Would really appreciate the help.


title: script started in .xinitrc stays in processes

text: I have made a little startup bash-script to run before my wm starts. Unfortunately after X and WM is started this script is still listed in the in `htop` and I don't have a clue why... this is the startup-script               #!/bin/bash          #Bind Multimedia Keys with xbindkeys     xbindkeys          #Turn X-Screensaver off     xset -dpms; xset s off          #Set Cursor to Arrow-Shape     xsetroot -cursor_name left_ptr          # Start Compton for compositing     compton --config ~/.config/compton.conf -b          # Set Wallpaper     feh --bg-fill ~/pictures/makoto-shinkai_00412767.jpg          # Start Dropbox     [ -e /usr/bin/dropboxd ] && /usr/bin/dropboxd &          # Start Emacs-Daemon     #/usr/bin/emacs --daemon          exit       and this is my .xinitrc               #!/bin/sh     #     # ~/.xinitrc     #     # Executed by startx (run your window manager from here)          if [ -d /etc/X11/xinit/xinitrc.d ]; then       for f in /etc/X11/xinit/xinitrc.d/*; do         [ -x "$f" ] && . "$f"       done       unset f     fi          $HOME/bin/xstartup          # i3 is kept as default     session=${1:-i3}          case $session in         bspwm             ) exec bspwm;;         i3|i3wm           ) exec i3;;         hlwm              ) exec herbstluftwm;;         # No known session, try to run it as command         *) exec $1;;     esac


title: Display ONLY IP addresses of currently logged users

text: I want to get a list of the currently logged users and their respective IP addresses.   I tried the following command line:               w -s      However, the TTY, IDLE and WHAT columns are also displayed. I don't want those columns to be displayed as I plan to use only the needed information as an input to a script. Is there any way to filter those columns out? Any way of getting a list with just the users and their IPs?


title: installing centOS as second OS on laptop

text: I am going to install CentOS 5.6 by bootable dvd and I arrive at the Installation Method stage that forces me to choose one item to identify CentOS packages. My CentOS iso file exists on my hard drive and I dont know which one to choose?


title: Show "last login" information when "su"

text: I'm trying to configure the PAM modules working with `su` command. I want to `su` shows the "last login" information, as `ssh` or `login` do. I find, on `/etc/pam.d/login` a PAM module called `pam_lastlog` that does exactly what I want. I simply copy the line from `login` to `su` configuration file, but when I run `su` I didn't get the expected behavior. This is the content of my `/etc/pam.d/su`:               #%PAM-1.0     auth     sufficient     pam_rootok.so     auth     include        common-auth     account  sufficient     pam_rootok.so     account  include        common-account     password include        common-password     session  include        common-session     session  optional   pam_lastlog.so  nowtmp     session  optional       pam_xauth.so      This is the default GNU/Linux distribution's file, only adding the `session optional pam_lastlog.so nowtmp` line commented above. Why is this not working?


title: CentOS 5.8 with gcc 4.4.7 links against libstdc++ 6.0.8. How is it possible?

text: According to the gcc ABI policy, gcc 4.4.7 should depend on libstdc++ 6.0.13. As far as I understood, the compiler version and the libstdc++ version are deeply interrelated and can't be swapped, so it came to me as a surprise to discover the following facts:   * CentOS 5.8 somehow manages to have a gcc44 package that links against 6.0.8, apparently coming with the default system (which is based on gcc-4.1.2)   * that the libstdc++.so in the compiler directory (/usr/lib/gcc/x86_64-redhat-linux6E/4.4.7, where I expected to find a libstdc++-6.0.13) is not a link to a shared object of any sort, but a text file containing `INPUT ( -lstdc++_nonshared /usr/lib64/libstdc++.so.6 )` What kind of magic is going on here? Specifically:   * How could they provide a gcc 4.4.7 that links against an older version of libstdc++? I thought it was not possible.   * what is this stdc++_nonshared library?   * I didn't know a .so file could contain that text. Who parses it (dynamic linker I guess) and what are its specifications and consequences?   * How far can this magic go? Can I use gcc4.7 with libstdc++ 6.0.3? What is the spectrum of compatibility


title: Where can you host a custom Linux Distribution?

text: I've recently been creating a custom Linux distribution based on Gentoo that includes a custom installer, artwork, development tools, and desktop environment. I have an ISO image and a local mirror for packages, however I am currently running a mirror privately on a home network with a residential Internet connection. I was wondering what the next step is to make my distribution public? Where can I host my distribution ISO files, as well as my source code and update files?


title: Lightweight Debian based distro?

text: Can anyone recommend an lightweight debian based distribution working on an PC with 800 MHZ CPU and 64 MB RAM? Also, would some old games like Worms Armageddon or Diablo 2 work on the lightweight distro with wine? (these two games, for example, work fine on the computer, running windows) Are the minimum requirements different for games running over wine, than the ones for windows.


title: How can I hook on to one terminal's output from another terminal?

text: I need to hook onto output of currently running terminal (tty1) from virtual terminal and capture it (running X server). I'm pretty sure such a thing is possible by simpler means than debugging (result of my Google searches). Can anyone help?


title: Pre-specifying a default GNU Stow target-directory

text: **TLDR:** Can I pre-define a stow folder other than `/usr/local` with GNU Stow? I do not have admin privileges on the machine I use for work, and I was told that I could use GNU Stow to manage my installations. The tool looks great, but everywhere in the documentation I read that stow uses `/usr/local` as the installation directory where it builds the symlink farm. Unfortunately this folder was already populated by `root`, and I do not have write privileges on anything under `/usr/local`. There is a flag `-t` that I can use in the command line to specify the target directory, but since I will always be using the same (I want my installations to consistently be under the same target directory), I was wondering if there is a way to use a default path of my choice.


title: Difference between eval and alias commands

text: what are the differences between `eval` and `alias` commands? Examples:               x=‘ls -d -l $HOME’     $x     eval $x          alias y=‘ls -l -d $HOME’     y


title: from a laptop with CentOS 6.3 what is the command line to talk mysql server on my pc?

text: I have CentOS 6.3 running on my laptop which is already connected to the net. What is the command line to talk to MySQL server on my PC? Both devices are connected via my router and they can talk to each other.


title: How to list existing alias for a certain linux user?

text: Does anyone know how do I list existing alias for a certain Unix/Linux user on Debian? For example I have an Unix/Linux user 1001 and want to know which alias for login it has?


title: how to concatenate strings in bash?

text: I need to concatenate 2 strings in bash, so that:               string1=hello     string2=world          mystring=string1+string2      `echo mystring` should produce > helloworld


title: How to get list of urls from a URL recursively with filtering

text: I want to get list of URLs that contains `vimeo.com` from a web site recursively by a command , so that I can pipe it to vimeo_downloader.sh. I prefer to use `wget`, but also I'm happy with other options. ### Example `index.html`               01     02     03     04     05     06      `01.html`               ...     ... src="//player.vimeo.com/video/xxxxxxxxxx?api=1" ...     ...      Likewise `02.html` to `06.html` have a vimeo's URL. How to get all vimeo URLs from `01~06.html`?


title: Is it possible to inject newlines in the ouput of cowsay/cowthink while preserving the "bubble"?

text: I keep a printed version of the `Bash` manual handy so I'm curious about any changes made to it - especially since I don't always pay attention to the packages I update. Usually locally you have the version of the manual related to the version of the software you have, and you can track changes easily. I built this to check some sources and have a summary:               #!/usr/bin/env bash     ## bashmancheck - Check different sources for date of the last updates          header="BASH manual -- Local BASH manual -- BASH repo /doc -- BASH Reference man(www)"     data="$(links -dump 'http://git.savannah.gnu.org/cgit/bash.git/tree/doc/bash.1' | grep -om 1 'Last Change.*' | cut -d ' ' -f 4,6,9) -- $(zcat /usr/share/man/man1/bash.1.gz | grep -om 1 'Last Change.*' | cut -d ' ' -f 4,6,9) -- $(links -dump 'http://git.savannah.gnu.org/cgit/bash.git/log/doc' | grep -Eom 1 '[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}') -- $(links -dump 'http://www.gnu.org/software/bash/manual' | grep -om 1 'last updated.*' | cut -d ' ' -f 3-)"          cowthink -W80 -f bud-frogs --  $header $data      It uses `links` and `zcat` to look at a specific string in the manpages source online and locally, as well as in the /doc section of the Bash repository and finally in the online reference manual. And the output looks like this:               ( BASH manual -- Local BASH manual -- BASH repo /doc -- BASH Reference man(www) )     ( Feb 2 2014 -- Feb 2 2014 -- 2014-02-26 -- August 22, 2012                     )      -------------------------------------------------------------------------------           o           o               oO)-.                       .-(Oo              /__  _\                     /_  __\              \  \(  |     ()~()         |  )/  /               \__|\ |    (-___-)        | /|__/               '  '--'    ==`-'==        '--'  '      Yet I wish I had pairs of item and date each on a line, like so:               BASH manual: Feb 2 2014     Local BASH manual: Feb 2 2014     BASH repo /doc: 2014-02-26     BASH Reference man(www): August 22, 2012      But for that I would need to change line after I concatenate the item and its date - and I can't make happen it with `cowsay/cowthink`. And this explains why I have designed the script like it is. The two variables are just there to help me out with formatting but have no bearing on it at execution. It just so happens that the header and data variables are less than 80 columns wide each and the command ouput is set to 80 columns for that purpose. I also used `cut` to shorten the dates for them to display on one line instead of just using `grep -o` like I was initially doing. I arbitrarily used some characters(double dashes) for formatting - which is just crude. Can you use newlines with something like cowsay? Is there a (better) way to do this?


title: Send a command with password in upstart script

text: CentOS 6.5 The server is an AWS AMI, specifically this one I'm trying to use upstart to start a process on boot On this particular box, the `root` login is disabled, and every time I need to run something with `sudo` it asks for my password So simply putting my command in the script won't work. I tried to follow this answer, with no success I've got this rio.conf file in the /ect/init directory:               start on runlevel [2345]     stop on runlevel [!2345]          exec echo Password! | sudo -s /usr/bin/riofs --fuse-options="allow_other" --fmode=0777 --dmode=0777 xx.xxxxxx /mnt/applications/recorder/streams/_definst_/s3      And whenever I run this, nothing seems to happen. `Password!` is just an example password. ## EDIT: If I type `exec /usr/bin/riofs` my SSH window will close, and then when I go back in, I can see that it's working. I don't know what that means, or how to automate that.


title: copying specific files in directory

text: I am trying to copy some of the files in a directory. The directory contains following files my current directory is ~/certificate/               drwxrwxr-x 2 ubuntu ubuntu     4096 Oct 16 11:58 apache     -rw-rw-r-- 1 ubuntu ubuntu     5812 Oct 16 11:20 apache.keystore     -rw-rw-r-- 1 ubuntu ubuntu     1079 Oct 16 08:31 csr.txt     -rwxr-xr-x 1 ubuntu ubuntu 36626564 Oct 16 10:08 my.war     drwxrwxr-x 2 ubuntu ubuntu     4096 Oct 16 09:39 tomcat     -rw-rw-r-- 1 ubuntu ubuntu     6164 Oct 16 09:31 tomcat.keystore      I want to copy all files to ~/certs/ except my.war. I have tried following command without success. I do not want to move my.war out of the folder even temporarily.               cp -r ~/certificate/(?!m)* ~/cert/.       Please help me with suitable regular expression or any other tool.


title: What is the optimum swap size on Linux for a heavily threaded program?

text: I using an Amazon EC2 server small instance and by default it allows 382 threads per process. However, I wish to run 10,000 threads in a single process. Recently, I learned that this can be done by either reducing the stack limit or increasing virtual memory. To the best of my knowledge, virtual memory can be increased by increasing RAM or swap space in Linux. Increasing RAM is not an option. I know how to increase swap space, but I am not sure what the optimum size I should go for is. What I am not clear on is, how do swap space and RAM work when I run threads? Is there some specific limit after which swap memory makes the threads slow? Is there an optimal amount of swap space I should use?:


title: Recommended location of node.js applications in linux filesystem?

text: Where is the conventionally accepted location of node.js/express web apps, in a linux file system? Currently I've got a subdirectory in `/opt/` but I'd like to hear other people's view on this...


title: Use of sed in perl?

text: I want to re-use the code given here, but I'm stuck in understanding the use of `sed`               print "Sending to QRadar...\n";     # SSH To QRadar's Console and push out file + trigger update     `scp -i $qradar_ssh_key -o UserKnownHostsFile=$qradar_ssh_knownhosts -o StrictHostKeyChecking=no root\@$qradar_console:/store/configservices/staging/globalconfig/remotenet.conf .`;     `sed -i -e '/^SECULERT/d' remotenet.conf`;     `cat $seculert_qradar_list >> remotenet.conf`;     `scp -i $qradar_ssh_key -o UserKnownHostsFile=$qradar_ssh_knownhosts -o StrictHostKeyChecking=no remotenet.conf root\@$qradar_console:/store/configservices/staging/globalconfig/remotenet.conf`;      I like to know what `sed` is doing over here.


title: Delete 100 lines from vi editor using single command

text: I am using Ubuntu and trying to delete all 100 lines from `vi` editor but I got interview question of doing this in one command.


title: SNAT with network alias IP RHEL 5.5

text: I have Rehat Enterprise Linux Server Release 5.5(Tikanga) with two interfaces as below   * eth0: with public IP as xxx.xx.64.118   * eth0:0: with public IP as xxx.xx.116.19   * eth1: with private IP as 172.16.23.2 By default my iptable POSTROUTING chain rule is as below:               Chain POSTROUTING (policy ACCEPT)     target      prot  opt source              destination     MASQUERADE  all  --  0.0.0.0/0            0.0.0.0/0      which means it has NAT IP as IP of eth0. Now I want a specific host computer(172.16.23.6), connected to eth1, to have source IP as that of eth0:0 (ie. xxx.xx.116.19) while connecting to internet. So I added a rule as below               iptables  -t nat -A POSTROUTING -s 172.16.23.6 -o eth0 -j SNAT --to-source xxx.xx.116.19      Which added new rule above MASQUERADE as show :               Chain POSTROUTING (policy ACCEPT)     target     prot opt source               destination     SNAT       all  --  172.16.23.6       0.0.0.0/0           to:xxx.xx.116.19     MASQUERADE  all  --  0.0.0.0/0            0.0.0.0/0      After what I supposed was that the host having IP 172.16.23.6 would have public IP xxx.xx.116.19 when connecting to the internet(checked via whatismyip.com). But it still shows the public IP of eth0(xxx.xx.64.118). The same worked well for Ubuntu. Can anybody please suggest what is the problem ?


title: how to enable root user in linux(Ubuntu)?

text: In Linux (Ubuntu),I am going through with a lot of problems. In ubuntu, I haven't got any root user. So, I have to apply `sudo` bash at every Instance. I just want to create a root user, from which I can login and have all the privileges.


title: cygwin, tail -F and rapidly filling/rotatinglogs

text: I'm using cygwin tail to follow busy java web application logs, on a windows server, generating roughly 16Gb worth of logs a day. I"m constrained to 10MB log sizes, so the files roll very often. The command line I'm using is :               /usr/bin/tail -n 1000 -F //applicationserver/logs/logs.log      It survives 2-4 rolls of the file, about 4-6 minutes, but eventually, usually reports: "File truncated" and then echos the name of the file every second. the file is busily filling and rotating. Am I exceeding the capability of tail?


title: Printer is not recognized by CUPS

text: I have a printer (Product code: PRP-085, Vendor BIRCH), I'm using Fedora 20 KDE (also tested on Ubuntu 13. 10) and CUPS 1. 7. 2 My issue is printer is not recognized by CUPS, the output of `lpinfo -v` is:               network ipps     network lpd     network beh     direct hp     network http     network https     network ipp     network socket     network smb     direct hpfax     network bjnp      I have tried some guides in https://wiki.archlinux.org/index.php/CUPS#Device_node_permissions. I can not find anyways to recognize this device.


title: Impossible to send mail to microsoft (hotmail, live ...)

text: I cannot send mail to hotmail with my postfix server. I can send and receive mail from gmail and others, but not hotmail. I made an "Authentication Report" on `auth-results@verifier.port25.com`:               ==========================================================     Summary of Results     ==========================================================     SPF check:          pass     DomainKeys check:   neutral     DKIM check:         neutral     Sender-ID check:    pass     SpamAssassin check: ham          ==========================================================     Details:     ==========================================================          HELO hostname:  bart.localdomain     Source IP:      62.210.240.55     mail-from:      contact@dimsolution.com          ----------------------------------------------------------     SPF check details:     ----------------------------------------------------------     Result:         pass      ID(s) verified: smtp.mailfrom=contact@dimsolution.com     DNS record(s):         dimsolution.com. SPF (no records)         dimsolution.com. 3522 IN TXT "1|www.dimsolution.com"         dimsolution.com. 3522 IN TXT "v=spf1 a mx ip4:62.210.240.55 -all"         dimsolution.com. 3522 IN A 62.210.240.55          ----------------------------------------------------------     DomainKeys check details:     ----------------------------------------------------------     Result:         neutral (message not signed)     ID(s) verified: header.From=contact@dimsolution.com     DNS record(s):          ----------------------------------------------------------     DKIM check details:     ----------------------------------------------------------     Result:         neutral (message not signed)     ID(s) verified:           NOTE: DKIM checking has been performed based on the latest DKIM specs     (RFC 4871 or draft-ietf-dkim-base-10) and verification may fail for     older versions.  If you are using Port25's PowerMTA, you need to use     version 3.2r11 or later to get a compatible version of DKIM.          ----------------------------------------------------------     Sender-ID check details:     ----------------------------------------------------------     Result:         pass      ID(s) verified: header.From=contact@dimsolution.com     DNS record(s):         dimsolution.com. SPF (no records)         dimsolution.com. 3522 IN TXT "1|www.dimsolution.com"         dimsolution.com. 3522 IN TXT "v=spf1 a mx ip4:62.210.240.55 -all"         dimsolution.com. 3522 IN A 62.210.240.55          ----------------------------------------------------------     SpamAssassin check details:     ----------------------------------------------------------     SpamAssassin v3.3.1 (2010-03-16)          Result:         ham  (-0.2 points, 5.0 required)           pts rule name              description     ---- ---------------------- --------------------------------------------------     -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%                                 [score: 0.0000]      0.0 HTML_MESSAGE           BODY: HTML included in message      1.7 HTML_IMAGE_ONLY_08     BODY: HTML: images with 400-800 bytes of words          ==========================================================     Explanation of the possible results (from RFC 5451)     ==========================================================          SPF and Sender-ID Results     =========================          "none"           No policy records were published at the sender's DNS domain.          "neutral"           The sender's ADMD has asserted that it cannot or does not           want to assert whether or not the sending IP address is authorized           to send mail using the sender's DNS domain.          "pass"           The client is authorized by the sender's ADMD to inject or           relay mail on behalf of the sender's DNS domain.          "policy"          The client is authorized to inject or relay mail on behalf           of the sender's DNS domain according to the authentication           method's algorithm, but local policy dictates that the result is           unacceptable.          "fail"           This client is explicitly not authorized to inject or           relay mail using the sender's DNS domain.          "softfail"           The sender's ADMD believes the client was not authorized           to inject or relay mail using the sender's DNS domain, but is           unwilling to make a strong assertion to that effect.          "temperror"           The message could not be verified due to some error that           is likely transient in nature, such as a temporary inability to           retrieve a policy record from DNS.  A later attempt may produce a           final result.          "permerror"           The message could not be verified due to some error that           is unrecoverable, such as a required header field being absent or           a syntax error in a retrieved DNS TXT record.  A later attempt is           unlikely to produce a final result.               DKIM and DomainKeys Results     ===========================          "none"           The message was not signed.          "pass"           The message was signed, the signature or signatures were           acceptable to the verifier, and the signature(s) passed           verification tests.          "fail"           The message was signed and the signature or signatures were           acceptable to the verifier, but they failed the verification           test(s).          "policy"           The message was signed but the signature or signatures were           not acceptable to the verifier.          "neutral"           The message was signed but the signature or signatures           contained syntax errors or were not otherwise able to be           processed.  This result SHOULD also be used for other           failures not covered elsewhere in this list.          "temperror"           The message could not be verified due to some error that           is likely transient in nature, such as a temporary inability           to retrieve a public key.  A later attempt may produce a           final result.          "permerror"           The message could not be verified due to some error that           is unrecoverable, such as a required header field being           absent. A later attempt is unlikely to produce a final result.               ==========================================================     Original Email     ==========================================================          Return-Path: <contact@dimsolution.com>     Received: from bart.localdomain (62.210.240.55) by verifier.port25.com id hfnbc211u9cn for <check-auth@verifier.port25.com>; Thu, 22 May 2014 06:51:45 -0400 (envelope-from <contact@dimsolution.com>)     Authentication-Results: verifier.port25.com; spf=pass smtp.mailfrom=contact@dimsolution.com     Authentication-Results: verifier.port25.com; domainkeys=neutral (message not signed) header.From=contact@dimsolution.com     Authentication-Results: verifier.port25.com; dkim=neutral (message not signed)     Authentication-Results: verifier.port25.com; sender-id=pass header.From=contact@dimsolution.com     Received: by bart.localdomain (Postfix, from userid 33)         id 58E2FF401AB; Thu, 22 May 2014 12:51:45 +0200 (CEST)     To: check-auth@verifier.port25.com     Subject: fsdfg     X-PHP-Originating-Script: 501:rcube.php     MIME-Version: 1.0     Content-Type: multipart/alternative;      boundary="=_b148f0ac1d5edc2ff6cb8772d93c5c22"     Date: Thu, 22 May 2014 12:51:45 +0200     From: Agence web Dim'Solution <contact@dimsolution.com>     Organization: Dim'Solution     Message-ID: <1e17adc6630c90ded8b6bf2b80596ac4@dimsolution.com>     X-Sender: contact@dimsolution.com     User-Agent: Roundcube Webmail/1.0.0          --=_b148f0ac1d5edc2ff6cb8772d93c5c22     Content-Transfer-Encoding: 8bit     Content-Type: text/plain; charset=UTF-8      Error from /var/log/mail.log:               May 18 17:50:32 sd-45290 postfix/smtp[12608]: D1487F40CB0: lost connection with mx4.hotmail.com[65.55.92.152] while performing the HELO handshake     May 18 17:50:32 sd-45290 postfix/smtp[12607]: 766E8F40C92: lost connection with mx4.hotmail.com[207.46.8.199] while performing the HELO handshake     May 18 17:50:32 sd-45290 postfix/smtp[12610]: E4F64F40AB5: lost connection with mx3.hotmail.com[207.46.8.199] while performing the HELO handshake     May 18 17:50:32 sd-45290 postfix/smtp[12612]: 2BBBAF40AB4: lost connection with mx4.hotmail.com[65.55.33.119] while performing the HELO handshake     May 18 17:50:33 sd-45290 postfix/smtp[12608]: D1487F40CB0: lost connection with mx2.hotmail.com[65.55.92.168] while performing the HELO handshake     May 18 17:50:33 sd-45290 postfix/smtp[12610]: E4F64F40AB5: lost connection with mx1.hotmail.com[65.55.92.136] while performing the HELO handshake     May 18 17:50:33 sd-45290 postfix/smtp[12607]: 766E8F40C92: lost connection with mx4.hotmail.com[65.55.37.104] while performing the HELO handshake     May 18 17:50:33 sd-45290 postfix/smtp[12612]: 2BBBAF40AB4: lost connection with mx3.hotmail.com[207.46.8.167] while performing the HELO handshake     May 18 17:50:33 sd-45290 postfix/smtp[12608]: D1487F40CB0: lost connection with mx1.hotmail.com[65.55.92.168] while performing the HELO handshake     May 18 17:50:33 sd-45290 postfix/smtp[12610]: E4F64F40AB5: lost connection with mx1.hotmail.com[65.55.92.168] while performing the HELO handshake     May 18 17:50:33 sd-45290 postfix/smtp[12607]: 766E8F40C92: lost connection with mx2.hotmail.com[65.55.92.152] while performing the HELO handshake     May 18 17:50:33 sd-45290 postfix/smtp[12612]: 2BBBAF40AB4: lost connection with mx3.hotmail.com[65.55.92.136] while performing the HELO handshake     May 18 17:50:34 sd-45290 postfix/smtp[12608]: D1487F40CB0: lost connection with mx3.hotmail.com[65.54.188.94] while performing the HELO handshake     May 18 17:50:34 sd-45290 postfix/smtp[12607]: 766E8F40C92: lost connection with mx3.hotmail.com[65.55.92.168] while performing the HELO handshake     May 18 17:50:34 sd-45290 postfix/smtp[12610]: E4F64F40AB5: lost connection with mx1.hotmail.com[65.55.37.88] while performing the HELO handshake     May 18 17:50:34 sd-45290 postfix/smtp[12612]: 2BBBAF40AB4: lost connection with mx1.hotmail.com[65.55.37.104] while performing the HELO handshake     May 18 17:50:34 sd-45290 postfix/smtp[12608]: D1487F40CB0: to=<jeftiy@hotmail.fr>, relay=mx1.hotmail.com[65.55.92.184]:25, delay=21407, delays=21405/0.05/2/0, dsn=4.4.2, status=deferred (lost connection with mx1.hotmail.com[65.55.92.184] while performing the HELO handshake)     May 18 17:50:34 sd-45290 postfix/smtp[12610]: E4F64F40AB5: to=<daisy11@hotmail.fr>, relay=mx2.hotmail.com[65.55.92.136]:25, delay=332155, delays=332152/0.06/2.2/0, dsn=4.4.2, status=deferred (lost connection with mx2.hotmail.com[65.55.92.136] while performing the HELO handshake)      What could be wrong?


title: Run a script at startup

text: I am using Ubuntu 14.04. I wrote a small script named trial. The contents of the script are as follows:                #!/bin/sh     SHELL=/bin/sh     PATH=/bin:/sbin:/usr/bin:/usr/sbin          sh -c firefox      I copied the script to `/etc/init.d`, modified permission using `chmod +x trial` and used `update-rc.d trial defaults`. The file made link but when I rebooted the machine. It did not run firefox. I tried cron @reboot but with no success. I tried rc.local too again failure. I think something is wrong in my script. I am new to linux so can some one point out my mistake?


title: How to sync terminal session command history in bash?

text: I've tried to search in `~/.bash_history` for my recent commands while in a terminal session but they just weren't there. I guess this is because I have multiple terminal sessions open. Is there a way that I can sync (ie. sync-push or sync-write-out) the current terminal session's command history into the bash_history file (without closing the session and losing that environment)? (It would be remotely similar in idea to how the `sync` command stores the file-system modifications on some embedded systems.) I imagine I could set up bash to preserve multiple session history but the ability to push the current history buffer would still be useful in scenarios when you are working on a new machine and you accidentally forgot to set up bash the way you may would have wanted.


title: How to set sctp_nodelay to enable piggybacking while replying back

text: **Problem:** We are hosting a telecom application that receives traffic from the network at > 500 TPS. The packets are piggybacked so each sctp packet contains multiple application layer packets lets say 10. Our interface to the network is a SG(signalling gateway) which routes the packets to our internal node in the cluster. But since our sctp library (the native lkstp lib) doesnt support the piggybacking or **sctp_nodelay** is set to true, it splits the packets and sends them to the internal node as multiple packets thereby yielding congestion in the network. **What we want** We want to check for any option at kernel or the sctp library level to be able to turn off sctp_nodelay (Im assuming this option works in the same manner as tcp_nodelay does). So that multiple packets are sent out in one sctp message. **Server specification:** CentOS: 5.8 kernel: 2.6.18-308.el5 sctplibrary: lksctp-tools-1.0.10! In the following image it shows the piggybacked packets comming from network and the routed packets being sent as individual packets. Here is the sample packet EDIT: yes I have tried the following code, it still doesnt work:               private void doInitiateConnectionSctp() throws IOException {         this.socketChannelSctp.setOption(SctpStandardSocketOptions.SCTP_NODELAY, true);             // Create a non-blocking socket channel             this.socketChannelSctp = SctpChannel.open();             this.socketChannelSctp.configureBlocking(false);                  // bind to host address:port             this.socketChannelSctp.bind(new InetSocketAddress(this.hostAddress, this.hostPort));             if (this.extraHostAddresses != null) {                 for (String s : extraHostAddresses) {                     this.socketChannelSctp.bindAddress(InetAddress.getByName(s));                 }             }                  // Kick off connection establishment             this.socketChannelSctp.connect(new InetSocketAddress(this.peerAddress, this.peerPort), 32, 32);         }


title: How to know how long will my simulation run in UNIX?

text: ![enter image description here](http://i.stack.imgur.com/5oHEB.jpg) I am new in using Unix, I want to know what command can display how long will my simulation run. I am using windows but running cygwin to get the UNIX environment. I am running a discrete dipole approximation simulation. This is my simulation, I don't know if it worked or not that is why I want to see the remaining time to ensure it is really running, or is there any way to know if it is really running?


title: How a piped shell programs balance their output/input rates?

text: > **Possible Duplicate:**   >  Bash while loop and reading from pipe I come from web programming background, and find myself interested in one peculiarity of using a local shell. I understand that when a program reads from file, it can read at whatever rate's necessary. But I'm curious to know, how does it work when a program gets other program's input piped in and can't process it in realtime? A good example would be video encoding. Suppose I point a decoder to video file, then it's output gets piped in as encoder's input. The total size of decoded video is more than ram+swap, so I guess there's no way to have it buffered altogether. I found about read and write calls to stdin and stdout, but I'm interested to know what actually happens when this example's encoder can't cope with all the data at once. Does it somehow informs the decoder about desired rate? Does decoder program needs to be specifically prepared for such a signal and modify it's processing speed accordingly? If not, how does it all gets balanced in the end?


title: Rearrange text file by prepending data rows with header row

text: I have a file whose content looks like this:               2009 150  0  0  0     0000     75.316   0.0400390625  0.00007        0.00000 0.8980     76.216   0.0400390625  0.00007        1.00000 0.9046     77.217   0.0400390625  0.00009        2.00000 0.9113     78.341   0.0400390625  0.00010        3.00000 0.9183     2009 150  2  0  0     0000     75.316   0.0400390625  0.00007        0.00000 0.8980     76.216   0.0400390625  0.00007        1.00000 0.9046     77.217   0.0400390625  0.00009        2.00000 0.9113     78.341   0.0400390625  0.00010        3.00000 0.9183     79.616   0.0400390625  0.00013        4.00000 0.9255      I would like to:   1. Find all lines that start with keyword 2009.   2. Pre-pend those lines to all following ones until another occurrence of line that starts with 2009 is found, and so on until EOF. In essence I am looking for an output like this:               2009 150  0  0  0     0000 75.316   0.0400390625  0.00007        0.00000 0.8980     2009 150  0  0  0     0000 76.216   0.0400390625  0.00007        1.00000 0.9046     2009 150  0  0  0     0000 77.217   0.0400390625  0.00009        2.00000 0.9113     2009 150  0  0  0     0000 78.341   0.0400390625  0.00010        3.00000 0.9183     2009 150  2  0  0     0000 75.316   0.0400390625  0.00007        0.00000 0.8980     2009 150  2  0  0     0000 76.216   0.0400390625  0.00007        1.00000 0.9046      ....... I have been scratching my head on this for quite a while and cannot come up with a solution. Help would be appreciated. I know how to extract the text between keywords using flags but I am not sure if that is the right direction.