title: Manual configuring network interfaces on Cubieboard

text: I have installed Cubian (It's Debian for the Cubieboard). After the system has started, the wired network works fine. I've read this and configured the network interface(I added only the wlan0 settings):               //default     # the loopback interface     auto lo     iface lo inet loopback          #     #auto eth0     allow-hotplug eth0     iface eth0 inet dhcp          //my     auto wlan0     allow-hotplug wlan0     iface wlan0 inet dhcp     wireless-essid My_network_name      but when I try `sudo ifup wlan0` I get: > No DHCPOFFERS received. No working leases in persistent database - sleeping. I have a MAC filter on my router, but I added the MAC address to the white list. Also I can't understand why Cubian is connecting eth0, when there is               #auto eth0      in `/etc/network/interfaces`. In the wiki I saw: > If you absolutely don't need the wired network, please disable this feature > by comment or delete auto eth0. It is commented out by default, why does eth0 start working after the system has started? * * * I have understood my bad. I have router and repeater with one ssid to cover a larger area, and Cubian doesn't know what to use. How can I fix it problem (maybe specify MAC address to connect) for feture? Now it remembers where is dhcp and connect there fine.


title: Openbox isn't loading correctly

text: I'm on Crunchbang 11, 64 bit, it is a Debian Wheezy distro. This morning Openbox isn't loading correctly    ![link to screenshot](http://i.stack.imgur.com/ZtMBO.jpg)   * All the programs and shortcuts are working correctly. Conky is loading correctly.   * The desktop wallpaper isn't loading   * The menu on top isn't loading, so if I minimize a program, I will not be able to know where it is. here's autostart, Openbox version 3.5.0-7, display manager is `slim`. Here's slim.log


title: How to display the time of sadf in epoch format

text: I have a problem in sadf between ubuntu and centos. The thing is how the date is displayed in both. Ubuntu:               root@db1:/usr/local/nagios/libexec/nrpe_local# sadf | head -10     db1.oas3.realmedia.xstrat.us  300   2014-05-15 03-05-01 UTC all     %%user  0.14     db1.oas3.realmedia.xstrat.us  300   2014-05-15 03-05-01 UTC all     %%nice  0.00      Centos:               [root@ui1 jboss]# sadf | head -5     ui1.oas3.realmedia.xstrat.us    595     1400123401      all     %user   1.00     ui1.oas3.realmedia.xstrat.us    595     1400123401      all     %nice   0.00      I need to display time in ubuntu as it's displayed in centos (epoch time). I haven't have lucky to find some configuration file that could fix this issue.


title: Multi-function CapsLock without X

text: I would like to remap `CapsLock` to `Esc` when pressed by itself and `Ctrl` when pressed with another key **without using X**. This is similar to a previous question ( Remap CapsLock to Escape and Control System Wide ) but I am specifically looking for a solution without X.


I have an old Medion MD 8818 desktop PC with MS-7318 mobo with Phoenix AwardBIOS 6.00PG. I'm attempting to run Zorin OS 7 Core on it, but the PC won't boot my 32GB Sandisk Cruzer Switch USB stick that I prepared using Universal USB Installer and the Zorin ISO. The BIOS auto-recognizes and lists the stick as a removable device, and I've specified removable device as first boot option. During boot, I see the stick listed before my (SATA) HDD, but it won't boot. Using Trinity Rescue Kit 3.4 in the single drive connected to the end of an IDE cable, I can copy files between the stick and my HDD. Prepping the stick with other things like FreeDOS and attempting to boot from floppy using a FreeDOS DVD also gives me the "isolinux: Disk error 01, AX=0201, drive 80" error, which should be coming from the stick as the HDD only has Windows (of which I renamed bootmgr to keep it from booting) and I believe FreeDOS doesn't use isolinux. Why am I getting this error? I fear it might be my BIOS, despite it apparently recognizing the stick, as I've read terrible things about updating a BIOS from a DVD.


title: EBS Volumes Mounted On Wrong Directory After Reboot

text: I have three EBS RAID 10 volumes in my /etc/fstab on an Amazon AMI hosted with AWS/EC2... Everytime I reboot the instance, the volumes get mounted to the wrong mount points. Any ideas on how I can get these RAID volumes to mount to the correct mount points? Correct Example               Filesystem            Size  Used Avail Use% Mounted on     /dev/xvda1            7.9G  1.3G  6.6G  16% /     tmpfs                 3.4G     0  3.4G   0% /dev/shm     /dev/md127            2.0G  129M  1.9G   7% /mnt/db     /dev/md126             35G   18G   18G  50% /mnt/web     /dev/md125            3.0G  267M  2.8G   9% /mnt/bc      After Reboot               Filesystem            Size  Used Avail Use% Mounted on     /dev/xvda1            7.9G  1.3G  6.6G  16% /     tmpfs                 3.4G     0  3.4G   0% /dev/shm     /dev/md127            2.0G  129M  1.9G   7% /mnt/bc     /dev/md126             35G   18G   18G  50% /mnt/db     /dev/md125            3.0G  267M  2.8G   9% /mnt/web      My /etc/fstab               LABEL=/     /           ext4    defaults,noatime  1   1     tmpfs       /dev/shm    tmpfs   defaults        0   0     devpts      /dev/pts    devpts  gid=5,mode=620  0   0     sysfs       /sys        sysfs   defaults        0   0     proc        /proc   proc    defaults        0   0     /dev/md127  /mnt/db     xfs     defaults        0   0     /dev/md126  /mnt/web    xfs     defaults        0   0     /dev/md125  /mnt/bc    xfs     defaults        0   0


title: How do I add other language in a Debian system?

text: I want to add another language in Debian. I have done               dpkg-reconfigure locales     locale -a     C     C.UTF-8     en_US.utf8     POSIX     ru_RU.utf8      but I don't have any result.               root@ai:/home/volkov# locale     LANG=en_US.UTF-8     LANGUAGE=en_US:en     LC_CTYPE="en_US.UTF-8"     LC_NUMERIC="en_US.UTF-8"     LC_TIME="en_US.UTF-8"     LC_COLLATE="en_US.UTF-8"     LC_MONETARY="en_US.UTF-8"     LC_MESSAGES="en_US.UTF-8"     LC_PAPER="en_US.UTF-8"     LC_NAME="en_US.UTF-8"     LC_ADDRESS="en_US.UTF-8"     LC_TELEPHONE="en_US.UTF-8"     LC_MEASUREMENT="en_US.UTF-8"     LC_IDENTIFICATION="en_US.UTF-8"     LC_ALL=      The field “System Settings → locale → Languages → available languages” is empty. How do I fix it?


title: Can I partition around a bad block on a harddrive?

text: I used a computer too much, running a script for many weeks. Eventually, Debian printed a thousand errors and shutdown, and won't start again. When I ran DBAN on the drive, to write 0's to the disk and reinstall, it said there is a bad sector. Can I simply find where the bad sector is and reinstall Debian while leaving a blank partition at the bad area?


title: A tool for checking broken web links

text: Please recommend a tool that checks for broken links on a web site. **not required, but would be nice to have** :   * checks standards-compliance of the HTML, CSS, Javascript, ...   * displays permanent redirects


title: resizable serial console window?

text: When using the serial console of my system I always end up with `$COLUMNS=80` and `$LINES=24`. While I can change these variables manually it is somewhat annoying to do this any time when the client side terminal window has been resized. Usually I'm connecting to the console using `screen /dev/mytty baudrate`. Changing the `$TERM` environment variable to "screen" or "xterm" does not help. Will I need to call `getty` with some of those instead of vt100? Needless to say that all of this works fine, when I connect to the same machine using ssh.


title: make "print to file" settings permanent in Iceape [Seamonkey]

text: Everytime I want to "print to file", say, a website in Iceape [Seamonkey] in Linux [Debian], I have to set all the options for printing anew to overwrite the default settings. Not just every time I restart the browser but for every single document! **Question** : How to set "Title" in the top left corner and "Page x of y" in the bottom right corner once and for all. All other fields should be empty: no URL, no date, no nothing - this should be also set once and for ever.


title: Is many consoles in securetty file a risk?

text: I got a problem So I expect you can give me an answer. I have to evaluate the security of a RedHat server. The idea is review the /etc/securetty file to ensure that only the console tty is listed. But I've found the following:               ====================================================     [FILE]: SECURETTY     -rw------- 1 root root 122 Feb 17  2003 /etc/securetty     ====================================================     console     vc/1     vc/2     vc/3     vc/4     vc/5     vc/6     vc/7     vc/8     vc/9     vc/10     vc/11     tty1     tty2     tty3     tty4     tty5     tty6     tty7     tty8     tty9     tty10     tty11     =================================      Why are these many consoles? Is this a risk?


title: Is there a way to determine which process creates a file on osx 10.6.8

text: I would like to know which process has created files on os X 10.6. I'm trying DTrace, which probably will give the right answer, but I have not eyes to see the method. I'm doing this because I think some oddities are happening with the Flash plugin, and triggering spotlight.


title: Fedora 15 i686 report only 2.6 GB RAM

text: I have laptop Asus N53SV with 4 GB of RAM, i7 with integrated card and dedicated GPU. My problem on Fedora is that system reports only 2.6 GB RAM. I know that I should use kernel with PAE but even after I install it, I have only 2.6 GB RAM avaiable. Now I use 3.0.0 rc6 kernel, but still nothing. Is it possible that the integrated GPU uses almost 1GB of RAM ? Can I check it somehow?               $ free     Non-standard uts for running kernel:     release 3.0-0.rc6.git6.1.fc15.i686=3.0.0 gives version code 196608                  total       used       free     shared    buffers     cached     Mem:       2752180    2527816     224364          0      11232     499444     -/+ buffers/cache:    2017140     735040     Swap:      4849660     500048    4349612      dmidecode http://pastebin.com/CNrph9KA kernel logs http://pastebin.com/QvqUmEZb


title: The meaning of output of pmap

text: I wrote `main.c` in Linux:               int main()     {       while (1){}     }      When I compile and start it, I can `pmap` it:               # pmap 28578     28578:   ./a.out     0000000000400000      4K r-x--  /root/a.out     0000000000600000      4K r----  /root/a.out     0000000000601000      4K rw---  /root/a.out     00007f87c16c2000   1524K r-x--  /lib/libc-2.11.1.so     00007f87c183f000   2044K -----  /lib/libc-2.11.1.so     00007f87c1a3e000     16K r----  /lib/libc-2.11.1.so     00007f87c1a42000      4K rw---  /lib/libc-2.11.1.so     00007f87c1a43000     20K rw---    [ anon ]     00007f87c1a48000    128K r-x--  /lib/ld-2.11.1.so     00007f87c1c55000     12K rw---    [ anon ]     00007f87c1c65000      8K rw---    [ anon ]     00007f87c1c67000      4K r----  /lib/ld-2.11.1.so     00007f87c1c68000      4K rw---  /lib/ld-2.11.1.so     00007f87c1c69000      4K rw---    [ anon ]     00007fff19b82000     84K rw---    [ stack ]     00007fff19bfe000      8K r-x--    [ anon ]     ffffffffff600000      4K r-x--    [ anon ]      total             3876K      total (3876) divided by K equals the `VIRT` column in the output of `top`. Now where is the text segment? At 400000, 600000 and 601000, right? Where can I read an explanation what is where? `man pmap` did not help.


title: my git is messed up for all commands, how can I fix it?

text: I did this (was trying to set an 'self' alias with -v):                git() { if [[ $1 == "commit" ]]; then command git commit -v; else command git "$@"; fi; }       git() { if [[ $1 == "commit" ]]; then command git commit -v; else command git "$@"; fi; }       git() { git commit }; )       git() { git commit; }       git() { git (); }       git() { git(); }       git() { git() }      and now all git commmands hang - no error but no return prompt. I've uninstalled and installed git but it hasn't helped. How can I reset git command back to the default? I've tried `mv .gitconfig .gitconfig_old` but it didn't help.


title: A file exists but executing it doesn't work

text: I downloaded a Java tarball, extracted the archive and copied over scp to a remote machine. Using the `ls` command, the java executable exists:               ubuntu@Ubuntu:~$ ls -la /home/ubuntu/jre1.7.0_55/bin/     total 420     drwxr-xr-x 2 ubuntu ubuntu   4096 Mar 18 03:54 .     drwxr-xr-x 6 ubuntu ubuntu   4096 Apr 30 12:55 ..     lrwxrwxrwx 1 ubuntu ubuntu      8 Apr 30 10:58 ControlPanel -> jcontrol     -rwxr-xr-x 1 ubuntu ubuntu   5714 Mar 18 03:53 java     -rwxr-xr-x 1 ubuntu ubuntu  16246 Mar 18 03:54 java_vm     -rwxr-xr-x 1 ubuntu ubuntu 104497 Mar 18 03:54 javaws     -rwxr-xr-x 1 ubuntu ubuntu   6391 Mar 18 03:54 jcontrol     -rwxr-xr-x 1 ubuntu ubuntu   5873 Mar 18 03:53 keytool     -rwxr-xr-x 1 ubuntu ubuntu   6013 Mar 18 03:53 orbd     -rwxr-xr-x 1 ubuntu ubuntu   5893 Mar 18 03:53 pack200     -rwxr-xr-x 1 ubuntu ubuntu   5981 Mar 18 03:53 policytool     -rwxr-xr-x 1 ubuntu ubuntu   5865 Mar 18 03:53 rmid     -rwxr-xr-x 1 ubuntu ubuntu   5877 Mar 18 03:53 rmiregistry     -rwxr-xr-x 1 ubuntu ubuntu   5893 Mar 18 03:53 servertool     -rwxr-xr-x 1 ubuntu ubuntu   6045 Mar 18 03:53 tnameserv     -rwxr-xr-x 1 ubuntu ubuntu 215380 Mar 18 03:53 unpack200      However:               ubuntu@Ubuntu:~$ /home/ubuntu/jre1.7.0_55/bin/java     -bash: /home/ubuntu/jre1.7.0_55/bin/java: No such file or directory      What's the reason?


title: In which vlan am I in?

text: **My question:** are there any methods to detect that in which vlan I am? Can tcpdump show this? Or can I force a GENERAL switch to say to me?


title: Graphics glitches when I open web pages

text: Whenever I'm browsing some websites, some graphics glitches appear, like in this screenshot: ![enter image description here](http://i.stack.imgur.com/qtUW1.png) This happens with any Linux distribution that I use. Sometimes, the windows of these programs themselves have these errors (only happened once in this case, however). What can be wrong here? `lshw -C display`:               WARNING: You should run this program the super-user.     *-display     description: VGA compatible controller     Product: 82G33/G31 Express Integrated Graphics Controller     Manufacturer: Intel Corporation     physical id: 2     Bus information: pci @ 0000:00:02.0     Version: 10     width: 32 bits     clock: 33MHz     capabilities: vga_controller bus_master cap_list rom     configuration: driver = i915 latency = 0     resources: irq: 43 memory: fea80000-feafffff ioport: DC00 (size = 8)     memory:     e0000000-efffffff memory: fe900000-fe9fffff      lspci:               00:00.0 Host bridge: Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller (rev 10)     00:02.0 VGA compatible controller: Intel Corporation 82G33/G31 Express Integrated Graphics Controller (rev 10)     00:1B.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio Controller (rev 01)     00:1C.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 01)     00:1C.1 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 2 (rev 01)     00:1D.0 USB Controller: Intel Corporation USB UHCI N10/ICH 7 Family Controller # 1 (rev 01)     00:1D.1 USB Controller: Intel Corporation USB UHCI N10/ICH 7 Family Controller # 2 (rev 01)     00:1D.2 USB Controller: Intel Corporation USB UHCI N10/ICH 7 Family Controller # 3 (rev 01)     00:1D.3 USB Controller: Intel Corporation USB UHCI N10/ICH 7 Family Controller # 4 (rev 01)     00:1D.7 USB Controller: Intel Corporation USB2 EHCI N10/ICH 7 Family Controller (rev 01)     00:1E.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)     00:1F.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01)     00:1F.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01)     00:1F.2 IDE interface: Intel Corporation N10/ICH7 Family SATA Controller [IDE mode] (rev 01)     00:1F.3 SMBus: Intel Corporation SMBus Controller N10/ICH 7 Family (rev 01)     01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 02)


title: Is it possible to send arrays from bash to C++ program?

text: I wanted to know, if its possible to create an array_of_strings and send it to a C++ program, which has an argument string array_of_strings[]?


title: How to find out what turned off the computer?

text: Yesterday, after getting back home I found out my computer is turned off. Since it appeared it was cold shutdown (a lot of disk repairs were shown during boot up) I am wondering what was the cause. For this particular shutdown I probably won't figure it out, but how to set up system (openSUSE 11.4) to log the possible causes in such way, that if nothing is logged it would have to be power cut off. For now, I can think of several causes of cold shutdown:   * pressing turn off button (in my case not possible)    * overheating (possible, because one reason could be fan malfunction, and this can happen)    * power outage (possible) I cannot think of anything else. I rule out cracking into the system, because in such case shutdown would be clean. So, the question is -- how to set up your system, to be prepared for later finding out the cause of cold shutdown?


title: How to make Vim display colors as indicated by color codes?

text: In short, I'm in an effort to replace `less` with `vim` (`vimpager`). I have settings for scripts to spit out colors (and bold and everything nice) whenever they can. `less` understands the color codes and displays them nicely. How can I make `vim` parse the codes and display colors/boldness the way `less` does?


title: How to hide user status messages in XChat?

text: I'm referring to messages like these:               yeswanth (~yeswanth@115.184.67.87) has joined #python-dev      and               yeswanth has quit (Ping timeout: 260 seconds)


title: How do I completely disable an account?

text: How do I completely disable an account? `passwd -l` will not allow anyone to log into an account using a password but you can still log in via private/public keys. How would I disable the account completely? As a quickfix I renamed the file to `authorized_keys_lockme`. Is there another way?


title: Removing broken packages

text: Recently in a bout of frustration with getting phpmyadmin setup, I decided to start from scratch. Unfortunately, during the uninstall phase, I was prompted with the root password for mysql which I didn't have on hand at the time. Suffice to say, it informed me that there would be residue components since it couldn't properly clean its database connectors. When I arrived home, I attempted to remove the package through `aptitude purge` which turns out to no more potent than `aptitude remove` in that it saw phpmyadmin, attempted to remove it, and failed since the directories associated with the package were already removed from my earlier attempt. I tried to reinstall phpmyadmin, but aptitude simply stated that there was no update available, and did nothing, if there were an update, I'd probably run into the same problems regardless. In this regard, I proceeded to clean up mysql by dropping the database it used, and cleaning it from the user tables. I however have no idea what else is left from the package, or even how to clean the hooks in aptitude. The result of `dpkg --purge`               ickronia:/home/ken# dpkg --purge phpmyadmin     (Reading database ... 27158 files and directories currently installed.)     Removing phpmyadmin ...     /var/lib/dpkg/info/phpmyadmin.prerm: line 5: /usr/share/dbconfig-common/dpkg/prerm.mysql: No such file or directory     dpkg: error processing phpmyadmin (--purge):      subprocess pre-removal script returned error exit status 1     /var/lib/dpkg/info/phpmyadmin.postinst: line 35: /usr/share/dbconfig-common/dpkg/postinst.mysql: No such file or directory     dpkg: error while cleaning up:      subprocess post-installation script returned error exit status 1     Errors were encountered while processing:     phpmyadmin      On following Gile's advice, I tried to re-install the dependency dbconfig- common               ickronia:/home/ken# aptitude reinstall dbconfig-common     Reading package lists... Done     Building dependency tree     Reading state information... Done     Reading extended state information     Initializing package states... Done     Reading task descriptions... Done     dbconfig-common is not currently installed, so it will not be reinstalled.     dbconfig-common is not currently installed, so it will not be reinstalled.     The following packages are BROKEN:       phpmyadmin     0 packages upgraded, 0 newly installed, 0 to remove and 3 not upgraded.     Need to get 0B of archives. After unpacking 0B will be used.     The following packages have unmet dependencies:       phpmyadmin: Depends: php5-mcrypt but it is not installable                   Depends: dbconfig-common but it is not installable                   Depends: libjs-mootools (>= 1.2.4.0~debian1-1) which is a virtual  package.     The following actions will resolve these dependencies:          Remove the following packages:     phpmyadmin          Score is 121          Accept this solution? [Y/n/q/?] n          *** No more solutions available ***          The following actions will resolve these dependencies:          Remove the following packages:     phpmyadmin          Score is 121          Accept this solution? [Y/n/q/?] n          *** No more solutions available ***          The following actions will resolve these dependencies:          Remove the following packages:     phpmyadmin          Score is 121          Accept this solution? [Y/n/q/?] y     The following packages will be REMOVED:       phpmyadmin{a}     0 packages upgraded, 0 newly installed, 1 to remove and 3 not upgraded.     Need to get 0B of archives. After unpacking 17.7MB will be freed.     Do you want to continue? [Y/n/?] y     Writing extended state information... Done     (Reading database ... 27158 files and directories currently installed.)     Removing phpmyadmin ...     /var/lib/dpkg/info/phpmyadmin.prerm: line 5: /usr/share/dbconfig-common/dpkg/prerm.mysql: No such file or directory     dpkg: error processing phpmyadmin (--remove):      subprocess pre-removal script returned error exit status 1     /var/lib/dpkg/info/phpmyadmin.postinst: line 35: /usr/share/dbconfig-common/dpkg/postinst.mysql: No such file or directory     dpkg: error while cleaning up:      subprocess post-installation script returned error exit status 1     Errors were encountered while processing:      phpmyadmin     E: Sub-process /usr/bin/dpkg returned an error code (1)     A package failed to install.  Trying to recover:     Reading package lists... Done     Building dependency tree     Reading state information... Done     Reading extended state information     Initializing package states... Done     Writing extended state information... Done     Reading task descriptions... Done          ickronia:/home/ken#      It appears that phpmyadmin cleanly cleared out dbconfig-common               ickronia:/usr/share/dbconfig-common# ls -alF     total 12     drwxr-xr-x  3 root root 4096 2011-02-09 08:09 ./     drwxr-xr-x 98 root root 4096 2011-01-20 21:42 ../     drwxr-xr-x  3 root root 4096 2011-01-05 11:08 data/     ickronia:/usr/share/dbconfig-common#      Attempted to dpkg from archives as suggested by Giles               ickronia:/usr/share/dbconfig-common# dpkg -i /var/cache/apt/archives/{dbconfig-common,php5-mcrypt,libjs-mootools}*.deb     Selecting previously deselected package dbconfig-common.     (Reading database ... 27161 files and directories currently installed.)     Unpacking dbconfig-common (from .../dbconfig-common_1.8.46_all.deb) ...     Selecting previously deselected package php5-mcrypt.     Unpacking php5-mcrypt (from .../php5-mcrypt_5.3.3-6_i386.deb) ...     Selecting previously deselected package libjs-mootools.     Unpacking libjs-mootools (from .../libjs-mootools_1.2.5~debian1-2_all.deb) ...     Setting up dbconfig-common (1.8.46) ...     dpkg: dependency problems prevent configuration of php5-mcrypt:      php5-mcrypt depends on libltdl7 (>= 2.2.6b); however:       Package libltdl7 is not installed.      php5-mcrypt depends on libmcrypt4; however:       Package libmcrypt4 is not installed.     dpkg: error processing php5-mcrypt (--install):      dependency problems - leaving unconfigured     Setting up libjs-mootools (1.2.5~debian1-2) ...     Processing triggers for man-db ...     Processing triggers for libapache2-mod-php5 ...     Reloading web server config: apache2.     Errors were encountered while processing:      php5-mcrypt     ickronia:/usr/share/dbconfig-common#      I have a webserver running on php, but I'm willing to risk downtime to get this resolved.


title: How do I stop sed from adding extra newline characters

text: I am running the following 2 `sed` commands. The first one adds newline characters where I want them, the second also adds newline characters where I want them, BUT also adds an extra one at the end of the file where there wasn't one before.               sed -e 's|\<LIST_G_STATEMENT>|&\     |g' ${XMLDIR}/statement_tmp_1.xml > ${XMLDIR}/statement_tmp_2.xml          sed -e 's|\</LIST_G_STATEMENT>|&\     |g' ${XMLDIR}/statement_tmp_2.xml > ${XMLDIR}/statement_tmp_3.xml      Using `od -c` on all 3 of the files gives the following output. statement_tmp_1.xml (no `\n` at end of file)               1314700    T   A   T   E   M   E   N   T   >   <   /   L   I   S   T   _     1314720    G   _   S   T   A   T   E   M   E   N   T   >   <   /   G   _     1314740    S   E   T   U   P   >   <   /   L   I   S   T   _   G   _   S     1314760    E   T   U   P   >   <   /   A   R   X   S   G   P   O   >     1314777      statement_tmp_2.xml (no `\n` at end of file)               1314700    S   T   A   T   E   M   E   N   T   >   <   /   L   I   S   T     1314720    _   G   _   S   T   A   T   E   M   E   N   T   >   <   /   G     1314740    _   S   E   T   U   P   >   <   /   L   I   S   T   _   G   _     1314760    S   E   T   U   P   >   <   /   A   R   X   S   G   P   O   >     1315000      statement_tmp_3.xml (`\n` at end of file - where did it come from?)               1314700    S   T   A   T   E   M   E   N   T   >   <   /   L   I   S   T     1314720    _   G   _   S   T   A   T   E   M   E   N   T   >  \n   <   /     1314740    G   _   S   E   T   U   P   >   <   /   L   I   S   T   _   G     1314760    _   S   E   T   U   P   >   <   /   A   R   X   S   G   P   O     1315000    >  \n     1315002      I am running AIX 5.3 Basically, I either want it to stop adding the extra `\n`, or find a way of removing it.


title: command to layout tab separated list nicely

text: Sometimes, I'm getting as an input tab separated list, which is not quite aligned, for instance               var1  var2  var3     var_with_long_name_which_ruins_alignment  var2 var3      Is there an easy way to render them aligned?               var1                                      var2  var3     var_with_long_name_which_ruins_alignment  var2  var3


title: why has /dev/dsp vanished from SUSE

text: I used to test my sound settings with the command               dd if=/dev/urandom of=/dev/dsp      This will play random sound over your default sound device (using OSS). I am using SUSE Linux. Now in the newer releases (starting maybe 12.1, not sure) `/dev/dsp` is no longer there but sound works nevertheless. That is a problem because I have written guides how to troubleshoot sound problems under Linux, e.g. http://www.linuxintro.org/wiki/Sound_troubleshooting Why is `/dev/dsp` no longer there by default? How do I do a "smoke test" for Linux sound?


title: Fix the debian default version to wheezy

text: I followed this tutorial http://kemitix.postach.io/install-viber-on-debian- wheezy to install viber on debian wheezy 7.6. My problem is about the part that says: > Fix the default version to wheezy. Add this line to > /etc/apt/apt.conf.d/10release: APT::Default-Release "wheezy"; i went to /etc/apt/apt.conf.d/ but there wasn't a 10release file, so i created it and i add the line. After this i did an update and i install libc6 from the testing repository. I saw from the installation log of libc6 that a lot of system libs,etc were changed.   1. So why the 10release file didn't exist? do i need to add the `APT::Default-Release "wheezy";` line somewhere else too?   2. What exactly happed by installing this lib from testing repository?   3. Will i get updates from the testing repo? Did the testing entry to the sources.list changed my debian version?   4. How can i ensure that my default version is wheezy and i won't get updates from testing repo?


title: Select default binary to use

text: This is the output from `which -a autoconf`:               /usr/bin/autoconf     /usr/bin/autoconf     /home/amumu/root/bin/autoconf      I want to use autoconf in my home directory since it's newer version compare to the default in the server. How to set it as the default? I don't want to overwrite `/usr/bin/autoconf` or write to `/usr/local/bin`


title: How to have triple boot Linux Mint 17 Cinnamon/Ubuntu 14.04/Windows 8?

text: I have installed Ubuntu 14.04 and Windows 8 as a dual boot, now I want to install Linux Mint 17 and having triple boot. How can I have Mint 17 in my triple booting? How can I partitioning my HDD? I want to install that with USB and not using windows installer. thank you in advance.


title: Udev RUN rule to run touch has no effect

text: I've created the file bellow               $ cat /etc/udev/rules.d/10-tuned.rules      SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_STATUS}=="Charging", RUN+="touch /home/fx/charg"     SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_STATUS}=="Discharging", RUN+="touch /home/fx/disc"      but if I connect or disconnect the power cable no files created. After creating this file I did execute               sudo udevadm control --reload-rules      for rules reloading. What I did wrong?


title: Replace FreeBSD base clang with ports clang

text: FreeBSD 10 was the first release that officially released with Clang as the default, base compiler. Most ports, unless specially marked, now compile using the base ("pre- installed") clang. However, clang development is moderately rapid, and so the version of clang in base can be out of date frequently - not only do we have to wait for clang to be imported into base, but then we have to recompile from base (`make world`) to install it; the other alternative for the more enterprising operator would be to navigate the source tree and attempt to rebuild and reinstall just clang. It would be a lot easier to just use the version of clang that's in ports under lang/clangXX. Installing that's easy enough, but then how does one modify the ports infrastructure to use that install of clang instead of the base install of clang?


title: How to install get_iplayer in Fedora?

text: I have just installed Linux Fedora 17. (I have upgraded from Fedora 12, new computer, vendor installed 20, lots of problems, already got DVD for 17 so used that, now everything fine, until ... ) I want to use BBC i-player, needs plug-in. I have installed Adobe Flash Player, still no go. After searching the Web, and trying lots of suggestions in vain, it seems that I should have `get_iplayer` already, but I don't, nor can I install it:               [root@Hugh harry]# get_iplayer     bash: get_iplayer: command not found...     [root@Hugh harry]# yum install get_iplayer     Loaded plugins: langpacks, presto, refresh-packagekit     No package get_iplayer available.     Error: Nothing to do     [root@Hugh harry]#       Have I done, missed, or overlooked something obvious? Please, any help would be much appreciated.


title: Can anyone recommend some linux kernel related books for beginners?

text: I'm a newcomer of Linux kernel, and I want to know the mechanism of Linux kernel. But I was confused by such a huge number of concepts, structs and functions after the reading of _Understanding the Linux kernel_. This book details too many concepts which make me lost in the complex net of relationships between these components. I think I want a book which has many figures to describe these relationships behind this monolithic system. This book needs to describe the mechanisms of kernel instead of details how these functions work. Is there a such book?


title: netselect - how to get it installed on Mint?

text: I have been using Linux already for a couple of years, and got used with it. Most of distro I used are: Centos, Ubuntu, Fedora, etc. Recently I decided to put in one of my machines Mint and I must admit to love it, specially for multi-media stuff. One thing I couldn't figure out alone is about Netselect - an extremely useful tool indeed http://www.lowendguide.com/1/using-linux/useful-debian-command- netselect-apt . Why Mint doesn't include it as part of the package available to install from the Software Manager? This program I installed it with no problems on Ubuntu, but on Mint, I didn't find a way out to put it up and running. I even looked around with google and no information about it. I also looked in the available softwares from the software management. But nothing there about netselect. One thing I found was this link: https://packages.debian.org/stable/net/netselect . But the problem is, if you download and try to install it with `dpkg -i *.deb`, then the installation crashes complaining about dependencies, that if you try to solve, then will ask for another dependency, and that's goes on and on. Is there some way to enable netselect to run on Mint?


title: How to dual-boot on a machine with PGP WDE?

text: PGP Whole disk encryption ("WDE") is an encryption software that encrypts all your data, and includes a bootguard. Because of this, I have been unable to successfully dual-boot, as there is no place to install GRUB. (I did attempt an install, the result of which was a complete loss of my Windows partition, and a completely shot weekend.) I attempted the Ubuntu dual-boot (wubi version, does not install bootloader), but since the sequence is PGP decrytption-bootloader-OS, the data necessary for the install were inaccessible. The computer is a work computer, and I have not been granted permission to decrypt it. I'm booting off an external drive for now, but are there any good means of doing this?


title: dialog --inputbox

text: Follow the below script I've a unique variable that keeps all variables, I need have each variable separated from `$VALUES`:               #!/bin/bash     shell=""     groups=""     user=""     home=""     exec 3>&1     VALUES=$(dialog --ok-label "Submit" \               --backtitle "Linux User Managment" \               --title "Useradd" \               --form "Create a new user" \     15 50 0 \             "Username:" 1 1 "$user"         1 10 10 0 \             "Shell:"    2 1 "$shell"        2 10 15 0 \             "Group:"    3 1 "$groups"       3 10 8 0 \             "HOME:"     4 1 "$home"         4 10 40 0 \     2>&1 1>&3)     exec 3>&-          echo "$VALUES"


title: Send specific signal number with specific key

text: I want to set a specific key like F12 to send me a specific signal number that out of linux signals range that I can handle this signal with `trap` command. How can I do that? **NOTE:** I'm working with console and X server not installed.


title: How would you migrate from a Windows AD to a Linux LDAP server?

text: I currently run a Windows server with Active Directory. But since we're no longer using Exchange 2007, it became a fancy file server with authentication. I would like to move the AD to a Linux server. What would be the best way to do this? And which LDAP server should I use? **Update** there won't be any Windows clients left. They'll be updated to Edubuntu.


title: Where are some good guides for making packages (deb, rpm, etc)?

text: I am looking for a succinct howto on the basics.


title: How to reset linux centOS 6.0 keyboard shortcuts with custom changes to default one?

text: On Single Desktop Environment.... I created some custom shortcuts, but currently I want to revert all the changes to default settings (which having no custom changes). Example: created like `CTRL` + `N` = new terminal and later changed it to `CTRL` + `T` so here, `CTRL` + `N` is overridden with some conflicts. Where gedit `CTRL` + `N` for opening a new document is affected (not working at all). I found some related questions on this, but none resolved my purpose. Actually, if there are no ways to reset entire keyboard shortcut keys in CentOS, please suggest a way to rectify `CTRL` + `N` to work fine for `gedit` again?


title: "Linux supports the dynamic loading of kernel modules. "

text: I read in a book written by Robert Love that: > Linux supports the dynamic loading of kernel modules. He said this is the difference between Linux and Unix, but I seem to recall there is also KLD in FreeBSD? So can KLD also be seen as dynamic loading of kernel modules?


title: Startup log file for RHEL?

text: When I start up my Red Hat box I see a progress meter in the center of the screen that has a button that says "Show Details...". When I click on this button, I see a console like screen that shows the starting up of the services and such. After the startup has completed and after I log in, is there some log file that I can look at to see what I saw during the startup? If so, where is that log file?


title: Disabling thumbnails in Nautilus using dconf

text: Bellow are the steps I undertook to try to disable thumbnails in Nautilus ( following instruction mentioned here: https://wiki.gnome.org/dconf/SystemAdministrators ) . It didn't help. (I'm on Debian Wheezy, which seemingly has no /etc/dconf by default):   * `mkdir -p /etc/dconf/db/local.d/locks`   * `nano /etc/dconf/db/local.d/settings`              # /etc/dconf/db/local.d/settings     # prevent showing thumbnails     [org.gnome.nautilus.preferences]     show-image-thumbnails="never"        * `nano /etc/dconf/db/local.d/locks/settings`              # prevent changes to showing thumbnails setting     org.gnome.nautilus.preferences.show-image-thumbnails        * `mkdir /etc/dconf/profile`   * `nano /etc/dconf/profile/local`              system-db:local        * `export DCONF_PROFILE=/etc/dconf/profile`   * `dconf update` What's wrong here? I also tried to disable it using `dconf-editor` (both as root and as regular user) and I was not able to change the setting from 'local-only' to 'never' it looked like it was locked. I also tried `gsettings`:               # gsettings get org.gnome.nautilus.preferences show-image-thumbnails 'local-only'          # gsettings set org.gnome.nautilus.preferences show-image-thumbnails "never"          ** (process:5834): WARNING **: The connection is closed          ** (process:5834): WARNING **: The connection is closed      PS: I didn't reboot. Do I need to reboot in order for the new settings to take effect? I found several dconf files but it doesn't look like they contain any lock of org.gnome.nautilus.preferences.show-image-thumbnails and adding               [org.gnome.nautilus.preferences]     show-image-thumbnails="never"      to them didn't help either. Here are they:               /var/lib/gdm3/.cache/dconf     /var/lib/gdm3/.cache/dconf/user     /var/lib/gdm3/dconf/db     /var/lib/gdm3/dconf/profile     /var/lib/gdm3/dconf/db/gdm     /var/lib/gdm3/dconf/db/gdm.d     /var/lib/gdm3/dconf/db/gdm.d/00-upstream-settings     /var/lib/gdm3/dconf/db/gdm.d/10-desktop-base-settings     /var/lib/gdm3/dconf/db/gdm.d/90-debian-settings     /var/lib/gdm3/dconf/db/gdm.d/locks     /var/lib/gdm3/dconf/db/gdm.d/locks/00-upstream-settings-locks     /var/lib/gdm3/dconf/profile/gdm      and               /usr/share/gdm/dconf     /usr/share/gdm/dconf-profile     /usr/share/gdm/dconf/00-upstream-settings     /usr/share/gdm/dconf/10-desktop-base-settings     /usr/share/gdm/dconf/locks     /usr/share/gdm/dconf/locks/00-upstream-settings-locks      It looks like dconf update ignores:               /etc/dconf/db/local.d/settings      because if I intentionally write wrong things there it doesn't complain. Any ideas?


title: Can I read/write from/to the USB device that does not enumerate any device in /dev?

text: I'm using a Texas Instruments MSP430F5529 Launchpad, but it is probably not important. This device upon connection enumerates 2 ACM devices: `/dev/ttyACM0` and `ttyACM1`. Once upgrading firmware something went wrong and these files are no longer created, that's why I cannot indicate this device to the firmware upgrade application. However, the device can be seen in `lsusb`:               $ lsusb | grep Texas     Bus 001 Device 005: ID 0451:2046 Texas Instruments, Inc. TUSB2046 Hub     Bus 001 Device 006: ID 2047:03fe Texas Instruments      Bus 001 Device 007: ID 2047:0203 Texas Instruments       Is there any way to access to `Bus 001 Device 007: ID 2047:0203` as to a `/dev/ttyACM0` ?


title: Enable kwebkitpart in Konqueror

text: In KDE SC 4.5.0 it's possible to use a WebKit part for rendering in Konqueror. I don't think it's on by default (I could be wrong) and I believe I've installed all the requirements for it... How do I enable it? I figured out how to switch it...               View -> View mode -> webkit      But you must be on a web page first. Problem is that this setting doesn't stick. I can't find a permanent setting. Does one exist?


title: How to enable killing Xorg with Ctrl+Alt+Backspace

text: I don't remember why they did this, but at one point X.org decided that disabling `Ctrl``Alt``Backspace` to kill it was a good idea. I know there's a way to re-enable it but I don't remember how. Can someone refresh my memory?


title: How to install gcc 4-8 on #! Waldorf 64-bit?

text: I would like to install and use g++ 4-8 compiler. It supports various C++11 features, and I am willing to look into them and use them. Also, as I came here from Windows, my previous files also used C++11. I looked for a moment and found this site. It contains .deb package with 4-8 gcc base. I downloaded it and installed, but synaptic shows that it isn't supported. Is there a way I can use it? Also, please note that I am new to Linux - I migrated here literally few days ago and want to set things up. Therefore, I may not understand some fancy words or scripts.


title: Scrolling with a WACOM tablet pen

text: I've got a wacom pen with a button. How can I trigger scrolling when moving the pen with the button pressed? According to `xev`, below, the triggering events are _MotionNotify_ with state _0x200_. If this isn't done trivially, an idea I have is to build a service to read these events from somewhere and transform them into other events. This way, I can define gestures, as well. With this approach:   * Where can I read them?   * How can I write events back?   * Are there libraries to detect gestures?               MotionNotify event, serial 33, synthetic NO, window 0xc00001,         root 0x2ce, subw 0x0, time 695630659, (349,181), root:(1255,185),         state 0x0, is_hint 0, same_screen YES          ButtonPress event, serial 33, synthetic NO, window 0xc00001,         root 0x2ce, subw 0x0, time 695630659, (349,181), root:(1255,185),         state 0x0, button 2, same_screen YES          MotionNotify event, serial 33, synthetic NO, window 0xc00001,         root 0x2ce, subw 0x0, time 695630667, (348,183), root:(1254,187),         state 0x200, is_hint 0, same_screen YES          MotionNotify event, serial 33, synthetic NO, window 0xc00001,         root 0x2ce, subw 0x0, time 695630675, (347,184), root:(1253,188),         state 0x200, is_hint 0, same_screen YES          ...          MotionNotify event, serial 33, synthetic NO, window 0xc00001,         root 0x2ce, subw 0x0, time 695632069, (327,486), root:(1233,490),         state 0x200, is_hint 0, same_screen YES          ButtonRelease event, serial 33, synthetic NO, window 0xc00001,         root 0x2ce, subw 0x0, time 695632069, (327,486), root:(1233,490),         state 0x200, button 2, same_screen YES


title: problem with my wireless adapter on BTR 5

text: I'm using backtrack 5 r3 on Vmware but I'm having a problem with my wireless usb adapter, it looks like the backtrack can't find a driver for it. I have a D-link dwa-123 n150, how can I get it to work under Linux?


title: Evaluating the output of a program as an integer

text: I'm trying to create a script that will evaluate the output of a command line, and then print if it's larger than 200. The program `/exc/list` will count the number of "stories" I have in a directory as an expression. For example:               /exc/list q show.today1.rundown      will return 161 if there are 161 stories in the today1 rundown. I have to figure this for 23 different directories. If the number of stories is greater than 200, I need it to print it to a temp file (`/tmp/StoryCount.$date`). What's the best method to handle this comparison?


title: How can I remotely debug a broken initrd?

text: ## Background I have a system that runs Linux. It's a NAS, and does not have any monitor, keyboard, or serial port. It does have a network port. I'm not happy with the software running on it, and am trying to get a different distro to run. ## What I have On the existing system, I can manage to get a new kernel and initrd booted, by using the web interface to upgrade the ROM, but that upgrade is a specially crafted image, that does nothing more than unpack a kernel, initrd, `kexec`, and runs `kexec` with the required arguments to boot the new kernel. The initrd sets up a network connection, starts an SSH server (dropbear), and waits for it to end. It then runs a different script. Using this, I can do some testing: I can boot into that kernel/initrd, log in via SSH, customise the stage-2 script, kill dropbear, and hope for the best. Using this approach, I have managed to install a functional OS on the hard disk. (For now, it's NixOS, if it matters, but I may change that in the future. My question isn't about any specific distro though.) I have intentionally _not_ made it bootable. I wish to keep the flash memory as it is, so that aside from the data on the hard disk, the NAS remains "official". I have, however, obtained the distro's own kernel and initrd, that I would want to put in an upgrade image. ## The problem Using that kernel and initrd, the system does not start. ## My attempts I have put together a shared initrd, containing the distro's setup as well as my own, which continues to boot into dropbear. In an SSH shell, I then attempt to run the distro's init scripts. This fails, however, because it relies on being run as PID 1. I then attempted to make PID 1 take arbitrary commands: I made it run scripts from a pipe, and wrote to that pipe from my remote shell, intending to inspect manually whether the command had the desired effect. However, that doesn't work: the init-shell (PID 1) sees EOF after the very first command, and immediately exits. Hello kernel panic. I also attempted to test what would happen if I made it not care whether it was being run as PID 1, by passing systemd's `\--system` option, and then run the distro's init script from my shell. In that form, I was unable to reproduce the problem: it just worked. ## My question: What now? At this point I'm looking back at the pipe approach for an alternative, something that actually works to run more than one command. Preferably something that also lets me see the commands' output. Basically: I want to know how I can remotely see the output of the boot programs that run from PID 1, that cannot run in an SSH session, without actually attaching a monitor or serial cable. Answers that take a completely different approach are also welcome, but please keep in mind the system restrictions I'm dealing with. I don't just not have a monitor or serial cable, I don't even have a VGA or serial port. I have one USB port that I could plug a keyboard into, if needed, but I am of course not able to see anything I type.


title: How can I restart the SSH daemon on Ubuntu?

text: When I type in `service sshd restart` I get a `sshd: unrecognized service` error. I do have, in `/etc/ssh/` a file `sshd_config` that I use to set config. I can also putty into the Ubuntu box (it is remote). When I type in `/etc/init.d/sshd restart` I get `No such file or directory` Under `/usr/sbin/` there is an sshd file, but it is binary. Is something wrong with my sshd? What do I do to fix this? To be clear, I want to be able to type `service sshd restart` (like all the online tutourials say) to be able to, well, restart my sshd. So that my port changes take effect.


title: How can a filesystem be copied exactly as is?

text: I have a file system for a device I am programming that I would like to make an exact copy of. Ideally I would like this copy to be identical to the folder that it was copied from. I have tried using `cp -r` `cp -a` and `rsync -azvP` to try to achieve this. Each one though results in a folder with different size (using `du -s`) and ultimately,even though my device runs off of the original folder, it won't run off of the one that I copied.   * What is getting left out that the commands I have used aren't accounting for?   * Is it possible to keep everything identical when copying a file system/folder? If so how would I go about doing that? P.S. I posted a similar questions on StackOverflow but quickly realized I had asked it on the wrong exchange * * * Edit: This may not be helpful but no matter which method I use the copied directory always causes the machine in question to Kernel Panic with the following output. > VFS: Unable to mount root fs via NFS, trying floppy. VFS: Cannot open root > device "nfs" or unknown-block(2,0) Please append a correct "root=" boot > option; here are the available partitions: 1f00   >  64 mtdblock0 (driver?) 1f02 64 mtdblock2 (driver?) 1f04 2432 mtdblock4 > (driver?) 1f05 128 mtdblock5 (driver?) 1f06 4352 mtdblock6 (driver?) 1f07 > 204928 mtdblock7 (driver?) 1f08 50304 mtdblock8 (driver?) 0800   >  8388608 sda driver: sd Kernel panic - not syncing: VFS: Unable to mount > root fs on unknown-block(2,0)


title: Multiple pattern match and print in single line

text: I need to match two patterns in a log file and need to get the next line of the one of the pattern (out of two patterns) that is matched, finally need to print these three values in a single line. Sample Log File:               2013/09/05 04:26:00          Processing Batch /fbc/dev/cebi/dod/9739867262     2013/09/05 04:26:02          Batch 9739867262 was successful     2013/09/05 04:26:02          Total Time          =  3.13 Secs     2013/09/05 04:26:02          Repository API Time =  2.96 Secs     2013/09/05 04:26:02          File System Io Time =  0.06 Secs     2013/09/05 04:26:02          Doc Validation Time =  0.03 Secs     2013/09/05 04:26:02      Ending @ Thu Sep 05 04:26:02 EDT 2013     2013/09/05 08:18:10      Starting @ Thu Sep 05 08:18:10 EDT 2013     2013/09/05 08:18:10      Starting @ Thu Sep 05 08:18:10 EDT 2013     2013/09/05 08:18:10          Processing Batch /fbc/dev/cebi/dod/9844867675     2013/09/05 08:18:10          Processing Batch /fbc/dev/cebi/dod/9886743777     2013/09/05 08:18:16          Batch 9844867675 was successful     2013/09/05 08:18:16          Total Time          =  6.00 Secs     2013/09/05 08:18:16          Repository API Time =  5.63 Secs     2013/09/05 08:18:16          File System Io Time =  0.05 Secs     2013/09/05 08:18:16          Doc Validation Time =  0.19 Secs     2013/09/05 08:18:16      Ending @ Thu Sep 05 08:18:16 EDT 2013     2013/09/05 08:18:18          Batch 9886743777 was successful     2013/09/05 08:18:18          Total Time          =  8.27 Secs     2013/09/05 08:18:18          Repository API Time =  8.52 Secs     2013/09/05 08:18:18          File System Io Time =  0.08 Secs     2013/09/05 08:18:18          Doc Validation Time =  0.47 Secs     2013/09/05 08:18:18      Ending @ Thu Sep 05 08:18:18 EDT 2013      I have the numbers seperatly in file named cust_no.txt               9739867262     9844867675     9886743777      Taking these numbers as input I need to match following two patterns in the log file   1. Processing Batch /fbc/dev/cebi/dod/   2. Batch was successful Following are required as output: -> On the match of first pattern (`i.e Processing Batch /fbc/dev/cebi/dod/<numbers in the cust_no.txt>`) I need to get the 2nd word i.e $2 . -> On the match of second patterns (`i.e Batch <numbers in the cust_no.txt> was successful`) I need to get the 2nd word i.e $2 -> And the 6th word ($6) on the next line after the match after the second pattern (i.e the line staring with `Total Time` )  Desired output:               9739867262,04:26:00,04:26:02,3.13 Secs     9844867675,08:18:10,08:18:16,6.00 Secs     9886743777,08:18:10,08:18:18,8.27 Secs      In order get this I tried in the below way but this seems not to work:               awk -v cn=$cust_no '{{if ($0 ~ "Processing.*" cn) st=$2 && if ($0 ~ "Customer cn was successful" et=$2; getline; tt=$4} ; print st,et,tt}


title: How to find the installation path for a software under linux?

text: Under linux, I launch a software by typing, e.g., fluidplot. How can I find the installation path for this software?


title: What does meta+n do in the terminal

text: When I click this it replaces whatever I have currently typed into the buffer with a `:`. Hitting backspace will go back to whatever I had in the buffer but I can't seem to find what the hell it's supposed to do. It reminds me of a prompt for typing commands into.


title: init-scripts in autoyast to autodeploy Suse Linux server

text: I'm deploying a base SLES11.1 server using autoyast. What I want to achieve is to install some packages on it after the deployment. So I use the init-script in the autoyast control file. Here is the my init-scripts part:               <scripts>       <init-scripts config:type="list">          <script>             <location>nfs://10.198.31.71/InsRepository/initScript.sh</location>             <filename>initScript.sh</filename>             <rerun config:type="boolean">true</rerun>          </script>       </init-scripts>     </scripts>      And here is my initScript.sh code                #!/bin/bash           zypper ar -f http://download.opensuse.org/distribution/11.1/repo/oss Opensuse      zypper --no-gpg-checks --non-interactive in \             --force-resolution gcc openssl-devel e2fsprogs-devel           curl -L http://cpan.org | perl - --sudo App::cpanminus Text::CSV Date::Parse File::Path      wget --directory-prefix=/tmp ftp://10.198.31.71/VMware-vSphere-CLI-5.1.0-780721.i386.tar.gz           tar -zxvf VMware-vSphere-CLI-5.1.0-780721.i386.tar.gz           export http_proxy=      export ftp_proxy=           ./vmware-vsphere-cli-distrib/vmware-install.pl --default      But when I finished deployment, I found nothing run. The thing is, I can run the script on a freshly deployed server.


title: Do any text-based web browsers support unicode box-drawing characters?

text:
I have some html like this:                 &#x250c&#x2500&#x2500&#x2500&#x2500&#x2500&#x2500&#x2500&#x2500       &#x2500&#x2500&#x2500&#x2500&#x2500&#x2500&#x2500&#x2500&#x2510
       &#x2502testtesttesttest&#x2502
       &#x2514&#x2500&#x2500&#x2500&#x2500&#x2500&#x2500&#x2500&#x2500       &#x2500&#x2500&#x2500&#x2500&#x2500&#x2500&#x2500&#x2500&#x2518
      It shows up in Chrome with a solid box as I would expect (can't get it to display in SE right either!):                   ┌────────────────┐         │testtesttesttest│         └────────────────┘      and I was hoping the text browsers could do this too, but on Lynx I get                   +----------------+         |testtesttesttest|         +----------------+      On w3m its                   ??????????????????         ?testtesttesttest?         ??????????????????           and finally on links2 I get > >        +----------------+ >        &#x2502|testtesttesttest| >        +----------------+ >   Any chance of configuring one of the text browsers to show this stuff with the pretty solid lines like the graphical browsers? I am using PuTTY set to UTF-8 with "use unicode line drawing" enabled, connecting to Ubuntu 12.04.


title: How can I get a tmux session menu from outside a tmux session?

text: I'm trying to build a wrapper for tmux that presents me with a menu of all available sessions instead of creating a new one. However the man page explicitly says that this is not possible (excerpt from the `choose-tree` command): > This command works only if at least one client is attached. How could I have a shell function / script to present me with the the menu above, but without goint into tmux first? Or maybe a shortcut to attach and show the chooser in one go?


title: Bash: run command2 if command1 fails

text: I want to do something like this:               if cmd1 && cmd2     echo success     else     echo epic fail     fi      How should I do it?


title: Linux: Interface/control 3.5 mm Headphone or Microphone port?

text: This might sound crazy, but bear with me ;) I am making a DIY camera trigger, and I would like to see if I can trigger it remotely by plugging it into my Microphone or Headphone ports. It's a basic `2.5 mm --> 3.5 mm` plug, and all I need to do is short the first and last, first and second, and all three to focus, trigger, and focus and trigger. It's a bit hard to explain, but is it possible to send electrical signals directly through those ports? I'm up to some C++ or Python (heh) if I have to...


title: Information about a laptop fan

text: Can you help me with finding **all** the **hardware information** (parameters) and **configuration files** about the **fan** in my laptop?   I'm interested of the fan's parameters and configuration files that I can edit and change those parameters to have the most possible control over the fan. I used `sudo lshw | grep fan` and it didn't find it.   I remember the sentence "Everything in Unix is a file" so there should be files with the information I'm looking for and commands that are able to extract the information from those files. Linux kernel communicate with the hardware, so part of the information could be pulled out from there? Here is the link to **sensors-detect** output ending with error message.               $ dmesg | grep fan     [    0.281316] fan PNP0C0B:00: registered as cooling_device0     [    0.281534] fan PNP0C0B:01: registered as cooling_device1      In `/proc/acpi` there is a lot of information. What are the fan parameters I can control (state, speed, scheduling)? And where are the files that I can edit the fan parameters?


title: APTonCD equivalent for Fedora

text: Is there an equivalent of APTonCD for Fedora? I tried googling and found YUMonCD but wanted to know if there exists some package in the repos.


title: How do I install a PHP CLI with a usable interactive prompt on Debian Wheezy?

text: When I install php5-cli on Debian Wheezy (currently testing), the interactive prompt is very unusable due to missing readline support (bug 341868). What's the easiest way to install a version linked against libreadline (for usable line editing)?


title: How to force overwrite non-empty directories using `mv`

text: I am wanting to move (not just copy) a group of files/directories to a different directory some of which have name clashes with files/directories in the target directory. My main objective is to move the files, so I can tolerate the non-empty directory being overwritten. I am currently using `mv ... destination` however, occasionally I get > mv: cannot move `target' to /destination/target': Directory not empty I tried `mv -f ... destination` with no success and since I want the files to be gone from their original location, `rsync` doesn't seem to be appropriate. As a bonus, is there a good solution for preserving the files intended to be overwritten somehow maybe by renaming?


title: Installing CentOs 5.5-x86_64 kernel hangs with message NET: Registered Protocol family 2

text: The title pretty much says it all. I am attempting to install CentOS 5.5 on Oracle VM VirtualBox. I press enter for normal installation, things start to happen and then it hangs with the above message.


title: cannot touch -m a writable file

text: Can someone explain why I get permission denied when running `touch -m` on this file even though it is group writable and I can write to the file fine.               ~/test1-> id     uid=1000(plyons) gid=1000(plyons) groups=1000(plyons),4(adm),20(dialout),24(cdrom),46(plugdev),109(lpadmin),110(sambashare),111(admin),1002(webadmin)     ~/test1-> ls -ld .; ls -l     drwxrwxr-x 2 plyons plyons 4096 Feb 14 21:20 .     total 4     -r--rw---- 1 www-data webadmin 24 Feb 14 21:29 foo     ~/test1-> echo the file is writable >> foo     ~/test1-> touch -m foo     touch: setting times of `foo': Operation not permitted     ~/test1-> lsattr foo      -------------e- foo     ~/test1-> newgrp - webadmin      ~/test1-> id     uid=1000(plyons) gid=1002(webadmin) groups=1000(plyons),4(adm),20(dialout),24(cdrom),46(plugdev),109(lpadmin),110(sambashare),111(admin),1002(webadmin)     ~/test1-> touch -m foo     touch: setting times of `foo': Operation not permitted     ~/test1-> echo the file is writable >> foo     ~/test1->


title: Changing the localization

text: I have SSH access to a CentOS 6.3 box. Some results on that SSH and I think the whole OS is localized to portuguese. When I type date, for example, I get               Sex Fev 15 02:35:48 WET 2013      instead of               Fri Feb 15... bla bla      the timezone is correct but this localization in portuguese is giving me problems with scripts using date, because they are not recognizing this as a date. how can I change the date back to english format? thanks. * * * edit: typing locale gives me this               LANG=pt_PT.UTF-8     LC_CTYPE="pt_PT.UTF-8"     LC_NUMERIC="pt_PT.UTF-8"     LC_TIME="pt_PT.UTF-8"     LC_COLLATE="pt_PT.UTF-8"     LC_MONETARY="pt_PT.UTF-8"     LC_MESSAGES="pt_PT.UTF-8"     LC_PAPER="pt_PT.UTF-8"     LC_NAME="pt_PT.UTF-8"     LC_ADDRESS="pt_PT.UTF-8"     LC_TELEPHONE="pt_PT.UTF-8"     LC_MEASUREMENT="pt_PT.UTF-8"     LC_IDENTIFICATION="pt_PT.UTF-8"     LC_ALL=


title: Xubuntu 12.10 vs Linux Mint 14 XFCE

text: How are the distributions `Xubuntu 12.10` and `Linux Mint 14 XFCE` different given that the latter is based on `Ubuntu 12.10`? Simply the changes made to the `XFCE` desktop by the Mint team and the choice of pre-installed apps? Is there anything else?


title: How to send text to a command and THEN read from terminal

text: I'd like to know if it's possible to send some to a command's stdin and then keep reading from the terminal. The problem i'm trying to solve is executing some initialization code every time i open a Node.js REPL, so i have some functions available at the REPL from the start. Basically, to automate this:               $ node     > require('./myutils')     > ... continue using the REPL      I now i can use here string to send some text to the command's stdin:               $ node <<<"require('./myutils')"      That will execute my initialization code, but will also close the REPL immediately after that. Maybe there's another solution for this particular problem with Node.js, but i'd look to know if there's a general way of mixing input from a string or file and then keep reading from the terminal. **Update** : Chris Down's solution work, but the Node.js REPL won't run in the interactive mode by default (this is expected, as we're not reading from a terminal). Luckily, there's an `-i` option to force the interactive mode in the Node.js terminal:               { echo "require('./myutils')" ; cat ; } | node -i


title: Text editor with font-size selection for specific human languages (ie. Unicode Block) eg Devanagari

text: Pre Linux, I used Windows.. (too many years in the wilderness :) ... however there was a ray of sunshine in amongst all the general virus/re-install flack.. and that was Notepad++, a text Editor I really like(d). I'd probably still be using it, even now that I've shifted fully across to Linux(Ubuntu), but it doesn't behave 100% in 'wine'... (and its regex is stunted)... There is one feature in Notepad++ which I sorely miss, and that is the ability to display different SIZE fonts within a single document (at the same time)... At some point, I started learning Hindi, and found that the Devanagari script really needs to be larger than the Latin script (used here)... Devanagari is by nature a "taller" script, with frills above, and below the main line, and has more detail. Because of this I utilized Notepad++'s Syntax Highlighting to display my learning notes in a manner my eyes could handle... Now my dilemma, is to find a Linux Text Editor which can (at least) do what Notepad++ can do (ie. allow me to specify my own mix of font SIZES, and also to specify my own comment-delimiters)... **Now, the big ask**... What I would really like is an editor which is "Human- Language" aware, or "Font-Type" aware, or "Unicode-Codeblock" aware... so I don't have to fiddle and twiddle with syntax-highlighting, which is really not intended for what I want.. (PS... I don't want a word-processor) In October, last year, I asked here about SciTe (Scintilla) specifically (Notepad++ is based on Scintilla), but as per one answer, it is _too painful_ :) ... A comment suggested that Emacs could do it, so if that means "at the same time", then I'm interested, but I need some initial pointers on how to go about it... Here is an example of the Notepad++ presentation.. ![Here is an example of the Notepad++ presentation](http://i.stack.imgur.com/Cn79h.png)


title: Video freezes with Debian Jessie

text: On a fresh Debian testing installation I am not able to watch a video using standard video player such as: parole, VLC or banshee. Here are the symptoms:   * The sound is OK, but the image is always freezing.   * If I always drag around the video player the image and the sound are OK.   * If I open the video file with Chromium, the image and the sound are OK. (using the chromium player) I have installed the Intel graphics driver.               00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 09)     00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)     00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 09)     00:14.0 USB controller: Intel Corporation Lynx Point-LP USB xHCI HC (rev 04)     00:16.0 Communication controller: Intel Corporation Lynx Point-LP HECI #0 (rev 04)     00:1b.0 Audio device: Intel Corporation Lynx Point-LP HD Audio Controller (rev 04)     00:1c.0 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 3 (rev e4)     00:1c.3 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 4 (rev e4)     00:1d.0 USB controller: Intel Corporation Lynx Point-LP USB EHCI #1 (rev 04)     00:1f.0 ISA bridge: Intel Corporation Lynx Point-LP LPC Controller (rev 04)     00:1f.2 SATA controller: Intel Corporation Lynx Point-LP SATA Controller 1 [AHCI mode] (rev 04)     00:1f.3 SMBus: Intel Corporation Lynx Point-LP SMBus Controller (rev 04)     01:00.0 Network controller: Intel Corporation Wireless 7260 (rev 6b)


