title: fedora 15, oracle 11: can't login using sqlplus

text: So yesterday I was fighting with importing cx_Oracle and it finally worked. However, I could not connect to the database. So I checked sqlplus to find out, whether I can connect to my Oracle database at all. I have tried both SYS and SYSTEM with the password I set during configuration as well as SCOTT/TIGER, but nothing helps and I get always the same error. This is what is printed:               [gruszczy@gruszczy-laptop matches]$ sqlplus          SQL*Plus: Release 11.2.0.2.0 Beta on Sat Jun 11 12:33:48 2011          Copyright (c) 1982, 2010, Oracle.  All rights reserved.          Enter user-name: sys     Enter password:      ERROR:     ORA-01034: ORACLE not available     ORA-27101: shared memory realm does not exist     Linux-x86_64 Error: 2: No such file or directory     Process ID: 0     Session ID: 0 Serial number: 0               Enter user-name: system     Enter password:      ERROR:     ORA-01034: ORACLE not available     ORA-27101: shared memory realm does not exist     Linux-x86_64 Error: 2: No such file or directory     Process ID: 0     Session ID: 0 Serial number: 0               Enter user-name: scott     Enter password:      ERROR:     ORA-01034: ORACLE not available     ORA-27101: shared memory realm does not exist     Linux-x86_64 Error: 2: No such file or directory     Process ID: 0     Session ID: 0 Serial number: 0      Do you have any idea, what might not have been set? I have found information on Google, that I need to have no trailing slash in ORACLE_HOME and ORACLE_SID set. I have done both those things:               export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe     export PATH=$PATH:$ORACLE_HOME/bin     export ORACLE_SID=XE     export LD_LIBRARY_PATH=$ORACLE_HOME/lib      Is there anything that I have done wrong or do I have to set up something more? **EDIT** My tnsnames.ora:               XE =       (DESCRIPTION =         (ADDRESS = (PROTOCOL = TCP)(HOST = gruszczy-laptop)(PORT = 1521))         (CONNECT_DATA =           (SERVER = DEDICATED)           (SERVICE_NAME = XE)         )       )          EXTPROC_CONNECTION_DATA =       (DESCRIPTION =         (ADDRESS_LIST =           (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))         )         (CONNECT_DATA =           (SID = PLSExtProc)           (PRESENTATION = RO)         )       )      **EDIT** I tried doing suggested operations and got this:               $ sudo su - oracle     $ -bash-4.2$ sqlplus / as sysdba          SQL*Plus: Release 11.2.0.2.0 Beta on Sat Jun 11 21:47:15 2011          Copyright (c) 1982, 2010, Oracle.  All rights reserved.          Connected to an idle instance.          SQL> startup     ORA-00119: invalid specification for system parameter LOCAL_LISTENER     ORA-00130: invalid listener address '(ADDRESS=(PROTOCOL=TCP)(HOST=gruszczy-laptop)(PORT=1521))'     SQL> Disconnected          -bash-4.2$ lsnrctl status          LSNRCTL for Linux: Version 11.2.0.2.0 - Beta on 11-JUN-2011 21:47:43          Copyright (c) 1991, 2010, Oracle.  All rights reserved.          Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))     TNS-12541: TNS:no listener      TNS-12560: TNS:protocol adapter error       TNS-00511: No listener        Linux Error: 2: No such file or directory     Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=gruszczy-laptop)(PORT=1521)))      This doesn't say me anything and I have no idea, how this all should be configured. I have never had to set this up before. Also usually before I try doing anything I start database with 'Start Database' application.


title: How to change profile to search current directory?

text: I would like to change my profile so that I can execute programs in the current directory without `./`. In other words:               $ foo.sh      would accomplish what currently happens with:               $ ./foo.sh      I'm new to linux, so I'm open to hearing about why this is a bad idea, but this is for my personal machine.


title: What does this error mean when installing namecoin?

text: I'm trying to set up namecoin, but I get the following error on running makefile.unix:               $ g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -DNOPCH DFOURWAYSSE2 -DUSE_SSL -DUSE_UPNP=0 -o obj/nogui/net.o net.cpp          In file included from net.cpp:10:     /usr/include/miniupnpc/upnpcommands.h:11:30: error: portlistingparse.h: No such file or directory     /usr/include/miniupnpc/upnpcommands.h:13:28: error: miniupnpctypes.h: No such file or directory     In file included from net.cpp:10:     /usr/include/miniupnpc/upnpcommands.h:25: error: ‘UNSIGNED_INTEGER’ does not name a type     /usr/include/miniupnpc/upnpcommands.h:29: error: ‘UNSIGNED_INTEGER’ does not name a type     /usr/include/miniupnpc/upnpcommands.h:33: error: ‘UNSIGNED_INTEGER’ does not name a type     /usr/include/miniupnpc/upnpcommands.h:37: error: ‘UNSIGNED_INTEGER’ does not name a type     /usr/include/miniupnpc/miniupnpc.h: In function ‘void ThreadMapPort2(void*)’:     /usr/include/miniupnpc/miniupnpc.h:53: error: too few arguments to function ‘UPNPDev* upnpDiscover(int, const char*, const char*, int, int, int*)’     net.cpp:906: error: at this point in file     /usr/include/miniupnpc/upnpcommands.h:117: error: too few arguments to function ‘int UPNP_AddPortMapping(const char*, const char*, const char*, const char*, const char*, const char*, const char*, const char*, const char*)’     net.cpp:920: error: at this point in file     make: *** [obj/nogui/net.o] Error 1      I think the issue may be Berkeley DB but I don't know how to check that. Anybody have any idea?


title: Understanding "vncserver -list" with respect to Xvnc processes

text: I have a pretty standard setup on a Centos 6.5 VM. I've configured VNC sessions to start at boot per CentOS's wiki               VNCSERVERS="1:root 2:moe 3:curly"     VNCSERVERARGS[1]="-geometry 640x480"     VNCSERVERARGS[2]="-geometry 640x480"     VNCSERVERARGS[3]="-geometry 800x600"      In my case, I have sessions 1 through 12 configured, with 2 through 12 being local users, and session 1 belonging to root. All of my sessions get created on boot, as expected, which I can verify if I run "ps -ef | grep Xvnc"               [moe@stooges ~]$ ps -ef|grep Xvnc     root     26037     1  0 Aug19 ?        00:00:14 /usr/bin/Xvnc :1 -desktop stooges.domain.com:1 (root) -auth /root/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -fp catalogue:/etc/X11/fontpath.d -pn     moe 26126     1  0 Aug19 ?        00:00:00 /usr/bin/Xvnc :2 -desktop stooges.domain.com:2 (moe) -auth /export/home/moe/.Xauthority -geometry 1680x1050 -rfbwait 30000 -rfbauth /export/home/moe/.vnc/passwd -rfbport 5902 -fp catalogue:/etc/X11/fontpath.d -pn     (... and so on for all 12 sessions...)      I'm able to connect to all these, as well as kill them as root using "vncserver -kill :PORT# Where I get confused is when I compare this result with the output of "vncserver -list"               [moe@stooges ~]$ vncserver -list          TigerVNC server sessions:          X DISPLAY # PROCESS ID     :1      22091     :2      1929     :12     30719      If I run "vncserver" as root or any other user, that new session ends up getting represented in the results of both "ps -ef|grep Xvnc" and "vncserver -list" What is the relationship/behavior I'm missing of the vncserver service, Xvnc processes created at boot, Xvnc sessions created via user execution of "vncserver"?


title: What's the easiest way of installing JRE on Debian?

text: What is the easiest way of installing JRE on my Debian OS (Linux)?


title: How do I mount an XFS partition via /etc/fstab and non-root users can r/w to it?

text: I have 2 XFS partitions I want to mount via `/etc/fstab`:               /dev/sdb1        /media/data        xfs        defaults        0        2     /dev/sdc1        /media/backup      xfs        defaults        0        2      Both are mounted at boot but when I try to access it as a non-root user, I get               $ cd /media/data     -bash: cd: /media/data: Permission denied          $ ls /media/data     ls: cannot access /media/data/audio: Permission denied     ls: cannot access /media/data/documents: Permission denied     ls: cannot access /media/data/downloads: Permission denied     ls: cannot access /media/data/images: Permission denied     ls: cannot access /media/data/video: Permission denied     audio documents downloads images video      Note that from the `ls` command there is a `Permission denied` error but the last line shows the directory names although they are in red font. I have tried doing `sudo chmod 766 /media/data` and `sudo chmod 766 /media/backup` but I still get permission errors when trying to access said mount points as a non-root user. I am using Fedora 20 and I am not sure if this has something to do with SELinux but in my previous setup with a partition of NTFS, I don't get these errors and the partition was accessible by non-root users.


title: How can i know which unistd.h file is loaded?

text: I have several unistd.h files in my Ubuntu Linux. I've one on: /usr/include/asm/unistd.h This file has this directives:               # ifdef __i386__     #  include "unistd_32.h"     # else     #  include "unistd_64.h"     # endif      In that folder, i can find those files (unistd_32.h and unistd_64.h). But in /usr/src/linux-headers-2.6.31-22/include/asm-generic/ there's another unistd.h that starts with this directives:               #if !defined(_ASM_GENERIC_UNISTD_H) || defined(__SYSCALL)     #define _ASM_GENERIC_UNISTD_H      So, the question is: How can i know, which one is loaded? Is there any way to check it in runtime with Java? Thanks!


title: Capture multi-line output of a bash builtin

text: Normally, bash is able to assign multi-line output of a command:               L=`ls`      This works from both interactive shell and scripts. But it appears the output of a builtin can't be captured in a variable:               L=`dirs -l -p`      This works in the interactive shell, but in the script only first line end up in the variable, probably due to different treatment of builtins by bash. Why does it happen, and how can I do what I need?


title: Linux-compatible 56k modem

text: I have a client who wants to set up a fax server in their office. I'd like to use HylaFAX under Ubuntu, but I'm a little shy to spend money on hardware for Linux, particularly a modem given the whole Winmodem issue. So to ask two different questions in the same post: First, **what are the most reliable ways to tell if a modem is supported in modern releases of Linux?** It's nice when a manufacturer specifically mentions Linux support. Failing that, do you check the kernel docs? Chipset type? Other keywords on the modem's spec sheet? Second, **what specific modem would you recommend?**


title: How to Mount Western Digital external hard drive

text: I am using Debian. I cannot mount Western Digital My Passport Ultra on my system. I have tried `sudo mount /dev/sdbx /media/hdd`. It worked fine for me. But the problem is that I have to repeat this process every time I restart my system. And it is hard for my friends to mount it on their Linux machine as well. _(works fine on Windows!)_ Why is it not mounting automatically even after reformatting the drive to `NTFS` from Linux? What is the permanent solution?


title: recursively chmod

text: I was trying to `chmod` folders and files with:               find . -type d -exec chmod 755 {} \;     find . -type f -exec chmod 644 {} \;      But I was wondering:   1. How to do it in one line using `find` and excluding the directories `.` and `..`   2. Which method is better, `find -exec` or `xargs`?


title: How to redirect sqlite3 output to a file

