list all files newer than given timestamp and sort them

I want to list all files (sorted by date) that are newer than **timestamp** in format `20130207003851` in directory /tmp only. Subdirectories can be omitted. Using SUSE Linux Enterprise Server 11. The output format should be               S0002948.LOG Feb  7 03:28      S0002935.LOG Feb  7 05:58      S0002952.LOG Feb  7 09:58      S0002940.LOG Feb  7 11:58       **find /tmp -newermt "7 feb 2013" -ls** lists the files I want but   * how can I use the timestamp in a format 20130207003851   * how can I sort the output?   * how can I display only file name and date. File name first and then the date?  ps I don't want to use touch to create reference file for find pss               find -newermt "20130207003851" -ls     find: I cannot figure out how to interpret `20130207003851' as a date or time


Git: Fixing wrong object headers

I have a git repository that is not corrupt (all object files remains, i can commit to it and so on). It was orginally created by migration from svn using "svn2git" if i recall correctly. Recently I decided to try to wipe some big data files from the repository history using "git filter-branch" but it bailed on certain commits (the same commits can more easily be listed using "git fsck"):               git fsck --full     Checking object directories: 100% (256/256), done.     error in commit 1e04e033e642f9310bd7b0e6745f3ef775a15f15: invalid author/committer line - bad email     error in commit 313a8574deb9c71bea7f69586a092c9906fb4bba: invalid author/committer line - bad email      plus another 30 or so commits with the same error. It took me a while to figure out how to unpack the git objects, so here's how i did it: ONE. move the pack file outside of the .git directory:               mv .git/objects/pack/pack-40570d231c361ba427f63273ac1e3c7ad03b5de5.pack tmp/ TWO. unpack the pack file:               git unpack-objects < tmp/*.pack      The object files should now be in .git/objects THREE. Unpack individual object, using zpipe from http://www.zlib.net/zpipe.c               zpipe -d < .git/objects/1e/04e033e642f9310bd7b0e6745f3ef775a15f15     commit 276tree 591e98a0b53880a22f18f5bedefe133166d3e67d     parent 4c33ebce11897dd52528defa41890eabc59135e3     author Martin Lindhe <martin@xxx.se     > 1382869510 +0100     committer Martin Lindhe <martin@xxx.se     > 1382869510 +0100          MIPS: improve decoder. it is now basically finished PSX disasm As seen here, the emails have a trailing newline (0x0a, as shown by piping to xxd) I tried to fix up the object and repack it, but that quickly turned my git repo into a mess, reporting:               git status     fatal: bad object HEAD      So, any ideas how to fix the object headers in order to create a fully working repository?


The dependency isn't installed

I'm testing my `.deb` package and cannot find out why it doesn't install the dependencies: The control file's Depends line is:               Depends: zend-grid-module, postgresql-8.4, ${shlibs:Depends}, ${misc:Depends}      And when I run:               $ sudo dpkg -i zend-grid-module-test-application_1.0.2-2_all.deb      I see:               (Reading database ... 25616 files and directories currently installed.)     Preparing to replace zend-grid-module-test-application 1.0.2-2 (using zend-grid-module-test-application_1.0.2-2_all.deb) ...     Unpacking replacement zend-grid-module-test-application ...     dpkg: dependency problems prevent configuration of zend-grid-module-test-application:      zend-grid-module-test-application depends on postgresql-8.4; however:       Package postgresql-8.4 is not installed.     dpkg: error processing zend-grid-module-test-application (--install):      dependency problems - leaving unconfigured     Errors were encountered while processing:      zend-grid-module-test-application      And after that:               $ sudo apt-get install -y -f      outputs               Reading package lists... Done     Building dependency tree     Reading state information... Done     Correcting dependencies... Done     The following extra packages will be installed:       zend-grid-module-test-application     The following packages will be upgraded:       zend-grid-module-test-application     1 upgraded, 0 newly installed, 0 to remove and 36 not upgraded.     1 not fully installed or removed.     Need to get 0B/43.8kB of archives.     After this operation, 238kB disk space will be freed.     (Reading database ... 25618 files and directories currently installed.)     Preparing to replace zend-grid-module-test-application 1.0.2-2 (using .../zend-grid-module-test-application_1.0.2-2_all.deb) ...     Unpacking replacement zend-grid-module-test-application ...     Setting up zend-grid-module-test-application (1.0.2-2) ...      I don't see the postgresql dependency resolved, though I expect it to be installed with `apt-get install -f -y` Any ideas what I'm missing?


How can I blank the desktop via the command line?

How can I programmatically make my desktop blank (i.e. remove the icons and make it black) from the command line? I'd also like to be able to restore it afterwards. Multiple solutions are OK, Ubuntu, GNOME, etc. but it would be ideal if there was one way to do this for all desktops. ### UPDATE #1 I should mention why I'm looking for this. I'm looking for a way to hide the entire desktop + icons and then launching a single app. It's for productivity usage, if that makes any sense.


Can a overlay/union file system be used as makeshift deduplication?

Given a union file system (mhddfs, unionfs, aufs) would it save me anything if I overlaid a writable file system over one with a bunch of ISO files, say Ubuntu 10.04, and then use `zsync` to update the CD/DVD images to 10.04.1, 10.04.2 etc, respectively? I suppose the question boils down to whether or not these overlay file systems keep track of blocks or only of files as a whole?


How to place Empathy in Gnome 3's messaging bar?

For consistency between Skype and Empathy, I'd like to put Empathy into the bottom messaging bar in Gnome 3 (Gnome Shell, if you will). Is there a way to do this? (I use Gnome 3.4, although answers for any version are welcome.)


How do I get UUENCODE to work?