title: how to enable mcrypt in php5.5 with rhel6.5

text: i am using rhel6 OS with php5 But i am unable to add mcrypt extension for php5. Lots of Google but doesn't find any solution. [root@lav6 modules]# locate mcrypt.so /usr/lib64/libmcrypt.so /usr/lib64/libmcrypt.so.4 /usr/lib64/libmcrypt.so.4.4.8 /usr/lib64/php/modules/mcrypt.so [root@lav6 modules]# php -v PHP Warning: PHP Startup: Unable to load dynamic library '/opt/rh/php55/root/usr/lib64/php/modules/mcrypt.so' - /opt/rh/php55/root/usr/lib64/php/modules/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP 5.5.6 (cli) (built: Feb 21 2014 07:31:57) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies Thanks in advance.


title: Concatenate all commentary about source files in a directory tree

text: I am working on a multitude of projects involving codes in Fortran. They are in a directory tree involving 10 to 20 folders, each of the codes is in a 'src' folder. What I am looking for is a **simple** command that I could run at the root of the arborescence to go fetch all relevant information about the programs. This information is commented in the head of the .f or .f90 files, but of course it can run on a different number of lines in each file. A difficulty is that it is not always at the very head of the file, since there are sometimes modules first. But the information always recalls the name of the file, or at least contains the word 'main'. More precisely, let's say the arborescence is as follows :               /     |-folder1/          |-program1.f     |-folder2/          |-program2.f90      In `program1.f` I need the following block :               c     c program1 does the following     c blah blah     c      (this might be a capital C) and in `program2.f90` I need the following :               !     ! program2 does the following     ! blah blah     !      Perhaps, there is a _regular expression_ which could be used to fetch the full notice block?