text: I installed `sqlite3` and want to use it to recover information from `stylish.sqlite` which is located in my Firefox profile folder and is generated by the Stylish extension:               $ cd ~/.mozilla/firefox/w4wcp85s.default     $ sqlite3 stylish.sqlite     SQLite version 3.7.17 2013-05-20 00:56:22     Enter ".help" for instructions     Enter SQL statements terminated with a ";"     sqlite> .tables     style_meta  styles     sqlite> SELECT * FROM styles;     6||||YouTube|/* AGENT_SHEET */      /* ▓▓ NIGHTSHIFT - eye care:                                 ▓▓        ▓▓_http://userstyles.org/styles/18192/nightshift-eye-care_▓▓ */          @namespace url(http://www.w3.org/1999/xhtml);     @-moz-document regexp("https?://www.youtube.com/.*")  {     body,html {min-height: 100%!important; }     html, body{background-color:#111!important}     body>*:not(:empty){background-color:#222!important}     body>*>*:not(:empty){background-color:#222!important}     body>*>*>*:not(:empty){background-color:#282828!important}     ...       My question is this: how can I capture the output of `sqlite> SELECT * FROM styles;` to a file? (I know I can select the output in the terminal and copy it to a file.)


title: sendmail not using mailertable

text: I'm having trouble getting my mailertable to work....               /etc/mail/sendmail.mc contains this line     FEATURE(`mailertable', `hash -o /etc/mail/mailertable.db')dnl          /etc/mail/mailertable contains this line     domain1.com        esmtp:[10.210.5.22]      I ran these to "recompile" the settings...               makemap hash /etc/mail/mailertable.db < /etc/mail/mailertable     m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf     service sendmail restart      Then tried to send a test               $ mail -s "test email" aaron@domain1.com               $ tail -f /var/log/maillog     May  9 10:03:14 npsetl005 sendmail[27779]: p49E3EG0027777: to=<aaron@www.domain1.com>, ctladdr=<root@npsetl005.domain.domain1.pri> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120350, relay=www.domain1.com. [172.16.1.47], dsn=4.0.0, stat=Deferred: Connection refused by www.domain1.com.      Contents of the mailertable.db file               root@npsetl005:/etc/mail$ strings mailertable.db     esmtp:[10.210.5.22]     domain1.com      We have this stupid problem on our internal network where DNS and MX records aren't really set up 100 percent correctly. Getting permission to change it, and test it are way beyond the scope of this question; So I just want sendmail to ignore what's in DNS and fire messages straight to our internal relay server (which works for dozens of other clients) - but it's not doing that. You can see that it's rewriting the addresses to user@www.domain1.com because the parent *.domain1.com is a cname to www.domain1.com (someone did this as a poor mans redirect. So if a user tries to go to a subdomain that doesn't exist, they go to the root website instead... I know. I know.) What did I miss?


title: vim spell checker?

text: Is there a way to spell check a file using vim?


title: How to reach a Vbox guest from host when using NAT networking

text: Using Fedora or Ubuntu for the host with firewalls turned off on each side (vbox guest&host), what do I have to do to reach the guest machine using a NAT interface just like it would be with a bridged interface? (Only from the vbox host!) **Update** : `ifconfig` on the host machine:               # ifconfig -a     eth0      Link encap:Ethernet  HWaddr 00:41:56:6B:78:4E             inet addr:192.168.1.2  Bcast:.192.168.1.255  Mask:255.255.255.0           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:271850 errors:0 dropped:0 overruns:0 frame:0           TX packets:144494 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:256776500 (244.8 MiB)  TX bytes:10670238 (10.1 MiB)           Interrupt:16 Memory:fc500000-fc520000           lo        Link encap:Local Loopback             inet addr:127.0.0.1  Mask:255.0.0.0           UP LOOPBACK RUNNING  MTU:16436  Metric:1           RX packets:77698 errors:0 dropped:0 overruns:0 frame:0           TX packets:77698 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:104227086 (99.3 MiB)  TX bytes:104227086 (99.3 MiB)          vboxnet0  Link encap:Ethernet  HWaddr 0A:00:27:00:00:00             BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)


title: Problem on Linux NAND Root Filesystem

text: I'm have a JFFS2 root filesystem running on a large NAND device. Every once in a while, when I restart the computer, I get error messages about invalid ELF headers when /sbin/init or /bin/login try to load dynamically linked shared libraries from the /lib folder The errors cause a kernel panic and I'm stuck reflashing the NAND to get the computer up and running again. Example:               /sbin/init: error while loading shared libraries: /lib/libc.so.6: invalid ELF header     Kernel panic - not syncing: Attempted to kill init!     Call Trace:     [dffc1d20] [c0007c74]  (unreliable)     [dffc1d60] [c0020d68]      [dffc1db0] [c0025074]      [dffc1e80] [c00250bc]      [dffc1f40] [c000f340]       It seems that somehow the dynamically linked libraries in the /lib folder are becoming corrupted. I don't _think_ that dynamically linked libraries are even written to disk during normal operation (unless you're doing an update). So that rules out a partial write with a loss of power causing the corruption. So the only other causes I can think of are that either JFFS2 has some sort of terrible bug that is corrupting files that aren't even being written to? Or the NAND itself is being corrupted? Does anyone have any other ideas? Or am I way off base?


title: new users can't log in via GUI

text: I have added 3 new users to the system via a terminal session and defined their password. However at the GUI logon screen when I click on their account and put in the password I get the spinning wheel then it goes right back out to the login screen. No errors or nothing. What could be wrong here? I can get in with the account that was created at OS installation is there a log I can look at perhaps in /var/log?


title: Why is apt-get trying to remove certain packages when I install wine?

text: I'm trying to install wine, which is software for running Windows applications. When I do `sudo apt-get install wine`, apt-get warns me that some packages are being removed.   1. Why would apt-get remove any packages to install a package?    2. It smells funny to me, since many of the packages it wants to remove are libreoffice packages, which would supposedly compete with Windows productivity software (which I'm NOT planning to install). Is this the reason? Would wine do nasty things like that? Here's the output from running `apt-get install wine`:               Reading package lists... Done     Building dependency tree            Reading state information... Done     The following packages were automatically installed and are no longer required:       bind9-doc libasound2:i386 libglu1-mesa:i386     Use 'apt-get autoremove' to remove them.     The following extra packages will be installed:       apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common chromium cups cups-bsd cups-client dbus dovecot-core dovecot-imapd dovecot-pop3d       libasound2:i386 libavformat53 libcups2 libcupscgi1 libcupsdriver1 libcupsimage2 libcupsmime1 libcupsppdc1 libdbus-1-3 libdbus-1-3:i386 libfontconfig1:i386       libfreetype6:i386 libgadu3 libgcrypt11:i386 libglu1-mesa:i386 libgnutls26 libgnutls26:i386 libgpg-error0:i386 libgpm2:i386 libgsm1:i386 libice6:i386       libjbig0:i386 libjpeg-progs libjpeg8 libjpeg8:i386 libltdl7:i386 liblzma5:i386 libmpg123-0:i386 libncurses5:i386 libodbc1:i386 libp11-kit0:i386       libpng12-0:i386 libsm6:i386 libssl1.0.0 libssl1.0.0:i386 libtasn1-3:i386 libtiff4:i386 libtinfo5:i386 libuuid1:i386 libwine:i386 libwine-bin:i386       libwine-gecko-1.4 libxcomposite1:i386 libxcursor1:i386 libxi6:i386 libxml2:i386 libxrandr2:i386 libxrender1:i386 libxslt1.1:i386 openssh-client       openssh-server openssl uuid-runtime wine-bin:i386     Suggested packages:       apache2-suexec apache2-suexec-custom chromium-l10n cups-pdf xpp dovecot-gssapi dovecot-sieve dovecot-pgsql dovecot-mysql dovecot-sqlite dovecot-ldap       dovecot-lmtpd dovecot-managesieved dovecot-solr libasound2-plugins:i386 rng-tools:i386 gpm:i386 libmyodbc:i386 odbc-postgresql:i386 tdsodbc:i386       unixodbc-bin:i386 wine-doc:i386 libwine-cms:i386 libwine-sane:i386 libwine-ldap:i386 libwine-print:i386 libwine-openal:i386 libwine-gphoto2:i386       ssh-askpass libpam-ssh keychain monkeysphere rssh molly-guard ufw     Recommended packages:       uuid-runtime:i386 libv4l-0:i386 ttf-liberation:i386 libwine-gl:i386 libwine-alsa:i386 libwine-oss:i386 xml-core:i386     The following packages will be REMOVED:       bind9 bind9utils cheese dlint dnsutils empathy gnome gnome-control-center gnome-core gnome-nettool gnome-video-effects gstreamer0.10-plugins-bad       kde-standard kmail libcheese-gtk21 libcheese3 libfarstream-0.1-0 libpurple-bin libpurple0 libreoffice libreoffice-base libreoffice-base-core       libreoffice-calc libreoffice-common libreoffice-core libreoffice-draw libreoffice-emailmerge libreoffice-evolution libreoffice-filter-binfilter       libreoffice-filter-mobiledev libreoffice-gnome libreoffice-gtk libreoffice-help-en-us libreoffice-impress libreoffice-java-common libreoffice-math       libreoffice-report-builder-bin libreoffice-style-galaxy libreoffice-style-tango libreoffice-writer libtelepathy-farstream2 lwresd mythes-en-us       nautilus-sendto-empathy python-uno task-dns-server task-gnome-desktop telepathy-haze unoconv     The following NEW packages will be installed:       libasound2:i386 libdbus-1-3:i386 libfontconfig1:i386 libfreetype6:i386 libgcrypt11:i386 libglu1-mesa:i386 libgnutls26:i386 libgpg-error0:i386 libgpm2:i386       libgsm1:i386 libice6:i386 libjbig0:i386 libjpeg8:i386 libltdl7:i386 liblzma5:i386 libmpg123-0:i386 libncurses5:i386 libodbc1:i386 libp11-kit0:i386       libpng12-0:i386 libsm6:i386 libssl1.0.0:i386 libtasn1-3:i386 libtiff4:i386 libtinfo5:i386 libuuid1:i386 libwine:i386 libwine-bin:i386 libwine-gecko-1.4       libxcomposite1:i386 libxcursor1:i386 libxi6:i386 libxml2:i386 libxrandr2:i386 libxrender1:i386 libxslt1.1:i386 uuid-runtime wine wine-bin:i386     The following packages will be upgraded:       apache2 apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common chromium cups cups-bsd cups-client dbus dovecot-core dovecot-imapd dovecot-pop3d       libavformat53 libcups2 libcupscgi1 libcupsdriver1 libcupsimage2 libcupsmime1 libcupsppdc1 libdbus-1-3 libgadu3 libgnutls26 libjpeg-progs libjpeg8       libssl1.0.0 openssh-client openssh-server openssl     29 upgraded, 39 newly installed, 49 to remove and 57 not upgraded.     Need to get 121 MB of archives.     After this operation, 294 MB disk space will be freed.     Do you want to continue [Y/n]? n     Abort.


title: How to bind IP address to MAC in autoyast?

text: Is it possible to bind IP to physical address in autoyast config file? The following code doesn't do the trick:                    ...     <interfaces config:type="list">           <interface>             <bootproto>static</bootproto>             <device>eth0</device>             <ipaddr>ip_address_0</ipaddr>             <hwaddr>aa:bb:cc:dd:ee:ff</hwaddr>             <name>MY 1st NETWORK</name>             <netmask>255.255.255.0</netmask>             <startmode>auto</startmode>             <usercontrol>no</usercontrol>           </interface>           <interface>             <bootproto>static</bootproto>             <device>eth1</device>             <ipaddr>ip_address_1</ipaddr>             <hwaddr>ff:aa:bb:cc:dd:ee</hwaddr>             <name>MY 2nd NETWORK</name>             <netmask>255.255.255.0</netmask>             <startmode>auto</startmode>             <usercontrol>no</usercontrol>           </interface>           <interface>             <bootproto>static</bootproto>             <device>eth2</device>             <ipaddr>ip_address_2</ipaddr>             <hwaddr>ee:ff:aa:bb:cc:dd</hwaddr>             <name>MY 3rd NETWORK</name>             <netmask>255.255.255.0</netmask>             <startmode>auto</startmode>             <usercontrol>no</usercontrol>           </interface>             <interface>             <bootproto>static</bootproto>             <device>eth3</device>             <ipaddr>ip_address_3</ipaddr>             <hwaddr>dd:ee:ff:aa:bb:cc</hwaddr>             <name>MY 4th NETWORK</name>             <netmask>255.255.255.0</netmask>             <startmode>auto</startmode>             <usercontrol>no</usercontrol>           </interface>                   <interface>             <bootproto>static</bootproto>             <device>eth4</device>             <ipaddr>ip_address_4</ipaddr>             <hwaddr>cc:dd:ee:ff:aa:bb</hwaddr>             <name>MY 5th NETWORK</name>             <netmask>255.255.255.0</netmask>             <startmode>auto</startmode>             <usercontrol>no</usercontrol>           </interface>            <interface>             <bootproto>static</bootproto>             <device>eth5</device>             <ipaddr>ip_address_5</ipaddr>             <hwaddr>bb:cc:dd:ee:ff:aa</hwaddr>             <name>MY 6th NETWORK</name>             <netmask>255.255.255.0</netmask>             <startmode>auto</startmode>             <usercontrol>no</usercontrol>           </interface>                  </interfaces>        ...


title: Adding new users from terminal session

text: Is there a way to add a new user from the terminal AND have the system setup their user profile? ie, create their home DIR and add then to the sudoers file? I'd like to be able to do this without them having to log in via the GUI. This is an Ubuntu 14.04 system.


title: Vim: Exit single character replace mode with <C-C> when using `nnoremap <C-C> <silent> <C-C>`

text: I've become far too trained to use `<C-C>` to return to normal mode. I understand there is a difference between `<C-C>` and `<ESC>` but that's beside the point of this question. I use the mapping `nnoremap <C-C> <silent> <C-C>` so I don't see the message "Type :quit<Enter> to exit vim" when pressing `<C-C>` in normal mode. When in normal mode and pressing `r` I can't cancel with `<C-C>`, instead it will just insert the non printable character. Is there a way to change this behavior?


title: directory changes permission when mounted

text: I want to mount a samba sghare to a directory in my home dir. I have created it but mount the share as root. Upon mount, the owner of my dir changes to root and my user doesn't have permission tow rite files on the share... How do I modify my mount line to be able to mount with write permissions? It currently looks like this: `sudo mount -t cifs //IP/share/ /mount/point/ -o rw,username=user,password=pass,domain=domain`


title: How to interpret all fields of `utmpdump /var/log/utmp`

text: I'd like to monitor logged in sessions, include how they logged in (physical console or SSH), and how long that session has existed for. It seems like `utmpdump /var/log/utmp` has that information, but I can find't the documentation that explains all the fields. Can someone enlighten me?


title: thunderbird folder pane changed after upgrade from version 17 to 24

text: After `Thunderbird` upgrade from version 17 to 24, the "`folder pane`" no longer has my theme color, but instead has some kind of light-grey grainy image-gradient. This might be an insignificant detail for most users, but my `thunderbird` theme is dark, and this is extremely annoying. ![enter image description here](http://i.stack.imgur.com/CIwAG.png) I have found several links where people complain about this, but no solutions works for me. Most of these (non-working) solutions involve putting some code into `userContent.css`. Could somebody with knowledge of thunderbird internals please advise what I should put into my `userContent.css` so that I get my old colors back? I am using Debian Wheezy and my Thunderbird (Icedove) version is 24.4.0 at the moment, my `userContent.css` contains only:               span[_moz_quote=true] {     color: rgb(129, 212, 255) ! important;     }      # UPDATE: This seems to be a Thunderbird issue, not related to a theme: bugzilla.mozilla.org: Bug 845819 Folder Pane should have the "sandstone" image overlaid on the background color


title: How to connect to a guest VM from the host system?

text: I have a VM webserver setup and I have installed and started Apache. The VM has a bridged network interface and can be pinged from the host using 192.168.0.2. However, if I type that same IP address into the browser on the host machine, I was expecting to see the default apache page generated on the VM, but instead, I get `can't connect to 192.168.0.2` in the host machines browser. I've clearly missed something out. Anyone know what I have missed or done wrong? Output from VM `netstat -tnlp`               tcp     0     0 0.0.0.0:22        0.0.0.0:*     LISTEN     950/sshd     tcp     0     0 127.0.0.1:25      0.0.0.0:*     LISTEN    1026/master     tcp     0     0 :::22                  :::*     LISTEN     904/sshd     tcp     0     0 ::1:25                 :::*     LISTEN     980/master      Rough drawing of what I'm thinking the network activity/connectivity would look like.                                ![enter image description here](http://i.stack.imgur.com/mOcL1.png)


title: Possible to Host LAMP VirtualBox for Internet Site

text: Can someone explain briefly, or point me to, how to host a LAMP server on a Linux-based VirtualBox (Oracle) such at the web site on the VB are accessible to the outside world? The Host itself would be a windows machine that is connected to the internet through cable modem. I'm already familiar with using VirtualBox as a development LAMP. But, the networking aspects of how this works are what I am asking about.


title: Count in real time the output lines from another output command

text: I think what I want to do is very easy, but I can not find a way to do that: If I put this command:               [root@:Active] tmp # tcpdump -i any -s 65535 host 192.168.1.110 and port 1645 or port 1813 -v     -X | grep -o 'Start'     Start     Start     ...     ...     ...     Start     Start     10047 packets captured     10046 packets received by filter     0 packets dropped by kernel      I got a lot of Start coincidence, but I only want to count how many "Start" is actually showing in the shell (meanwhile the tcpdump command is running). I try adding wc -l:               [root@:Active] tmp # tcpdump -i any -s 65535 host 192.168.1.110 and port 1645 or port 1813 -v     -X | grep -o 'Start' | wc -l     tcpdump: listening on any, link-type EN10MB (Ethernet), capture size 65535 bytes      But still nothing, I don't want to save a file with the output of tcpdump and then count, just count the output lines that already is showing, in real time. Also I try some combination with xargs, but still fail counting. I think "wc -l" "grep -c" and similar commands needs a file to point and count, but I don't know where in the memory the output from tcpdump is storage. If you have any clever ideas will be appreciate it :D. I still think that I'm missing some silly things, the lines already are showing in the shell, I just need to count how many are they, without saving any file or stopping the tcpdump. Meanwhile I will keep trying, some friend told me with AWK language I can do this. Greetings to all.


title: Wildcards in aptitude

text: I want to do something like               aptitude -P install mypackage*      which should install all packages which start with "mypackage". How can I do this with `aptitude`?


title: Disable screen outputting "[screen is terminating]"

text: How do I disable the output when you are done with a screen from the `screen` command? Example:               function foo()     {         echo "Testing..."         sleep 2         echo "Done!"     }     export -f foo     screen -q bash -c "foo" &> /dev/null      It all works as expected, however I cannot find out how to disable the "[screen is terminating]".


title: Mini ultra light linux boot on a USB key

text: I don't have linux. I'm on Windows (XP or 7). I'd like to have just a linux USB key only to boot and have the command line to launch some command line programs. How may I simply create that USB key (256 Mb available) ? Do you know some Windows tools that would allow me to do that without having to make all by hand each time ?


title: What's wrong with this sed command?

text: This command runs fine:               $ sed  -e '/foo/{g; d}' myfile         But this one has an error:               $ sed  -e '/foo/{g; a bar}' myfile     sed: -e expression #1, char 0: unmatched `{'      What's wrong with it?


title: Backup selinux system running strict

text: I have a cron job that is backing up a SELinux system running in strict mode. The problem is that SELinux wants to deny access to to the backup script since it wants access to every single file on the filesystem (and all the contexts on those files). I'm running in permissive mode right now so the script works, but I would like to turn permissive mode off.               kernel: [1491196.754521] type=1400 audit(1325232096.275:12572): avc:  denied  { read open } for  pid=24642 comm="xfsdump" name="init.d" dev=dm-1 ino=268794309 scontext=root:sysadm_r:cronjob_t tcontext=system_u:object_r:initrc_state_t tclass=dir      Running the script as unconfined_t doesnt work as it seems unconfined_t is not allowed when running the strict policy. The backup is being performed by taking an LVM snapshot of root, mounting that snapshot, and then doing an xfsdump. It also backs up the /boot partition (ext2) into a tarball. What is the proper way to perform such a backup?   Is there a way to mount the filesystem where the file contexts can be backed up, but will not be enforced? But also for academic purposes, if I want to back up a system where such a mount isnt possible (already mounted and not possible to remount), how would that be accomplished?


title: What FreeBSD should I install if I use Intel Pentium 4

text: I have Pentium 4 and I want to install FreeBSD with Xfce. What distribution should I download?


title: Extracting part from a file column

text: I want to extract part from a log file column which is like this:               xx.xxx.xx.xx#59796:      Edit: This is the actual log line:               Jan 10 17:38:11 server named[747]: client 21x.x0.x8x.xxx#40649: view external: query (cache) 'domain.TLD/A/IN' denied      The part before the "#" in the line above is an IP address, and I want to extract only the IP. The part after the "#" is random numbers and not always the same. I use the below command to grep a pattern, extract the IP column, and then redirect the output to text file, but then I have to use an editor to leave out the extra characters from the extracted column.               grep -E 'view external.*denied' /var/log/messages |awk '{print $7}' > view_external_denied_ip.txt      If I can extract only the IP without the extra characters in the column, I would use the sort command to sort them ( sort | uniq -c | sort -rn ).


title: Create link to folder in Elementary-OS

text: When I used to use stock Ubuntu, you could create links to folders and put them in other folders. How can I do this in elementary 0.2?


title: What makes fsck so slow on big filesystems?

text: I have over a dozen of filesystems on my OpenBSD server with 12GB DDR3 and several 1.5TB HDDs. All filesystems themselves are generally between 8GB and 64GB in size. I've noticed that even by following the best practice -- of keeping them so small -- `fsck` is still very slow on reboot. What makes `fsck` so slow? Raw filesystem size? Total number of inodes (iused + ifree)? Number of used inodes? Something else entirely? Any easy way to improve `fsck` times even further?


title: How can I see dmesg output as it changes?

text: I'm writing a device driver that prints error message into _ring buffer_ dmesg output. I want to see the output of `dmesg` as it changes. How can I do this?


title: How to connect to Internet in Kali Linux after changing IP address manually?

text: I have a problem in my Kali Linux. I cannot connect to the Internet after changing my IP address using this command:               ifconfig eth0 198.168.198.130 netmask 255.255.255.0 up      After this, when I open my `iceweasel` browser, it shows               cannot connect to server      check your internet connection      How can I solve it (and I have forgotten my old IP address)?


title: Why brace expansion not supported?

text: Do I have to do any configuration to start brace expansion? When I run `mkdir {1..10}`, it just creates a dir naming `{1..10}`.


title: How to add Multiple Searches in AWK command

text: Im trying to search for the files Created in June,July and August months. I used this method               ls -lrth|awk '/[Jun][Jul][Aug]/ {print}'      but it ain't working. Please help me correct the syntax.


title: What happened to `vga=ask` in newer kernels?

text: I used to activate framebuffer mode in the "older" kernels with `vga=ask`, and later setting it to a value, once I've figured out which one works best for me. Now, this option seems to be gone, the 3.11 kernel tells me it ignores this legacy option. What should I use instead, when activating framebuffer mode for the text mode consoles and the boot process?


title: Can a file be retrieved by its inode?

text: Run command like the following:               $ln a b     $ls -i a b     523669 a 523669 b     $rm -f a     $ls -i b     523669 b      I concluded from this test that command `rm` actually removes the filename (`a` in this test) only instead of the file, as the inode still exists and could be retrieved through another filename ( `b` ). My question is, if a file is harded linked to only one filename, when `rm` is executed to the file, is the real file ( ie, the inode ) removed thoroughly. And if not, can a file inode be retrieved without a filename and only though the inode?


title: List of 'if' switches anywhere?

text: Is there a list of all the `if` switches for use in bash scripting? Sometimes I see someone using it and I wonder what the switch they're using actually does. Example is the `-z` in this one. I know how to use it, but I don't know where it was derived from.               if [ -z "$BASH_VERSION" ]; then         echo -e "Error: this script requires the BASH shell!"         exit 1     fi      Any references, guides, posts, answers would be appreciated. Thank you!


title: systemd timer every 15 minutes

text: I'm trying to make a systemd timer that runs every 15 minutes. Right now I have:               [Unit]     Description=15min timer          [Timer]     OnBootSec=0min     OnCalendar=*:*:0,15,30,45     Unit=timer-fifteen.target          [Install]     WantedBy=basic.target                 [Unit]     Description=15min Timer Target     StopWhenUnneeded=yes      This runs over and over again without stopping. Does it need to be `*:0,15,30,45:*` instead? How can I make this work?


title: Zsh completion of brew formulas

text: In OS X, is there any way to have Zsh (I'm using Oh-my-zsh) tab-complete formulas? E.g.               $ brew install em<TAB>      could expand to:               $ brew install emacs


title: Mount from auto to manual and changing dir gives errors

text: I just installed Ubuntu 14.04 and am trying to mount my internal HD to a different location in the `/home/username` dir (auto-mount mounts it to `/mnt/{uuid}` ) But I ran into a problem. In Disks, when I switch from auto-mount to manual, all I change is the directory and try to mount, I get an error: > Error mounting system-managed device /dev/sdb1: command-line 'mount > "/mnt/{uuid}" exited with non-zero exit status 32: mount: wrong fs type, bad > option, bad superblock on /dev/sdb1, missing codepage or helper program, or > other error" I tried changing from auto to manual and not changing any options, everything was the same - and I get the error again. But when it goes to auto-mount, it mounts just fine. I already did a `sudo apt-get install linux-generic`. What I'm doing wrong and how can I solve this?


title: Arch Linux terminal not starting

text: I just installed Arch Linux following a video tutorial from youtube for the first time. However, when I try starting the GNOME terminal it won't start. It will say Terminal at the top of my screen for a couple of seconds and there will be a loading symbol, but after a couple of seconds they both disappear and no terminal will appear. Because I can't load or start the terminal I can't do anything (I can't even answer the question to register to the Arch Linux forums). What am I doing wrong?


title: setting default umask and user:group on directory

text: I have a directory `data` and I need to set default `umask` and ownership for all directories/files (both existing and future files). I want all files in `data` to have ownership `root:martin` ans permissions `750/640` I am aware that I can use `setfacl` to set default `umask` recursively using               setfacl -R -d -m o::--- data      and that I can use `setgid` bit on the directory, so that all created files have ownership `root:martin`               chmod -R +s data      What I am not sure about is whether I should combine `setgid` with `acl`. Can I perhaps achieve the same with `acl` only? How would I do it? Would that solution be superior?


title: autorun a linux program on startup from a non-root user in centOS 6 64bit

text: I have a software that needs to be run via specific user "non-root" hence its home directory is `/home/non-root/`, _I have to emphasize that the program must not be run via root and must only run after mysql has started running_ And it has a software that needs to run via command: `./athena-start start`. I am not really familiar with unix system, I tried googling for any tutorial, but I had no luck finding a guide that teaches how to auto-run via non-root and on centos, I found this here, but seems like it is only for Fedora. Can somebody help me?


title: Purpose of HLFS

text: I recently found out about the LFS project and their sub-projects. Is the HLFS Project only for > production-quality servers, routers, and firewalls or is it also recommended for securing your desktop PC?


title: How to zip recursively all subdirectories that only contain text files

text: I have a backup from a disk that contains data files and analysis. The dir structure and names are not really consistent. To save space, I would like to zip all the subdirs that only contain data (`*.txt`) and delete the original afterwards. There are several threads on zipping subdirs, but not on the conditions I have. To be more precise: I do not want to zip all `*.txt` files, but all _directories_ that exclusively contain txt-files into a _directory_.zip and delete the original directory.


title: How do I install Debian onto the same physical hard disk that the installer files are on?

text: I need to somehow copy the installer to hard drive (local disk), so that I can plug this prepared hard drive to another computer, boot the installer from hdd and install it (on same hdd). Example: You have a 400gb hdd (internal) you create a 1 partition (of size 600mb), format in ext2 or something like that, extract debian installer there, install grub to MBR and configure so that it can boot the debian installer. Target user start the target pc with installer on that partition and start debian setup (with no need to have installation cd, nor USB disk). User can anytime reinstall their system by returning to this setup (as a recovery option in grub) How can I do this?


title: How to install the latest Python version on Debian separately or upgrade?

text: I'm still new to Linux, so I'm still trying to understand where executables and their libraries are and how to install packages, so I have Debian Wheezy 7.3 which has these Python versions:   * Python 2.7.3 (default)   * Python 2.6.8 So in the directory `/usr/bin/` there are these files that I can call from the terminal:   * python (which is a link to python2.7)   * python2 (also a link to python2.7)   * python2.6 (Python 2.6.8 executable)   * python2.7 (Python 2.7.3 executable) and in `/usr/lib/`, the main folders:   * python2.6   * python2.7 Currently the latest version of Python is 2.7.6 which I want to install, but I don't know how, I tried using apt-get:               apt-get install python      it outputs `python is already the newest version.`. So how can I install the latest version of Python ? on the Python download page there is the source tarball, how can I use that to install it separately like having another folder in `/usr/lib/` like `python2.7.6` and make the `python` link in `/usr/bin/` point to the new executable, or maybe upgrade the current version if it won't break anything.


title: Iotop shows swapin but vmstat si is zero

text: I run iotop and vmstat on a CentOS server. Under some load the iotop swapin column starts to display values around 5% to 20% for some processes. But vmstat si an so remain zero. I thought that vmstat si and iotop swapin would both reflect swapping. How can si be zero while iostat shows significant swapin?


title: Exit vim more quickly

text: I use Vim mainly for quick edits rather than long work sessions. In that sense, I find the keyboard sequence for quitting especially laborious: `Esc`, `Shift` + `;`, `w`, `q`, `Enter`. How to quit Vim (possibly saving the document) with the least keystrokes? Especially from Insert mode.


title: How to verify a file automatically over sftp?

text: I am trying to create a cron job to perform backup of a server over the internet using sftp. But before the actual backup is performed, I would like to verify that the server is connecting to the correct backup machine as its IP address may change periodically. My idea is to put a file containing a checksum say `abc123` in the sftp folder of the backup machine and let the server read and compare this checksum first before performing the backup transfer. I have already set up the ssh key to allow authentication without password. How do I go about performing this verification with sftp command?


title: How to compile with third party libs properly?

text: This is a follow up question to Confusion about linking boost library while compilation: What is to do, when I generate a Makefile by qmake and I have **only a third** party boost lib installed (I uninstalled all boost libs from dependency management, because it always links to the boost lib from dependency management what I don't want) and I want it to compile only against this manually installed library as well as run against it. These are the important parts of a Makefile generated by qmake:               CC            = gcc     CXX           = g++     DEFINES       = -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DBOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN -D__NO_SYSTEM_INCLUDES -DUSE_UPNP=1 -DSTATICLIB -DUSE_QRCODE -DUSE_DBUS -DHAVE_BUILD_INFO -DLINUX -DQT_NO_DEBUG -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED     CFLAGS        = -m64 -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)     CXXFLAGS      = -m64 -pipe -fstack-protector -O2 -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -D_REENTRANT $(DEFINES)     INCPATH       = -I/usr/share/qt4/mkspecs/linux-g++-64 -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtDBus -I/usr/include/qt4 -Isrc -Isrc/json -Isrc/qt -IC:/deps/ -IC:/deps/boost -Ic:/deps/db/build_unix -Ic:/deps/ssl/include -IC:/deps/libqrencode/ -Ibuild -Ibuild     LINK          = g++     LFLAGS        = -m64 -fstack-protector -Wl,-O1     LIBS          = $(SUBLIBS)  -L/usr/lib/x86_64-linux-gnu -LC:/deps/miniupnpc -lminiupnpc -lqrencode -lrt -LC:/deps/boost/stage/lib -Lc:/deps/db/build_unix -Lc:/deps/ssl -LC:/deps/libqrencode/.libs -lssl -lcrypto -ldb_cxx -lboost_system-mgw46-mt-sd-1_54 -lboost_filesystem-mgw46-mt-sd-1_54 -lboost_program_options-mgw46-mt-sd-1_54 -lboost_thread-mgw46-mt-sd-1_54 -lQtDBus -lQtGui -lQtCore -lpthread       This is the path to boost:               /usr/local/lib/boost1.55/lib# ls -1     libboost_atomic.a     libboost_atomic.so     libboost_atomic.so.1.55.0     libboost_chrono.a     libboost_chrono.so     libboost_chrono.so.1.55.0     libboost_context.a     libboost_context.so     libboost_context.so.1.55.0     libboost_coroutine.a     libboost_coroutine.so     libboost_coroutine.so.1.55.0     libboost_date_time.a     libboost_date_time.so     libboost_date_time.so.1.55.0     libboost_exception.a     libboost_filesystem.a     libboost_filesystem.so     libboost_filesystem.so.1.55.0     libboost_graph.a     libboost_graph.so     libboost_graph.so.1.55.0     libboost_locale.a     libboost_locale.so     libboost_locale.so.1.55.0     libboost_log.a     libboost_log_setup.a     libboost_log_setup.so     libboost_log_setup.so.1.55.0     libboost_log.so     libboost_log.so.1.55.0     libboost_math_c99.a     libboost_math_c99f.a     libboost_math_c99f.so     libboost_math_c99f.so.1.55.0     libboost_math_c99l.a     libboost_math_c99l.so     libboost_math_c99l.so.1.55.0     libboost_math_c99.so     libboost_math_c99.so.1.55.0     libboost_math_tr1.a     libboost_math_tr1f.a     libboost_math_tr1f.so     libboost_math_tr1f.so.1.55.0     libboost_math_tr1l.a     libboost_math_tr1l.so     libboost_math_tr1l.so.1.55.0     libboost_math_tr1.so     libboost_math_tr1.so.1.55.0     libboost_prg_exec_monitor.a     libboost_prg_exec_monitor.so     libboost_prg_exec_monitor.so.1.55.0     libboost_program_options.a     libboost_program_options.so     libboost_program_options.so.1.55.0     libboost_random.a     libboost_random.so     libboost_random.so.1.55.0     libboost_regex.a     libboost_regex.so     libboost_regex.so.1.55.0     libboost_serialization.a     libboost_serialization.so     libboost_serialization.so.1.55.0     libboost_signals.a     libboost_signals.so     libboost_signals.so.1.55.0     libboost_system.a     libboost_system.so     libboost_system.so.1.55.0     libboost_test_exec_monitor.a     libboost_thread.a     libboost_thread.so     libboost_thread.so.1.55.0     libboost_timer.a     libboost_timer.so     libboost_timer.so.1.55.0     libboost_unit_test_framework.a     libboost_unit_test_framework.so     libboost_unit_test_framework.so.1.55.0     libboost_wave.a     libboost_wave.so     libboost_wave.so.1.55.0     libboost_wserialization.a     libboost_wserialization.so     libboost_wserialization.so.1.55.0      This is the output of **ldconfig -v** concerning boost:               # ldconfig -v     /sbin/ldconfig.real: Path `/lib/x86_64-linux-gnu' given more than once     /sbin/ldconfig.real: Path `/usr/lib/x86_64-linux-gnu' given more than once     /usr/local/lib/boost1.55/lib:         libboost_wave.so.1.55.0 -> libboost_wave.so.1.55.0         libboost_thread.so.1.55.0 -> libboost_thread.so.1.55.0         libboost_system.so.1.55.0 -> libboost_system.so.1.55.0         libboost_prg_exec_monitor.so.1.55.0 -> libboost_prg_exec_monitor.so.1.55.0         libboost_context.so.1.55.0 -> libboost_context.so.1.55.0         libboost_atomic.so.1.55.0 -> libboost_atomic.so.1.55.0         libboost_filesystem.so.1.55.0 -> libboost_filesystem.so.1.55.0         libboost_math_c99l.so.1.55.0 -> libboost_math_c99l.so.1.55.0         libboost_math_c99.so.1.55.0 -> libboost_math_c99.so.1.55.0         libboost_timer.so.1.55.0 -> libboost_timer.so.1.55.0         libboost_wserialization.so.1.55.0 -> libboost_wserialization.so.1.55.0         libboost_math_c99f.so.1.55.0 -> libboost_math_c99f.so.1.55.0         libboost_coroutine.so.1.55.0 -> libboost_coroutine.so.1.55.0         libboost_signals.so.1.55.0 -> libboost_signals.so.1.55.0         libboost_random.so.1.55.0 -> libboost_random.so.1.55.0         libboost_chrono.so.1.55.0 -> libboost_chrono.so.1.55.0         libboost_program_options.so.1.55.0 -> libboost_program_options.so.1.55.0         libboost_date_time.so.1.55.0 -> libboost_date_time.so.1.55.0         libboost_locale.so.1.55.0 -> libboost_locale.so.1.55.0         libboost_log.so.1.55.0 -> libboost_log.so.1.55.0         libboost_log_setup.so.1.55.0 -> libboost_log_setup.so.1.55.0         libboost_serialization.so.1.55.0 -> libboost_serialization.so.1.55.0         libboost_math_tr1f.so.1.55.0 -> libboost_math_tr1f.so.1.55.0         libboost_unit_test_framework.so.1.55.0 -> libboost_unit_test_framework.so.1.55.0         libboost_math_tr1l.so.1.55.0 -> libboost_math_tr1l.so.1.55.0         libboost_graph.so.1.55.0 -> libboost_graph.so.1.55.0         libboost_math_tr1.so.1.55.0 -> libboost_math_tr1.so.1.55.0         libboost_regex.so.1.55.0 -> libboost_regex.so.1.55.0      What do I have exactly to do to compile and run the code properly? I tried combinations of:               -L/usr/local/lib/boost1.55/lib/boost_thread-mgw46-mt-sd-1_54     -L/usr/local/lib/boost1.55/lib/boost_thread     -I/usr/local/lib/boost1.55/     -I/usr/local/lib/boost1.55/lib/     -lboost_system-mgw46-mt-sd-1_54     -lboost_system-mgw46-mt-sd-1_55     -lboost_system      All this **NEVER** works when there is no boost installed by package manager, but I don't want it to use it from package manager. That means it doesn't compile. Sometimes I get something like:               /usr/bin/ld: cannot find -lboost_system-mgw46-mt-sd-1_54      or               /usr/bin/ld: cannot find -lboost_system      or               addrman.cpp:(.text.startup+0x23): undefined reference to `boost::system::generic_category()'      ...and so on. I don't get it. What's wrong here? **[UPDATE]**   It turns out that there seems to be something wrong with boost lib itself. After modifying the important parts of the makefile to:               LIBS          = $(SUBLIBS)  -L/usr/lib/x86_64-linux-gnu -lminiupnpc -lqrencode -lrt -lssl -lcrypto -ldb_cxx -L/usr/local/lib/boost1.55/ -L/usr/local/lib/boost1.55/include/ -L/usr/local/lib/boost1.55/lib/ -lboost_system -lboost_filesystem -lboost_program_options -lpthread -lboost_thread -lQtDBus -lQtGui -lQtCore      **make** produced another error:               build/json_spirit_reader.o: In function `void boost::call_once<void (*)()>(boost::once_flag&, void (*)())':     json_spirit_reader.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[_ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_]+0x14): undefined reference to `boost::detail::get_once_per_thread_epoch()'     json_spirit_reader.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[_ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_]+0x2c): undefined reference to `boost::detail::once_epoch_mutex'     json_spirit_reader.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[_ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_]+0x35): undefined reference to `boost::detail::once_epoch_mutex'     json_spirit_reader.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[_ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_]+0x72): undefined reference to `boost::detail::once_epoch_mutex'     json_spirit_reader.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[_ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_]+0x77): undefined reference to `boost::detail::once_epoch_cv'     json_spirit_reader.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[_ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_]+0xa8): undefined reference to `boost::detail::once_epoch_mutex'     json_spirit_reader.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[_ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_]+0xb0): undefined reference to `boost::detail::once_epoch_mutex'     json_spirit_reader.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[_ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_]+0xd9): undefined reference to `boost::detail::once_global_epoch'     json_spirit_reader.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[_ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_]+0xde): undefined reference to `boost::detail::once_epoch_cv'     json_spirit_reader.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[_ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_]+0xe9): undefined reference to `boost::detail::once_global_epoch'     json_spirit_reader.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[_ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_]+0x128): undefined reference to `boost::detail::once_global_epoch'     json_spirit_reader.cpp:(.text._ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_[_ZN5boost9call_onceIPFvvEEEvRNS_9once_flagET_]+0x19b): undefined reference to `boost::detail::once_epoch_cv'     collect2: error: ld returned 1 exit status      It seems that there is no such function (in this boost version?):               $ objdump -T /usr/local/lib/boost1.55/lib/libboost_thread.so|c++filt|grep once_epoch      prints nothing as well as               $ for i in /usr/local/lib/boost1.55/lib/libboost_*.so ; do if grep once_epoch_mutex <(objdump -T $i|c++filt) ; then echo $i ; fi ; done      does not. **[UPDATE 2]**   After adding               -I/usr/local/lib/boost1.55/include/ -I/usr/local/lib/boost1.55/include/boost/      to INCPATH and recompile the whole application within a fresh workspace, the error is different but now, I don't see any error message:               /usr/local/lib/boost1.55/include/boost/bind/arg.hpp: In constructor ‘boost::arg<I>::arg(const T&)’:     /usr/local/lib/boost1.55/include/boost/bind/arg.hpp:37:22: warning: typedef ‘T_must_be_placeholder’ locally defined but not used [-Wunused-local-typedefs]              typedef char T_must_be_placeholder[ I == is_placeholder<T>::value? 1: -1 ];                           ^     In file included from /usr/local/lib/boost1.55/include/boost/tuple/tuple.hpp:33:0,                      from /usr/local/lib/boost1.55/include/boost/thread/detail/async_func.hpp:37,                      from /usr/local/lib/boost1.55/include/boost/thread/future.hpp:22,                      from /usr/local/lib/boost1.55/include/boost/thread.hpp:24,                      from src/util.h:22,                      from src/bignum.h:13,                      from src/main.h:9,                      from src/wallet.h:9,                      from src/wallet.cpp:7:     /usr/local/lib/boost1.55/include/boost/tuple/detail/tuple_basic.hpp: In function ‘typename boost::tuples::access_traits<typename boost::tuples::element<N, boost::tuples::cons<HT, TT> >::type>::const_type boost::tuples::get(const boost::tuples::cons<HT, TT>&)’:     /usr/local/lib/boost1.55/include/boost/tuple/detail/tuple_basic.hpp:228:45: warning: typedef ‘cons_element’ locally defined but not used [-Wunused-local-typedefs]        typedef BOOST_DEDUCED_TYPENAME impl::type cons_element;                                                  ^     src/wallet.cpp: In member function ‘bool CWallet::AddToWallet(const CWalletTx&)’:     src/wallet.cpp:402:13: error: ‘replace_all’ is not a member of ‘boost’                  boost::replace_all(strCmd, "%s", wtxIn.GetHash().GetHex());                  ^     In file included from /usr/local/lib/boost1.55/include/boost/system/system_error.hpp:14:0,                      from /usr/local/lib/boost1.55/include/boost/thread/exceptions.hpp:22,                      from /usr/local/lib/boost1.55/include/boost/thread/pthread/thread_data.hpp:10,                      from /usr/local/lib/boost1.55/include/boost/thread/thread_only.hpp:17,                      from /usr/local/lib/boost1.55/include/boost/thread/thread.hpp:12,                      from /usr/local/lib/boost1.55/include/boost/thread.hpp:13,                      from src/util.h:22,                      from src/bignum.h:13,                      from src/main.h:9,                      from src/wallet.h:9,                      from src/wallet.cpp:7:     /usr/local/lib/boost1.55/include/boost/system/error_code.hpp: At global scope:     /usr/local/lib/boost1.55/include/boost/system/error_code.hpp:222:36: warning: ‘boost::system::posix_category’ defined but not used [-Wunused-variable]          static const error_category &  posix_category = generic_category();                                         ^     /usr/local/lib/boost1.55/include/boost/system/error_code.hpp:223:36: warning: ‘boost::system::errno_ecat’ defined but not used [-Wunused-variable]          static const error_category &  errno_ecat     = generic_category();                                         ^     /usr/local/lib/boost1.55/include/boost/system/error_code.hpp:224:36: warning: ‘boost::system::native_ecat’ defined but not used [-Wunused-variable]          static const error_category &  native_ecat    = system_category();                                         ^     make: *** [build/wallet.o] Error 1