I have a server that I have inherited that has an older version of Redhat installed due to software requirements and now there is a need to use UUENCODE to allow email attachments. The `uuencode` and `uudecode` files are not in `/usr/bin`. I tried copying them from another server but I receive an error: > /lib64/tls/libc.so.6: version `GLIBC_2.4' not found when we try to run it. It appears that I may need to install the sharutils.rpm but I am not sure which one to download? Can anyone either point me to the correct rpm to download or an alternative method for processing uuencode? Server Details:               $ cat /proc/version     Linux version 2.6.9-42.ELsmp (bhcompile@ls20-bc1-13.build.redhat.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-2)) #1 SMP Wed Jul 12 23:32:02 EDT 2006          $ cat /etc/redhat-release     Red Hat Enterprise Linux ES release 4 (Nahant Update 4)          $ uname -a     Linux <servername> 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:32:02 EDT 2006 x86_64 x86_64 x86_64 GNU/Linux


Are there zero-width assertions in sed?

Is it possible to make lookahead or lookbehind zero-width assertions in `sed`? I want to emulate Perl's `(?=)` and family. My sed is not GNU sed version 4.0.


parse json using python

### I have a JSON file `members.json` as below.               {        "took": 670,        "timed_out": false,        "_shards": {           "total": 8,           "successful": 8,           "failed": 0        },        "hits": {           "total": 74,           "max_score": 1,           "hits": [              {                 "_index": "2000_270_0",                 "_type": "Medical",                 "_id": "02:17447847049147026174478:174159",                 "_score": 1,                 "_source": {                    "memberId": "0x7b93910446f91928e23e1043dfdf5bcf",                    "memberFirstName": "Uri",                    "memberMiddleName": "Prayag",                    "memberLastName": "Dubofsky"                 }              },               {                 "_index": "2000_270_0",                 "_type": "Medical",                 "_id": "02:17447847049147026174478:174159",                 "_score": 1,                 "_source": {                    "memberId": "0x7b93910446f91928e23e1043dfdf5bcG",                    "memberFirstName": "Uri",                    "memberMiddleName": "Prayag",                    "memberLastName": "Dubofsky"                 }              }           ]        }     }      I want to parse it using `bash` script get only the list of field `memberId`. ### The expected output is:               memberIds     -----------      0x7b93910446f91928e23e1043dfdf5bcf     0x7b93910446f91928e23e1043dfdf5bcG      ### I tried adding following bash+python code to `.bashrc`:               function getJsonVal() {        if [ \( $# -ne 1 \) -o \( -t 0 \) ]; then            echo "Usage: getJsonVal 'key' < /tmp/file";            echo "   -- or -- ";            echo " cat /tmp/input | getJsonVal 'key'";            return;        fi;        cat | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["'$1'"]';     }      And then called:               $ cat members.json | getJsonVal "memberId"      But it throws:               Traceback (most recent call last):       File "<string>", line 1, in <module>     KeyError: 'memberId'      ### Reference http://stackoverflow.com/a/21595107/432903


Difference between a.out and ./a.out

**My Confusion** `a.out` is the output of the programs which I execute in my Ubuntu 12.10. In Red Hat system when I execute `a.out` in the terminal it executes. While in Ubuntu I have to execute `./a.out` to get the output. 'a.out' doesn't work. Can somebody explain what is the difference between the commands?


allow only specific users to login via sshd, but refuse connect to non-listed users

I'm running a CentOS server (7.0) and I'd like to login via sshd as a user, not root. So I set `PermitRootLogin no` in the config file and `su -` after login. I've received lots of hacking activities and I decided to allow only one user to login via sshd. Since the username is not my real name or any common name, I think it would be good enough. Let's say it's 'hkbjhsqj'. I've tried both ways introduced on nixCraft: AllowUsers in sshd_config or pam_listfile.so in PAM. The only problem to me is that anyone else still has chances to type in passwords and that leaves records in /var/log/secure. I assume these actions consumes my server's resources to run password checking and other stuff. Let's say I try to login with the username 'admin':               www$ ssh admin@0.0.0.0     admin@0.0.0.0's password:     Permission denied, please try again.     admin@0.0.0.0's password:     Permission denied, please try again.     admin@0.0.0.0's password:     Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).      and in the secure log:               Aug  8 08:28:40 www sshd[30497]: pam_unix(sshd:auth): check pass; user unknown     Aug  8 08:28:40 www sshd[30497]: pam_listfile(sshd:auth): Refused user admin for service sshd     Aug  8 08:28:43 www sshd[30497]: Failed password for invalid user admin from 192.168.0.1 port 52382 ssh2     Aug  8 08:28:47 www sshd[30497]: pam_unix(sshd:auth): check pass; user unknown     Aug  8 08:28:47 www sshd[30497]: pam_listfile(sshd:auth): Refused user admin for service sshd     Aug  8 08:28:50 www sshd[30497]: Failed password for invalid user admin from 192.168.0.1 port 52382 ssh2     Aug  8 08:28:52 www sshd[30497]: pam_unix(sshd:auth): check pass; user unknown     Aug  8 08:28:52 www sshd[30497]: pam_listfile(sshd:auth): Refused user admin for service sshd     Aug  8 08:28:55 www sshd[30497]: Failed password for invalid user admin from 192.168.0.1 port 52382 ssh2     Aug  8 08:28:55 www sshd[30497]: Connection closed by 192.168.0.1 [preauth]     Aug  8 08:28:55 www sshd[30497]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.0.1      While all this will not happen if I add the IP in /etc/hosts.deny:               www$ ssh admin@0.0.0.0     ssh_exchange_identification: Connection closed by remote host      and in the secure log:               Aug  8 08:35:11 www sshd[30629]: refused connect from 192.168.0.1 (192.168.0.1)     Aug  8 08:35:30 www sshd[30638]: refused connect from 192.168.0.1 (192.168.0.1)      So my question would be, is there a way I can refuse all irrelevant users' ssh requests from anywhere without password checking, like I put them in the hosts.deny list? But at the same time I do need allow all ssh requests with the username 'hkbjhsqj' from anywhere and check the password then.


How to convert html entities to readable text?

I want html number entities like ę and want to convert it to real character. I have emails mostly from linkedin that look like this: > chciałabym zapytać, czy rozważa Pan takze udział w > nowych projektach w Warszawie ? Obecnie poszukujemy specjalisty > javascript/architekta z bardzo dobrą znajomością > Angular.js do projektu, który dotyczy systemu, > służącego do monitorowania i zarządzania flotą > pojazdów. Zespół, do którego poszukujemy I'm using clawsmail, switching to html don't convert it to text, I've try to copy and use               xclip -o -sel clip | html2text | less      but it didn't convert the entities. Is there a way to have that text using command line tools? The only way I can think of is to use `data:text/html,<PASTE THE EMAIL>` and open it in a browser, but would prefer the command line.


How to verify from "uname -a" output, the installed Solaris OS is openSolaris or not

How to verify from `uname -a` output, if the installed Solaris OS is openSolaris or not. I need to know the type of OS installed like, Solaris or opensolaris or Solaris Express etc               cat /etc/release     Solaris 10 3/05 s10_74L2a SPARC     Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.     Use is subject to license terms.     Assembled 22 January 2005          uname -a     SunOS sndcc02.sanjose.ibm.com 5.10 Generic sun4u sparc     SUNW,Sun-Fire-V490


libata patch to allow disable sata port

My question is related to the patch introduced in this post How to tell Linux Kernel > 3.0 to completely ignore a failing disk? If the kernel is patched with this code what is the kernel parameter that need to be set to disable ata:2 Cheers Fred


IPtables rule to double NAT

Let me rephrase it.. I just need an IPtable rule to do double NAT-ting..               Host A - Host B - Host C - Host D      Host B should do both source NAT and destination NAT, so that my request from Host A reaches Host C and response from Host C reaches Host A. In the same way, Host C should take care of requests from Host B to Host D and vice-versa. So, basically, at end of the day, I want a request from Host A to Host D to happen, and a response from Host D to Host A to happen. I am a little confused with where we need to use PREROUTING, POSTROUTING..


evince opens a new document to the last page

I have a postscript file (created using groff) which is a multi-page document. If I open it using ggv on Solaris 10 it opens correctly to page 1. When I open it using evince on Solaris 11 it opens to the last page of the document rather than the first. I tried the –page-label=1 command line open and that didn’t do anything (--page-label=2 does cause the document to open to page 2) Page 1 has a page header with the page number and everything looks like it does for page 2. I don’t see anything in the postscript file that would cause this to work for page 2 and not page 1 (although I haven’t worked a lot with postscript files, so maybe I am missing something) Using the –preview or the –presentation command line options also causes evince to open to the first page. Unfortunately, we would prefer not to use either of those settings. Upgrading our version of evince is not an option as have to use the version that comes with Solaris 11 which, at the time we upgraded to Solaris 11 was version 2.30.3. I am hoping that someone can help with either an answer or at least point me in the direction of finding an answer. I have searched the threads and cannot find anything related to my issue. I have also read through wiki.gnome.org/Apps/Evince and googled this problem. Clearly I am missing something. If you have any suggestions on how I can fix this, or if this was a known issue that had a bug fix in a later release and you could let me know what release, I would greatly appreciate your input. eta: A script is run to view the files. The script runs the following command: groff -ms -Tps -t -f H -P-l ${Report} > ${TMPREPORT}; ggv ${TMPREPORT}; rm ${TMPREPORT} So every time we view the report the postscript version is recreated on the fly and is then deleted when we are done.


What is the difference between [.]* and '.*' for command 'find -name'?

My goal is to find all files or directories in a filesystem that start with a dot (`.`), for example `.gnupg`. So I came up with the command:               find -name '.*'      Checking on the Internet, I saw some hints saying that I should use `[.]*` instead as the parameter value for `-name` option. What is the difference between both approach, since the result looks like the same?


cascaded grep matches color code as pattern

I am piping output of one `grep` comand into another `grep`. The first `grep` is using `\--color=always`, so that the first match is colored. In practice, that means that the match is enclosed between two color codes, i.e. `\033[1;31m` and `\033[0m`. Now the problem is if the second pattern is `m`, then it matches the color code of the previous match:               echo A B C | grep --color=always A | grep m      Similarly, the number `31` would also match. Is there any way around this ? # UPDATE: I expected it will go without saying, that I need the match to be colored. So getting rid of `\--color=always` is not a satisfactory solution for me.


What do I need in my script to be able to change ownership of a directory structure that belongs to root to the current user running the bash script?

My bash script has the following section:               su root -c chown -R smithb:other /export/home/smithb/workspace/rootownsit/     exit      The directory `rootownsit` and its two sub directories were created and is owned by `root`. I thought what I have above would work but it doesn't. Running my bash script as my user, I get prompted for the root password and then I get a usage message for `chown` after I type in the root password. I need to change ownership of the directory rootownsit and it's sub directories.


Gparted claims my internal drive is full

I intend to resize and add a new partition to my main drive, and for that purpose I have created a GParted-USB to resize my partition. However, this has proven to be more difficult than I thought, seeing as GParted claims that my internal drive is full. ![enter image description here](http://i.stack.imgur.com/M6Yqt.png) Any idea as to what's causing this, and eventually how to fix it? (Ignore the key, I shot this from Fedora.)


Arch Linux starting Wireless connection shuts down wired connection

When Im starting the wireless connection via SSH, as soon as th dhcp starts the connection(wired) to the computer stops working and the computer is only available on Wifi. Is that normal. Im using dhcpd for the wired connection and dhclient for the wireless connection (since dhcpd only timeouts with the wireless connection)


How am I supposed to edit files on a network with Vim?

Currently I'm doing it by SSHing into a server, and executing Vim on the server. This has the benefit of not having to deal with cumbersome syntax of opening files from a remote server over SCP, and, more importantly, being able to really quickly navigate the server's filesystem. On the other hand, it has lag, which make editing kind of hard. What's the canonical way of editing lots of remote files?


Setting up multiboot .iso usb using syslinux

I have followed jakgibb's tutorial for creating multiboot usb stick using syslinux. I want to boot linux live .iso's directly from USB drive using syslinux instead of method provided in pendrivelinux.com. Here is my syslinux.cfg:               default vesamenu.c32     prompt 0     timeout 300     menu title Geek USB     menu background /bg.png     MENU TABMSG  Created by Salman     MENU WIDTH 72     MENU MARGIN 10     MENU VSHIFT 3     MENU HSHIFT 6     MENU ROWS 15     MENU TABMSGROW 20     MENU TIMEOUTROW 22     menu color title 1;36;44 #66A0FF #00000000 none     menu color hotsel 30;47 #C00000 #DDDDDDDD     menu color sel 30;47 #000000 #FFFFFFFF     menu color border 30;44 #D00000 #00000000 std     menu color scrollbar 30;44 #DDDDDDDD #00000000 none          label HardDisk         menu label Continue to Boot from ^First HD (default)         KERNEL chain.c32         APPEND hd1         MENU DEFAULT          label MY         menu label ^MY         loopback loop /ubuntu-12.04.3-desktop-i386.iso         linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-12.04.3-desktop-i386.iso noeject noprompt splash --         initrd (loop)/casper/initrd.lz          label MIX         menu label ^MIX         insmod loopback         insmod iso9660         set isofile="/ubuntu-12.04.3-desktop-i386.iso"         loopback loop $isofile         kernel (loop)/casper/vmlinuz         append boot=casper initrd=(loop)/casper/initrd.lz splash --          label MIX2         menu label ^MIX2         set isofile="/ubuntu-12.04.3-desktop-i386.iso"         loopback loop $isofile         kernel (loop)/casper/vmlinuz         append boot=casper live-media-path=(loop)/casper/ file=(loop)/preseed/ubuntu.seed initrd=(loop)/casper/initrd.lz splash --          label MIX3         menu label ^MIX3         loopback loop /ubuntu-12.04.3-desktop-i386.iso         kernel (loop)/casper/vmlinuz         append boot=casper live-media-path=(loop)/casper/ file=(loop)/preseed/ubuntu.seed initrd=(loop)/casper/initrd.lz splash --      My USB is booting and syslinux is working and boot menu ( **syslinux.cfg** ) is displaying fine but menus are not working, don't know why.   No menu is booting `ubuntu-12.04.3-desktop-i386.iso`. The worst part is that no error is coming when I select a menu and hit enter, screen blinks and returns to main menu. What is wrong with my config?


Need to get the difference between two time in seconds

The following two variables contain the start time and the end time , need to get the difference between these two time in seconds               start_time=06:07:25     end_time=07:02:08      Desired Output               diff_time= 3283 Seconds      I use AIX 6.1 machine with ksh88.


zsh: trouble batch-renaming files with zmv

I'm trying to mass rename the files from one extension to another (background: use haml instead of erb in my rails app). I get following output when issuing rename command:               % zmv '**/*.erb' $1.haml         zmv: error(s) in substitution:     app/views/l/links/index.html.erb and app/views/index/index.html.erb both map to .haml     app/views/l/links/new.html.erb and app/views/l/links/index.html.erb both map to .haml     app/views/l/links/show.html.erb and app/views/l/links/new.html.erb both map to .haml     app/views/l/links/stats.html.erb and app/views/l/links/show.html.erb both map to .haml     app/views/layouts/application.html.erb and app/views/l/links/stats.html.erb both map to .haml     app/views/u/profiles/_form.erb and app/views/layouts/application.html.erb both map to .haml     app/views/u/profiles/edit.html.erb and app/views/u/profiles/_form.erb both map to .haml     app/views/u/profiles/show.html.erb and app/views/u/profiles/edit.html.erb both map to .haml     app/views/u/user_sessions/new.html.erb and app/views/u/profiles/show.html.erb both map to .haml     app/views/u/users/_form.erb and app/views/u/user_sessions/new.html.erb both map to .haml     app/views/u/users/new.html.erb and app/views/u/users/_form.erb both map to .haml     app/views/u/users/show.html.erb and app/views/u/users/new.html.erb both map to .haml      Can anyone point me to the right direction of fixing this?


Gnome won't log in.. Black screen

I installed Arch on my external HDD and set it up with GNOME, but when I get to the login screen I type the correct password then the will go black and return to the login screen, can anyone identify the problem? I've searched around and haven't seen anything related to it.


Console outputing wrong single quote character (â)

My console `yakuake` is outputting the wrong single quote character.               test.cpp: In function âint main()â:      I've tried, one by one:               export LC_CTYPE="C"         export LC_CTYPE="posix"     export LC_ALL="en_CA.UTF-8"     export LC_COLLATE=C     export LC_MESSAGES=C      but that didn't work, it still outputting that character instead of a single quote. my current `locale` output:               LANG=en_CA.UTF-8     LC_CTYPE="en_CA.UTF-8"     LC_NUMERIC="en_CA.UTF-8"     LC_TIME="en_CA.UTF-8"     LC_COLLATE="en_CA.UTF-8"     LC_MONETARY="en_CA.UTF-8"     LC_MESSAGES="en_CA.UTF-8"     LC_PAPER="en_CA.UTF-8"     LC_NAME="en_CA.UTF-8"     LC_ADDRESS="en_CA.UTF-8"     LC_TELEPHONE="en_CA.UTF-8"     LC_MEASUREMENT="en_CA.UTF-8"     LC_IDENTIFICATION="en_CA.UTF-8"     LC_ALL=      my font was "Anka Coder Condensed". How can I fix this?


Books/Guides for Securing a Server

I have a website idea I want to build and launch, and I'm thinking of getting a small VPS to host it (I like Linode for their price, and they seem to be widely recommended). The problem is that I'm really very new to Linux in general, and I'm pretty broke so I can't afford a managed server. I downloaded Ubuntu Lucid Server and have it running in a VirtualBox, to help me learn and to act as a close approximation to the eventual production server. I'm committed to learning, but I'm pretty afraid I'm going to miss something dumb and get compromised. As such, I'd like to know of any good guides/books explaining the main points of securing a LAMP server. I've worked through the basic stuff in Linode and Slicehost's respective tutorials, but I want to be as prepared as possible. The site isn't written yet, and I'm likely to deploy to a shared host first as a trial run, so I do have time to learn at least the basics. I know to keep everything up to date, configure iptables to only allow the holes I need (which appears to just TCP ports 22, for ssh/scp/sftp - I'll change it from the default port for the (very minor) security through obscurity bonus - and 80 for http) - though I am confused by some tutorials which say to block ICMP since I don't why I wouldn't want to respond to ping - and to only install software I need/remove software I don't need. Any advice beyond this, and especially any recommendations for guides, are well appreciated.


How to connect to virtual /dev/ttyX from same machines pts terminal?

I want to get output/input from `/dev/ttyX` console (normally accessible directly using keys `ctrl+alt+FNr`, where Nr is number of `/dev/ttyNr`: `ctrl+alt+f4` access `/dev/tty4`). I want to view and control these consoles over ssh (which normally uses virtual `/dev/pts` console like desktop applications (xterm) does). I need something to either connect from normal virtual terminal (`/dev/pts/Y`) to `/dev/ttyX`, or switch consoles. For physical devices like `/dev/ttySX`, `/dev/ttyUSBX` utilities like `minicom` and `screen` after setting baud rate are working well. I tried to apply similar methods for virtual `/dev/ttyX` but sessions only hang: output send from `screen` gets to tty, but are not executed and input does show (`ctrl+alt+f4` shows output but it does not get executed, neither while writing anything shows up in `screen`: like I would be using `echo nonsense >> /dev/tty4` but not having real session). `minicom` does the same. Either I am abusing utilities or I don't know how to properly setup tty's. Should I do something with `getty`? It seems that it is important here too. Any ideas how to connect to `/dev/tty` from `pts` console? I am using Linux with systemd if that is important.


How can I reset or lower the serial used in BIND DNS server's "SOA" record?

I use BIND as my DNS server at home. For my SOA record (start of authority) I always use a serial in the recommended format > YYYYMMDD## where `##` is the counter for changes on that day. Unfortunately I changed the serial and added 1 more digit by mistake. After updating the name-deamon, I couldn't revert this anymore. Is there a possible way to reset the serial / counter inside BIND's internal libraries?


Ubuntu automatically connects to a wireless network when its already connected by eth0 to the same network

I use Ubuntu 11.04, and I work at an institution which has wired and wireless connectivity. My computer is set to automatically connect to the wireless network if it is available. When I am plugged into the wired network, Ubuntu still tries to automatically connect to the wireless network, even though it's the same network. In Windows, if I am plugged into the wired network, my computer does not attempt to connect to the wireless network. This is the functionality I would like. Is this possible to achieve under Ubuntu?


How can I hide the command list in Alpine?

I run Alpine across SSH on my phone which has a fairly limited screen size. The only issue that I have is the command list at the bottom takes up valuable screen real estate. **Is there any way that I can turn the command list off (or toggle it)? *** I seem to recall spotting an 'expert mode' type option or start flag that would turn it off, but I've slept since then and my relatively quick searches through the man page and duckduckgo.com have failed to turn up anything useful.


Error 127 when trying to install ms-sys

I just installed Fedora 20 and am trying to install ms-sys. However, when I do "make", I am presented with the following error:               "cc -O2 -ansi -pedantic -Wall -c -I inc -D PACKAGE=\"ms-sys\" -D LOCALEDIR=\"/usr/local/share/locale\" -idirafter include-fallback -D_FILE_OFFSET_BITS=64  -o obj/fat32fd.o src/fat32fd.c     make: cc: Command not found     make: *** [obj/fat32fd.o] Error 127"      I have tried to install gettext as many believes to be the solution to error 127, but it is already installed according to yum.


Is there a hook-like system for shell?

I noticed I like to execute certain actions in a specific order. A hook, as I see it, is basically "do something after event", where event, could be any command with parameters, such as `git clone`, `git submodule add`, `cd`, `rm` or any other. I'd like to say, "if `git add`, do `git status`". For example, I always: `git add X; git status`, and `cd X; ls -la`, and I can think of many more combinations like that, that I'd like to automate within my workflow. There are 3 reasons why aliases \ functions won't _easily_ work here:   1. The _main reason I don't think it can be **easily_** done is that I have multiple function definitions and haven't found a way to override existing functions while still being able to use them. I'll illustrate what I mean with an example: I use some zsh scripts by Nathan Broadbent called SCM Breeze - the scripts add a git() function that does things. Suppose now I want to automate my workflow, and make it so that after every `git clone`, there is a `cd` to the directory made by the previous command (Here's how to do that). To do that, I'll use a git() function, right? That function would override the SCM Breeze command, and I won't be able to use SCM Breeze.   1. Aliases require me to remember things. I want this to happen automatically.   2. **It's not easy to maintain** - I tried manually overriding each command, but changing things is really cumbersome, and I don't see myself doing it for every combination I can think of because of the complexity. I use ZSH with OhMyZsh, if that helps. Right now, I'm doing it with bash scripts (aliases and functions), but it feels as if I'm doing work very likely done by somebody else by now. Anyone familier with a project that does that? help facilitate "hooks" in a tidy fashion?


/var/adm/wtmpx: Value too large for defined data type

getting error `/var/adm/wtmpx`: Value too large for defined data type in Solaris 10.


remastering knoppix DVD

I read the remastering Knoppix howto guide at http://ftp.knoppix.net/wiki/Knoppix_Remastering_Howto and wast able to remaster a CD. However, when I tried the same for a Knoppix DVD, it failed. I researched this and it seems that one need to setup enough swap. Also, it seems that the `create_compressed_fs -B X` where X must be bigger than 65536 is required. So, I would appreciate if anyone can enlightening me and show me the path or link that have instructions to create a remastering Knoppix DVD as I have search high and low in the internet and could not find one for the Knoppix DVD.


Change the color of the file name text

I am writing scripts to initialize and configure a large system with many components.   Each component has its own log file. I would like to change the color of the component file name to red whenever an error occur on its installation/configuration. How can I do it?


cannot make protobuf on Solaris 8

I just downloaded protocol buffer (protobuf) 2.5.0 from here. Then I tried to install it on Solaris 8 (SunOS ms-sparc8 5.8). When I try to run make, I got this error.               In file included from google/protobuf/compiler/command_line_interface.h:41,                  from google/protobuf/compiler/main.cc:33:     google/protobuf/stubs/common.h:48:20: stdint.h: No such file or directory      My Solaris dont have `stdint.h`. So I tried to put a portable `stdint.h` taken from here and put it inside `/usr/include/`. After putting in the `stdint.h`, I tried to run make again and failed. Then I tried to have a look inside the file thats causing the error (command_line_interface.h & main.cc). I make an assumption that `command_line_interface.h` and `main.cc` uses `common.h` header file and the problem are caused by common.h. When I look inside the `common.h` code, I found this initialization:               #if defined(__osf__)     // Tru64 lacks stdint.h, but has inttypes.h which defines a superset of     // what stdint.h would define.     #include <inttypes.h>     #elif !defined(_MSC_VER)     #include <stdint.h>     #endif      I tried to remove `#include <stdint.h>` in `!define(_MSC_VER)` and replace it with `<inttypes.h>` hoping that it will be forced to use only `inttypes.h`. Then again, it fails. So my next guess is because the `__ost__` is not defined. What does that stand for? When I have a look inside the make log, it confuse me even more. If you need to see the make log. I have paste it here. How can I solve this? Does anyone have the same problem when installing protobuf?


vim customized with emacs commands (insert mode only)

I was an `emacs` user, and I have to switch to `vim`. But I miss some basic emacs commands in `vim` insert mode:   1. `C-A`   2. `C-E`   3. `C-K`   4. `C-Y`   5. `C-x C-s`   6. ... and some other I know that I can press `Escape` and then press some of the following keys and finally press key `i`:   1. `^`   2. `$`   3. `d$`   4. `p`   5. `:w` _[Enter]_   6. ... However I will like to stay in `vim` insert mode and avoid pressing `Escape`/`i` keys. On the web, I have found customizations for `emacs` (`vi-mode`, `vip`, `viper`, `vimpulse`, `vim-mode`, `evil`). But not yet found the opposite: customize `vim` to use `emacs` commands... I am interested about the `emacs` commands in `vim` **insert mode** only. Just some basic commands, as `bash` commands: `C-A`, `C-E`, `C-K`, `C-Y`, `C-U`... (yep `C-U` is not a default `emacs` command but I like it too).


Cut and transpose some lines of a file

I have 1344 rows of data column. I want to form 32 row by 42 columns from my input data file. I want to cut the first 42 row and paste to one raw of 42 column data and continue down likewise. My data is arranged as file name: data.txt               1     2     3     .     .     .     1344      I want the result be output.txt               1 2 3 ....42     43 44      84     .     .     .     1303 1304 . . . 1344      I want you help me with a script that can do it.


Unable to ssh out from my laptop

I'm unable to ssh from a particular machine, either from my Ubuntu 12.04 install or my Windows Vista install (using putty). I'm trying to ssh into a remote machine where I have an account, but I keep getting a "connection refused" error. However, from another computer in my office using the same setup, I can connect just fine Here is the ouput of `dig sun.chpc.ac.za`:               ; <<>> DiG 9.8.1-P1 <<>> sun.chpc.ac.za     ;; global options: +cmd     ;; Got answer:     ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55409     ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0     ;; QUESTION SECTION:     ;sun.chpc.ac.za. IN A     ;; ANSWER SECTION:     sun.chpc.ac.za. 2598 IN A 196.24.44.62     ;; Query time: 1 msec     ;; SERVER: 127.0.0.1#53(127.0.0.1)     ;; WHEN: Tue Oct 30 21:40:35 2012     ;; MSG SIZE rcvd: 48     "nslookup sun.chpc.ac.za" Server: 127.0.0.1 Address: 127.0.0.1#53     Non-authoritative answer: Name: sun.chpc.ac.za Address: 196.24.44.62      I stopped the Firewire and tried to ssh, but it still said "connection refused" When I run `nmap sun.chpc.ac.za`:               Starting Nmap 5.21 ( http://nmap.org ) at 2012-10-30 22:24 SAST      Nmap scan report for sun.chpc.ac.za (196.24.44.62)      Host is up (0.0044s latency).      Not shown: 998 closed ports      PORT STATE SERVICE      1863/tcp filtered msnp      2000/tcp filtered cisco-sccp     Nmap done: 1 IP address (1 host up) scanned in 2.81 seconds      Here is the output of the coommand: `ssh -vvv user@sun.chpc.ac.za`               OpenSSH_5.9p1 Debian-5ubuntu1,      OpenSSL 1.0.1 14 Mar 2012     debug1: Reading configuration data /etc/ssh/ssh_config      debug1: /etc/ssh/ssh_config line 19: Applying options for *     debug2: ssh_connect: needpriv 0     debug1: Connecting to sun.chpc.ac.za [196.24.44.62] port 22.     debug1: connect to address 196.24.44.62 port 22: Connection refused     ssh: connect to host sun.chpc.ac.za port 22: Connection refused      Here is the `ipconfig` output of the Windows computer that can connect:               Windows IP Configuration          Ethernet adapter Local Area Connection:             Connection-specific DNS Suffix  . :        Link-local IPv6 Address . . . . . : fe80::f988:68a0:c432:d37c%11        IPv4 Address. . . . . . . . . . . : 172.20.15.51        Subnet Mask . . . . . . . . . . . : 255.255.255.0        Default Gateway . . . . . . . . . : 172.20.15.254          Tunnel adapter Teredo Tunneling Pseudo-Interface:        Connection-specific DNS Suffix  . :        IPv6 Address. . . . . . . . . . . : 2001:0:5ef5:79fb:3403:122f:53eb:f0cc        Link-local IPv6 Address . . . . . : fe80::3403:122f:53eb:f0cc%12        Default Gateway . . . . . . . . . : ::          Tunnel adapter isatap.{C3E90CF9-5991-4463-AC91-A1497807E5D6}:        Media State . . . . . . . . . . . : Media disconnected        Connection-specific DNS Suffix  . :      Using the same cable, here is the `ifconfig` output of my Linux laptop that can not connect:               eth0      Link encap:Ethernet  HWaddr 00:14:0b:3f:b9:4c             UP BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:135737 errors:0 dropped:0 overruns:0 frame:0           TX packets:111352 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:155954649 (155.9 MB)  TX bytes:10990034 (10.9 MB)           Interrupt:17           lo        Link encap:Local Loopback             inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:16436  Metric:1           RX packets:25939 errors:0 dropped:0 overruns:0 frame:0           TX packets:25939 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:2034277 (2.0 MB)  TX bytes:2034277 (2.0 MB)          wlan0     Link encap:Ethernet  HWaddr 00:13:e8:f8:0e:af             inet addr:172.1.2.33  Bcast:172.1.255.255  Mask:255.255.0.0           inet6 addr: fe80::213:e8ff:fef8:eaf/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:1885246 errors:0 dropped:0 overruns:0 frame:0           TX packets:196008 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:430638332 (430.6 MB)  TX bytes:36583180 (36.5 MB)      The output of `tcptraceroute sun.chpc.ac.za 22` is:               Selected device eth0, address 172.20.15.35, port 51859 for outgoing packets          Tracing the path to sun.chpc.ac.za (196.24.44.62) on TCP port 22 (ssh), 30 hops max           1  172.20.15.254  0.494 ms  0.431 ms  0.354 ms      2  * * *      3  196.24.44.62 [closed]  0.323 ms  0.326 ms  0.312 ms


SSH to two addresses, use the one that connects first

I have a home computer (let’s call it _franklin_ because that’s what I call it) that I often ssh into from my work laptop. When I’m at home, I ssh to franklin.local, and when I’m at work or anywhere else, I ssh to remote.address.of.franklin. I want to have a function in my profile that always connects in the correct way for the situation. My network conditions often change (wired vs. wireless, different SSIDs, etc), so I’d prefer not to do it by detecting the state of the network, but rather:   1. If franklin is available locally, connect locally,   2. else, connect remotely Here’s what I use now:               function franklin () {         ping -c 5 "franklin.local" > /dev/null         if [[ $? != 0 ]]             then             echo "franklin not available on local, so trying remote connection"             ssh -p 22 remote.address.of.franklin         else             echo "franklin available on local network, so trying local connection"             ssh username@franklin.local         fi     }      The problem is, the ping takes time. **My question is:** can I execute both ssh commands simultaneously, and then automatically use whichever one connects first?


Zip output formatting

I'm learning `zip` and I have run into something I cannot figure out in `man zip`. When I run `zip -r $folder $folder` it will correctly zip all contents but the zip contents is as follows:               zip     |-folder       |--files       |--files      That is annoying to me and I wanted the zip outcome to be:               zip     |-files     |-files      Suggestions on being able to create a zip file with the folder name and all contents?


How to copy settings from one machine to another?

I would like to copy my "settings" from my desktop to my laptop. I am running KDE on Arch. I am not sure what to do with ~/.config, ~/.local, and ~/.kde4 since they have subdirectories with names that match my desktop hostname. If I naively copy everything, I get all sorts of errors/warning when logging in and trying to open my email/calendar/akonadi.


fix the virtualbox centos after vdi resizing or expand a LV group

I successfully resized my centos vdi in virtualbox with command `VboxManage.exe modifyhd Centos.vdi --resize 12000` But when i started Centos i got error messages that gnome power manager not been installed correctly, also starting **Avahi** and **postfix** daemons failed, and after that i haven't gnome screen at all. How do i could fix the situation? I rolled back to initial state, before resizing and added a new volume instead, the new Q is how to expand a vg_localhost?   output of `vdisplay`:               --- Physical volume ---       PV Name               /dev/sda2       VG Name               vg_localhost       PV Size               8,51 GiB / not usable 3,00 MiB       Allocatable           yes (but full)       PE Size               4,00 MiB       Total PE              2178       Free PE               0       Allocated PE          2178       PV UUID               Z4g5Cc-            "/dev/sdb2" is a new physical volume of "12,51 GiB"       --- NEW Physical volume ---       PV Name               /dev/sdb2       VG Name       PV Size               12,51 GiB       Allocatable           NO       PE Size               0       Total PE              0       Free PE               0       Allocated PE          0       PV UUID               oDCocH-      I did extension of vg and lvresize but still in trouble               lsblk     NAME                          MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sdb                             8:16   0    20G  0 disk     ├─vg_localhost-lv_root (dm-0) 253:0    0    18G  0 lvm  /     └─vg_localhost-lv_swap (dm-1) 253:1    0     2G  0 lvm  [SWAP]     sda                             8:0    0     9G  0 disk     ├─sda1                          8:1    0   500M  0 part /boot     └─sda2                          8:2    0   8,5G  0 part     sr0                            11:0    1  1024M  0 rom               df -h       /dev/mapper/vg_localhost-lv_root                           6,5G  6,2G  256M  97% /     tmpfs                 499M  200K  499M   1% /dev/shm     /dev/sda1             485M   78M  382M  17% /boot      what am i missed?


What happens when a hard drive fills up?

What happens when a hard drive gets full with Linux running? Does it lock the system? Or something else, or nothing happens? I am using Ubuntu Linux.


Map "windows" key on keyboard to "ctrl"

I am on Ubuntu and using a Microsoft keyboard. I want to map my `Win` key to a `Ctrl` key. How can I do that?


Replace specified character between two strings?

i have something to accomplish. i need to replace all occurrence of & inside or between `<ex>` `</ex>` to #. actual example below:               a & b & c <ex> a & b & c </ex> a & b & c      again, i need to replace all occurrence of & inside `<ex>` and before `</ex>` expected output:               a & b & c <ex> a # b # c </ex> a & b & c      please post the explanation also on how you guys managed to make it. ### EDIT#1 Please only provide me with a `sed` solution since I'm going to run this on an AS400 system and lack the ability to install Perl or any other interpreter.


make a 2nd root?

I was thinking, maybe i'd like to disable passwords for the root user and only use keys to log in. and if i need to login without keys have a 2nd user that is like root in everyway except has a different name. Is there a way to have a 2nd root user? Is this impossible? is it a bad idea to disable passwords?


RPM Build error : D: May free Score board((nil))

I have a problem building , it fails with the error: D: May free Score board((nil)) What does this mean ? I do not see any other errors appearing in the build before this so i am fairly stumped by the lack of information. OS : FC 8 Edit : FYI , it builds fine on FC10,13. Edit2 : Sorry for the missing info guys. I am trying to build a soap engine from apache - Axis2c. I am creating an RPM for the same. Here are the details of the spec file.               define _axis_name axis2-c     %define _axis_version 1.0     %define _axis_release 1     %define _axis_prefix "/usr/local/Axis2C"               Name:           %{_axis_name}     Version:        %{_axis_version}     Release:        %{_axis_release}     Summary:        Axis2C C++ Webservices Framework          Group:          Apache     License:        GPL     URL:            http://axis.apache.org/axis2/c/core/     Source0:        %{_axis_name}-%{_axis_version}.tar.gz     BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)          BuildRequires:  expat expat-devel xerces-c xerces-c-devel httpd httpd-devel     Requires:       expat expat-devel xerces-c xerces-c-devel httpd httpd-devel          %description     * Fri Jan 21 2011 RM<xx@xxx>     - First Attempt to build Axis2C RPM's          %prep     %setup -q               %build     #%configure     #make %{?_smp_mflags}     %define AXISHOME %(echo ${AXIS2C_HOME})     ./build.sh                    %install     rm -rf $RPM_BUILD_ROOT     make install DESTDIR=$RPM_BUILD_ROOT     mkdir -p ${RPM_BUILD_ROOT}/etc/ld.so.conf.d     cp ${RPM_BUILD_DIR}/${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION}/axis2c.conf ${RPM_BUILD_ROOT}/etc/ld.so.conf.d/axis2c.conf          %clean     rm -rf $RPM_BUILD_ROOT               %files     %defattr(-,root,root,-)     %doc     /etc/ld.so.conf.d/axis2c.conf     %{AXISHOME}/AUTHORS     %{AXISHOME}/COPYING     %{AXISHOME}/CREDITS     %{AXISHOME}/INSTALL     %{AXISHOME}/LICENSE     %{AXISHOME}/NEWS     %{AXISHOME}/NOTICE     %{AXISHOME}/axis2.xml     %{AXISHOME}/bin/axis2_http_server     .......      Build :               rpmbuild -bs --nodeps /root/rpmbuild/SPECS/axis2c.spec     rpmbuild -vv --rebuild --target "i686" /root/rpmbuild/SRPMS/axis2-c-1.0-1.src.rpm


RJ-45 <-> RS-232, can I substitute the RS-232 side and abuse my Ethernet port as COM port?

We have a PCIX board (with MIPS CPU) from some vendor and it has an RJ-45 jack on the "board-side", where the cable has an RS-232 plug on the other side. The expected protocol is clearly the same as when using a nullmodem cable between two machines. Now I am wondering whether there is some Linux or *nix flavor that allows me to substitute the cable for a standard patch cable with RJ-45 connectors on both ends (not crossed for obvious reasons)? I read that someone suggested `socat` for some similar use-case, but it appears that the use case is so arcane that documentation is virtually non-existent on the topic. Of course it's well possible that I simply used the wrong search terms so far. Reasoning: it's almost hard to come by devices that have a COM port nowadays, but most have an ethernet port. Also, the board is in a rather inaccessible location, so to connect to it we've been using mobile devices. And then it's even harder to find machines with COM ports. **NB:** I'm aware of RS-232 to USB devices, but would prefer a solution as pointed out as it seems more universal.


$(tail) into variable removing \n

I am doing the following:               x="Hello to the world of tomorrow\n <pre>";     x="${x}$(tail -n 50 log/logfile.log)"     x="${x}</pre>";     echo -e $x | ./perlscript      The Perl script:               #!perl     # perlscript     open(MAIL, "sendmail -t")     print MAIL "EMAIL HEADERS\n\n"     print MAIL <STDIN>     close(MAIL);      When I receive the email, the log file doesn't have any `\n` inside the `<pre>` tag. The `Hello to the world of tomorrow` works fine and the `\n` is represented. How to I get `tail` not to remove any `\n`, or is it something further down/up the chain?


Moving a root directory to a separate partition

I'd like to create a new partition and move the contents of the `/var` directory to it for the security reason of having `/var/www` and other subdirectories "mounted" with `nosuid`, `noexec`, and `nodev` permissions. How do I do it for `/var` or any other root directory?


How to sort and join at the same time?

I have 2 files, one having 2 columns, another having 1 column. The second file is sorted using sort -u. Now the task is I need to join this column with the first column of the first file, which is not sorted, so what will be the syntax? will this work? join -j 1 file2.txt sort -s -n -k 1 file1.txt? The output I want is actually the 2nd column of file 2 after joining and the uniq entries in it. File 2 * * *               1     2     3      File 1 * * *               2  500     1  5000      1  300     3  3000      3  300     4  450      Output * * *               5000     300     500     3000


Given a private SSH key, how do I recover my public key?

I've somehow lost my `id_rsa.pub` file. I still have my `id_rsa` file. How do I recover the public key from the private key? (This question came up after `ssh-copy-id` was reporting "ERROR: No identities found" while `ssh-keygen` reported "/root/.ssh/id_rsa already exists". `ls ~/.ssh` pointed out the problem was having `id_rsa` but not `id_rsa.pub`. I found the solution, but it was buried at the bottom of a long post on an Ubuntu support forum.)


How to assign an additional IP/hostname to a chrooted environment?

While I can simply have e.g. `sshd` in a `chroot` environment ("chrootenv") listen to a different port than its parent ("parentenv"), it would be more convenient to have that environment have an additional IP and hostname and have `sshd` listen to _that_ IP's port 22. So basically I'd like to set up a `chroot` environment such that it behaves like a separate host in the network. How can this be achieved? Or is this something LXC or user-mode Linux (which I lack experience with) is better suited for?


Force thunderbird to open the attachment with associated app

Is there any way to force Thunderbird into opening the attachments with the associated application? Or at least to open the association dialogue instead of the file open dialogue? It's really driving me nuts. The easiest way to open the attachments is to save them to disk and open them from the file manager.


Error updating all ArchLinux packages with -Syu

I am on Arch Linux with Kde. I haven't updated the packages in a while and I'm having a problem while trying to do so: The first thing I tried was: `sudo pacman -Syu` as the documentation says, and I get this error:               :: Synchronizing package databases...      testing is up to date      core is up to date      extra is up to date      community is up to date     :: The following packages should be upgraded first :         pacman     :: Do you want to cancel the current operation     :: and upgrade these packages now? [Y/n] y          resolving dependencies...     looking for inter-conflicts...     error: failed to prepare transaction (could not satisfy dependencies)     :: packagekit: requires pacman<3.6.0     :: package-query: requires pacman<3.6      I checked what version of pacman I had and I have v3.5.4:                .--.                  Pacman v3.5.4 - libalpm v6.0.4     / _.-' .-.  .-.  .-.   Copyright (C) 2006-2011 Pacman Development Team     \  '-. '-'  '-'  '-'   Copyright (C) 2002-2006 Judd Vinet      '--'                            This program may be freely redistributed under                            the terms of the GNU General Public License.      Which seems to be ok I guess? Just in case I tried to first update yaourt and I got the same message:                testing is up to date      core is up to date      extra is up to date      community is up to date     error: failed to prepare transaction (could not satisfy dependencies)     :: Starting full system upgrade...     :: packagekit: requires pacman<3.6.0     :: packagekit: requires pacman<3.6.0      I ran the following command to see if I could get the useful information and got this from where I couldn't get any more useful information, but maybe you can. Just in case I also tried it with KPackageKit and also got the same error:               :: packagekit: requires pacman<3.6.0     :: packagekit: requires pacman<3.6.0      I hope you have all the information you need, otherwise please ask. Thanks in advance.


Limit clamav to one thread

I'm only running on a low memory system so would like to run only one clamd, but i have googled for hours trying to find the answer with no luck. I tried clamscan instead but it takes far too long to scan each email. Does anyone know how to limit the clamd to run only one 'thread'? ![clamd](http://i.stack.imgur.com/TuGvK.png)


How to switch X windows from the command-line?

How can I create a script that automatically switches windows? I'm trying to do the same thing `Alt`+`Tab` does.


How to keep YouTube video fullscreen after moving mouse to other screen in Awesome WM?

I've managed to get YouTube Flash videos fullscreen by using two tips, but whenever I move the mouse pointer to a different screen (thereby changing the application focus) the fullscreen mode is canceled. **Is there some way to ensure that only application focus changes _on the same screen_ cancels the fullscreen mode?**


pass 1 environment variable using sudo

Is this a correct way for passing an environment variable in sudo ?               sudo -u www-data -b env FOOBAR="foobar" /home/user/folder/daemon


Cannot access to web server, but can ssh to it

I have a Ubuntu server but there are some weird things I can't understand. I cannot ping to the server via IP address, but I can ssh to it. I can access to apache server inside the server via command line, but I cannot acccess in my Windows's browser. What kind of setting I need to check now?


Why is kworker consuming so many resources on Linux 3.0.0-12-server?

Last Friday I upgraded my Ubuntu server to 11.10, which now runs with a 3.0.0-12-server kernel. Since then the overall performance has dropped dramatically. Before the upgrade the system load was about 0.3, but currently it is at 22-30 on an 8 core CPU system with 16GB of RAM (10GB free, no swap used). I was going to blame the BTRFS file system driver and the underlaying MD array, because [md1_raid1] and [btrfs-transacti] consumed a lot of resources. But all the [kworker/*:*] consume a lot more. `sar` has outputted something similar to this constantly since Friday:               11:25:01        CPU     %user     %nice   %system   %iowait    %steal     %idle      11:35:01        all      1,55      0,00     70,98      8,99      0,00     18,48      11:45:01        all      1,51      0,00     68,29     10,67      0,00     19,53      11:55:01        all      1,40      0,00     65,52     13,53      0,00     19,55      12:05:01        all      0,95      0,00     66,23     10,73      0,00     22,10       And `iostat` confirms a very poor write rate:               sda             129,26      3059,12       614,31  258226022   51855269               sdb              98,78        24,28      3495,05    2049471  295023077               md1             191,96       202,63       611,95   17104003   51656068               md0               0,01         0,02         0,00       1980        109                The question is: How can I track down why the kworker threads consume so many resources (and which one)? Or better: Is this a known issue with the 3.0 kernel, and can I tweak it with kernel parameters? **Edit:** I updated the Kernel to the brand new version 3.1 as recommended by the BTRFS developers. But unfortunately this didn't change anything.


Showing GNU screen session name and window title in shell prompt

Is there a way to present the GNU Screen session name and window title in the prompt of the shell (let us say, the Bash prompt defined by `PS1`)?


Second monitor does not work on BackTrack(Based on ubuntu 10.04)

I have installed BackTrack5(based on ubuntu 10.04) on my dell mini 1018 netbook,but when connect my external monitor(LG LED) to VGA port of my netbook,backtrack says second monitor is unknown,what can i do? lspci:               00:00.0 Host bridge: Intel Corporation N10 Family DMI Bridge     00:02.0 VGA compatible controller: Intel Corporation N10 Family Integrated Graphics Controller     00:02.1 Display controller: Intel Corporation N10 Family Integrated Graphics Controller     00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio Controller (rev 02)     00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 02)     00:1c.1 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 2 (rev 02)     00:1d.0 USB Controller: Intel Corporation N10/ICH7 Family USB UHCI Controller #1 (rev 02)     00:1d.1 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #2 (rev 02)     00:1d.2 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #3 (rev 02)     00:1d.3 USB Controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #4 (rev 02)     00:1d.7 USB Controller: Intel Corporation N10/ICH 7 Family USB2 EHCI Controller (rev 02)     00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)     00:1f.0 ISA bridge: Intel Corporation NM10 Family LPC Controller (rev 02)     00:1f.2 SATA controller: Intel Corporation N10/ICH7 Family SATA AHCI Controller (rev 02)     00:1f.3 SMBus: Intel Corporation N10/ICH 7 Family SMBus Controller (rev 02)     05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 05)     07:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device 8176 (rev 01)


How do I set an unlimited size to the history file for tcsh?

This is a follow-up question to Is there a maximum size to the bash history file?. Unfortunately, it doesn't work with the atmospheric science department computers, as they use tcsh rather than bash. Also, for some reason, the history file keeps on getting replaced whenever I quit my remote putty session and start a new one. How do I fix that?


Recovering from setting root's shell to a bad file

Let's say I've gone and done a silly thing, such as using 'chsh' to change the root user's shell to a bad file path. Future logins to the root account will abruptly fail, citing /bin/whatever not being found, and boot you back out to the login screen. Barring a recovery mode or inserting a LiveCD to edit /etc/passwd, what are my options for getting my system back? Let's also assume (for fun?) that there are no other users in wheel. Thoughts?


Finding the sector size of a partition

I answered this question, _assuming_ that the `*.img` file had a sector size of `512`. How do I query a device, or the image of a device, to find the correct sector size?


Nagios Core Acknowledgement notification (email)

Nagios Core 3.X on RHEL. I want to know how to send an email to the relevant contact group when someone Acks an alert.


Configure TP-Link TL WN723N for Debian Squeeze

I did a reinstall yesterday of my HP probook laptop using Debian Squeeze. I've been struggling with installing the rtl8192cu module, required to run the TP- Link TL WN723N USB dongle.   I am currently using kernel 3.8.6, but on the Realtek website the current driver is said to run on kernel 3.0.2. However, I managed to configure the dongle on my previous Debian installation, which used kernel 3.4.4, but now I can't remember how I did it. Looking through forums, I stumbled upon several posts, which suggested using the Windows driver (and ndiswrapper), compiling the driver from source and installing it, etc, but all these methods seem to fail in my case: in the first case ndiswrapper successfully installs the rtl8192cu driver, but modprobing ndiswrapper and ifconfig up-ping the wlan0 interface does not work. The second method also fails, as I get an error               cast from pointer to integer of different size      when using the driver on Realtek's website, or               implicit declaration of function daemonize      when compiling the driver provided here Why doesn't this work? Can rtl8192cu be compiled against kernel 3.8.6, or should I use a lower-version kernel?


msmtp-mta: Add $HOSTNAME to every mail

I have a fleet of Ubuntu clients running `msmtp-mta` along with `heirloom- mailx`. I'd like to have the same `/etc/msmtprc` on all machines. At present, when someone uses `mailx` or `sendmail`, the mail will be from `user@mydomain.com` and the only clue to the client machine is the IP address in the mail header. Is there a way to add the client host name to every mail sent? Like   * Prepend it to the subject or   * auto-attach a file to any mail or   * change `mydomain.com` to `client.mydomain.com` (remember, one file to rule them all, and changes in host name should be met automatically) **Note:** I cannot configure the actual SMTP-Server, just the `msmtp` client.


Strange behavior in mv command - maybe open sys call issue?

I'm noticing very strange behavior from the "mv" command that may (or may not) be related to the "open" system call. We're running RedHat v5. There are two separate storage devices, one mounted to "/diskTo" and the other "/diskFrom" (for this example). In normal operations, we are moving (mv'ing) hundreds, if not low thousands, of files from /diskFrom to /diskTo. The majority of the files move fine. However, out of, say 1000 files, we have 1-5 that fail. The failure is a permission denied error. When we check the file destination, a file **exists** , but the inode contents are garbage. For example, the timestamp is junk ("1969", but varies), and the permissions are "0." So, I figured we should run strace on the mv commands and capture the output of the failures. Here's what I found:               munmap(0x2b0328770000, 4096)            = 0     geteuid()                               = 31169     ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7fff90de9500) = -1 ENOTTY (Inappropriate ioctl for device)     stat("/diskTo/foo.dat", 0x7fff90de95d0) = -1 ENOENT (No such file or directory)     lstat("/diskFrom/bar.dat", {st_mode=S_IFREG|0444, st_size=234632119, ...}) = 0     lstat("/diskTo/foo.dat", 0x7fff90de9370) = -1 ENOENT (No such file or directory)     rename("/diskFrom/bar.dat", "/diskTo/foo.dat") = -1 EXDEV (Invalid cross-device link)     unlink("/diskTo/foo.dat") = -1 ENOENT (No such file or directory)     open("/diskFrom/bar.dat", O_RDONLY|O_NOFOLLOW) = 3     fstat(3, {st_mode=S_IFREG|0444, st_size=234632119, ...}) = 0     open("/diskTo/foo.dat", O_WRONLY|O_CREAT|O_EXCL, 0400) = -1 EEXIST (File exists)     write(2, "mv: ", 4)                     = 4     write(2, "cannot create regular file `/diskTo"..., 76) = 76     write(2, ": File exists", 13)           = 13     write(2, "\n", 1)                       = 1      As you can see, The **unlink** is called, which returns -1, which shows the file doesn't exist. Then, "mv" tries to **open** the file and receives an EEXIST error. But the file can't possibly exist! I'm not showing this here, but the script that is creating this test case is using unique numbers to build directories - so it's very unlikely (if not impossible) that the file truly existed. Not to mention, the **unlink** proves the file didn't exist. Could this be an issue with how **open** is creating the inode contents? I'm not sure where to look at this point. Maybe looking into "mv" more, or the "open" system call?


How to compact a chmod UNIX command

Is there anyway to compact the follow UNIX command:               chmod 755 scriptA.ksh | chmod 755 scriptB.ksh | chmod 755 scriptC.ksh | chmod 755 scriptD.ksh      The above command makes every KornShell (ksh) script executable, so the compacted command will be shorter in length and still make every ksh script executable.


CrashPlan migrate backup from Windows to Linux?

I have CrashPlan installed on my Windows partition but since I almost don't use windows anymore I want to move it to my ElementaryOS/Ubuntu installation. **The problem is:** In my Windows machine CrashPlan is configured to backup my `D:` drive which is also mounted in my Linux OS as `/media/DATA`. Is it possible to make CrashPlan understand that it's the same data so it doesn't backup it again?


Getting relative links between two paths

Say I have two paths: `<source_path>` and `<target_path>`. I would like my shell (zsh) to automatically find out if there is a way to represent `<target_path>` from `<source_path>` as a relative path. E.g. Let's assume   * `<source_path>` is `/foo/bar/something`   * `<target_path>` is `/foo/hello/world` The result would be `../../hello/world` ## Why I need this: I need like to create a symbolic link from `<source_path>` to `<target_path>` using a **relative** symbolic link whenever possible, since otherwise our samba server does not show the file properly when I access these files on the network from Windows (I am not the sys admin, and don't have control over this setting) Assuming that `<target_path>` and `<source_path>` are absolute paths, the following creates a symbolic link **pointing to an absolute path**.               ln -s <target_path> <source_path>      so it does not work for my needs. I need to do this for hundreds of files, so I can't just manually fix it. Any shell built-ins that take care of this?


Chroot SFTP users who require access to multiple directories under same parent folder

I have a RHEL 6 server with a /Documents directory, and it has child directories 1 2 3 4 5.... right under the /Documents directory. Is it possible to create an SFTP chroot jail that only gives a user access to 1,2,7,9 but not the other folders? I am using NFSv3 with RHEL 6 and am therefore limited in ACL choices somewhat.


packages have unmet dependencies - unable to install packages

I am trying to install passenger module with bellow command: > sudo passenger-install-apache2-module And I am getting following output:                * GNU C++ compiler... found at /usr/bin/g++      * Curl development headers with SSL support... found      * OpenSSL development headers... found      * Zlib development headers... found      * Ruby development headers... found      * OpenSSL support for Ruby... found      * RubyGems... found      * Rake... found at /usr/bin/rake      * rack... found      * Apache 2... found at /usr/sbin/apache2      * Apache 2 development headers... not found      * Apache Portable Runtime (APR) development headers... not found      * Apache Portable Runtime Utility (APU) development headers... not found      And then its asking me to install:                * To install Apache 2 development headers:        Please run apt-get install apache2-prefork-dev as root.           * To install Apache Portable Runtime (APR) development headers:        Please run apt-get install libapr1-dev as root.           * To install Apache Portable Runtime Utility (APU) development headers:        Please run apt-get install libaprutil1-dev as root.      But when I am running :               sudo apt-get install apache2-prefork-dev libapr1-dev libaprutil1-dev                Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:       apache2-prefork-dev: Depends: apache2.2-common (= 2.2.14-5ubuntu8.10) but 2.2.20-1ubuntu1 is to be installed       libapr1-dev: Depends: libapr1 (= 1.3.8-1ubuntu0.3) but 1.4.5-1 is to be installed       libaprutil1-dev: Depends: libpcre3-dev but it is not going to be installed     E: Broken packages      I have ruby1.8.7,rubygem1.8.24, rails3.2.9 installed. > vim /etc/apt/sources.list               #############################################################     ################### OFFICIAL UBUNTU REPOS ###################     #############################################################     ###### Ubuntu Main Repos     deb http://fr.archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse     deb-src http://fr.archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse          ###### Ubuntu Update Repos     deb http://fr.archive.ubuntu.com/ubuntu/ lucid-security main restricted universe multiverse     deb http://fr.archive.ubuntu.com/ubuntu/ lucid-updates main restricted universe multiverse     deb http://fr.archive.ubuntu.com/ubuntu/ lucid-proposed main restricted universe multiverse     deb http://fr.archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse     deb-src http://fr.archive.ubuntu.com/ubuntu/ lucid-security main restricted universe multiverse     deb-src http://fr.archive.ubuntu.com/ubuntu/ lucid-updates main restricted universe multiverse     deb-src http://fr.archive.ubuntu.com/ubuntu/ lucid-proposed main restricted universe multiverse     deb-src http://fr.archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse          ###### Ubuntu Partner Repo     deb http://archive.canonical.com/ubuntu lucid partner     deb-src http://archive.canonical.com/ubuntu lucid partner      > vim /etc/apt/sources.list.d               " ============================================================================     " Netrw Directory Listing                                        (netrw v136)     "   /etc/apt/sources.list.d     "   Sorted by      name     "   Sort sequence: [\/]$,\<core\%(\.\d\+\)\=\>,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$     "   Quick Help: <F1>:help  -:go up dir  D:delete  R:rename  s:sort-by  x:exec     " ============================================================================     ../     mercurial-ppa-releases-lucid.list     mercurial-ppa-releases-lucid.list.save     .mercurial-ppa-releases-lucid.list.swp


Closing connection after executing reboot using ssh command

I am using the `reboot -f` command remotely to force reboot a Unix machine. The problem is that the ssh connection remains active for a long time which I don't know why? I want to close the ssh connection immediately after rebooting the machine and return to my local shell. How can i do that? Note that the reboot command without `-f` flag does not work.


To check which resource is being accessed by which process

I have some process running on my system. I need to list out which of the process at a moment has acquired/is using one or more of these in my system:   1. Ethernet    2. Camera   3. USB   4. Bluetooth   5. WiFi   6. File System etc. Is there a way to find this out ? Platform : Ubuntu/Fedora (Allowed to have SELinux as well if required to implement the above)


extract last match from logfile till end

Using sed, grep, awk, or ruby, what's a simple way to find the _last_ match of a string in a larger log file, and send every line following it (inclusive) to another file? Example:               grep -A222 "_____________" recent/toptrigs.OX.rb.log      is my nearest workaround, since 222 lines of context afterword should always hit EOF first, except that I want it to start from the _last_ instance of " ** ___ __ ___ _**" string. It's a logfile simultaneously growing from the same process (so I manually flush STDOUT and STDERR at the end of each item's loop, with this segment cutting in mind).


Is is safe to share /home between Ubuntu and Fedora?

I already read this thread, so please don't mark me as a duplicate of it. That asks how. I want to know how safe it is. I currently have Fedora 20 with GNOME 3.8. I've already messed up its configuration to the point of being unable to log in graphically, but that's not this question.   I want to install Ubuntu 14.04 LTS, with the default desktop environment (i think it's called Unity). Will the two distros' configs interfere with each other if I use the same `/home` partition?   I prefer not to put my main files/folders (docs, music, pics, git repos) in a subdirectory, as Nautilus seems to have hardcoded shortcuts to ~/Documents, ~/Music, ~/Downloads, etc. I expect to use much of the same programs (Chrome, Rhythmbox, Nautilus, Sublime Text) on the distros. Will their configs get messed up if they're shared?


"screen" process closes out of the blue

I spawned 4 screen processes with the following command (one after the other):               screen ./"executeable"      Logging back into the server I run the program on at a later time only showed 3 processes remaining (with `screen -r`). How can I find out what is going wrong? The error is reproduceable and I think its because of my program, but as screen just closes I cannot be sure..


Gnome 3 "broken" after upgrades, kind of looks like gnome 2 . . .?

I'm running debian wheezy ( testing ) and after some upgrades my gnome 3 is broken. It's not exactly broken, but it's completey different. Almost like it's no longer actually gnome 3; most of the UI bells and whistles are gone and it mostly look like gnome 2. Anyway, how does one start troubleshooting such a thing? I looked in /var/log/gdm3 and didn't see any glaring errors; I did see some minor errors but they seem to be in the older logs too.


Automount not disabling in Ubuntu 12.04 or 13.04

I'm trying to disable the automounting of any usb device. I have this working in Ubuntu 10.04, but I'm trying to do the same in either 12.04 or (ideally) 13.04 but not having any luck. Everywhere I look tells me to run `dconf-editor`, then go to `org`,`desktop`,`media-handling` and untick `automount` and `automount-open`. This method worked in 10.04 but not in the others. I've also tried ticking `autoopen-never` with the other two unticked, but not had any luck. I'm using VirtualBox VMs to do this in, I don't know if that will have a bearing on my result. I have set-up a blank USB device filter to catch all devices and attach them to the VM. Any suggestions welcomed! Edit: Thanks for all the suggestions. I started again with a clean install and managed to get this working, I think it must have been something to do with my VM settings, but I don't know what!


How to delete a NTFS filesystem file whose name contains ":"?

I backup some of my Linux files in a NTFS removable hard disk several days ago, this time I need to remove those files. But I find it difficult since:   1. On windows, it complains that " _Could not find this item_ "   2. On a virtual machine whose OS is ubuntu 12.04, when I mount the hard disk(I guess it's using "ntfs-3g") and use "`rm`", it complains " _No such file or directory_ "; even "`ls`" fails for the file. So are there any ways to smash this file correctly?


How to add EBCDIC support on debian/ubuntu

I have to add EBCSIC text support to deal with IBM OS text messages. I have succesfuly added EBCDIC support to a CentOS box by adding lang and encoding to `/etc/i18n/sysconfig`. I searched in the docs and the equivalent should be in debian `/etc/default/locale` but it didn't work. I have checked and the EBCDIC support is present under `/usr/share/i18n/charmaps/`


CronTab on OpenShift

I have a robot witch updates a particular page on Wikipedia every 2 hours. I copied it to OpenShift and made a Crontab on my own computer witch connects to OpenShift via ssh and run the robot. How can I tune its cron on OpenShift?


Where is the Arch Linux official package source repository?

After searching Google and the wiki I can't seem to find it, but only links to the _software_ repositories.


Why would cron be "skipping" scheduled jobs

I have 3 tasks sheduled to crontab on my server, but my second job doesn't run automatically               \# m h  dom mon dow   command     */5 * * * * ~/dbCron.sh     00 09 * * * ~/dbCron_daily_backup.sh           <--------- this is skipping     55 23 * * * ~/backup_logs.sh && ~/clear_logs.sh      so what could be the solution that would run the tasks at proper time without fail.


Is it safe to format this extended partition?

On a ubuntu server I own, I am running out of space. When I ran               sudo parted /dev/sda -l      to find all available drives, I got this:               Model: ATA ST31000528AS (scsi)     Disk /dev/sda: 1000GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number  Start   End     Size    Type      File system  Flags      1      1049kB  256MB   255MB   primary   ext2         boot      2      257MB   1000GB  1000GB  extended      5      257MB   1000GB  1000GB  logical                lvm               Model: Linux device-mapper (linear) (dm)     Disk /dev/mapper/server--vg-swap_1: 2135MB     Sector size (logical/physical): 512B/512B     Partition Table: loop          Number  Start  End     Size    File system     Flags      1      0.00B  2135MB  2135MB  linux-swap(v1)               Model: Linux device-mapper (linear) (dm)     Disk /dev/mapper/server--vg-root: 998GB     Sector size (logical/physical): 512B/512B     Partition Table: loop          Number  Start  End    Size   File system  Flags      1      0.00B  998GB  998GB  ext4      I understand /dev/mapper/server--vg-root is the filesystem, and /dev/sda1 has some stuff related to GRUB. But, what about /dev/sda2 and /dev/sda5? When I tried to mount /dev/sda2, it said that I needed to specify the file system, which according to the table, is nonexistent. So, is it safe to format this with, say ext4 and mount it? Also, when I tried to mount /dev/sd5, it gave me this error:               mount: unknown filesystem type 'LVM2_member'      I assume it is NOT save to reformat this. If I'm wrong, then that would be great, because I could save some space. Please let me know either way. Thanks in advance! UPDATE: Here is the result of `mount`:               /dev/mapper/server--vg-root on / type ext4 (rw,errors=remount-ro)     proc on /proc type proc (rw,noexec,nosuid,nodev)     sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)     none on /sys/fs/fuse/connections type fusectl (rw)     none on /sys/kernel/debug type debugfs (rw)     none on /sys/kernel/security type securityfs (rw)     udev on /dev type devtmpfs (rw,mode=0755)     devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)     tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)     none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)     none on /run/shm type tmpfs (rw,nosuid,nodev)     /dev/sda1 on /boot type ext2 (rw,acl)     /dev/sda1 on /media/hd2 type ext2 (rw)


Make effective the changes in CPU governor plugin

I'm using Debian Testing + Xfce. I added to my panel the plugin the handle the CPU governor. My problem is that the setting that I do on the plugin interface are not made effective. Maybe because I'm not running it as root? How can I fix it? Thank you.


How to get exact file size and file name?

Right now I am using `ls -lt /my/directory` (see below) then php parses the output. But inconsistently because the delimiter is space and there might be two or more spaces in between two fields. The solution is output only **file name** and **its size**. How can I list files (using wild card) and its full size in command line? So instead of               -rw------- 1 db2inst1 db2iadm1 855658496 Apr 22 02:31 MONTE.0.db2inst1.NODE0000.CATN0000.20120422023005.001      I get               855658496 MONTE.0.db2inst1.NODE0000.CATN0000.20120422023005.001


NFS does not store tails of files when program crashes

Program is running in parallel on multiple processors and is writing logs to a central host via NFS under RH7.3 or SUSE 11.3. If program crashes or hangs then tails of log files are lost and we lack information on the location and reason of the crash. Shell sync has no effect. Mounting mode is `async` for a strong reason: in case of sync mode the times of loading initial data and unloading results increase by the factor of 10, from minutes to hours. Sometimes `flush()` inserted in the program may help but it is difficult to do when the location is not known for certain. So, is it possible to force an NFS client to flush its buffers unconditionally when the process terminates, no matter how?


Wireless on Slackware

Ok, so I finally got my wireless working on Slackware. Trouble is, I don't really understand what I'm doing. I'm currently root and in order to get wireless, I first have to:               wpa_supplicant -c/etc/wpa_supplicant.conf -Dwext -iwlan0      then:               /etc/rc.d/rc.inet1 wlan0_start      If I do the second line first, I get time-out, no connection. So my questions are:   1. is there a better way to do this (am I having some kind of conflict between config files)?   2. can I automate this on startup?   3. can I automate this for another account besides root?               bash-4.1# wpa_supplicant -c/etc/wpa_supplicant.conf -d -Dwext -iwlan0 &     [1] 2935     bash-4.1# Initializing interface 'wlan0' conf '/etc/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'     Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'     Reading configuration file '/etc/wpa_supplicant.conf'     ctrl_interface='/var/run/wpa_supplicant'     ctrl_interface_group='0'     eapol_version=1     ap_scan=1     fast_reauth=1     Priority group 10        id=0 ssid=(##hidden##)     Priority group 0        id=1 ssid=''     WEXT: cfg80211-based driver detected     SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf       capabilities: key_mgmt 0xf enc 0xf flags 0x0     netlink: Operstate: linkmode=1, operstate=5     Own MAC address: (##HIDDEN##)     wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0     wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0     wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0     wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0     wpa_driver_wext_set_countermeasures     RSN: flushing PMKID list in the driver     Setting scan request: 0 sec 100000 usec     WPS: UUID based on MAC address - (##HIDDEN##)     EAPOL: SUPP_PAE entering state DISCONNECTED     EAPOL: Supplicant port status: Unauthorized     EAPOL: KEY_RX entering state NO_KEY_RECEIVE     EAPOL: SUPP_BE entering state INITIALIZE     EAP: EAP entering state DISABLED     EAPOL: Supplicant port status: Unauthorized     EAPOL: Supplicant port status: Unauthorized     ctrl_interface_group=0     Added interface wlan0     RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])     RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added     RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])     RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added     Wireless event: cmd=0x8b06 len=12     RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])     RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added     Wireless event: cmd=0x8b1a len=16     State: DISCONNECTED -> SCANNING     Starting AP scan for wildcard SSID     Scan requested (ret=0) - scan timeout 5 seconds     EAPOL: disable timer tick     EAPOL: Supplicant port status: Unauthorized     RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])     RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added     Wireless event: cmd=0x8b19 len=16     Scan results did not fit - trying larger buffer (8192 bytes)     Received 7670 bytes of scan results (15 BSSes)     BSS: Start scan result update 1     (##BUNCH OF SSID's for my local removed##)     New scan results available     WPS: Unsupported attribute type 0x1049 len=6     WPS: Unsupported attribute type 0x1049 len=6     Selecting BSS from priority group 10     Try to find WPA-enabled AP     (##HIDDEN##)     Trying to associate with (##HIDDEN##)     Cancelling scan request     WPA: clearing own WPA/RSN IE     Automatic auth_alg selection: 0x1     RSN: using IEEE 802.11i/D9.0     WPA: Selected cipher suites: group 8 pairwise 24 key_mgmt 2 proto 2     WPA: clearing AP WPA IE     WPA: set AP RSN IE - (##HIDDEN##)     WPA: using GTK TKIP     WPA: using PTK CCMP     WPA: using KEY_MGMT WPA-PSK     WPA: Set own WPA IE default - hexdump (##HIDDEN##)     No keys have been configured - skip key clearing     State: SCANNING -> ASSOCIATING     wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)     netlink: Operstate: linkmode=-1, operstate=5     wpa_driver_wext_associate     wpa_driver_wext_set_drop_unencrypted     wpa_driver_wext_set_psk     Setting authentication timeout: 10 sec 0 usec     EAPOL: External notification - EAP success=0     EAPOL: Supplicant port status: Unauthorized     EAPOL: External notification - EAP fail=0     EAPOL: Supplicant port status: Unauthorized     EAPOL: External notification - portControl=Auto     EAPOL: Supplicant port status: Unauthorized     RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])     RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added     Wireless event: cmd=0x8b1a len=16     RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])     RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added     Wireless event: cmd=0x8b06 len=12     RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])     RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added     Wireless event: cmd=0x8b04 len=16     RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])     RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added     Wireless event: cmd=0x8b1a len=24     RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])     RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added     RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])     RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added     Wireless event: cmd=0x8c08 len=198     AssocResp IE wireless event - hexdump (##HIDDEN##)     RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])     RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added     Wireless event: cmd=0x8b15 len=24     Wireless event: new AP: (##HIDDEN##)     Association info event     resp_ies - hexdump(len=182): (##HIDDEN##)     State: ASSOCIATING -> ASSOCIATED     wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)     netlink: Operstate: linkmode=-1, operstate=5     Associated to a new BSS: BSSID=(##HIDDEN##)     No keys have been configured - skip key clearing     Associated with (##HIDDEN##)     WPA: Association event - clear replay counter     WPA: Clear old PTK     EAPOL: External notification - portEnabled=0     EAPOL: Supplicant port status: Unauthorized     EAPOL: External notification - portValid=0     EAPOL: Supplicant port status: Unauthorized     EAPOL: External notification - EAP success=0     EAPOL: Supplicant port status: Unauthorized     EAPOL: External notification - portEnabled=1     EAPOL: SUPP_PAE entering state CONNECTING     EAPOL: enable timer tick     EAPOL: SUPP_BE entering state IDLE     Setting authentication timeout: 10 sec 0 usec     Cancelling scan request     RX EAPOL (##HIDDEN##)     Setting authentication timeout: 10 sec 0 usec     IEEE 802.1X RX: version=1 type=3 length=95       EAPOL-Key type=2       key_info 0x8a (ver=2 keyidx=0 rsvd=0 Pairwise Ack)       key_length=16 key_data_length=0       replay_counter - hexdump(len=8): (##HIDDEN##)       key_nonce - hexdump(len=32): (##HIDDEN##)       key_iv - hexdump(len=16): (##HIDDEN##)       key_rsc - hexdump(len=8): (##HIDDEN##)       key_id (reserved) - hexdump(len=8): (##HIDDEN##)       key_mic - hexdump(len=16): (##HIDDEN##)     State: ASSOCIATED -> 4WAY_HANDSHAKE     WPA: RX message 1 of 4-Way Handshake from (##HIDDEN##)     RSN: msg 1/4 key data - hexdump(len=0):     WPA: Renewed SNonce - hexdump(len=32): (##HIDDEN##)     WPA: PTK derivation - A1=(##HIDDEN##)     WPA: PMK - hexdump(len=32): [REMOVED]     WPA: PTK - hexdump(len=48): [REMOVED]     WPA: WPA IE for msg 2/4 - hexdump(len=22): (##HIDDEN##)     WPA: Sending EAPOL-Key 2/4     RX EAPOL from (##HIDDEN##)     IEEE 802.1X RX: version=1 type=3 length=175       EAPOL-Key type=2       key_info 0x13ca (ver=2 keyidx=0 rsvd=0 Pairwise Install Ack MIC Secure Encr)       key_length=16 key_data_length=80       replay_counter - hexdump(len=8): 00 00 00 00 00 00 00 02       key_nonce - hexdump(len=32): (##HIDDEN##)       key_iv - hexdump(len=16): (##HIDDEN##)       key_rsc - hexdump(len=8): (##HIDDEN##)       key_id (reserved) - hexdump(len=8): (##HIDDEN##)       key_mic - hexdump(len=16): (##HIDDEN##)     RSN: encrypted key data - hexdump(len=80): (##HIDDEN##)     WPA: decrypted EAPOL-Key key data - hexdump(len=72): [REMOVED]     State: 4WAY_HANDSHAKE -> 4WAY_HANDSHAKE     WPA: RX message 3 of 4-Way Handshake from (##HIDDEN##)(ver=2)     WPA: IE KeyData - hexdump(len=72): (##HIDDEN##)     WPA: RSN IE in EAPOL-Key - hexdump(len=26): (##HIDDEN##)     WPA: GTK in EAPOL-Key - hexdump(len=40): [REMOVED]     WPA: Sending EAPOL-Key 4/4     WPA: Installing PTK to the driver.     wpa_driver_wext_set_key: alg=3 key_idx=0 set_tx=1 seq_len=6 key_len=16     EAPOL: External notification - portValid=1     State: 4WAY_HANDSHAKE -> GROUP_HANDSHAKE     RSN: received GTK in pairwise handshake - hexdump(len=34): [REMOVED]     WPA: Group Key - hexdump(len=32): [REMOVED]     WPA: Installing GTK to the driver (keyidx=2 tx=0 len=32).     WPA: RSC - hexdump(len=6): 00 01 00 00 00 00     wpa_driver_wext_set_key: alg=2 key_idx=2 set_tx=0 seq_len=6 key_len=32     WPA: Key negotiation completed with  [PTK=CCMP GTK=TKIP]     Cancelling authentication timeout     State: GROUP_HANDSHAKE -> COMPLETED     CTRL-EVENT-CONNECTED - Connection to (##HIDDEN##) completed (auth) [id=0 id_str=]     wpa_driver_wext_set_operstate: operstate 0->1 (UP)     netlink: Operstate: linkmode=-1, operstate=6     EAPOL: External notification - portValid=1     EAPOL: External notification - EAP success=1     EAPOL: SUPP_PAE entering state AUTHENTICATING     EAPOL: SUPP_BE entering state SUCCESS     EAP: EAP entering state DISABLED     EAPOL: SUPP_PAE entering state AUTHENTICATED     EAPOL: Supplicant port status: Authorized     EAPOL: SUPP_BE entering state IDLE     EAPOL authentication completed successfully     RTM_NEWLINK: operstate=1 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])     RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added     EAPOL: startWhen --> 0     EAPOL: disable timer tick     bash-4.1# /etc/rc.d/rc.inet1 wlan0_start     bash-4.1# BSS: Expire BSS 0 due to age     BSS: Remove id (##HIDDEN##)     BSS: Remove id (##HIDDEN##)     BSS: Remove id (##HIDDEN##)     (etc)      Here's the output from lspci:               ubsystem: Intel Corporation Device 1121             Flags: bus master, fast devsel, latency 0, IRQ 41             Memory at f8000000 (64-bit, non-prefetchable) [size=8K]             Capabilities: [c8] Power Management version 3             Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+             Capabilities: [e0] Express Endpoint, MSI 00             Capabilities: [100] Advanced Error Reporting             Capabilities: [140] Device Serial Number (##HIDDEN##)             Kernel driver in use: iwlagn             Kernel modules: iwlagn


GNOME Shell - display path of files in Activities window

One feature that I really like of GNOME Shell is the possibility to just type the name of a file in the Activities window and have a list of matching files shown, so that you can open them. However, only the file name is displayed, and not the path. Questions:   1. Is there any way (setting, external plugin etc.) to also show the path?   2. If there is not, how would I go to write one? What components need to be edited? Would a GNOME Shell plugin be able to modify the activities window?


What is the use/meaning of 'swap area' while linux installation?

When i installed ubuntu in my x86 machine, I had to configure some memory as 'swap area'. What is the use of this memory and what is the importance of this memory in linux file systems? How can I determine the exact size of 'swap area' in a machine for the safe working of linux inside in it?


Very poor read performance compared to write performance on md(raid1) / crypt(luks) / lvm

I'm experiencing very poor **read** performance over raid1/crypt/lvm. In the same time, write speeds are about 2x+ faster on the same setup. On another raid1 setup on the same machine I get normal read speeds (maybe because I'm not using cryptsetup). OS related disks: sda + sdb. I have raid1 configuration with two disks, both are in place. I'm using LVM over the RAID. No encryption. Both disks are WD Green, 5400 rpm. IO test results on this raid1:               dd if=/dev/zero of=/tmp/output.img3 bs=8k count=256k conv=fsync      - 2147483648 bytes (2.1 GB) copied, 22.3392 s, 96.1 MB/s          sync     echo 3 > /proc/sys/vm/drop_caches     dd if=/tmp/output.img3 of=/dev/null bs=8k      - 2147483648 bytes (2.1 GB) copied, 15.9 s, 135 MB/s      And here is the problematic setup (on the same machine). Currently I have only one sdc (WD Green, 5400rpm) configured in software raid1 + crypt (luks, serpent-xts-plain) + lvm. Tomorrow I will attach another disk (sdd) to complete this two-disk raid1 setup. IO tests results on this raid1:               dd if=/dev/zero of=output.img3 bs=8k count=256k conv=fsync     2147483648 bytes (2.1 GB) copied, 17.7235 s, 121 MB/s          sync     echo 3 > /proc/sys/vm/drop_caches     dd if=output.img3 of=/dev/null bs=8k     2147483648 bytes (2.1 GB) copied, 36.2454 s, 59.2 MB/s      We can see that the read performance is very very bad (59MB/s compared to 135MB/s when using no encryption). Nothing is using the disks during benchmark. I can confirm this because I checked with iostat and dstat. Details on the hardware:   * disks: all are WD green, 5400rpm, 64mb cache.   * cpu: FX-8350 at stock speed   * ram: 4x4GB at 1066Mhz. Details on the software:   * OS: Debian Wheezy 7, amd64   * mdadm: v3.2.5 - 18th May 2012   * LVM version: 2.02.95(2) (2012-03-06)   * LVM Library version: 1.02.74 (2012-03-06)   * LVM Driver version: 4.22.0   * cryptsetup: 1.4.3 Here is how I configured the slow raid1+crypt+lvm setup: parted /dev/sdc   1. mklabel gpt   2. type: ext4   3. start: 2048s   4. end: -1 Now the raid, crypt and the lvm configuration:   1. mdadm --create /dev/md1 --level=1 --raid-disks=2 missing /dev/sdc   2. cryptsetup --cipher serpent-xts-plain luksFormat /dev/md1   3. cryptsetup luksOpen /dev/md1 md1_crypt   4. vgcreate vg_sql /dev/mapper/md1_crypt   5. lvcreate -l 100%VG vg_sql -n lv_sql   6. mkfs.ext4 /dev/mapper/vg_sql-lv-sql   7. mount /dev/mapper/vg_sql-lv_sql /sql So guys, can you help me identify the reason and fix it? It has to be something with the cryptsetup as there is no such read slowdown on the other setup (sda+sdb) where no encryption is present. But I have no idea what to do. Thanks!


different passwords depending on plugged-in devices

I would like to have different passwords for my account(s): When (e.g.) a certain USB stick is plugged in then an easy password is to be used. The idea is: If I leave my computer then I take the stick with me and the easy passwords shall be disabled then. My general idea is:   1. Detect the stick with udev, maybe detect certain data on it (with a script run by udev) and react accordingly (e.g. create a file which is deleted when the stick is plugged out). This should be easy.   2. Have PAM check for the existence of this file and select the password database accordingly. The main question is probably (i.e. if I understand the structure of the problem correctly): Can `pam_unix2` be configured to use another shadow file? I just had a look at the man page for `pam_unix2` and it seems that this is not possible because this module lets glibc NSS make this decision.


Screen fading out on GNOME, without ability to cancel

Sometimes, on my Arch Linux laptop, using GNOME for the desktop, my screen will fade out after a while of non-activity (even if I'm watching a video). This fade out is very slow, and can't be cancelled by mouse movements, keyboard presses etc. What is responsible for this, and how do I disable it?


doubt regarding use of split in awk

arr=($(echo "great#man" | awk  '{split($0,a,"#"); } END {print a[0]; print a[1];}'))          echo " ${arr[0]} "         echo " ${arr[1]}"      My expected output is:               great     man      But I am getting               great      arr[1] is not getting printed


How to fully lock the GNOME-panel?

I know I can lock elements on GNOME-panel that prevent users to move the element on the GNOME-panel, but how can I fully lock the GNOME-panel? I mean I need a locking mechanism, that will prevent accidentally removing of elements, like ex.: the user deletes the clock from the GNOME-panel. Are there any solutions to lock it? version 2.30.2-0ubuntu0.2