title: Unable to install crontab on OpenSuse

text: I am running the following command as root, on OpenSuse:               linux-gn77-PC:/home/harbir/project # crontab -e      when the editor opens up I type the following, as I want the command to be run at 2145 hours               45 21 * * * * /home/harbir/project/maildispatcher.sh  &> /tmp/mycommand.log      when I try to save the file, I get the following message               crontab: installing new crontab     "/tmp/crontab.WOxjzG":1: bad command     errors in crontab file, can't install.     Do you want to retry the same edit?      I want the output of the crontab to go the file `/tmp/mycommand.log`.


title: Can't display from remote host when running X, but can when running xinit

text: I'm setting up xdmx. I've got it working, and am now trying to get it to start automatically once both display server boot. I want to avoid using xinit to start the backend X because I don't want xterm to run when I'm going to start xdmx. But when I run just X and not xinit, I can't display from a remote host:               displayhost:~ # X &     displayhost:~ # export DISPLAY=:0     displayhost:~ # xhost +          clienthost:~ $ export DISPLAY=displayhost:0     clienthost:~ $ xterm     No protocol specified     No protocol specified     No protocol specified     No protocol specified     xterm Xt error: Can't open display: questek0.local:0      If I run `netstat -l` on the displayhost, I can see that it is listening on port 6000. I can also telnet to the displayhost port 6000 from the clienthost, so I don't think it is a network issue. How can I get the above to work?