title: Unable to install Mysql

text: When I install mysql on my Centos, I get the following error:               Loaded plugins: fastestmirror, refresh-packagekit, security     Loading mirror speeds from cached hostfile     Could not retrieve mirrorlist mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was 14: PYCURL ERROR 22 - "The requested URL returned error: 403"     Error: Cannot find a valid baseurl for repo: base       Is there any problem with yum?


title: cryptsetup luksOpen only accepts password via ssh

text: while installing my Gentoo system I encoutered a strange error. One of my disk is encrypted, I have done all the installation via ssh, so did I enter the encryption passphrase via ssh. Now I entered the password directly on the computer, and it did not work. (I tried it about six times, even plugged in the keyboard from the other computer and tried it again). After ssh'ing into the box, unlocking the cryptdrive worked without complaining. I think I have to reformat that crypt-drive again, because its intended to be a /root encryption, so ssh'ing into the computer wont be possible in that stage of boot. (reformating the drive is not a problem, I prolly did that about 20 times the last five days). But why does this problem occur at all? And yeah, my password is long, about 30 characters (numbers, upper/lowercase, special chars) and I am using a german keyboard on both computers. But entering the passphrase into the shell, to actually see it, yields - at least from what I can see - the same result.


title: Could not perform immediate configuration on 'libstdc++6' on Nexenta

text: My original goal was setup service-network-ssh on Nexenta Illumos. As a result of the command               apt-get install service-network-ssh      I got the following message               Reading package lists...     Building dependency tree...     Reading state information...     You might want to run 'apt-get -f install' to correct these:     The following packages have unmet dependencies:      libstdc++6-4.2-dev : Depends: g++-4.2 (= 4.2.3-2nexenta7) but it is not going to be installed                           Depends: gcc-4.2-base (= 4.2.3-2nexenta7) but it is not going to be installed                           Depends: libstdc++6 (>= 4.2.3-2nexenta7) but it is not going to be installed     E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).      I tried to do               apt-get -f install      and received               Reading package lists...     Building dependency tree...     Reading state information...     Correcting dependencies... Done     The following extra packages will be installed:       apt apt-utils base-passwd binutils ca-certificates coreutils cpp-4.2 debconf       debconf-i18n debootstrap diff dpkg ed findutils g++-4.2 gawk gcc-4.2       gcc-4.2-base gettext-base gnupg gpgv grep hostname lib64gcc1 libbz2-1.0       libcomerr2 libcurl3-gnutls libdb4.6 libgcc1 libgcrypt11 libgnutls13 libgomp1       libgpg-error0 libgpmg1 libiconv libidn11 libkrb53 libldap-2.4-2       liblocale-gettext-perl liblzo2-2 libncurses5 libnspr4 libnspr4-0d libnss3       libnss3-0d libnss3-1d libopencdk10 libreadline5 libsasl2-2 libsasl2-modules       libsqlite3-0 libssl0.9.8k libstdc++6 libtasn1-3 libtext-charwidth-perl       libtext-iconv-perl libtext-wrapi18n-perl libtspi1 lzma makedev nexenta-lu       nexenta-sunw nexenta-zones perl-base readline-common sed sunwbridgeu       sunwcakr sunwcar sunwckr sunwcnetr sunwcsl sunwcslr sunwcsr sunwcsu       sunwgrubr sunwkvm sunwlibm sunwpool sunwpoolr sunwsmapi sunwtecla sunwtoo       sunwtsg sunwtsr sunwtsu sunwzfsr sunwzfsu sunwzoner sunwzoneu ubuntu-keyring       zlib1g     Suggested packages:       apt-doc aptitude synaptic gnome-apt wajig dpkg-dev binutils-doc       gcc-4.2-locales debconf-doc debconf-utils libgnome2-perl libnet-ldap-perl       libqt-perl libterm-readline-gnu-perl diff-doc mlocate locate slocate       g++-4.2-multilib gcc-4.2-doc libstdc++6-4.2-dbg gcc-4.2-multilib libgcc1-dbg       libgomp1-dbg libmudflap0-4.2-dbg libmudflap0-4.2-dev gnupg-doc xloadimage       rng-tools gnutls-bin krb5-doc krb5-user libsasl2-modules-gssapi-mit       libsasl2-modules-gssapi-heimdal libsasl2-modules-ldap libsasl2-modules-otp       libsasl2-modules-sql     The following NEW packages will be installed:       apt apt-utils base-passwd binutils ca-certificates coreutils cpp-4.2 debconf       debconf-i18n debootstrap diff dpkg ed findutils g++-4.2 gawk gcc-4.2       gcc-4.2-base gettext-base gnupg gpgv grep hostname lib64gcc1 libbz2-1.0       libcomerr2 libcurl3-gnutls libdb4.6 libgcc1 libgcrypt11 libgnutls13 libgomp1       libgpg-error0 libgpmg1 libiconv libidn11 libkrb53 libldap-2.4-2       liblocale-gettext-perl liblzo2-2 libncurses5 libnspr4 libnspr4-0d libnss3       libnss3-0d libnss3-1d libopencdk10 libreadline5 libsasl2-2 libsasl2-modules       libsqlite3-0 libssl0.9.8k libstdc++6 libtasn1-3 libtext-charwidth-perl       libtext-iconv-perl libtext-wrapi18n-perl libtspi1 lzma makedev nexenta-lu       nexenta-sunw nexenta-zones perl-base readline-common sed sunwbridgeu       sunwcakr sunwcar sunwckr sunwcnetr sunwcsl sunwcslr sunwcsr sunwcsu       sunwgrubr sunwkvm sunwlibm sunwpool sunwpoolr sunwsmapi sunwtecla sunwtoo       sunwtsg sunwtsr sunwtsu sunwzfsr sunwzfsu sunwzoner sunwzoneu ubuntu-keyring       zlib1g     0 upgraded, 92 newly installed, 0 to remove and 416 not upgraded.     Need to get 0 B/91.4 MB of archives.     After this operation, 83.9 MB of additional disk space will be used.     Do you want to continue [Y/n]? Y     E: Could not perform immediate configuration on 'libstdc++6'. Please see man 5 apt.conf under APT::Immediate-Configure for details. (2)      Based on the error log of the first command, I tried to remove the package from gсс, to set gсс version 4.2.3 and with the command               apt-get --purge remove developer-gcc-44      I got               Reading package lists...     Building dependency tree...     Reading state information...     You might want to run 'apt-get -f install' to correct these:     The following packages have unmet dependencies:      libstdc++6-4.2-dev : Depends: g++-4.2 (= 4.2.3-2nexenta7) but it is not going to be installed                           Depends: gcc-4.2-base (= 4.2.3-2nexenta7) but it is not going to be installed                           Depends: libstdc++6 (>= 4.2.3-2nexenta7) but it is not going to be installed     E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).      In connection with all this there was a question: What to do - to delete gcc manually (and again to set, and then to set ssh through a repository, but my chief considers, what for the Nexenta operating system gcc shall be set through the package manager) or to try to set service-network-ssh manually, not through a repository? If the second option preferable, advise please links to service-network-ssh installation instructions to Nexenta. If with the errors given above, it is possible to be overcome differently, tell as.