title: Ways to execute shell command as root?

text: I'm developing an application that will run on an Amazon EC2 instance, and execute certain commands that require root access. The problem is that different VM's give root access in different ways. E.g. some VM's give direct access to the root account, while others will simply allow a default non-root user access to sudo. Now, I can easily solve the above example by adding an option to prepend "sudo " to all commands. However, I'm not very familiar with unix, and I'd like to know if there are any other ways of gaining root privileges that I should prepare my program for. Are su and sudo reasonably enough?


title: Verify that /etc/passwd has correct number of fields on each line?

text: I'm looking for an easy, portable way to validate the number of fields in /etc/passwd, /etc/shadow, /etc/group and /etc/master.passwd. This would run on FreeBSD, Linux and other Un*xes. pwck does this, and more, but it only runs on Linux-based systems. How can I count the number of fields separated by colons in /etc/passwd?               root:x:0:0:root:/root:/bin/bash     bin:x:1:1:bin:/bin:/sbin/nologin     daemon:x:2:2:daemon:/sbin:/sbin/nologin      Following the example in "grep: count total number of occurrences", I came up with the following quick hack:               cat /etc/passwd | while read LINE; do echo $LINE | grep -o ':'  |wc -l; done      But I'm looking for a better way.


title: How to I solve the error? In svn email notification?