title: Updating disk free size without rebooting the host

text: I use RHEL4 with LVM2 on it. At times even after removing large files more that a GB the partition size is not getting updated when is see using df command.               -bash-3.00$ df -h     Filesystem            Size  Used Avail Use% Mounted on     /dev/mapper/sys-root  3.9G  1.4G  2.3G  39% /     /dev/cciss/c0d0p1     251M   19M  219M   8% /boot     /dev/mapper/sys-home  250G  125G  113G  53% /home     /dev/mapper/sys-tmp   3.9G   41M  3.7G   2% /tmp     /dev/mapper/sys-var   3.9G  3.6G   98M  98% /var      But when i check using du it shows the proper size               -bash-3.00$ sudo du -sh /var/      179M   /var/      you can see there that the df output shows /var partition to be 3.6Gb used but the du shows that its just only 179Mb. Now the problem is that neither sync or partprobe is not updating the information. But surely rebooting the host will resolve the issue. But as this is a production server i cannot reboot it. Is there any way that i can update the disk information manually withough rebooting the host ? Any help on this will be appreciated.


title: command to mass rename files according to pattern

text: I have a lot of files in a directory that are named as follows ID_OTHER_STUFF.txt I'd like to rename them all to ID.txt. This isn't a duplicate because I don't know how to specify this pattern.