text: I have working from svn email notification,but it got the error, could you help for me. (The command execute autometic send file for my mail, but now not sending ) svn commit -m "[1] add some text in this file" error: Sending test/test.txt Transmitting file data . I go to syslog: tail -f /var/log/syslog Sep 4 13:16:42 dmayavanlo1 logger: Going to execute the email notification command Sep 4 13:16:42 dmayavanlo1 sSMTP[3116]: Unable to locate smtp.gmail.com Sep 4 13:16:42 dmayavanlo1 logger: sendmail: Cannot open smtp.gmail.com:587 Sep 4 13:16:42 dmayavanlo1 sSMTP[3116]: Cannot open smtp.gmail.com:587 Sep 4 13:16:42 dmayavanlo1 logger: Traceback (most recent call last): Sep 4 13:16:42 dmayavanlo1 logger: File "/home/bugzilla/mysvn/hooks /mailer.py", line 1348, in Sep 4 13:16:42 dmayavanlo1 logger: sys.argv[3:3+expected_args]) Sep 4 13:16:42 dmayavanlo1 logger: File "/usr/lib/python2.7/dist- packages/svn/core.py", line 281, in run_app Sep 4 13:16:42 dmayavanlo1 logger: return func(application_pool, *args, **kw) Sep 4 13:16:42 dmayavanlo1 logger: File "/home/bugzilla/mysvn/hooks/mailer.py", line 105, in main Sep 4 13:16:42 dmayavanlo1 logger: messenger.generate() Sep 4 13:16:42 dmayavanlo1 logger: File "/home/bugzilla/mysvn/hooks/mailer.py", line 383, in generate Sep 4 13:16:42 dmayavanlo1 logger: group, params, paths, subpool) Sep 4 13:16:42 dmayavanlo1 logger: File "/home/bugzilla/mysvn/hooks/mailer.py", line 653, in generate_content Sep 4 13:16:42 dmayavanlo1 logger: renderer.render(data) Sep 4 13:16:42 dmayavanlo1 logger: File "/home/bugzilla/mysvn/hooks/mailer.py", line 963, in render Sep 4 13:16:42 dmayavanlo1 logger: self._render_diffs(data.diffs, '') Sep 4 13:16:42 dmayavanlo1 logger: File "/home/bugzilla/mysvn/hooks/mailer.py", line 1042, in _render_diffs Sep 4 13:16:42 dmayavanlo1 logger: w(line.raw) Sep 4 13:16:42 dmayavanlo1 logger: IOError: [Errno 32] Broken pipe 2)tail -f /var/log/apache2/error.log [Thu Sep 04 12:34:11 2014] [error] [client 192.168.1.12] Could not fetch resource information. [301, #0] [Thu Sep 04 12:34:11 2014] [error] [client 192.168.1.12] Requests for a collection must have a trailing slash on the URI. [301, #0]


title: sed pattern matching with deletion over a line

text: I want to delete only some spaces(say 4) after the `line$#*425 with space` I am not able to complete it please suggest               echo "line$#*425 with space          " | sed 's/ /\1 \2/g'      i am thinking of using `od -b` also but still not able to figure it out how do i do it **NOTE** :spaces could be a normal " " or a tab character also **EDIT** :heres how i did a test to check for the below answer               [root@testgfs2 test]$echo -e "line$#*425 with space \t     "  | sed 's/[[:blank:]]\{4\}$//' | od -b     0000000 154 151 156 145 060 052 064 062 065 040 167 151 164 150 040 163     0000020 160 141 143 145 040 011 040 012     0000030      the deletion is happening not after the space word but at the end of line. the tab character( **011** ) is still there


title: How to start Process state

text: Over and over and also aver again. I saw this picture on operation system text book. But this time, I want to see the codes to understand this picture more tangible. where is codes which their duty is doing this jobs which you see on the picture? ![enter image description here](http://i.stack.imgur.com/LKrbO.png) this is a general question and I need general answer like where is code for each or at least some part of the picture.


title: How to replace all the first occurences in matched lines with incremental number?

text: I have a file like this               ...     1562 first part     1563 H     col3 H col4     1564 H     col3 H col4     ...     3241 H     col3 H col4     3242 third part     ...      I want to replace only the first `H` in every line to `H#`, with `#` is its number of appearance. The output should be:               ...     1562 first part     1563 H1    col3 H col4     1564 H2    col3 H col4     ...     3241 H1652 col3 H col4     3242 third part     ...      So far, I've tried:               max=`grep -c ' H ' b`     while [[ "$i" -le $max ]];do       grep -m $i ' H ' b|tail -n1|sed "s/H/H$i/1"       let i=i+1     done      This code is slow, it needs to read every line to replace and can't add the first part and third part of the file. Is there any better way to do this? Maybe awk? Thank you.


title: qemu can't run linux kernel

text: I saw this question and I did pretty much the same but I enabled initrd in configuration to use temporary root file system and no other modification but I still get this error on:               qemu -kernel linux-3.16.1/arch/x86/boot/bzImage      ![enter image description here](http://i.stack.imgur.com/zZFJN.png) any suggestion about what cause this error or how can i fix it ?


title: How do I put a hat on 'e' (ê)?

text: Since I've migrated to linux a few years ago, one issue still remains. The ê character features a lot in my "moeder taal" (home language). In Windows making the character was easy, I simply had to type `Alt`-`136` and voila! Is there a simplistic way in linux/unix to access special characters? I'd like to be able to type an ê anywhere on my (or any other) system, not only in the DE, but on the command-line as well.


title: How can I print unique line base on particular column value using awk?

text: I have a comma separated file with multiple fields. Example:               candidate1,12,56,ATTG     candidate2,45,90,ATTG     candidate3,90,140,ATTG     candidate4,2,36,AGCT      So, does anyone know the answer?


title: Is it possible to create an incremental snapshot file from an existing tar archive?

text: I have created a large tar archive and am now looking to do an incremental backup. The documentation indicates that a snapshot file can only be created when the initial tar backup file is created. Is it possible to list the contents of an existing tar archive to create a file in the snapshot file format? Is there enough detail in the original tar archive to allow an incremental backup to work correctly? (assuming some info such as inode numbers are fudged)


title: Piping commands together in unix

text: How do I pipe the output of one command to another in unix? For example, If I want to pipe the output of sort to tail, how would I do that?


title: What is Linux doing differently that allows me to remove/replace files where Windows would complain the file is currently in use?

text: The example I have is Minecraft. When running Bukkit on Linux I can remove or update the .jar files in the /plugins folder and simply run the 'reload' command. In Windows, I have to take the whole server process down because it will complain that the .jar file is currently in use when I try to remove or replace it. This is awesome to me, but why does it happen? What is Linux doing differently here?


title: Renaming or making filenames unique

text: I have written a plsql procedure using utl file to create files in the temp directory in Unix. I am sending the names of the files to a shell script to mail these files and delete after mailing from temp directory, it is working good but when two people running the same request with the same files, the files are replaced and deleted by the first program and the second program not having any files in the directory to mail. I decided to create file names_request_id to make file names unique, but my actual requirement is to get the files with the same name with out request_id to person who is receiving email. I created Incompatibility for the program with the same program but they want me to take away the incompatibility to save time. What other options do I have? For your reference i copied my whole shell script and added ####### symbol to denote the location of the code to be modified. The files are moved to the created directory and the file names have reuest_id-filename.extension so that request_id and the '-' must be removed and the actual filename should be there. name of the file in the database: 23456663-abcd.pdf required name of the filename : abcd.pdf               param=`echo $*`     #getting input values     echo "params : $param"          v_temp=`echo $param  | cut -d '"' -f 1 `     v_temp=`echo $v_temp | cut -d '=' -f 2 `     v_temp=`echo $v_temp | cut -d ' ' -f 1 `     #now v_temp has the request_id     v_temp=MUILT_EMAIL3-$v_temp          echo "temp file is : $v_temp"               #split the parameter string with " as seperator     v_email_list=`echo $param | cut -d '"' -f 8 `     v_file_list=`echo $param | cut -d '"' -f 10 `     v_subject=`echo $param | cut -d '"' -f 12 `     v_mail_content=`echo $param | cut -d '"' -f 14 `     v_reply_to=`echo $param | cut -d '"' -f 16 `     v_delete_attachment_files=`echo "$1"|cut -d'"' -f18`     v_outputfile_path=`echo "$1"|cut -d'"' -f20`     v_outputfile=`echo "$1"|cut -d'"' -f22`     v_request_id=`echo "$1"|cut -d'"' -f24`     #v_rename_file=`echo $param | cut -d '"' -f 24 `     echo "email list :" $v_email_list     echo "file list :" $v_file_list     echo "subject :" $v_subject     echo "mail_content :" $v_mail_content     echo "reply_to :" $v_reply_to     echo "delete_attachment_files :" $v_delete_attachment_files     echo "outputfile_path :" $v_outputfile_path     echo "outputfile :" $v_outputfile     echo "request_id :" $v_request_id          v_email_list=`echo $v_email_list |tr ";" " "`     v_file_list=`echo $v_file_list |tr ";" " "`          pwd     cd /               mkdir /tmp/$v_request_id     cp $v_outputfile_path /tmp/$v_request_id/$v_outputfile          mv /tmp/$v_request_id* /tmp/$v_request_id/      cd /tmp/$v_request_id/          ###### this is the place i need to rename the files that are moved to a request_id dir     ################# mv -- "34178248-2640006.pdf" "${34178248-2640006.pdf}"                v_mail_content =`basename $v_mail_content`     cat $v_mail_content > /tmp/${v_temp}.tmp               echo "File List : $v_file_list"          for i in ${v_file_list}; do         echo "File to attach before parsing $i"         v_attachment_name=`echo $i |awk '{ if ( index($1,":")> 0) { print substr($1,index($1,":")+1) } }'`         v_attachment_file=`echo $i |awk '{ if ( index($1,":")> 0) { print substr($1,1,index($1,":")-1) } }'`              echo "Checking attachment name after parse :"$v_attachment_name         if [ "$v_attachment_name" = '' ]           then           v_attachment_name=`basename $i`           v_attachment_file=$i           echo "base name is " $v_attachment_name         fi              /usr/bin/uuencode $v_attachment_file $v_attachment_name >> /tmp/${v_temp}.tmp     done     echo "Loop done"          if [ "${v_reply_to}" = '' ]       then       mailx -s "${v_subject}" "${v_email_list}" < /tmp/${v_temp}.tmp     #echo "something" | mailx -s "${v_subject}" ${v_email_list} < /tmp/${v_temp}.tmp     else       mailx -r "${v_reply_to}" -s "${v_subject}" "${v_email_list}" < /tmp/${v_temp}.tmp     #echo "something" | mailx -r "${v_reply_to}" -s "${v_subject}" ${v_email_list} < /tmp/${v_temp}.tmp     fi          echo "mailing done"          #delete the temporary files       echo "deleting file /tmp/${v_temp}.tmp"     rm /tmp/${v_temp}.tmp               if [ "${v_delete_attachment_files}" = 'Y' ]       then         echo "deleting attached files -start "         #Loop through to identify all the attachments and delete         for i in ${v_file_list}; do             echo $i             v_attachment_name=`echo $i |awk '{ if ( index($1,":")> 0) { print substr($1,index($1,":")+1) } }'`             v_attachment_file=`echo $i |awk '{ if ( index($1,":")> 0) { print substr($1,1,index($1,":")-1) } }'`                  echo "Check :"$v_attachment_name             if [ "$v_attachment_name" = '' ]               then               v_attachment_name=`basename $i`               v_attachment_file=$i               echo "base name is " $v_attachment_name             fi                  echo "deleting file $v_attachment_file"             rm $v_attachment_file         done         #End Loop through to identify all the attachments and delete     fi          echo "rm done"


title: Match PCI address of SATA controller and SCSI address of attached disks

text: I have a PCI-attached SATA controller connected to a (variable) number of disks on a machine with a Linux 2.6.39 kernel. I am trying to find the physical location of the disk, knowing the PCI address of the controller. In this case, controller is at address 0000:01:00.0, and there are two disks, with SCSI addresses 6:0.0.0.0 and 8:0.0.0 (though these last two aren't necessarily fixed, this is just what they are right now). `lshw -c storage` shows the controller and the SCSI devices (system disk and controller trimmed):               *-storage                       description: SATA controller        product: Marvell Technology Group Ltd.        vendor: Marvell Technology Group Ltd.        physical id: 0        bus info: pci@0000:01:00.0        version: 10        width: 32 bits        clock: 33MHz        capabilities: storage pm msi pciexpress ahci_1.0 bus_master cap_list rom        configuration: driver=ahci latency=0        resources: irq:51 ioport:e050(size=8) ioport:e040(size=4) ioport:e030(size=8) ioport:e020(size=4) ioport:e000(size=32) memory:f7b10000-f7b107ff memory:f7b00000-f7b0ffff     *-scsi:1        physical id: 2        logical name: scsi6        capabilities: emulated     *-scsi:2        physical id: 3        logical name: scsi8        capabilities: emulated      `lshw -c disk` shows the disks:               *-disk        description: ATA Disk        product: TOSHIBA THNSNF25        vendor: Toshiba        physical id: 0.0.0        bus info: scsi@6:0.0.0        logical name: /dev/sdb        version: FSXA        serial: 824S105DT15Y        size: 238GiB (256GB)        capabilities: gpt-1.00 partitioned partitioned:gpt        configuration: ansiversion=5 guid=79a679b1-3c04-4306-a498-9a959e2df371 sectorsize=4096     *-disk        description: ATA Disk        product: TOSHIBA THNSNF25        vendor: Toshiba        physical id: 0.0.0        bus info: scsi@8:0.0.0        logical name: /dev/sdc        version: FSXA        serial: 824S1055T15Y        size: 238GiB (256GB)        capabilities: gpt-1.00 partitioned partitioned:gpt        configuration: ansiversion=5 guid=79a679b1-3c04-4306-a498-9a959e2df371 sectorsize=4096      However, there does not seem to be a way to go from the PCI address to the SCSI address. I have also looked under the sysfs entries for the PCI and SCSI devices and no been able to find an entry which makes the connection. When the disks are plugged into different physical ports on the controller, the SCSI address doesn't necessarily change, so this cannot be used with an offset to correctly determine the location of the disk. Listing disks by ID also doesn't work - `ls -lah /dev/disks/by-path` shows that the entry for `pci-0000:01:00.0-scsi-0:0:0:0` points to `/dev/sdc` (or in general, the last disk connected), and there are no other paths that start in `pci-0000:01:00.0` that aren't just links to partitions of that drive. Are there any other ways to map the controller address into something that can be used to locate the disks?


title: grep IP addresses in expect script

text: This is part of code in an expect script, I have a problem with searching IP addresses from a file whose name is in the variable `$filename`.               #!/usr/local/bin/expect --      ###Made by Etihkru####               set env(TERM) vt100     set env(SHELL) /bin/sh     set env(HOME) /usr/local/bin     exp_internal 1     set PASSWORD eri     set SIU [lindex $argv 0]     match_max 1000     if {$SIU == ""} {     puts "Missing name of SIU. Run command as perl SIUADD FRTXXX"     exit     }               spawn ssh mashost     set USER admin     set PASS hidden          expect {         "assword"  {send "$PASSWORD\r"}     }                  expect "ranosusr@rn2osscs603"             send -- "cd /var/opt/ericsson/edd/ARNE_SIU \r"             expect "ranosusr@rn2osscs603"             send -- "grep -il $SIU *\r"             set prompt {ranosusr@rn2osscs603> }             expect -re "(FXL\\S+\\.xml).*$prompt$"             set filename $expect_out(1,string)              send -- "cat $filename | grep 'url=' \r"             expect -re "something.*$prompt$" //Expect this ip adreess ???             set IP $expect_out(1,string)//put it to variable IP ???               spawn ssh admin@$ip     expect {         -re "RSA key fingerprint" {send "yes\r"}         timeout {puts "Host is known"}     }          expect {         "assword"  {send "$PASS\r"}     }          expect "Osmon>"     send -- "resumePMMeasurements STN=0,MeasurementDefinition=0 sftp://pmup-rn2sossv605:eric@10.211.149.60/GRAN/rn2sossv605/$SIU/NeTransientUp \r"     expect "Osmon>"     send -- "getalarmlist \r"     expect -re "(\Operation Succeed\)"     send -- "rev \r"     expect "Osmon>"     send -- "subscribe 10.211.149.40 1 \r"     expect "Osmon>"     send -- "getsubscriptionstatus 1 \r"     expect "Osmon>"     interact      This is the ouput:                expect: does "> cat FXL704_FRTAMX_SIU_ARNE.xml | grep 'url=' " (spawn_id exp4) match glob pattern "ranosusr@rn2osscs603"? no         expect: does "> cat FXL704_FRTAMX_SIU_ARNE.xml | grep 'url=' \r\r\n" (spawn_id exp4) match glob pattern "ranosusr@rn2osscs603"? no                               <emUrl url="10.80.31.123"/>             expect: does "> cat FXL704_FRTAMX_SIU_ARNE.xml | grep 'url=' \r\r\n                  <emUrl url="10.80.31.123"/>\r\r\n" (spawn_id exp4) match glob pattern "ranosusr@rn2osscs603"? no         ranosusr@rn2osscs603>         expect: does "> cat FXL704_FRTAMX_SIU_ARNE.xml | grep 'url=' \r\r\n                  <emUrl url="10.80.31.123"/>\r\r\nranosusr@rn2osscs603> " (spawn_id exp4) match glob pattern "ranosusr@rn2osscs603"? yes      I need the pure IP address, cleared from other characters (e.g. `10.80.31.123`), because I need to use it in next SSH login, so I need to assign it to a variable `$IP`.


title: Trying to use TLS SMTP against Exim, getting Security Error back; what's wrong?

text: OS: FreeBSD9 64 Bit MTA: EXIM4 with TLS with Self Signed Certificate. I am using               telnet myserver.com 25      EHLO dummy@dummy.com     STARTTLS      It says               TLS go ahead      And then I issue               MSG FROM: me@me.com It says **               554 Security Error ** _It first says tls is ok go ahead then produces error!!!!!_ Can someone figure out What is the problem. And/Or provide necessary solution. If more information is required please let me know I tested my tls here https://www.wormly.com/test_smtp_server, It produced:               Resolving hostname...     Connecting...     SMTP -> FROM SERVER:     SMTP -> FROM SERVER:      SMTP -> ERROR: EHLO not accepted from server:      SMTP -> FROM SERVER:      SMTP -> ERROR: HELO not accepted from server:      Message sending failed.


title: Are system calls the only way to interact with the Linux kernel from user land?

text: Are there any other interfaces, e.g. the /proc filesystem?


title: What is the default action for incoming packets that don't match explicit iptables rules?

text: CentOS 5.x I'd like to understand what is specifically happening to incoming packets that don't explicitly match rules in my iptables chains. Is the default action to reject them? Or drop them? How/where can I set this? Here's an example output of my firewall setup (some ports have been modified to protect the innocent :-) ) :               Chain INPUT (policy ACCEPT)     target     prot opt source               destination     RH-Firewall-1-INPUT  all  --  anywhere             anywhere          Chain FORWARD (policy ACCEPT)     target     prot opt source               destination     RH-Firewall-1-INPUT  all  --  anywhere             anywhere          Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination          Chain RH-Firewall-1-INPUT (2 references)     target     prot opt source               destination     ACCEPT     all  --  anywhere             anywhere     ACCEPT     all  --  anywhere             anywhere     ACCEPT     icmp --  anywhere             anywhere            icmp any     ACCEPT     esp  --  anywhere             anywhere     ACCEPT     ah   --  anywhere             anywhere     ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED     ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:456     REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited      The key point though is that I have a different chain called `RH- Firewall-1-INPUT` that doesn't have an explicit `(policy ACCEPT)` or `(policy REJECT)` statement. What would be the default behavior for that (assuming of course that I'm NOT matching any of the prior rules). Is the last line just a "catch all"?


title: How to colorize `gcal`

text: I'm using `gcal`. http://www.gnu.org/software/gcal/manual/gcal.html Is there easy way to make Saturday blue and Sunday red?   If there is another CLI program that provides the same functionality in OSX, I would be willing to use it.


title: Low resolution options disappeared after selecting a higher one

text: I have a TV with a ridiculously low resolution (around 800x400), the TV accepts higher resolutions as well, and scales them down to the native resolution. Once I tried selecting a higher resolution using the gui control panel of mint, the native resolution disappeared from the list, and I'm now stuck on a resolution that gets scaled down, slightly ruining the colors on the screen. I'm suspecting mint may be hiding the native resolution of the TV because there are "better" options available. Is there any way getting around this without messing around with xrandr or the command line?


title: What is the difference between likely and unlikely calls in Kernel?

text: What is the between likely and unlikely calls in Kernel. While searching through the kernel source i found these statements.               # define likely(x)      __builtin_expect(!!(x), 1)     # define unlikely(x)    __builtin_expect(!!(x), 0)      Could somebody shed some light into it?


title: How to deal with closed source modules when configuring a new kernel build

text: I found this command very useful:               make localmodconfig      However, having some closed source drivers/modules ends up being a problem because this command can't find an appropriate way of including the config parameters, which do not exist, related to my closed-source software. My question is: for example, if I have the `fglrx` module installed, how can I configure my kernel build?


title: What's the most "correct" mount point for a permanent NTFS partition?

text: I have an NTFS partition (containing a Windows installation from which I dual boot) that I would like to permanently mount from my Linux installation. Problem is, I can't figure out what the best/right/correct mount point for the NTFS partition is. Obviously, it shouldn't be mounted as /home, /usr, etc. (any of the standard mount points for filesystems) because it's not part of the Linux system. I do want it to be permanently mounted, though; and this raises the question, where do I mount it? Here are the mount point possibilities I've come up with: ### /media/windows This one makes a lot of sense because it would be right alongside auto-mounted devices, but according to the filesystem standard, /media/ is really for removable media, so it doesn't seem quite right to put my permanently mounted, internal partition next to auto-mounted, removable ones. I'm leaning toward this option the most, but only because it is less incongruent than the others. ### /mnt/windows This one also seems pretty logical, but again, the standard (and other things I've read) indicate that subdirectory mountpoints are generally discouraged here. Plus, I do actually mount filesystems temporarily in /mnt/ on occasion (as the standard intended it), so this one looks like it would get in the way of regular system use. ### /windows I really don't like the idea of adding another top-level directory to my filesystem, if I can avoid it. It doesn't feel right. An upside to this one, though, is that it is very easily accessible and doesn't get in the way of anything else (i.e. automounting partitions in /media/ or temporary mounts in /mnt/). ### /home/[my username]/filesystems/windows I don't like this idea because the partition is decidedly system-specific, not user-specific, so shoving it in a home directory seems not right. * * * **Which of these options is the "right" one—or is there an alternative I didn't list here?** For clarity, note that I am running Linux (Arch Linux in particular), so any recommendations should probably be based on Linux's idea of filesystem organization rather than BSD's, for example.


title: Gnome-core on Debian

text: I installed only the base debian package and during installation I did not select any of GUI window manager, laptop, or system utilities. So basically I'm running debian from command line, now I want to set up a GUI just for desktop. For this I tried installing gnome-core by               apt-get install gnome-core      But is shows gnome-core as a 400MB archive, is the core package so big? I don't want any programs just the basic desktop GUI and nothing else. My internet speed is slow and I can't wait for hours together for installing gnome. Is there any other way to do it? To install only the core package for just desktop and nothing else.


title: Determine file system timestamp accuracy

text: File timestamps accuracy is limited to one second for EXT3, one microsecond for UFS, and one nanosecond for EXT4 (at least according to experience). Is there any way to determine this based only on filesystem info? The hacky alternatives I can think of are either to limit all my unit tests to seconds (which I do now), or to `touch` a bunch of files and checking which digits are zero in `stat -c %x`.