title: xDebug compatible PHP editor/IDE for LXDE

text: Which PHP editor/IDE supports line by line debugging using xdebug on LXDE?


title: Why is dd using direct slower writing to disk than to a file

text: I am trying to compare aggregate write rates when writing to a file in a GPFS file system, as compared to writing directly to a disk on a system with Red Hat Enterprise Linux Server release 6.4 (Santiago). For my application I need to measure the raw rate, i.e. without taking advantage of cache. I do not understand the impact of the direct option used with `dd` to bypass cache. When writing directly to a block device, I get a drastically lower rate when I use `oflag=direct`, as compared with writing to a file in the GPFS file system. Why does this happen? To measure aggregate rates I create `p` processes running `dd` that writes concurrently to the block device or file. I then sum the `p` rates obtained to get the aggregate write rate.                   #!/bin/bash         directdiskrate=~/scratch/rate5         syncdiskrate=~/scratch/rate4         filerate=~/scratch/rate3         numruns=1         numthreads=30              #to disk use both conv=fsync and oflag=direct         writetodiskdirect="dd if=/dev/zero of=/dev/sdac bs=256k count=4096 conv=fsync oflag=direct iflag=fullblock"         for p in $(seq $numthreads)         do                  #parses output of dd, rate is on last line, each field separated by ,s                 $writetodiskdirect 2>&1|tail -n 1|awk 'BEGIN { FS = "," } ; { print $3 }'|sed -e 's/MB\/s//g'>>$directdiskrate&         done         wait              #to disk use only conv=fsync option         writetodisksync="dd if=/dev/zero of=/dev/sdac bs=256k count=4096 conv=fsync iflag=fullblock"         for p in $(seq $numthreads)         do            #parses output of dd, rate is on last line, each field separated by ,s            $writetodisksync 2>&1|tail -n 1|awk 'BEGIN { FS = "," } ; { print $3 }'|sed -e 's/MB\/s//g'>>$syncdiskrate&         done         wait              #to file use both conv=fsync and oflag=direct         for p in $(seq $numthreads)         do             writetofile="dd if=/dev/zero of=/gpfs1/fileset6/file$p bs=256k count=4096 conv=fsync oflag=direct"             #parses output of dd, rate is on last line, each field separated by ,s             $writetofile 2>&1|tail -n 1|awk 'BEGIN { FS = "," } ; { print $3 }'|sed -e 's/MB\/s//g'>>$filerate&         done         wait      **Results:** The write rate of each of 30 processes is as follows:   1. Writing to disk using `conv=fsync` option, each process gets a write rate of ~180MB/s   2. Writing to disk using both `conv=fsync` and `oflag=direct`, each process gets a write rate of ~9MB/s   3. Writing to a file in GPFS file system, using both `conv=fsync` and `oflag=direct`, gets a write rate of ~80MB/s


title: working with filenames in a different encoding over ssh

text: I'm ssh'ing to a remote system where a different encoding for the filenames (and for the users' locales) has been used. And this causes some problems. ### Problems solved by matching the locale settings Before I move to the problems with filenames, I want to say that some encoding problems with such an ssh session are solved by setting the remote locale so that it matches the local locale, namely,   * the problems with editing the command line (I pressed Backspace trice, but since on my host the encoding is UTF-8, and on the remote end -- KOI8-R, or perhaps CP1251, some 8-bit Cyrillic encodings, this didn't affect my Cyrillic string correctly):               [imz@localhost ~]$ locale     LANG=ru_RU.UTF-8     LC_CTYPE="ru_RU.UTF-8"     LC_NUMERIC="ru_RU.UTF-8"     LC_TIME="ru_RU.UTF-8"     LC_COLLATE="ru_RU.UTF-8"     LC_MONETARY="ru_RU.UTF-8"     LC_MESSAGES="ru_RU.UTF-8"     LC_PAPER="ru_RU.UTF-8"     LC_NAME="ru_RU.UTF-8"     LC_ADDRESS="ru_RU.UTF-8"     LC_TELEPHONE="ru_RU.UTF-8"     LC_MEASUREMENT="ru_RU.UTF-8"     LC_IDENTIFICATION="ru_RU.UTF-8"     LC_ALL=     [imz@localhost ~]$ echo привет     привет     [imz@localhost ~]$ echo при     при     [imz@localhost ~]$ ssh -vv ivan@example.com     Last login: Fri Nov 25 13:44:56 2011 from NN.NN.NN.NN     [ivan@dell ~]$ locale     LANG=ru_RU.KOI8-R     LC_CTYPE="ru_RU.KOI8-R"     LC_NUMERIC="ru_RU.KOI8-R"     LC_TIME="ru_RU.KOI8-R"     LC_COLLATE="ru_RU.KOI8-R"     LC_MONETARY="ru_RU.KOI8-R"     LC_MESSAGES=POSIX     LC_PAPER="ru_RU.KOI8-R"     LC_NAME="ru_RU.KOI8-R"     LC_ADDRESS="ru_RU.KOI8-R"     LC_TELEPHONE="ru_RU.KOI8-R"     LC_MEASUREMENT="ru_RU.KOI8-R"     LC_IDENTIFICATION="ru_RU.KOI8-R"     LC_ALL=     [ivan@dell ~]$ echo привет     привет     [ivan@dell ~]$ echo при        привÐ     [ivan@dell ~]$ export LANG=ru_RU.UTF-8     [ivan@dell ~]$ echo привет     привет     [ivan@dell ~]$ echo при     при     [ivan@dell ~]$         * the problem with correct understanding of case-insensitivity for the strings processed; now it would work, after I set the locale:               [ivan@dell ~]$ echo привет | fgrep -i ВЕТ     привет     [ivan@dell ~]$       but this wouldn't work before. ### Minor problems with filenames The utilities that print out filenames (which, as you remember, are stored remotely in a different encoding) wouldn't print them verbatim, but they susbstitute question marks for the foreign characters:               [ivan@dell ~]$ find ~mama/Desktop/ -iname '*.xls'     /home/mama/Desktop/????????? ????????.xls     /home/mama/Desktop/???????? ??? ???????????? (1).xls     /home/mama/Desktop/???????? ??? ???????????? (2).xls     /home/mama/Desktop/???????? ??? ???????????? (3).xls     /home/mama/Desktop/???????? ??? ????????????.xls     [ivan@dell ~]$ find ~mama/Desktop/ -iname '*.xls' -print     /home/mama/Desktop/????????? ????????.xls     /home/mama/Desktop/???????? ??? ???????????? (1).xls     /home/mama/Desktop/???????? ??? ???????????? (2).xls     /home/mama/Desktop/???????? ??? ???????????? (3).xls     /home/mama/Desktop/???????? ??? ????????????.xls     [ivan@dell ~]$       The same problem is exhibited by `ls`, and so on. But this can be easily overcome by passing them as strings to printing commands (that are not aware of the issue with non-matching encodings of the filenames and of the terminal --or for whatever reason, but it works):               [ivan@dell ~]$ find ~mama/Desktop/ -iname '*.xls' -print0 | xargs -0 -n 1 echo      /home/mama/Desktop/Êðåäèòíûé ïîðòôåëü.xls     /home/mama/Desktop/ÀÄÐÅÑÀÒÛ äëÿ ïîçäðàâëåíèé (1).xls     /home/mama/Desktop/ÀÄÐÅÑÀÒÛ äëÿ ïîçäðàâëåíèé (2).xls     /home/mama/Desktop/ÀÄÐÅÑÀÒÛ äëÿ ïîçäðàâëåíèé (3).xls     /home/mama/Desktop/ÀÄÐÅÑÀÒÛ äëÿ ïîçäðàâëåíèé.xls     [ivan@dell ~]$       Also, the fact that they are unreadable wasn't very annoying, because I could always append an `| recode -f cp1251..utf-8` at the end of the command. ## The annoying problem The essential problem is that selecting (with a mouse) the filenames in the terminal and pasting them doesn't work:               [ivan@dell ~]$ diff '/home/mama/Desktop/ÀÄÐÅÑÀÒÛ äëÿ ïîçäðàâëåíèé (1).xls' '/home/mama/Desktop/ÀÄÐÅÑÀÒÛ äëÿ ïîçäðàâëåíèé (3).xls'     diff: /home/mama/Desktop/ÀÄÐÅÑÀÒÛ äëÿ ïîçäðàâëåíèé (1).xls: No such file or directory     diff: /home/mama/Desktop/ÀÄÐÅÑÀÒÛ äëÿ ïîçäðàâëåíèé (3).xls: No such file or directory     [ivan@dell ~]$       I've noticed an escaped representation of the filenames in the output of `stat`, so I was able to select and paste it (inside `$''` in _bash_ ):               [ivan@dell ~]$ diff '/home/mama/Desktop/\300\304\320\305\321\300\322\333 \344\353\377 \357\356\347\344\360\340\342\353\345\355\350\351 (1).xls' '/home/mama/Desktop/\300\304\320\305\321\300\322\333 \344\353\377 \357\356\347\344\360\340\342\353\345\355\350\351 (3).xls'     diff: /home/mama/Desktop/\300\304\320\305\321\300\322\333 \344\353\377 \357\356\347\344\360\340\342\353\345\355\350\351 (1).xls: No such file or directory     diff: /home/mama/Desktop/\300\304\320\305\321\300\322\333 \344\353\377 \357\356\347\344\360\340\342\353\345\355\350\351 (3).xls: No such file or directory     [ivan@dell ~]$ diff $'/home/mama/Desktop/\300\304\320\305\321\300\322\333 \344\353\377 \357\356\347\344\360\340\342\353\345\355\350\351 (1).xls' $'/home/mama/Desktop/\300\304\320\305\321\300\322\333 \344\353\377 \357\356\347\344\360\340\342\353\345\355\350\351 (3).xls'     Files /home/mama/Desktop/ÀÄÐÅÑÀÒÛ äëÿ ïîçäðàâëåíèé (1).xls and /home/mama/Desktop/ÀÄÐÅÑÀÒÛ äëÿ ïîçäðàâëåíèé (3).xls differ     [ivan@dell ~]$       So, the question is: > How to conveniently work with remote filenames (over _ssh_ ), which are in a > different encoding? It would be nice if they were readable, and selectable and pastable (and also typable by me from the keyboard and then completable by Tab in _bash_ ; to be typable by me conveniently, they must be readable, of course). I'm working in _urxvt_ in _X.org_ on _Linux_ on the local host, and it's _bash_ on _Linux_ at the remote end.


title: How can I tell which ports have been used for reverse SSH tunnels?

text: I have two machines, `client` and `server`. `client` has created a reverse- tunnel on `server` with something like `ssh -R 12345:localhost:12345 server`. When logged into `server` how could I find ports which have been bound to tunnels? So, in the above example, how could I tell that port 12345 was in use as a tunnel to `client`?


title: List all binaries from $PATH

text: Is there one-liner that will list all executables from $PATH in bash.


title: How do I install libXcursor.so.1 on Debian?

text: I have a Debian 7.3 vps, where I'm trying to run a Unity3d server. I get the error > `error while loading shared libraries: libXcursor.so.1: cannot open shared > object file: No such file or directory` `apt-cache search` finds nothing, searching google I've noticed it might be somehow related to `ia32-libs`, but if I try to install that I get > `ia32-libs : Depends: ia32-libs-i386 but it is not installable` I'm stuck, what am I supposed to do to make it work?


title: Pass shell variable as a /pattern/ to awk

text: Having the following in one of my shell functions:               function _process () {       awk -v l="$line" '       BEGIN {p=0}       /'"$1"'/ {p=1}       END{ if(p) print l >> "outfile.txt" }       '     }      , so when called as `_process $arg`, `$arg` gets passed as `$1`, and used as a search pattern. It works this way, because shell expands `$1` in place of awk pattern! Also `l` can be used inside awk program, being declared with `-v l="$line"`. All fine. Is it possible in same manner give pattern to search as a variable? Following will not work,               awk -v l="$line" -v search="$pattern" '       BEGIN {p=0}       /search/ {p=1}       END{ if(p) print l >> "outfile.txt" }       '      ,as awk will not interpret `/search/` as a variable, but instead literally.


title: How long system has been awake / running / since restart

text: First and foremost I want to know how long my laptop (unix, apple, OSX 10.9 mavericks) has been 'awake' (i.e. how long its been open, or since it last 'slept'). I' also be interested in how long since the last restart, and time since the last shutdown (if those two things can be differentiated). I've tried the `who` and `w` commands, which seem to show me time for the whole system, and for individual processes (terminals?) since the system last restarted. Is there a way to tell how long the system has been awake, explicitly?   Does the reported process times include sleep-time (i.e. when my laptop is closed)?   Is there a way to distinguish between restart and shutdown?


title: Can we change packages in Linux from scratch?

text: I've tried to compile Linux through Linux from scratch Version 7.5 and I can't compile some packages because as I realize and googled them, they have some bugs, for example I couldn't compile gcc 4.8. 2 but gcc 4.9. 1 compiled just fine so my questions are: Can I replace some of the packages with older or newer packages? Does it cause some issue in future?


title: How to use Ipfire as a router and modem ? red network problem!

text: I have Installed Ipfire Linux On an old pc and I have configured green network with A network card and the same for the red network, I want to use this server as modem and router in the same time (I have no modem niether a router so I want to plug the phone cable in the server becausze there is a PPPoE option on it) the problem is that I want to plug the phone cable Rj11 in the red network card witch is Rj45 is there a way the convert the Rj11 cable to Rj45, and I wonder if this installation is oki? the second Question is about the blue network, how can I configure it with a wireless usb so it can distribute ethernet?


For example, the executable `emacs`:               lrwxrwxrwx 1 root root      23 Jun  9  2012 /usr/bin/emacs -> /etc/alternatives/emacs     llrwxrwxrwx 1 root root     18 Jun  9  2012 /etc/alternatives/emacs -> /usr/bin/emacs23-x     lrwxrwxrwx 1 root root       9 May 16  2013 /usr/bin/emacs23 -> emacs23-x     -rwxr-xr-x 1 root root 6772008 May 16  2013 /usr/bin/emacs23-x      the executable `emacsclient`:               lrwxrwxrwx 1 root root      29 Jun  9  2012 /usr/bin/emacsclient -> /etc/alternatives/emacsclient     lrwxrwxrwx 1 root root      28 Jun  9  2012 /etc/alternatives/emacsclient -> /usr/bin/emacsclient.emacs23     -rwxr-xr-x 1 root root   18256 May 16  2013 /usr/bin/emacsclient.emacs23        1. why are there links to links in system directories?  If we need to link for some reason, in the examples, why links from a file in `/usr/bin` to a file in `/etc/alternatives/` then back to a file in `/usr/bin`, rather than links the two files in `/usr/bin` directly?   2. is there a command that can deference a link until reaching a non-link file? p.s. Ubuntu


title: How do I kill tmux without exiting the terminal session / how do I open a terminal without tmux?

text: Sometimes I SSH into a tmux-enabled shell. Having two tmuxes on top of each other is a pain, and `set -g status off` means the remote `tmux` doesn't pick up `Ctrl`+`b` keystrokes. I tried using `puTTY` but it doesn't have a fullscreen mode in linux, which is frustrating. I'm not fond of the idea of spending the rest of the week setting up some sort of synchronization magic between my tmuxes either, nor do I want to comment out sections of my `.bashrc` file to disable `tmux` everytime I want to use `ssh`. Can't I just turn off tmux on a per-session basis somehow? How are other users dealing with this?


title: How to keep overwriting the contents of a file instead of appending to it

text: How do I clear the contents of a file before writing to it? For example:               echo one > filename.tmp     # filename.tmp now contains "one"          echo two > filename.tmp     # filename.tmp should now contain "two", not "one" and "two"      My goal is:   1. Start a listener              $ nc -l 7007 > /var/tmp/test.log        2. Send some data              $ telnet localhost 7007     hi     second_word        3. Test the file              $ cat /var/tmp/test.log     second_word      I don't want "hi" to show up in the log; I want "second_word" to have replaced it


title: Comunicate with remote Serial over TCP/IP as /dev/ttyX device

text: I've one serial device on 192.168.x.x:yyyy (where "x" and "y" are real number) and it works correctly. But I want to communicate with this as `/dev/ttyX` device. I've tested `socat` command but not working correctly               $ while true; do         socat pty,link=/dev/ttyX,raw,echo=0,waitslave tcp:192.168.x.x:yyyy;      done      How can I resolve? ### update   * I think that I must be creating a virtual serial device. VIRTUAL SERIAL DEVICE <-> SERIAL-MACHINE-IP:PORT


title: How to add a string with spaces at the end of command output

text: I want to add a string with spaces at the end of each line of the output of `ls` command.               #!/bin/sh     STRING_WITH_SPACES="this should be at the end of output"     ls -lh | sed 's|$| '$STRING_WITH_SPACES'|'      The script above works fine when `$STRING_WITH_SPACES` has no spaces:               -rw-r--r-- 1 me users 0 May  4 14:55 testfile thisshouldbeattheend      However when there are spaces in `$STRING_WITH_SPACES` sed complains:               sed: -e expression #1, char 9: unterminated `s' command      How do I solve this?


title: udhcpc starting before PHY is up

text: I'm having a issue with my Ethernet PHY not being up before eth0 tries to get an IP address This is my etc/network/interfaces               # Configure Loopback     auto lo     iface lo inet loopback          # The primary network interface     auto eth0     iface eth0 inet dhcp     post-up /etc/network/if-post-up.d/nfs      And this is the log               Starting network...     eth0: device MAC address 7e:f1:78:29:23:d0     stmmac_open: failed PTP initialisation     udhcpc (v1.22.1) started     Sending discover...     Sending discover...     Sending discover...     No lease, failing     libphy: stmmac-0:01 - Link is Up - 100/Full      As you can see only after udhcpc stops trying to get an IP address is the PHY fully started. Is there a way to make udhcpc wait for the PHY to be started? Thanks


title: Out-of-the-box openSUSE 12.3: Package webkit-sharp-devel not found

text: I installed openSUSE 12.3 and now want to install the package `gtk- sharp2-devel`:               $ sudo zypper install webkit-sharp-devel     Package 'webkit-sharp-devel' not found.      Strange since a Google request seems to show that this package is not unheard of on openSUSE. I am new to openSUSE, do I have to somehow "enable" devel packages?   Or has the package changed name? By the way, `sudo zypper search webkit | grep devel` does not return any sharp-related result, even though package `webkit-sharp` exists.


title: How to call a shell function

text: How can I use the integer value returned by a function in shell script that takes some arguments as input? I am using the following code:               fun()     {         echo "hello ${1}"         return 1     }          a= fun 2     echo $a      I am not sure how should I call this function. I tried the methods below, bot none of them seems to work:               a= fun 2     a=`fun 2`     a=${fun 2}


title: Strange behaviour using serial port and bluetooth

text: I'm trying to connect via serial port, a wearable device to a processing IDE using a Bluetooth connection on Linux Mint. I've got the connection part working, but the problem is that the connection is not reliable and is slow. However, executing the same program code in Windows and Mac, everything works smooth and fine. What do I mean with "the connection is not reliable and is slow? To "talk" with the wearable device, I need to send packets, bytes, (to get its sample rate, to start streaming, etc). If I just send a request for something, I usually get nothing, so I have to send it twice or three times before the device answers me. Also, if the device is streaming, sometimes I get packets (bytes) in a different order and weird stuff like this. As I said, in Windows and Mac all this does not happen. I don't know a lot about ports but it seems there is some problem with these. After pairing my device using the Linux GUI, I run the following commands (as administrator) on my terminal to start the connection:               $ hcitool scan -> to scan BT devices     $ rfcomm bind 0 00:06:66:42:10:44 -> To connect the Shimmer     $ ./processing      Once this is done, if I use the command rfcomm I get:               $ rfcomm     rfcomm0: 00:06:66:42:10:44 channel 1 clean


title: When grepping a file, grep is returning true instead of the lines, why?

text: I am running a grep on a file that is about 13G in size. It is returning               Binary file file.xml matches      I was not expecting this, I thought it would return each line with my string so that I could run the following,               grep "searchString" ./file.xml | wc -l       and return a count of all the occurrences of my searchString in my large file.


title: Get the part of a line before the last slash

text: I'm trying to write a conky script that shows my MPD album art, a 'folder.jpg' in the album folder. My current plan is to use `mpc -f %file%`, which prints out the file name and path, and then cut out the actual file name (i.e. everything after the last /), and use that as the path to for conky's image object. I'm having trouble with grep/cut, particularly since some songs are nested in two folders, while others are in one. (`grep -m 1 . |cut -f1 -d /` works for the single folder albums) How would I go about this? Is there a simpler way I'm missing?


title: SELinux and samba

text: I have to set SELinux `setenforce Permissive` in order to give access to my samba share. I wonder if there is proper way to configure SELinux policy for fedora 17 as good admins do.


title: Cinnamon failed: desktop only, no panel, no dialog frame

text: I am using Linux Mint 14 (MATE) with Cinnamon installed. Cinnamon failed when I tried to delete an item on the menu with menu editor. The system froze, so I logged out by pressing `Ctrl`+`Alt`+`Delete`. When I logged back in, the desktop panel was not loaded (shortcuts were there as normal, and right-click works as well). I can barely do anyting but get the terminal with `Ctrl`+`Alt`+`t`. But all the dialogue windows are presented without any frames. Here are screenshots: ![](http://i48.tinypic.com/345orvs.png) ![](http://i48.tinypic.com/2uo3ytv.png) I tried reinstalling Cinnamon in the MATE desktop interface (it works fine), but it failed to solve the problem.


title: How to reload a file in vim?

text: Various editors like `gedit` detect if the file is changed and asks to reload it. Sometimes in `vim` when I got many files to edit, I sometimes end up opening same file in different tabs for quick look with other files and several other reasons. So is there anyway I can force to reload the current file before I update anything to it. I know one option is to exit and reopen it, but I have splitted the screen and I don't want to loose that view.


title: How do I get a mapping of Pid to Port?

text: I have a process which I need to run on a specific port. I have started some other process on that port and I need to kill it. Unfortunately, I don't remember the name/pid of the other process so I need a quick way to find which PID are associated with it. I tried `lsof -i :7080` but that returned nothing. I can `telnet localhost 7080` so I know its running. For reference I'm running RHEL5


title: Run metacity without gnome-shell (gnome 3)

text: Hi how can i use metacity with composite manager without gnome-shell. I'm trying to do so in my custom xsession               #!/bin/bash     if test -z "$DBUS_SESSION_BUS_ADDRESS"; then     eval `dbus-launch --sh-syntax --exit-with-session`     fi          metacity --replace ccp & wmpid=$!     xsetroot -solid white &     sleep 1     if [ -f ~/.metacity-session ]; then     source ~/.metacity-session &     else     xterm &     fi     # Wait for WM     wait $wmpid      But I've got this in my ~/.xsession_errors               GNOME_KEYRING_CONTROL=/run/user/rumkin/keyring-Ar8I4j     SSH_AUTH_SOCK=/run/user/rumkin/keyring-Ar8I4j/ssh     GNOME_KEYRING_CONTROL=/run/user/rumkin/keyring-Ar8I4j     SSH_AUTH_SOCK=/run/user/rumkin/keyring-Ar8I4j/ssh     GNOME_KEYRING_CONTROL=/run/user/rumkin/keyring-Ar8I4j     SSH_AUTH_SOCK=/run/user/rumkin/keyring-Ar8I4j/ssh     GPG_AGENT_INFO=/run/user/rumkin/keyring-Ar8I4j/gpg:0:1     GNOME_KEYRING_CONTROL=/run/user/rumkin/keyring-Ar8I4j     SSH_AUTH_SOCK=/run/user/rumkin/keyring-Ar8I4j/ssh     GPG_AGENT_INFO=/run/user/rumkin/keyring-Ar8I4j/gpg:0:1     Initializing tracker-miner-fs...     Tracker-Message: Setting up monitor for changes to config file:'/home/rumkin/.config/tracker/tracker-miner-fs.cfg'     Starting log:       File:'/home/rumkin/.local/share/tracker/tracker-miner-fs.log'     Initializing tracker-store...     Tracker-Message: Setting up monitor for changes to config file:'/home/rumkin/.config/tracker/tracker-store.cfg'     Tracker-Message: Setting up monitor for changes to config file:'/home/rumkin/.config/tracker/tracker-store.cfg'     Starting log:       File:'/home/rumkin/.local/share/tracker/tracker-store.log'          (tracker-store:7825): Tracker-CRITICAL **: D-Bus service name:'org.freedesktop.Tracker1' is already taken, perhaps the daemon is already running?     Failed to play sound: File or data not found          ** (gnome-screensaver:7804): WARNING **: Config key not handled: disable-application-handlers          ** (gnome-screensaver:7804): WARNING **: Config key not handled: disable-command-line          ** (gnome-screensaver:7804): WARNING **: Config key not handled: disable-log-out          ** (gnome-screensaver:7804): WARNING **: Config key not handled: disable-print-setup          ** (gnome-screensaver:7804): WARNING **: Config key not handled: disable-printing          ** (gnome-screensaver:7804): WARNING **: Config key not handled: disable-save-to-disk          ** (seapplet:7809): WARNING **: Error showing notification: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface `org.freedesktop.Notifications' on object at path /org/freedesktop/Notifications     Starting Dropbox...** Message: applet now removed from the notification area     Done!          (gnome-shell:7796): folks-WARNING **: Failed to find primary PersonaStore with type ID 'eds' and ID 'system'.     Individuals will not be linked properly and creating new links between Personas will not work.     The configured primary PersonaStore's backend may not be installed. If you are unsure, check with your distribution.     ** Message: applet now embedded in the notification area     Window manager warning: CurrentTime used to choose focus window; focus window may not be correct.     Window manager warning: Got a request to focus the no_focus_window with a timestamp of 0.  This shouldn't happen!     ** Message: Stopping applet secret agent because GNOME Shell appeared     Initializing nautilus-open-terminal extension     Initializing nautilus-dropbox 1.4.0          (rhythmbox:8172): GLib-GObject-CRITICAL **: g_value_get_uint: assertion `G_VALUE_HOLDS_UINT (value)' failed     Window manager warning: Log level 8: meta_window_raise: assertion `!window->override_redirect' failed     Window manager warning: Log level 8: meta_window_focus: assertion `!window->override_redirect' failed          (rhythmbox:8172): GLib-GObject-CRITICAL **: g_value_get_uint: assertion `G_VALUE_HOLDS_UINT (value)' failed     [8304:8329:0212/111557:ERROR:object_proxy.cc(608)] Failed to get name owner. Got org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.chromium.Mtpd': no such name     [8304:8329:0212/111557:ERROR:object_proxy.cc(608)] Failed to get name owner. Got org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.chromium.Mtpd': no such name     Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x2800051 (linux - Ho)     Window manager warning: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed.     Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x2800051 (linux - Ho)     Window manager warning: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed.     [8304:8304:0212/111558:ERROR:object_proxy.cc(513)] Failed to call method: org.chromium.Mtpd.EnumerateStorage: object_path= /org/chromium/Mtpd: org.freedesktop.DBus.Error.ServiceUnknown: The name org.chromium.Mtpd was not provided by any .service files     Created new window in existing browser session.          (rhythmbox:8172): GLib-GObject-CRITICAL **: g_value_get_uint: assertion `G_VALUE_HOLDS_UINT (value)' failed      Run on Fedora 17. What i've missed?


title: How do I merge two *.srt files

text: Please see this question. I have just merged two avi files `cd1.avi` and `cd1.avi` into `movie.avi` using:               avimerge -o movie.avi -i cd{1,2}.avi      Problem is that I had to _subtitle_ files linked to the first `avi` files:               cd1.srt     cd2.srt      At first I tried simply to concatenate the files together:               cat cd{1,2}.srt > movie.srt      But that caused havoc with the subtitles... any suggestions?


title: Del key in AIX ksh over PuTTY telnet

text: At the place where I work we're developing under AIX with ksh and connecting to it via `telnet`. Most people use ArcTel to connect, while I prefer PuTTY. The only problem I have with PuTTY is that the `Del` key isn't working - it prints `[3~` instead. The funny thing is that in ArcTel it _is_ functioning correctly. I tried looking at the ArcTel settings and there it only has one switch, called "Backspace and Delete": it can be either "normal" or "VNS-style". I have normal turned on (and Del works as expected). In PuTTY I tried playing around with the keyboard settings and couldn't find a combination that'd make `Del` do what I want it to do. Is there a way to make this work in PuTTY? Maybe remapping the `[3~` character in my `.profile`? I don't want to switch from Vi-mode in KSH though.


title: Shell script Variable Structure

text: How can I create a variable with a file name format like : FileName pattern: SnapshotIR__somenumber.csv I tried something like :               TODAY=$(date +"%m%d%Y")         SNAPSHOT = $(SnapshotIR$TODAY*.csv)      I get error like :               test.sh: line 2: SnapshotIR02122013_2239.csv: command not found     test.sh: line 2: SNAPSHOT: command not found      so, when I want to use with if               if [ -f SnapshotIR$TODAY*.csv]  -> works      if [ -f ${SNAPSHOT} ]           -> does not work (I get the above error)