How do I tell what program is asking for a password?

I'm getting an occasional "Authentication request" dialog from Gnome, and I don't know what program is asking or even which account it's talking about. ![enter image description here](http://i.stack.imgur.com/kkfQJ.png) [email redacted] is an email address of mine, but I've used that address for more than one account, and they all have different passwords. I don't know what it's asking for. This dialog tends to pop up when I unlock the computer after having been away for a while. I just click Cancel, and the dialog goes away for a while. I don't get any other message when I do that. I'm running Gnome 3.8.3 on Arch Linux. Note: After writing this question, I thought of checking Online Accounts in Gnome Settings. I noticed that it showed my Google account (under that email) as "credential expired". Is that what was causing it? I signed back in to my Google account, but it's too soon to tell if that fixed the problem. And I still want to know how to tell who's asking for my password (and for which account).


Journal commit I/O error for Seagate Expansion external USB hard drive

I am using Debian 7.6 (amd64) and for some reason when I am trying to read or write to my Seagate Expansion 1TB external USB drive, I am getting input/output errors ... Here is what the output of dmesg says:               [ 1761.587087] kjournald starting.  Commit interval 5 seconds     [ 1761.588775] EXT3-fs (sdd1): using internal journal     [ 1761.588788] EXT3-fs (sdd1): mounted filesystem with ordered data mode     [ 1797.015606] sd 6:0:0:0: rejecting I/O to offline device     [ 1797.015641] EXT3-fs error (device sdb3): ext3_get_inode_loc: unable to read inode block - inode=23560211, block=94240771     [ 1797.015652] journal commit I/O error     [ 1797.018883] sd 6:0:0:0: rejecting I/O to offline device     [ 1797.018938] EXT3-fs error (device sdb3): ext3_get_inode_loc: unable to read inode block - inode=23560249, block=94240773     [ 1797.020660] sd 6:0:0:0: rejecting I/O to offline device     [ 1797.020722] EXT3-fs error (device sdb3): ext3_get_inode_loc: unable to read inode block - inode=22208553, block=88834052     [ 1797.020735] journal commit I/O error     [ 1797.022350] sd 6:0:0:0: rejecting I/O to offline device     [ 1797.022399] EXT3-fs error (device sdb3): ext3_get_inode_loc: unable to read inode block - inode=1794049, block=7176194     [ 1797.022412] journal commit I/O error     [ 1797.024165] sd 6:0:0:0: rejecting I/O to offline device     [ 1797.024211] EXT3-fs error (device sdb3): ext3_get_inode_loc: unable to read inode block - inode=17481746, block=69926915     [ 1797.024223] journal commit I/O error     [ 1797.024475] sd 6:0:0:0: rejecting I/O to offline device     [ 1797.024524] EXT3-fs error (device sdb3): ext3_get_inode_loc: unable to read inode block - inode=17481747, block=69926915     [ 1797.024534] journal commit I/O error     [ 1797.025274] sd 6:0:0:0: rejecting I/O to offline device     [ 1797.025314] EXT3-fs error (device sdb3): ext3_get_inode_loc: unable to read inode block - inode=17080585, block=68321298     [ 1797.025324] journal commit I/O error     [ 1797.025509] sd 6:0:0:0: rejecting I/O to offline device     [ 1797.025544] EXT3-fs error (device sdb3): ext3_get_inode_loc: unable to read inode block - inode=17080589, block=68321298     [ 1797.025554] journal commit I/O error     [ 1797.026203] sd 6:0:0:0: rejecting I/O to offline device     [ 1797.026247] EXT3-fs error (device sdb3): ext3_get_inode_loc: unable to read inode block - inode=122881, block=491522     [ 1797.026260] journal commit I/O error     [ 1797.027246] sd 6:0:0:0: rejecting I/O to offline device     [ 1797.027295] EXT3-fs error (device sdb3): ext3_get_inode_loc: unable to read inode block - inode=7766017, block=31064066     [ 1797.032984] sd 6:0:0:0: rejecting I/O to offline device     [ 1797.033043] EXT3-fs error (device sdb3): ext3_get_inode_loc: unable to read inode block - inode=4170273, block=16678948     [ 1797.033382] sd 6:0:0:0: rejecting I/O to offline device     [ 1797.033427] EXT3-fs error (device sdb3): ext3_get_inode_loc: unable to read inode block - inode=4170274, block=16678948     [ 1797.038642] sd 6:0:0:0: rejecting I/O to offline device      This happened both when it was formatted as ext4 and now as ext3. I'm worried that something with the new kernel 3.2.0-4-amd64 might be causing it, because the hard drive was working fine before, and is still readable/writable from other computers. Do any of you have suggestions on what might be causing this, or how I can go about debugging this?


Why do wmaker icons shrink?

I find myself spending too much time getting the wmakers icons right. When I start an application from the commandline I get an Icon, which I can attach to the dock or the clip. Good. However, when the application is not running, the icon shrinks to about half the size. The tile keeps its original size (48x48) but the image in it gets smaller. This small image does not look good. I can work around this, by explicitly specifying an icon (rightClick -> settings). But it just takes too much time to browse through all the available icons (unless there is a fast way I am not aware of). I would be happy if wmaker just kept the icon it originally displayed. Seems like I do not fully understand, how wmaker can display an icon of a running application just fine, but sometimes requires configuration, when the application is not running. So why do wmaker icons shrink and what can be done to avoid spending too much time in getting the icons right?


how to share environment variables between shells like globals related to a master pid?

So, I need to share environment variables between shells, and that the changes on the variables be promptly recognized by all shells, like global variables. But they must be related to a master pid, so I can have 2 shell scripts running, each being a master with same global variable name, and it childs will only change the variable related to their master pid. I use bash for scripting. _My current researches are these:_ **Modules**   I read I could use modules project for that: http://modules.sourceforge.net/, but I am having huge trouble trying to do it, it seems to lack examples? also "modules" is a too generic word, very hard to google about because mixes with many other things... after some weeks my hands are still empty.. **Simple text source file**   I read also I should use a simple text file to store/update/read variables from, as a source script file, using `flock` too to avoid concurrent writing. But there are problems related to doing that, like concurrent change of variable simultaneously by 2 shells. **Alternatively**   I am aware that after a "global" variable is read by the shell, it will keep that value until another read is made; and another shell may change it in the mean while too...   May be a very fast external application could provide such storage and we would not try to use environment variables as globals then? but my guess is any sql solution will be too slow..


Checking if Apache requires SSL pass-phrase

I'm thinking about restarting a client's Apache server, but I'm reluctant to do so because I know he's currently running HTTPS and I don't want to get stuck with the server prompting me for the SSL Passphrase (which I don't have and he's not sure if there is one or not). Is there a quick/easy way to check whether Apache will require the SSL pass phrase **before** restarting it?


Problem on running Script on host after connecting

I am new to linux scripting. Please help. I searched on below a lot but was not able to find appropriate answer : I am trying to make a script which I will later schedule as cronjob, so that it keeps running on backend and stores results in a file say test.txt Main points of script are below : it connects to a host through ssh and then runs a few commands on that host and saves the results in a file.The script is connecting to host successfully but not running commands automatically on host. Script is as below :                   #!/usr/bin/expect -f          spawn ssh aspen          expect "password: "          send "PASSWORD\r"          expect "$ "          send "/bin/sh /home/target/Script.sh >>test.txt"          expect "$ "          send "exit\r"      But when I run this script it doesn't save complete output on test.txt Second thing is I want this output file on my own system not on host . Any help will be appreciable.


Migrate socat init script to systemd

I use socat with following init script on debian 7.2 with sysVinit. It works perfectly:               #!/bin/bash     DESC=socat     DAEMON=/usr/bin/socat     LIB=/usr/lib/socat     SOCAT_ARGS="-d -d -lf /var/log/socat.log"          [ ! -f /etc/default/socat.conf ] || . /etc/default/socat.conf          . /lib/lsb/init-functions          PATH=/bin:/usr/bin:/sbin:/usr/sbin          [ -x $DAEMON ] || exit 0          #     #       Try to increase the # of filedescriptors we can open.     #     maxfds () {             [ -n "$SOCAT_MAXFD" ] || return             [ -f /proc/sys/fs/file-max ] || return 0             [ $SOCAT_MAXFD -le 4096 ] || SQUID_MAXFD=4096             global_file_max=`cat /proc/sys/fs/file-max`             minimal_file_max=$(($SOCAT_MAXFD + 4096))             if [ "$global_file_max" -lt $minimal_file_max ]             then                     echo $minimal_file_max > /proc/sys/fs/file-max             fi             ulimit -n $SOCAT_MAXFD     }          start_socat() {             start-stop-daemon --quiet --start \                     --pidfile /var/run/socat.$NAME.pid \                     --background --make-pidfile \                     --exec $DAEMON -- $SOCAT_ARGS $ARGS < /dev/null     }          stop_socat() {             start-stop-daemon --stop --quiet --pidfile /var/run/socat.$NAME.pid --exec $DAEMON             rm -f /var/run/socat.$NAME.pid     }          start () {             echo "Starting $DESC:"                  maxfds             umask 027             cd /tmp             if test "x$AUTOSTART" = "xnone" -o -z "x$AUTOSTART" ; then                     echo "Autostart disabled."                     exit 0             fi             for NAME in $AUTOSTART ; do                     ARGS=`eval echo \\\$SOCAT_$NAME`                     echo $ARGS                     start_socat                     echo " $NAME $ARGS"             done             return $?     }          stop () {             echo -n "Stopping $DESC:"                  for PIDFILE in `ls /var/run/socat.*.pid 2> /dev/null`; do                     NAME=`echo $PIDFILE | cut -c16-`                     NAME=${NAME%%.pid}                     stop_socat                     echo -n " $NAME"             done     }          case "$1" in         start)             log_daemon_msg "Starting socat" "socat"             if start ; then                     log_end_msg $?             else                     log_end_msg $?             fi             ;;         stop)             log_daemon_msg "Stopping socat" "socat"             if stop ; then                     log_end_msg $?             else                     log_end_msg $?             fi             ;;         reload|force-reload|restart)             log_daemon_msg "Restarting socat" "socat"             stop             if start ; then                     log_end_msg $?             else                     log_end_msg $?             fi             ;;             *)             echo "Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart}"             exit 3             ;;     esac          exit 0      However after an upgrade to debian 7.4 the system changed to systemd. So to run the same script on systemd I added a service that wrappes the /etc/init.d/socat script:               [Unit]     Description=Socat          [Service]     ExecStart=/etc/init.d/socat start     ExecStop=/etc/init.d/socat stop          [Install]     WantedBy=multi-user.target      When I start the service it is started but stops directly: > Loaded: loaded (/usr/lib/systemd/system/socat.service; enabled)   >  Active: inactive (dead) since Fri, 18 Apr 2014 14:09:46 +0200; 4s ago > Process: 5334 ExecStart=/etc/init.d/socat start (code=exited, > status=0/SUCCESS) CGroup: name=systemd:/system/socat.service Am I missing something?


Clear unused space with zeros (ext3,ext4)

How to clear unused space with zeros ? (ext3,ext4) I'm looking for something smarter than               cat /dev/zero > /mnt/X/big_zero ; sync; rm /mnt/X/big_zero      Like FSArchiver is looking for "used space" and ignores unused, but opposite site. Purpose: I'd like to compress partition images, so filling unused space with zeros is highly recommended. Btw. For btrfs : Clear unused space with zeros (btrfs)


Check if a drive has been Zeroed with xxd and uniq?

I'm looking for a way to check if the entire binary contents of a USB device are purely 0s. I'm trying this command: `sudo xxd /dev/sdb | uniq` but it has no output and just runs forever. I've considered the Sort command, but my understanding is that it requires a file to read rather than just the standard terminal output. update: I realised I could check with `sudo xxd -a /dev/sdb`, but my question still stands: is there a way to uniquely sort output of the terminal without saving it to a file first?


Set terminal title within expect script

I use zsh as my shell, and I wrote an expect script to automate passing my password to ssh; it works perfectly, exept that the terminal window's title is set to the name of my script. I would like to set it to the name of the host I'm logging into, but haven't had any luck so far. I've tried, the following command within my expect script, but it doesn't work:               exec echo "\033]0;" $hostname "\007"      Any suggestions? Please do not suggest I setup ssh keys or that I download some other application to do this for me. I have my reasons for choosing this approach.


hunspell: add word to dictionary from command line

From hunspell man page:               ...         When in the -a mode, hunspell will also accept lines  of  single         words  prefixed  with  any of '*', '&', '@', '+', '-', '~', '#',         '!', '%', '`', or '^'.  A line starting with '*' tells  hunspell         to  insert the word into the user's dictionary (similar to the I         command).     ...      I tried something like: `echo "* my_word" | hunspell -a` but the word is not in my dictionary as parsing sample file again shows it as misspelled word How does this work, how can I add custom word?   Or with Aspell, or any "common" program that writes to compatible dictionaries read by Hunspell/Aspell?


Wiki for emacs users

I am looking for a new wiki software for a small private network. Since all users are very addicted to emacs, it would be nice to make everything "emacs compatible". What wiki software is most suitable for emacs users? In particular it should be possible to navigate in the wiki inside of emacs (follow links etc.) and have a good mode which supports the wiki syntax perfectly. It's also important to be able to save changes in emacs easily (perhaps even save changes before committing it to the wiki). The wiki software should also meet other requirements, so it woul be nice if you could give multiple suggestions for a good emacs integration.


Incoming Spam Mail to my mail id's in my website

I am getting lot's of incoming spam mail's to mail id's in my websites such as (info@domain.com, infouk@domain.com) mostly to info pages not to user's mail account. How to stop mail from such mail id's. I have exim mail server with `cpanel` and `whm` account.


phpcurl not able to install on terminal

I am not able to install packages `php` and `curl`. But its gives dependencies error, please check below               curl : Depends: libcurl3 (= 7.29.0-1ubuntu3.4) but 7.32.0-1ubuntu1 is to be installed     libcurl4-openssl-dev : Depends: libcurl3 (= 7.29.0-1ubuntu3.4) but 7.32.0-1ubuntu1 is to be installed                         Depends: libidn11-dev but it is not going to be installed                         Depends: libkrb5-dev but it is not going to be installed                         Depends: libldap2-dev but it is not going to be installed                         Depends: librtmp-dev but it is not going to be installed                         Depends: libssl-dev but it is not going to be installed                         Depends: zlib1g-dev but it is not going to be installed     E: Unable to correct problems, you have held broken packages.


What's wrong with this xargs command?

Consider the output:               % { echo one; echo two; echo three; } | xargs -I{} -L1 echo test-{}      test-{} one     test-{} two     test-{} three      Why doesn't `{}` get substituted as per the manual page (and my memory, too)? How to change the command line to get `test-one`, `test-two`, `test-three` lines as output?


VIM map not working

I'm trying to map `<c-y>,` (from zencoding-vim) to `<c-m>`. I tried:               map <C-m> <C-y>,     map <C-m> <C-y>,<cr>      But doesn't seems to be working. Maybe it's something with the comma?


rsync pattern copy: dotfiles

I followed the advice given in the question Rsync filter: copying one pattern only to setup a command line I need to backup only the dotfiles `.inF*` Yet with the command:               rsync -av --include='.inF*' --include='*/' --exclude='*' /0ale/ \        root@lambda2:/0ale/      I obtain that the directory structure gets mirrored, but no dotfile is copied. The same command with a test pattern               rsync -av --include='test*' --include='*/' --exclude='*' /0ale/ \         root@lambda2:/0ale/      correctly copies the `test1.txt` file so it is a problem with dotfiles only. Any hints?


What is the max partition supported in linux?

May i know the max partition size supported by an Linux system. And how much logical and primary Partition as we can create in an disk installed by linux system?


How to construct a read-only compressed modular filesystem

I am designing a Linux distro and was toying with the idea of creating pre- packaged compressed bits of the filesystem that are merged with a read-only file system, and from there stacked under a ramdisk via a UnionFS mount point. The bits would be like packages in a sense, except instead of being installed, they would be mounted as part of the filesystem in RAM and are read _directly_ from the read-only disk (vs. copied into memory). I was wondering how this might be done without creating a ton of mount points, copying more than is necessary into RAM, or creating a lot of overhead by stacking a whole bunch of tiny filesystems. ...or if it's even possible. I'm using UnionFS-FUSE and Cloop.


Hamachi for Web Surfing

I recently installed Hamachi on my FreeBSD 9 and I want to know how can I browse web anonymously by this software?


How to quickly create a local apt repository for random packages using a Debian based linux distribution?

Some situations call for manually installing a local package using `dpkg -i <packagename>`. Sometimes it may be further useful to leverage the functionality of `apt` with that package so the question is: How do you quickly create a local repository for random packages using a Debian based linux distribution - like Xubuntu 13.04/Ubuntu?


mysql database dump script adding fuctionality to skip dumped database

I'm using the following script to dump my database. it works great. I want to add functionality that it first checks if a database table is already dumped or not, if a dump exists then it should be skipped and move to the next table.               DB_host=127.0.0.1     DB_user=root     DB=mydb     DB_pass=mydbpassword     DIR=/          [ -n "$DIR" ] || DIR=.     test -d $DIR || mkdir -p $DIR          echo "Dumping tables into separate SQL command files for database '$DB' into dir=$DIR"          tbl_count=0          for t in $(mysql -NBA -h $DB_host -u $DB_user -p$DB_pass -D $DB -e 'show tables')     do         echo "DUMPING TABLE: $t"         mysqldump -h $DB_host -u $DB_user -p$DB_pass $DB $t  > $DIR/$t.sql         (( tbl_count++ ))     done          echo "$tbl_count tables dumped from database '$DB' into dir=$DIR"


Text file look-up by column

I have a file in this format:               [#]   OWNER_NAME     NAME                       SIZE     [6]   Robottinosino  Software                   200     [42]  Robottinosino  Ideas worth zero           188     [12]  Robottinosino  Ideas worth zero or more   111     [13]  I am Batman    Hardware                   180     [25]  Robottinosino  Profile Pictures           170      and I would like to be able to do the following using command line tools:               my_command "Ideas worth zero"      and get this result:               42      and not risk getting this result:               12      I have thought of using grep to identify the line, awk to get the 1st field but I am not sure how to reliably and efficiently match on the whole 'NAME' field short of counting at which column the text 'OWNER_NAME' and 'SIZE' appear in the header and get everything in-between with some whitespace trimming. Notice 'OWNER_NAME' could be more than one word: e.g. 'OWNER_NAME' = "I am Batman". Any ideas with accompanying implementation? What I have to go by here, is just the old family of cat, head, tail, awk, sed, grep, cut, etc.


Problem with booting using nosmp

I tried to install RHEL 5.1 in an i3 processor machine with 2gb ram. So after installation I tried to boot up, but unfortunately the machine got freezed showing `Starting udev.` I dont know exactly what the reason is. For finding that I rebooted with disabling the quite mode. I was not able to find any problems. I made a lot of googling and found a solution from a forum. `Boot using nosmp`. This worked well, but I just want to know that whether is it a good practise, and also will it make any problems. I will be running Oracle 11g in that particular machine. The machine will be a middleware which lies between the Data Centre and Main server for data synching purpose.


ssh tunnelling explanation

I have a question regarding ssh tunneling. I've read this article   * http://www.popcornfarmer.com/2009/01/ssh-tunneling-tutorial/ I would like to make X forwarding work and run some X applications at home and have them displayed on a remote system:                ssh -X -R 5555:localhost:22 user@remoteserver.com -N      On remote:                ssh -X -p 5555 user@192.168.1.2      Then on home:                //configure sshd to listen on 5555      ssh user@remoteserver.com      //here run some app      Should it work?


No permission on external drive

> **Possible Duplicate:**   >  can't change file permission On my hard drive everything is fine, but when I go onto my external drive I can't chmod. I get no error message but the changing simply doesn't take place. I have tested it and it works fine when I'm on my laptops hard drive. The same goes for creating symbolic links, I can create symbolic links on my hard drive but when I try to do it on my external drive I get: `failed to create symbolic link, Operation not permitted` What is the problem?


vim.googlecode.com SSL certificate change

I am building vim from source and keep having to update the SSL hostfingerprints of my `~/.hgrc` file. It's getting a little silly and large - see below. The pattern is the same: run update, find SSL finger print has changed, update fingerprint… Anyone knows of a simpler way to keep this updated?               ### openssl s_client -connect  vim.googlecode.com:443 < /dev/null 2>/dev/null | openssl x509 -fingerprint -noout -in /dev/stdin     [hostfingerprints]     vim.googlecode.com = CB:F1:C8:AC:28:D5:61:B7:C1:9C:73:7E:3A:B6:BB:E2:E6:55:95:2A      vim.googlecode.com = 52:BC:6F:6A:D5:86:38:B1:F5:FE:07:B3:A5:88:72:DC:EB:49:BF:5D     vim.googlecode.com = FD:02:92:B1:B3:32:27:F4:7B:40:3D:0A:CA:9E:DD:EE:22:17:52:02     vim.googlecode.com = F6:21:3F:1D:BA:DC:6A:0D:7C:AF:00:E4:C4:12:87:DC:1B:7C:1D:11     vim.googlecode.com = A0:60:E5:C3:DB:27:FB:31:B5:B2:D2:79:8E:24:4D:70:0E:E0:4B:EE     vim.googlecode.com = 65:A0:A7:8D:8F:48:EB:13:5C:81:3C:47:2D:6B:73:C4:7E:EA:61:5F


Find the total size of certain files within a directory branch

Assume there's an image storage directory, say, `./photos/john_doe`, within which there are multiple subdirectories, where many certain files reside (say, `*.jpg`). How can I calculate a summary size of those files below the `john_doe` branch? I tried `du -hs ./photos/john_doe/*/*.jpg`, but this shows individual files only. Also, this tracks only the first nest level of the `john_doe` directory, like `john_doe/june/`, but skips `john_doe/june/outrageous/`. So, how could I traverse the entire branch, summing up the size of the certain files?


**The developer says:http://comments.gmane.org/gmane.linux.real- time.rtnet.user/2546** > > > Now how can I tell the Makefile to look for headers in > /usr/local/rtnet/include respectively how could I set my CFLAGS? > > EXTRA_CFLAGS := -I ... > >> Sorry for that not really RTnet dependent question, but I couldn't find a Makefile-howto covering this question. > > Maybe this helps, though it a bit more complicated due to serving 2.4 and > 2.6 kernels: **So, I took the makefile from here:http://svn.gna.org/viewcvs/xenomai/trunk/examples/rtdm/driver-api/ and added `-I /usr/local/rtnet/include` corresponding to **EXTRA_CFLAGS****               ###### CONFIGURATION ######     ### List of applications to be build     APPLICATIONS = hello          ### Note: to override the search path for the xeno-config script, use "make XENO=..."               ### List of modules to be build     MODULES = hello          ### Note: to override the kernel source path, use "make KSRC=..."                    ###### USER SPACE BUILD (no change required normally) ######     ifeq ($(KERNELRELEASE),)     ifneq ($(APPLICATIONS),)          ### Default Xenomai installation path     XENO ?= /usr/xenomai          XENOCONFIG=$(shell PATH=$(XENO):$(XENO)/bin:$(PATH) which xeno-config 2>/dev/null)          ### Sanity check     ifeq ($(XENOCONFIG),)     all::     @echo ">>> Invoke make like this: \"make XENO=/path/to/xeno-config\" <<<"     @echo     endif               CC=$(shell $(XENOCONFIG) --cc)          CFLAGS=$(shell $(XENOCONFIG) --skin=native --cflags) $(MY_CFLAGS)          LDFLAGS=$(shell $(XENOCONFIG) --xeno-ldflags) $(MY_LDFLAGS) -lnative -lrtdm          # This includes the library path of given Xenomai into the binary to make live     # easier for beginners if Xenomai's libs are not in any default search path.     LDFLAGS+=-Xlinker -rpath -Xlinker $(shell $(XENOCONFIG) --libdir)          all:: $(APPLICATIONS)          clean::         $(RM) $(APPLICATIONS) *.o          endif     endif                    ###### KERNEL MODULE BUILD (no change required normally) ######     ifneq ($(MODULES),)          ### Default to sources of currently running kernel     KSRC ?= /lib/modules/$(shell uname -r)/build          OBJS := ${patsubst %, %.o, $(MODULES)}     CLEANMOD := ${patsubst %, .%*, $(MODULES)}     PWD := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)          ### Kernel 2.6     ifeq ($(findstring 2.6,$(KSRC)),2.6)          obj-m := $(OBJS)     EXTRA_CFLAGS := -I$(KSRC)/include/xenomai -I$(KSRC)/include/xenomai/posix $(ADD_CFLAGS) \     -I /usr/local/rtnet/include           all::         $(MAKE) -C $(KSRC) SUBDIRS=$(PWD) modules          ### Kernel 2.4     else          ARCH ?= $(shell uname -i)     INCLUDE := -I$(KSRC)/include/xenomai -I$(KSRC)/include/xenomai/compat -I$(KSRC)/include/xenomai/posix     CFLAGS += $(shell $(MAKE) -s -C $(KSRC) CC=$(CC) ARCH=$(ARCH) SUBDIRS=$(PWD) modules) $(INCLUDE)          all:: $(OBJS)          endif          ## Target for capturing 2.4 module CFLAGS     modules:         @echo "$(CFLAGS)"          clean::         $(RM) $(CLEANMOD) *.o *.ko *.mod.c Module*.symvers Module.markers modules.order         $(RM) -R .tmp*          endif      **Now, when I do make, I get the error:`error: implicit declaration of function ‘rt_dev_socket’` for the following `hello.c`.**               #include <stdio.h>     #include <signal.h>     #include <unistd.h>     #include <sys/mman.h>          #include <native/task.h>     #include <native/timer.h>          #include  <rtdk.h>          RT_TASK demo_task;          void demo(void *arg)     {       RT_TASK *curtask;       RT_TASK_INFO curtaskinfo;            printf("Hello World!\n");            curtask=rt_task_self();       rt_task_inquire(curtask,&curtaskinfo);            printf("Task name : %s \n", curtaskinfo.name);            ********int sockfd = rt_dev_socket(AF_INET, SOCK_DGRAM, 0);********     }          int main(int argc, char* argv[])     {       char  str[10] ;            rt_print_auto_init(1);            mlockall(MCL_CURRENT|MCL_FUTURE);            printf("start task\n");            sprintf(str,"hello");            rt_task_create(&demo_task, str, 0, 50, 0);            rt_task_start(&demo_task, &demo, 0);          }


Logical volume missing after reboot

Centos- 6, LVM2 after a system hang and hard reboot. `lvdisplay` and `lvscan` return no volumes. It had volumes earlier...how to recover? there is data on LV (logical volume) - shared as NFS export.. VG is listed under /etc/lvm/backup/datastore1. any ideas to restore the LV?               vgdisplay         -- Volume group --         VG Name               datastore1         System ID         Format                lvm2         Metadata Areas        1         Metadata Sequence No  1         VG Access             read/write         VG Status             resizable         MAX LV                0         Cur LV                0         Open LV               0         Max PV                0         Cur PV                1         Act PV                1         VG Size               10.92 TiB         PE Size               4.00 MiB         Total PE              2861467         Alloc PE / Size       0 / 0         Free  PE / Size       2861467 / 10.92 TiB         VG UUID               7uq001-dUxd-I1WS-PPu2-ljT3-FybY-D9ddx2 cat /etc/lvm/backup/datastore1 datastore1 { id = "7uq001-dUxd-I1WS-PPu2-ljT3-FybY-D9ddx2" seqno = 2 status = ["RESIZEABLE", "READ", "WRITE"] flags = [] extent_size = 8192 # 4 Megabytes max_lv = 0 max_pv = 0 metadata_copies = 0                   physical_volumes {                      pv0 {                         id = "kRGDrz-YFyf-EIKk-0om6-9H78-jgle-9z0B27"                         device = "/dev/cciss/c0d1p1"    # Hint only                              status = ["ALLOCATABLE"]                         flags = []                         dev_size = 23441142637  # 10.9156 Terabytes                         pe_start = 2048                         pe_count = 2861467      # 10.9156 Terabytes                 }         }      }


On Mac OS X, how to encrypt a small folder and copy that to Google Drive or DropBox?

On Mac OS X, right now I use the following to back up a small project folder to a USB Flash drive:               alias a='alias'     a dateseq='date "+%Y-%m-%d %H:%M:%S"'     a backup_proj='cp -a ~/code/MyProj "/Volumes/KINGSTON/MyProj `dateseq`"      so each time I type `backup_proj`, the folder is backed up from the hard drive to the USB drive, and each project is also internally version controlled using Git. Each folder is only about 500kb so it takes a long time to even fill up 1GB (the Flash Drive is 16GB). The folder is backed up as:               $ ls -1 /Volumes/KINGSTON/     MyProj 2012-05-27 08:20:50/     MyProj 2012-05-27 10:27:56/     MyProj 2012-05-27 14:53:01/      But I get paranoid and also want to back up to Google Drive or Dropbox so it will get uploaded to their server automatically, just by encrypting the whole folder and copying the single resulting file to Google Drive or DropBox's folder, and the password can be `apple234321pineapple` and specified on the command line. I wonder what is a good way to encrypt the folder into a single file so that it takes a non-practical time to crack? (can you please give the command line that will do it).


Execute remote programs and completely detaching it

I need to execute a remote application (named ConnectionManager), which uses the ncurses library, on the remote server launching it from a local pc. ConnectionManager is a program wich use ncurses and forks another process (itself) and waits for incoming tcp/ip connection. On a:               Distributor ID: ScientificSL     Description:    Scientific Linux SL release 5.5 (Boron)     Release:        5.5     Codename:       Boron     (Like Centos5.5)      I use this script:               #!/bin/bash     INFORMIXDIR=/opt/informix     INFORMIXSERVER=server1_on     ONCONFIG=onconfig.eda     PATH=$PATH:$INFORMIXDIR/bin     export INFORMIXDIR INFORMIXSERVER ONCONFIG PATH     echo $INFORMIXSERVER     echo $ONCONFIG     echo "Launch ConnectionManager"     export DISPLAY=:0.0 && xterm -e 'sudo -E /opt/informix/server /ConnectionManager'       and it all works. The previous script doesn't work on               Distributor ID: Scientific     Description:    Scientific Linux release 6.4 (Carbon)     Release:        6.4     Codename:       Carbon      The ConnectionManager doesn't allow an IP connection. I want to leave the ConnectionManager program running in a remote machine, also when I launch it from a local machine. What's wrong? I have tried `screen -d -m ./ConnectionManager`. The application works, but I don't see it on remote machine. I need to see the ConnectionManager within an xterm window. Is it possible that sudo is blocking ConnectionManager tcp/ip connections ? Update: When I use this command: sudo './ConnectionManager' I have immediately the following message: [1]+ Stopped sudo './ConnectionManager' I have check the code and the problem is the instruction `int setpgrp(void)` in ConnectionManager. Why ?


Curly Brace glob order?

If I have two files (in a folder with similarly numbered files) such as               foo.18     foo.19      And I want to use a glob on them, do I do it like so:               cp -r /folder1/*.{19,20} /folder2/      or like so?               cp -r /folder1/{*.19,*.20} /folder2/      Neither seem to expand out when I tap `tab`. Is one 'better than the other? What order does it expand in? Will it ever matter?


Trap, ERR, and echoing the error line

I'm trying to create some error reporting using a Trap to call a function on all errors:               Trap "_func" ERR      Is it possible to get what line the ERR signal was sent from? The shell is bash. If I do that, I can read and report what command was used and log/perform some actions. Or maybe I'm going at this all wrong? I tested with the following:               #!/bin/bash     trap "ECHO $LINENO" ERR          echo hello | grep "asdf"      And `$LINENO` is returning 2. Not working.


Is there a shell one-liner to convert JSON to BSON? Something suitable for one-off execution, or a shell script? `bsondump` from MongoDB goes the inverse way, but I'm clueless as to what I can use to go from JSON to BSON. There's no `bsonundump`, e.g.


Can I route through interface instead of IP?

I know I can route to another computer by setting its IP as the gateway. Can I also do this by just specifying the interface the packets should take. Like instead of doing `route add gw`, if I say `route add -net X dev interface`, it doesn't work.


Emacs: query-replace, regular expression, reuse of search result

How do I combine something like `query-replace` with a regular expression search-and-replace that in part reuses the search result? In my case, how to transform > The programmers are "sort of" confident that the subroutines "load_students" > and "compute_student_grade" are without bugs. into > The programmers are "sort of" confident that the subroutines > \texttt{load_students} and \texttt{compute_student_grade} are without bugs. I could use two `query-replace` and then hammer yes and no, but it seems sluggish for a big document. Also, I thought about including the whitespace in the searches (one ` "` and one `" `, but that would not work in cases such as `... that's not the way to use "load_students", rather ...` Is there built-in stuff for this or do you write Elisp code?


Run script after desktop loads

I'm running a script that changes files and installs things and what not on a SUSE computer. One of the scripts that gets run with my script, reboots the computer and when the computer loads back up again I want my script to continue where it left off. What I can't figure out is where to launch my script so that it will start **AFTER** the desktop has loaded back up (the SUSE computer is set to automatically log in as a specific user who isn't root). I want my script to run in this fashion because I want the user to be able to see an output log as to what is happening before another script later on reboots the computer again. **Edit:** Following the link given below: https://bbs.archlinux.org/viewtopic.php?id=130344 I found out that the directory that is supposed to be where you put scripts specifically for my question is /home/user/.kde4/Autostart. In my attempt to follow this I found that I do not have a .kde4 directory, but I do have a .kde directory. I decided this was probably the same thing and investigated finding that .kde does have Autostart. So I placed my script in there. This resulted in my script being opened by KWrite (just the basic text editor) when my desktop loads. But the script itself doesn't get run. I created a new directory, .kde4 with Autostart in it to place my script hoping that this would solve the problem. No luck, though, as my script doesn't even get opened in KWrite in this situation. **Edit2:** I changed the permission on my script `chmod 777 script` and now it starts up. It's in my home/user/.kde/Autostart directory.


Does a duplicate entries in a PATH variable revoke the precedence given by the first entry?

If I have a PATH variable that (when exploded onto multiple lines) contains something like this (with a few notes added by me):               /Users/brandon/.rvm/gems/ruby-2.0.0-p353/bin     /Users/brandon/.rvm/gems/ruby-2.0.0-p353@global/bin     /Users/brandon/.rvm/rubies/ruby-2.0.0-p353/bin     /opt/local/bin     /opt/local/sbin     /usr/local/sbin     /usr/local/bin   # <<--- notice this path appears again later     /usr/bin         # <<--- notice this comes AFTER /usr/local/bin     /bin     /usr/sbin     /sbin     /usr/local/bin   # <<--- here it is again!     /usr/local/git/bin     /Users/brandon/bin     /Users/brandon/.homebrew/bin     /usr/local/mysql/bin     /usr/local/share/npm/bin     /Applications/Postgres93.app/Contents/MacOS/bin     /Users/brandon/.rvm/bin      is it possible for the presence of the second `/usr/local/bin/` to cause the `/usr/bin` to take precedence over `/usr/local/bin`? This seems crazy (to me: I've never heard of such a thing) but that's exactly the behavior I'm seeing. I've just installed PHP with Homebrew, and yet the system PHP (from `/usr/bin`) is taking precedence:               $ which php     /usr/bin/php      _**BUT_** , after manually altering the PATH (rather than digging through all the files sourced by my `.zshrc` to try to figure out why & where the duplication is coming from) to remove the **_second_** instance of `/usr/local/bin`, I find that `/usr/local/bin` is taking precedence over `/usr/bin` as I would have expected it to in the first place:               $ which php     /usr/local/bin/php      What would cause this? Is this normal?


Dynamic password authentication

I would like to know how can I (and if it's possible) create a dynamic authentication for a user in linux. The server would change the user password periodically and the user would use a program (like a token) to retrieve and enter the correct password.


How to use my login password to do two things

I have a CIFS drive that I mount regularly, and it requires a password for it. Since it's annoying to type my password every time, I wrote a script that sets the PASSWD environment variable, mounts the drive, and then I clear it (CIFS checks the PASSWD environment variable before asking). It works, and the script with my password is on an encrypted partition, but I don't like it. What I would like to do instead is, since my box and the remote drive have the same plain-text password, the login manager use the password I type to try and mount the drive as well. That way my password isn't written in plain-text on my computer but I avoid having to answer yet-another-password. Other suggestions to improving the CIFS mount login are welcome, keeping in mind I don't have root access to the server hosting the drive. EDIT: I have to clear up somethings:   * I have root access to the client (my box), I just don't have access to the server. So all solutions must be client side.    * My concern is having a plain text copy of my password for anyone who gets physical access to my laptop. Currently my /home partition is encrypted so my script is fairly secure when the laptop is off.  This is why I'd like a solution, if possible, that uses the fact that I'm typing those exact credentials to log into my user account.


checking sendmail status as NON root user

I am in the process of converting to CentOS 6.5 from 5.5 and need a way to check if sendmail is on or not. For reasons I don't want to go through, I need to be able to check if sendmail is ON as a NON root user. In CentOS 5.5, I could use `/sbin/service sendmail status` running as a non root user. In CentOS 6.5, security is a bit tighter and new code was added to the `/etc/init.d/sendmail` script:               # Check that we're a privileged user     [ `id -u` = 0 ] || exit 4      The sendmail script uses the following code to check it's status:               status)        echo -n sendmail; status -p /var/run/sendmail.pid -l sendmail        RETVAL=$?        echo -n sm-client; status -p /var/run/sm-client.pid -l sm-client        [ $RETVAL -eq 0 ] && RETVAL=$?       ;;      In the beginning of the sendmail script the `functions` library is source so `status()` can be called in the `functions` script                # Source function library.     . /etc/rc.d/init.d/functions      As root, you would typically see this when running `/sbin/service sendmail status`:               sendmail (pid  1107) is running...     sm-client (pid  1115) is running...      When running as a NON root user I receive `return code 4` What I have tried so far is checking `/var/run/sendmail.pid` to get the process ID, then I check to see if there is there is and entry in `/proc` for the pid. For example, As a NON root user:               cat /var/run/sendmail.pid - Get the pid          1107     /usr/sbin/sendmail -bd -q3600s      Then I check `/proc/1107/status`:               Name:   sendmail     State:  S (sleeping)     Tgid:   1107     Pid:    1107     PPid:   1     TracerPid:      0     Uid:    0       0       0       0     Gid:    0       51      51      51     Utrace: 0     FDSize: 32     Groups: 51     VmPeak:    12844 kB     VmSize:    12840 kB     VmLck:         0 kB     VmHWM:      2020 kB     VmRSS:      2020 kB     VmData:     1176 kB     VmStk:       208 kB     VmExe:       824 kB     VmLib:     10156 kB     VmPTE:        44 kB     VmSwap:        0 kB     Threads:        1     SigQ:   0/3865     SigPnd: 0000000000000000     ShdPnd: 0000000000000000     SigBlk: 0000000000000000     SigIgn: 0000000000001006     SigCgt: 0000000180016201     CapInh: 0000000000000000     CapPrm: ffffffffffffffff     CapEff: ffffffffffffffff     CapBnd: ffffffffffffffff     Cpus_allowed:   1     Cpus_allowed_list:      0     Mems_allowed:   1     Mems_allowed_list:      0     voluntary_ctxt_switches:        560     nonvoluntary_ctxt_switches:     2      If `/proc/<pid>` doesn't exist, I know the service is not on.. This method seems to work, but I don't trust it completely and would rather use `/sbin/service sendmail status`. Any ideas on the best way to check if sendmail service is running as a NON root user??


How to switch text direction to rtl & ltr in kate and kwrite

How can I switch the text direction in kate and kwrite editors? I have English & Persian layouts and want to read the Persian text as right to left but I can't seem to be able to switch the text direction.


Save views in multiple screen terminals

As I do in default single view screen terminal of ubuntu;                gnome-terminal \       --tab-with-profile=Default --working-directory="some dir" --title="some title" \       --tab-with-profile=Default --working-directory="another dir" --title="title" \      I save above command in an executable file and open multiple terminals in single execution. But it opens default terminal only. Can I save screen with multiple views such that I can open all in a single click(if it can be bookmarked) or by running single command? **Multiview screen application for ubuntu** : terminal multiplexer (tmux), terminator, screen ...


Vintage terminal for Ubuntu

So I have just been introduced to Cathode for OSX and I am completely fascinated by how classic it looks with it's 1970s retro style. Does anyone know of any programs/packages I can download to get my terminal to sport that very look? If there are no packages available, is there are setting I can change on the Ubuntu 14.04 terminal? For those who are unaware of Cathode, I will post an image in reference to what I would like to have on my terminal: ![Cathode](http://i.stack.imgur.com/2DH6w.jpg) More information as to what Cathode does can be found on this link: Cathode Info


Some processes not remaining in jobs list

After a recent workspace reorganization, I am left with a question about the way certain processes interact with the output of `jobs`. I am running all of my program in the background on one 'Main' terminal, that way I have control and information from them all neatly in one place. what I have noticed is that when I create instances of some programs in the background, they continue running yet I get notification almost instantly in the console that they have ended. Programs I have noticed this on are:   * Firefox (only on the 2nd, or higher, instance)   * gnome-terminal (may only be on second, since I already have one open when I try this)   * nautilus (on first instance) While I can understand the firefox issue, since combining the processes under one parent could make performance/memory sense, I don't understand why a program like nautilus appears to be unable to exist on the `jobs` list for any amount of time, even though the window remains open and the program remains entirely functional.


mount options shown in /proc/mounts

IIRC then the mount options shown in `/proc/mounts` have changed. Some time ago `acl` and `user_xattr` were shown, now it seems that only `noacl` and `nouser_xattr` are shown if these features are turned off. Where is this configured? Does that depend on the compiled-in defaults of the filesystem code? How can I check whether a volume supports e.g. ACL? Is there a better solution than testing with `setfacl`, `getfacl`?


Certificate extensions in generating and signing certificartes using openssl

References:   1. SSL Configurations for Intermediate certificate   2. How to add my own created certificate authority to system trusted repositories Why I can't find a page which tell me what's the kind of openssl extensions?! I was doing Mutual Authentication and then when I wanted to put an intermediate certificate in the process I discovered that the generated and signed intermediate `CA` is self-signed because of the option `-sign-key`. I read the man pages and found this relevant: > **Basic Constraints.** This is a multi valued extension which indicates > whether a certificate is a CA certificate. For example: >   >   >         basicConstraints=CA:TRUE >         basicConstraints=CA:FALSE >   > > **Key Usage :** Key usage is a multi valued extension consisting of a list > of names of the permitted key usages. The supported names are: >   >   >        digitalSignature, nonRepudiation, keyEncipherment, >        dataEncipherment, keyAgreement, keyCertSign, cRLSign, >        encipherOnly and decipherOnly. >   > > **Examples:** >   >   >         keyUsage=digitalSignature, nonRepudiation >         keyUsage=critical, keyCertSign >   I have seen a `critical` and non critical in the browser certificate view. My certificates don't have those fields. I also read that when there's no extension, that means your certificate is considered as root and self-signed certificate. I want to make four different kinds of certificates: > rootca > serverca > server crt signed by server ca && client crt signed by > server ca In documentation I came across these: > v3_ca , v3_user , v3_ca Are those the answer of my question? My commands to generate _intermediate ca_ and sign it with `rootca` key are:               openssl genrsa -out $keyfile $keysize;          openssl req -new -key $keyfile -out $reqfile -passin pass:$pw \     -subj "/C=$country/ST=$state/L=$location/O=$org/CN=$name" 2>&1;          openssl x509 -req -days $days -in $reqfile -out $certfile \     -signkey $cakeyfile 2>&1;      P.s: I don't use a configuration file because I'm running all of this operations from a bash script. I wonder if anyone can give me an explanation of the extension and if could put them as arguments and not getting them from bash (because it will need to open the bash script and edit it for every call to my bash).


USB-Serial Driver(Exar Xr21v1414) Run Error

I'm currently trying to run the bellow driver in linux-3.8.3 on Exar xr21v1414 http://www.exar.com/connectivity/uart-and-bridging-solutions/usb- uarts/xr21v1410, but when i install the driver vizzini.ko, it arise the follow error:               [  162.650000] usbserial: USB Serial support registered for Vizzini USB serial port     [  162.650000] vizzini 1-1.4:1.0: Vizzini USB serial port converter detected     [  162.660000] usb 1-1.4: Vizzini USB serial port converter now attached to ttyUSB0     [  162.670000] vizzini 1-1.4:1.1: Zero length descriptor references     [  162.670000] vizzini: probe of 1-1.4:1.1 failed with error -22     [  162.680000] vizzini 1-1.4:1.2: Vizzini USB serial port converter detected     [  162.690000] usb 1-1.4: Vizzini USB serial port converter now attached to ttyUSB1     [  162.690000] vizzini 1-1.4:1.3: Zero length descriptor references     [  162.700000] vizzini: probe of 1-1.4:1.3 failed with error -22     [  162.710000] vizzini 1-1.4:1.4: Vizzini USB serial port converter detected     [  162.710000] usb 1-1.4: Vizzini USB serial port converter now attached to ttyUSB2     [  162.720000] vizzini 1-1.4:1.5: Zero length descriptor references     [  162.730000] vizzini: probe of 1-1.4:1.5 failed with error -22     [  162.730000] vizzini 1-1.4:1.6: Vizzini USB serial port converter detected     [  162.740000] usb 1-1.4: Vizzini USB serial port converter now attached to ttyUSB3     [  162.750000] vizzini 1-1.4:1.7: Zero length descriptor references     [  162.750000] vizzini: probe of 1-1.4:1.7 failed with error -22      I would greatly appreciate any help in resolving the errors.


text color settings in emacs

I just switched to emacs from Vim today so I have no idea what I am doing. How do I change the syntax coloring in Emacs? Everything is green or light green. As you can see, latex tex is dark green and regular text is green. ![enter image description here](http://i.stack.imgur.com/AQm4K.png)


Creating a private network for internal VMs

I am trying to configure a private network for use with my Xen VMs, in addition to the public network in use by another of the VMs (VM1, which has its own public IP). So far, I have the public side working perfectly with a bridged network... On the host machine:               eth0: 91.x.x.1, gateway: 91.x.x.254     xenbr0: bridged with eth0     VM1 connected to xenbr0, with a new IP address, 91.x.x.2, and gateway 91.x.x.254      On the host machine, I've also created a private dummy ethernet port:               dummy0: 192.168.1.1      and a bridge via XenServer, pdummy0 (using these instructions http://tipstricks.itmatrix.eu/?p=681) Everything's working there, as well - the two VMs connected to the bridge can ping each other, as well as the host machine via the private 192.168.1.1 IP.               VM2: 192.168.1.2     VM3: 192.168.1.3      The last step here, is to have each of those VMs (VM2 & VM3) to be able to see the internet... What routes / IP forwarding do I need to set up to make that happen? Sample route from VM2, /sbin/route:               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     192.168.1.0   *               255.255.255.0   U     0      0        0 eth0


How much RAM is there?

I'm trying to estimate how effective the zram kernel module is in case of my PC. I have a pretty old machine (7y) with the only 1 GiB of RAM. I created two zram swaps (two core processor), 250MiB each, and everything seems to be working:               # swapon -s     Filename                                Type            Size    Used    Priority     /dev/mapper/debian_crypt-swap           partition       2097148 0       10     /dev/zram0                              partition       255996  203404  70     /dev/zram1                              partition       255996  203284  70      I found a script zraminfo which can calculate the compression ratio:               # ./zraminfo.sh     Physical memory:      1,049,821,184 bytes     Buffers and cache:      116,097,024 bytes / 11.1% of total memory     Unallocated:             81,043,456 bytes /  7.7% of total memory     Compressed:             121,118,720 bytes / 11.5% of total memory     Uncompressed size:      346,472,448 bytes / 2.861 compression ratio      So, after decompressing 121M, I will get +200M extra. But one thing, why is there 200M in each zram device? Shouldn't be there 2*200M compressed data, and 1,2G uncompressed?


emacs line wrapping and numbering

How can I tell emacs to wrap lines at the 80th character? I am looking for a solution I can put in `/.emacs`. I put this in `/.emacs` but it doesn't work.               ;; ========== Enable Line Numbering ==========                                                   (line-number-mode 1)          ;; ========== Set the fill column ==========                                                     (setq-default fill-column 80)


wireless interface stops working, netcfg reports no network found

I'm having a recurrent issue with my Arch Linux installation: wireless will work for a few minutes and then randomly die. When I try to restart it through wifi-menu I am informed there aren't any networks.                > sudo wifi-menu     :: Scanning for networks                                                [FAILED]       > No networks found      Running netcfg directly, I recive:               sudo netcfg wlan0-2WIRE555     :: wlan0-2WIRE555 up                  [ BUSY ] Successfully initialized wpa_supplicant     Could not set interface wlan0 flags (UP): Connection timed out     nl80211: Could not set interface 'wlan0' UP     Could not set interface wlan0 flags (UP): Connection timed out     WEXT: Could not set interface 'wlan0' UP     wlan0: Failed to initialize driver interface     > wpa_supplicant did not start, possible configuration error      The output of `lspci` is:               ~ > lspci     00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 02)     00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02)     00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06)     00:19.0 Ethernet controller: Intel Corporation 82577LM Gigabit Network Connection (rev 06)     00:1a.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)     00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06)     00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 06)     00:1c.3 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 4 (rev 06)     00:1c.4 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 5 (rev 06)     00:1d.0 USB controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)     00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev a6)     00:1f.0 ISA bridge: Intel Corporation Mobile 5 Series Chipset LPC Interface Controller (rev 06)     00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 6 port SATA AHCI Controller (rev 06)     00:1f.3 SMBus: Intel Corporation 5 Series/3400 Series Chipset SMBus Controller (rev 06)     00:1f.6 Signal processing controller: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem (rev 06)     02:00.0 Network controller: Intel Corporation Centrino Advanced-N 6200 (rev ff)     ff:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers (rev 02)     ff:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture System Address Decoder (rev 02)     ff:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 02)     ff:02.1 Host bridge: Intel Corporation Core Processor QPI Physical 0 (rev 02)     ff:02.2 Host bridge: Intel Corporation Core Processor Reserved (rev 02)     ff:02.3 Host bridge: Intel Corporation Core Processor Reserved (rev 02)      Every time this happens, I have to restart in order to get internet working. Is there some systemd command I can use to restart it manually? Is this an issue I can resolve permanently?


Program similar to xcalib to invert desktop colors

I'm using `xcalib` to invert colors on my computer at home. I have two monitors at work, and unfortunately the `xcalib -i -a` inverts only one of them (the one I don't want to invert). I haven't found any solutions for this issue so I'm looking for a replacement for `xcalib`. The goal is to be able invert only selected monitor's colors or both at the same time. By the way I'm using Mint 13 Mate. Update: The computer is Dell Optiplex 990 with integrated Intel card.               lspci -k | grep VGA          00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)      Data from `xrandr`:               Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 8192 x 8192     VGA1 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 477mm x 268mm        1920x1080      60.0*+        1680x1050      60.0          1600x900       60.0          1280x1024      75.0     60.0          1440x900       59.9          1280x800       59.8          1152x864       75.0          1280x720       60.0          1024x768       75.1     70.1     60.0          832x624        74.6          800x600        72.2     75.0     60.3     56.2          640x480        72.8     75.0     66.7     60.0          720x400        70.1       HDMI1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm        1920x1080      60.0*+   50.0          1680x1050      60.0          1600x900       60.0          1280x1024      75.0     60.0          1440x900       59.9          1280x800       59.8          1152x864       75.0          1280x720       50.0     60.0          1024x768       75.1     70.1     60.0          832x624        74.6          800x600        72.2     75.0     60.3     56.2          720x576        50.0          720x480        59.9          640x480        72.8     75.0     66.7     60.0          720x400        70.1       DP1 disconnected (normal left inverted right x axis y axis)


Missing init.d/apache2 file

I am new to linux and just recently messed up my first apache/tomcat configuration. After trying to delete apache and tomcat, and now trying to reinstall apache 2, I am missing the `init.d/apache2` file to start/stop my server. I am not sure if the new install actualy worked, and my `apt-get purge apache2` didn't remove everything in the first place! How can I get the `init.d/apache2` file to test if server starts / is installed properly (I had removed files and directories manually)?


Why does this password fail AIX and Solaris rules

Had to reset my password on a couple of client servers today, and despite following the rules I get the message "Your password failed to meet: minimum of 2 non-alphabetic characters" back from the AIX server (the Solaris box doesn't give error messages so just keeps prompting for new password) The passwords I have tried include things like arstdyfu12445!! so I'm definitely including non-alphabetic characters.


How to show the number of installed packages

What is the Debian equivalent of Fedora's `yum list installed | grep wc --lines`?


How to remove all the files in a directory?

I am trying to remove all files and subdirectories in a directory. I used `rm -r` to remove all files, but I want to remove all files _and_ subdirectories, excluding the top directory itself. For example, I have a top directory like `images`. It contains the files `header.png`, `footer.png` and a subdirectory. Now I want to delete `header.png`, `footer.png` and the subdirectory, but not `images`. How can I do this in linux?


How to get vodafone mobile connect (or equivalent) working reliably on debian squeeze

I got a Vodafone K3760 at some point in Debian/Lenny's lifetime, for use with a Lenovo S10e. I installed (from the Vodafone BetaVine site) usb-modeswitch 0.97 and vodafone-mobile-connect (VMC) 2.10.01-1 (or maybe it was actually vodafone-mobile-connect_svn20090615) and it all worked pretty well. After the squeeze update I have had less luck. Unlike lenny, squeeze includes usb_modeswitch 1.1.4-2, and I also grabbed vodafone-mobile-connect 2.25.01. It does actually work... for a few minutes, then the system locks up (or sometimes the gnome panel dies, but xterms on-screen continue to work). Anyone know what magic combinations of packages, if any, will work reliably with Squeeze ? (The obvious next thing for me to try is to revert the relevant packages to their older versions; VMC does have quite a lot of dependencies though so I'm not too sure how well this will work). There's another school of thought which says forget about vodafone's app and just use the new Gnome network manager's mobile broadband support. I haven't tried this yet, but I kind of like the vodafone app (for it's usage monitoring, and for it's access to SMS messages on the K3760; these are pretty important if you travel abroad and want to see what outrageous charges you'll be stung for if you dare connect). But if Gnome or other apps provide such functionality, I'd happily drop the Vodafone software. Thanks for any advice Just to be clear: the system is rock solid when using wired or built-in wifi connection. Inserting the dongle seems to be pretty safe; the problems start once connected. **Update 1:** I couldn't revert to the older vodafone mobile connect because of various python dependencies not in squeeze. Reverting to the older usb_modeswitch seems to be possible, but at least this once I got a spew of kernel bug notifications (alas, these don't seem to submit anything useful: example) and got about 30mins uptime before a lockup. I'm not too sure what to make of dmesg (have got some saved); there are clearly some call stacks into serio_interrupt in i8042_interrupt in ...a pile of handle IRQ functions ... but there are other ones too. **Update 2:** I managed to get a dmesg log of some kernel errors from the "all-squeeze" version (not using any modules from the older setup) before lockup. This can be found here; no idea how to interpret it myself.


How to install some packages from "unstable" Debian on a computer running "stable" Debian?

On a computer running "stable" Debian, when trying to install a package which is in the unstable list on the Debian web site using the `aptitude install <package>/unstable` command, I get output similar to this:               Couldn't find any package whose name or description matched "<package>"     Couldn't find any package whose name or description matched "<package>"     No packages will be installed, upgraded, or removed.     0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     Need to get 0 B of archives. After unpacking 0 B will be used.      What can I do to be able to install "unstable" packages? (I thought of adding the repository to `sources.list`, but I don't want everything to start being installed from "unstable"). So: how can I install unstable packages (with using `/stable` at the end of the package name)?


awk a specific column with unexpected line break

I can't seem to find a solution for this and it's driving me crazy. I know I can use `awk` to print a column(s). I'm having trouble printing a specific column though because of the way my file system is arranged. This is what I have when I run `df`:               Filesystem           1K-blocks      Used Available Use% Mounted on     /dev/mapper/vg_root-root                           36623968   4484592  30278976  13% /     tmpfs                   961312         0    961312   0% /dev/shm     /dev/sda1               516040    102896    386932  22% /boot      If I `awk` for the 1K-blocks column it returns values from other columns because of the length of the filesystem location. Basically this happens:               1K-blocks          4484596     961312     516040      **How can I list the right column info?**


How do I edit an Audio CDs Artist and Title in Dolphin?

I am running a mostly fresh install of Fedora 14 KDE spin. I installed lame from rpmfusion to get mp3 support in Dolphin, but the CD I put in comes up with the wrong information. This isn't surprising since it is an independent release of a band I like, and is probably not in the CDDB. I am sure this is easy, but I dont know how to correct the information. I cannot open the virtual 'CDDB Information.txt' and right-click doesn't get me anywhere. Is there a package that needs to be there that I may have not installed yet?


Possible issues with SSD SATA3 drive

While investigating the issue with my SATA3 SSD drive being recognized as SATA2 (for some reason had to change SATA ports to fix it) I noticed the following messages when I run:               $ dmesg | grep ata3.00     [    0.980592] ata3.00: ACPI cmd ef/10:06:00:00:00:00 (SET FEATURES) succeeded     [    0.980594] ata3.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out     [    0.980596] ata3.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE CONFIGURATION OVERLAY) filtered out     [    0.980712] ata3.00: supports DRM functions and may not be fully accessible     [    0.980795] ata3.00: failed to get NCQ Send/Recv Log Emask 0x1     [    0.980797] ata3.00: ATA-9: SAMSUNG MZ7PD128HAFV-000H7, XXXXXXX, max UDMA/133     [    0.980798] ata3.00: 250069680 sectors, multi 1: LBA48 NCQ (depth 31/32), AA     [    0.981070] ata3.00: ACPI cmd ef/10:06:00:00:00:00 (SET FEATURES) succeeded     [    0.981072] ata3.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out     [    0.981073] ata3.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE CONFIGURATION OVERLAY) filtered out     [    0.981174] ata3.00: supports DRM functions and may not be fully accessible     [    0.981225] ata3.00: failed to get NCQ Send/Recv Log Emask 0x1     [    0.981227] ata3.00: configured for UDMA/133      My architecture:               $ uname     3.13.8-1-ARCH      My concern is the line where it says that system **failed to get NCQ Send/Recv Log Emask 0x1** Is this something I need to be concerned with? My system is Asrock Extreme4 mb with SAMSUNG MZ7PD128HAFV-000H7 SSD SATA3 drive on Arch Linux OS. **Update 1** I run SysLinux on my machine and below is the output of the same command (no failure messages):               root@sysresccd /root % dmesg | grep ata3     [    1.166153] ata3: SATA max UDMA/133 abar m2048@0xf0336000 port 0xf0336200 irq 42     [    1.470696] ata3: SATA link up 6.0 Gbps (SStatus 133 SControl 300)     [    1.471504] ata3.00: ACPI cmd ef/10:06:00:00:00:00 (SET FEATURES) succeeded     [    1.471507] ata3.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out     [    1.471710] ata3.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE CONFIGURATION OVERLAY) filtered out     [    1.472032] ata3.00: supports DRM functions and may not be fully accessible     [    1.472166] ata3.00: ATA-9: SAMSUNG MZ7PD128HAFV-000H7, SN, max UDMA/133     [    1.472359] ata3.00: 250069680 sectors, multi 1: LBA48 NCQ (depth 31/32), AA     [    1.472760] ata3.00: ACPI cmd ef/10:06:00:00:00:00 (SET FEATURES) succeeded     [    1.472761] ata3.00: ACPI cmd f5/00:00:00:00:00:00 (SECURITY FREEZE LOCK) filtered out     [    1.472762] ata3.00: ACPI cmd b1/c1:00:00:00:00:00 (DEVICE CONFIGURATION OVERLAY) filtered out     [    1.472920] ata3.00: supports DRM functions and may not be fully accessible     [    1.472946] ata3.00: configured for UDMA/133      I compared SATA power profiles on both OSes under `/sys/class/scsi_host/host(0-7)` and they set to **max_performance**. What else can I check on both OSes and configure Arch so that this failure message would go away? **Update 2** Looks like this issue only appears in newer kernels... I tried with Ubuntu Live CD 12.04, 13.10, and 14.04: I was able to see this issue in 14.04 but not in other 2 versions. I then run diff for the kernel config files but I can't figure out the exact change that affects me... Ubuntu 13.10 kernel config file Ubuntu 14.04 kernel config file


rsync from Mac ext hd to VPS works but not VPS to Mac

There are no errors with either `rsync -a /Volumes/hd/dir_foo foo@foo.com:~/` or `rsync -a foo@foo.com:~/dir_foo /Volumes/hd/dir_foo` in the first instance the synced folder on remote system CentOs successfully transfers. However, going the opposite way terminal just lists the contents but on Mac ext HD there is no folder or contents moved there. Practising rsync before attempting to save VPS to my local ext drive. This Is what it prints in terminal                  MyName-iMac:VPSbackups myname$ rsync -a root@mysite.net:~/testingrsync/test2.flv        root@mysite.net's password:         -rw-r--r--   661072538 2014/04/04 14:09:50 test2.flv      Is it because I have to declare the path of local folder not simply reside in it at command?


User permissions inside and outside of LXC containers?

I'm running some services inside of Docker LXC containers on my server and I'm beginning to actually do serious things with them. One thing I'm not clear on is how user permissions work inside and outside of the container. If, for example, I'm running MySQL in a container and have its data directory set to `/data`, which is a Docker volume, how do permissions inside and outside of the container affect access policies? Obviously, the idea is to run MySQL as its own user in the container (ie `mysql:mysql`) and give it read and write rights to that directory. I assume that this would be fairly straightforward, just `chmod`ing the directory, etc. But how does this work _outside_ of the container? Now that I have this Docker shared volume called 'data,' how do I manage access control to it? I'm specifically looking to be able to run an unprivileged user _outside_ of the Docker container which will periodically access the MySQL shared volume and backup the data. How can I setup permissions, users, and groups so that a specific user on the host can read/write files and folders in the Docker shared volume?


Difference between "eval" and "source /dev/stdin"

What is the difference between `eval` and `source /dev/stdin`? For example, we can run a list of commands in various ways like this.   1. with `eval`.              comd="ls"     eval "$comd"        2. with `source /dev/stdin`              printf "ls" | source /dev/stdin        3. with `source /dev/stdin` and `( )` or `{ }`              ( printf "ls" ) | source /dev/stdin     { printf "ls"; } | source /dev/stdin      (When we run `printf` in `{ }`, is there any benefit other than not using subshell?) **EDIT 1.** My question is,   1. What is the difference between the ways?   2. Which is more preferred?   3. If we run some commands in `()` or `{}`, which is more preferred?


Centralized logs for tomcat logs

We have 20 centos server and on each server we have 5 tomcats running. All time developer comes for logs so we are planning to keep all tomcat logs one URL so that Developer comes to that URL and check tomcat logs from there is there any way to check all server tomcat logs means catalina.out log from server or on URL


How can the Debian DVD .iso file be used to install software without a CD Drive or the Internet?

**Question Background:**   1. I donot have a CD-Drive   2. I downloaded Debian DVD Wheezy 64 Bit   3. Installed Basic Utilities + Desktop by usb boot   4. NOW I want to install more software **Problem:** `apt-get install vlc` It says insert dvd in DVD drive which i donot have. I mounted the iso file but didnot work. **I donot want use internet to download the software**. **Question:** How the iso file can be used to install software with out CD Drive & Internet???


/etc/init.d/ script starts during loads and crash the system

I have centos 6.4 machine. I created my own script using /etc/init.d/ . Below is the snippet which I took from the net and tried it. The problem now I notice which loading my os when this is loaded it start to work and it cant move to load all the whole os any more. What can I do as I cant access the system now.               #!/bin/bash     # chkconfig: 2345 95 05     # myapp daemon     # description: myapp daemon     # processname: myapp          DAEMON_PATH="/usr/local/bin/"     DAEMON=myap1.c     #DAEMONOPTS="-my opts"     NAME=myap1.c     DESC="my packet capture"          PIDFILE=/var/run/$NAME.pid     SCRIPTNAME=/etc/init.d/$NAME          case "$1" in     start)         printf "%-50s" "Starting $NAME..."         insmod /usr/local/pfring/kernel/pf_ring.ko         /usr/local/bin/myap1.c         #cd $DAEMON_PATH         #PID=`$DAEMON > /dev/null 2>&1 & echo $!`         #echo "Saving PID" $PID " to " $PIDFILE         #    if [ -z $PID ]; then         #        printf "%s\n" "Fail"         #    else         #        echo $PID > $PIDFILE         #        printf "%s\n" "Ok"         #    fi     ;;     status)             printf "%-50s" "Checking $NAME..."             if [ -f $PIDFILE ]; then                 PID=`cat $PIDFILE`                 if [ -z "`ps axf | grep ${PID} | grep -v grep`" ]; then                     printf "%s\n" "Process dead but pidfile exists"                 else                     echo "Running"                 fi             else                 printf "%s\n" "Service not running"             fi     ;;     stop)             printf "%-50s" "Stopping $NAME"                 PID=`cat $PIDFILE`                 cd $DAEMON_PATH             if [ -f $PIDFILE ]; then                 kill -HUP $PID                 printf "%s\n" "Ok"                 rm -f $PIDFILE             else                 printf "%s\n" "pidfile not found"             fi     ;;     restart)         $0 stop         $0 start      ;;     *)             echo "Usage: $0 {status|start|stop|restart}"             exit 1     esac


What are the advantages of the Unix file system structure

If I install an application in Linux for example Debian/Gnu Linux, the files of the applications are copied to many different directories in the file system. Some scripts goes into _/usr/share_ .. _/usr/local_ some other files into _/var_ .. _/log_ .. _etc/_ and so on. For me this is o.k because I learned something about the file system and most of the directories are there to hold files for a specific purpose. This fits very nice in the Unix philosophy "do one thing and do it well" But my question is **what are the advantages of such a directory structure?** Or is it simply the heritage of the old unix days. (e.g in comparison with the one windows use, where all files for an application are in one specific "folder")


Rm can't delete file

chmod 777  -R  /mnt       rm -rf /mnt/*            rm: cannot remove 'omitted': Read-only file system       rm: cannot remove 'omitted': Read-only file system        Please show me how I can do this?


Invoke git without loading user gitconfig

A git-interfaced tool written in Python breaks because of some settings in my local `~/.gitconfig`, namely `diff.noprefix=True`. I know that I can use something like `git -c diff.noprefix=False diff` in the call but I fear other things will break in other parts of the tool or on other setups. I have been looking for a `\--norc` or `-c /dev/null` parameter but didn't find my way in the documentation.


How to find the best monitor resolution and put it to work? Fedora

In this question I'm asking how to install a compatible driver to a Fedora machine, but, the main problem is a bad resolution. So, how can I find the best resolution to my monitor and put it to work? Please answer me with a complete solution or a successfully tutorial. Some system info is:               $ lspci | grep VGA     00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)          $ cat /etc/issue     Fedora release 17 (Beefy Miracle)     Kernel \r on an \m (\l)          $xandr      xrandr: Failed to get size of gamma for output default Screen 0: minimum 640 x 480, current 1280 x 1024, maximum 1280 x 1024 default connected 1280x1024+0+0 0mm x 0mm 1280x1024 76.0* 1024x768 76.0 800x600 73.0 640x480 73.0      **Edit** Looks like the main problema now is this output: **xrandr: Failed to get size of gamma for output default** Everything I try stops at this problem with the gamma. How can I solve this?


How to start a script file on boot?

I am running a stupid little minecraft server. I want Lubuntu to execute the following script when the server boots up. NOT on login, and NOT on restart (unless it's starting up of course). The script is currently located in:               /home/mc/server/craftbukkit.sh      I can manually launch the script by just going into the dir and typing `./craftbukkit.sh`. But I want to fire off the script when the machine boots.


Resetting password in Linux Mint when disk is encrypted

I have a system (VM, actually) with Linux Mint 15 on it. The disk is encrypted, but I remember that password -- just not the password for my account. I've tried changing the command in GRUB from `ro` to `rw init=/bin/bash`, per guides online, but that doesn't seem to play nicely with the disk encryption. Is there a way to decrypt the disk, then drop straight to a root prompt (in order to use `passwd`)?


Shell: Break both if and for loop at once. My script: ip to name resolve code               IP=192.168.27.191     hostNameChecker()     {         if [ `getent hosts $1 | wc -l` -ne 0 ];then             HOST_NAME=`hostname`             DNS_IP=`getent hosts $1 | cut -d " " -f 1 | sed 's/^[ \t]*//;s/[ \t]*$//'`             DNS_NAMES=`getent hosts $1 | cut -d " " -f 2- | sed 's/^[ \t]*//;s/[ \t]*$//'`             for DNS_NAME in ${DNS_NAMES[@]}              do                 if [[ "$DNS_NAME" == "$HOST_NAME" ]];then                         echo "Host name:$HOST_NAME and DNS_NAME:$DNS_NAME matched"                         break 2;########Not working. only brakes inner for not outer if                      else                         continue;                     fi             done                 echo "ERROR: Mismatch between DNS:$DNS_NAMES and Hostname:$HOST_NAME"                 exit 0           fi     }     hostNameChecker $IP      In the above script **break 2** only breaks inner for not outer if. I can add another if to solve it but is there any other possible way ???


apt-get script to update upgrade dist-upgrade clean and autoremove

I wrote this script,               #!/bin/bash     # if not root, run as root     if (( $EUID != 0 )); then         sudo /home/jb/bash/update.sh         exit     fi     apt-get update     apt-get -y upgrade     apt-get -y dist-upgrade     apt-get clean     apt-get -y autoremove      the goal being to have a one-stop-shop for updating everything and removing any unnecessary packages. Is the above sufficient? Is there anything redundant or unnecessary about it? Any dangers/cautions that need to be considered? Other (fill in the blank)? Edit: If I only use the built in Ubuntu 12.04 Update Manager, do things get cleaned and autoremoved?


Is `UDIF read/write image` bootable on non-Apple hardware?

Some guides on the internet suggest that it is possible to convert ISO disc image files (`.iso`) into an non-.iso image format (`.img` or `.dmg`) with `hdiutil` on OS X. However, the manual page for `hdiutil` says that it basically only supports conversion into several `UDIF` formats. Are images in the `UDIF` format bootable on non-Apple hardware? Wikipedia claims that UDIF, Universal Disc Image Format, is an Apple proprietary format, giving you the impression that it's not compatible with third-party hardware.


Specify MIME type to CUPS's lpr command

It seems when you pass a file to `lpr` (or pipe to it), it attempts to guess the MIME type. Sometimes, however, it guesses wrong—and then attempts to print something "interesting" at best. Is there a way to manually override the MIME type?


Can't mount external USB driver - on Ubuntu 12.04

When I plug in external usb driver I saw next prompt:               Error mounting: mount exited with exit code 1: helper failed with:     Unprivileged user can not mount NTFS block devices using the external FUSE     library. Either mount the volume as root, or rebuild NTFS-3G with integrated     FUSE support and make it setuid root. Please see more information at     http://tuxera.com/community/ntfs-3g-faq/#unprivileged      This is my current `sudo fdisk -l`:               nazar_art@nazar-desctop:~/Desktop/Big JAVA/bj4_code/ch24/time$ sudo fdisk -l          Disk /dev/sda: 160.0 GB, 160041885696 bytes     255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x000e28b8             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048   310484991   155241472   83  Linux     /dev/sda2       310487038   312580095     1046529    5  Extended     /dev/sda5       310487040   312580095     1046528   82  Linux swap / Solaris          Disk /dev/sdb: 1015 MB, 1015808000 bytes     31 heads, 32 sectors/track, 2000 cylinders, total 1984000 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1   *          31     1983999      991984+   6  FAT16          Disk /dev/sdd: 7751 MB, 7751073792 bytes     255 heads, 63 sectors/track, 942 cylinders, total 15138816 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0xc3072e18             Device Boot      Start         End      Blocks   Id  System     /dev/sdd1   *          63    15138815     7569376+   7  HPFS/NTFS/exFAT      And `gksudo gedit /etc/fstab`:               # /etc/fstab: static file system information.     #     # Use 'blkid' to print the universally unique identifier for a     # device; this may be used with UUID= as a more robust way to name devices     # that works even if disks are added and removed. See fstab(5).     #     # <file system> <mount point>   <type>  <options>       <dump>  <pass>     proc                                       /proc           proc  nodev,noexec,nosuid         0  0       # / was on /dev/sda1 during installation     UUID=5f5d330f-d5f2-4157-9496-94f1dce2f181  /               ext4  errors=remount-ro           0  1       # swap was on /dev/sda5 during installation     UUID=84747ef4-6f50-49bc-9df1-fcba364ba299  none            swap  sw                          0  0            /dev/fd0                                   /media/floppy0  auto  rw,user,noauto,exec,utf8    0  0       /dev/sdc1                                  /media/sdc1     auto  uid=1000,noauto,users,exec  0  0       /dev/sdd1                                  /media/sdd1     auto  uid=1000,noauto,users,exec  0  0       /dev/sdb1                                  /media/sdb1     auto  uid=1000,noauto,users,exec  0  0      **Update:** Checked if is installed `ntfs-3g`:               nazar_art@nazar-desctop:~$ dpkg -s ntfs-3g     Package: ntfs-3g     Status: install ok installed     Priority: optional     Section: otherosfs     Installed-Size: 1422     Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>     Architecture: amd64     Version: 1:2012.1.15AR.1-1ubuntu1.2     Replaces: libntfs-3g75, ntfsprogs     Depends: debconf (>= 0.5) | debconf-2.0, libc6 (>= 2.14), libfuse2 (>= 2.8.1), libgcrypt11 (>= 1.4.5), libgnutls26 (>= 2.12.6.1-0), initramfs-tools (>= 0.99), initscripts (>= 2.88dsf-13.3)     Pre-Depends: multiarch-support, fuse     Conflicts: libntfs-3g75, ntfsprogs (<< 1:2011.10.9AR.1-3~)     Description: read/write NTFS driver for FUSE      NTFS-3G uses FUSE (Filesystem in Userspace) to provide support for the NTFS      filesystem used by Microsoft Windows. It can:      .       * create, remove, rename, or move files, directories, hard links, and streams;       * read and write files, including streams, sparse files, and transparently         compressed files;       * handle special files like symbolic links, devices, and FIFOs;       * provide standard management of file ownership and permissions, including         POSIX ACLs.      .      This package also contains the tools previously available in the ntfsprogs      package.     Homepage: http://www.tuxera.com/community/ntfs-3g-advanced/     Original-Maintainer: Daniel Baumann <daniel.baumann@progress-technologies.net>      Figuring out exactly usb drive through **_lsblk_** :               nazar_art@nazar-desctop:~$ lsblk     NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sda      8:0    0 149.1G  0 disk      ├─sda1   8:1    0 148.1G  0 part /     ├─sda2   8:2    0     1K  0 part      └─sda5   8:5    0  1022M  0 part [SWAP]     sdb      8:16   1   7.2G  0 disk      └─sdb1   8:17   1   7.2G  0 part      sdc      8:32   1 968.8M  0 disk      └─sdc1   8:33   1 968.8M  0 part /media/sdc1     sr0     11:0    1  1024M  0 rom      It's sdb1 - this external usb drive. Tried again manually mount:               nazar_art@nazar-desctop:~$ sudo mount /media/sdb1     [sudo] password for nazar_art:      The disk contains an unclean file system (0, 0).     The file system wasn't safely closed on Windows. Fixing.      Now all is visible. **_- Why this happen?   - How to solve this issue?_**


Gnome Shell shortcut directly to Workspace List overlay?

Is there a way in `Gnome Shell` to define a shortcut that will bring up the `Overview` such that the `Workspace List` is already showing and available for clicking -- similar to the viewport selector in `Compiz`? Note: I'm using Gnome's terminology for this question. I have recently (been forcibly) migrated to Gnome 3/Gnome Shell on RHEL7 (from Gnome 2/Compiz on Ubuntu 10). As I can't function without 9 virtual workspaces in a 3x3 layout, the loss of Gnome Panel and Gnome Workspace Switcher has been painful. However, I've found a number of Extensions/tools that have made the experience tolerable. These include   * Workspace Grid, which transforms the Workspace List into a 2-D grid (both conceptually and in the Workspace List overlay)   * `dconf-editor`, which reveals that keyboard shortcuts can be assigned for instantaneous switching to up to 12 workspaces All I'm missing now is a **quick** way to view all of my workspaces at once (a la `Compiz`) and select any of them with my mouse. (Yes, I can switch to any workspace I want with the keyboard, but sometimes I prefer to use the mouse.) My current approach is to either   * bring up the `Overview` in `Windows` mode using the "hot corner" or the shortcut `org.gnome.desktop.wm.keybindings.panel-main-menu` and then move my mouse to the right edge of the screen to un-hide the `Workspace List`, or   * bring up the `Overview` in `Applications` mode using shortcut `org.gnome.shell.keybindings.toggle-application-view` and then hit `Esc` to reveal both the `Windows` and `Workspace List` overlays. Both of these approaches require more key presses and/or mouse movement than was necessary with `Compiz`. I did find two other Extensions that _almost_ do what I need:   * WorkspaceBar, which adds a clickable 1-D workspace selector (but no overview, although the bar does behave like an additional "hot corner")   * Frippery Bottom Panel, which adds a quasi-2-D workspace selector (but the interface is actually clumsier to use than that of `WorkspaceBar`, and again no overview) Any suggestions on how to go straight to the `Workspace List` overlay?


Upgrading Debian Squeeze to Wheezy - Should updatedb.conf be kept or replaced?

A similar question to Upgrading Debian Squeeze To Wheezy - Should conf' files be kept or replaced?, but in my case it concerns a different conf file and I am not on Linode. I am upgrading a VMWare virtual machine that I intend to use as a server, from Debian 6 to Debian 7. The Squeeze install has been done by the company that provides the machine. Besides the possible customizations they _may_ have done, I haven't done any customization or installs at all. In any case, I updated my `/etc/apt/sources.list` and I did `apt-get update; apt-get dist-upgrade`, during the process of which, I get the following prompt:               Configuration file `/etc/updatedb.conf'     ==> Modified (by you or by a script) since installation.     ==> Package distributor has shipped an updated version.        What would you like to do about it ?  Your options are:         Y or I  : install the package maintainer's version         N or O  : keep your currently-installed version           D     : show the differences between the versions           Z     : start a shell to examine the situation      The default action is to keep your current version.     *** updatedb.conf (Y/I/N/O/D/Z) [default=N] ?      on which I chose `D` and the output is:               --- /etc/updatedb.conf  2011-06-06 16:32:11.000000000 +0200     +++ /etc/updatedb.conf.dpkg-new 2010-09-25 10:12:26.000000000 +0200     @@ -1,4 +1,4 @@      PRUNE_BIND_MOUNTS="yes"      # PRUNENAMES=".git .bzr .hg .svn"      PRUNEPATHS="/tmp /var/spool /media"     -PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre_lite tmpfs usbfs udf fuse.glusterfs fuse.sshfs vmhgfs"     +PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre_lite tmpfs usbfs udf fuse.glusterfs fuse.sshfs curlftpfs"      Any suggestions on what these mean and what I should do?


Preventing a specific space from being expanded in a variable

In bash how do you avoid a specific space from being expanded in a variable? Lets say I have this               JAVA_OPTS="-Xmx1g"     JAVA_OPTS="$JAVA_OPTS -XX:OnError='/path/to/a/script.sh %p'"          function args() {         printf "%d :" $#         printf " <%s> " $@         echo     }          args $JAVA_OPTS      You get this               3 : <-Xmx1g> <-XX:OnError='/path/to/a/script.sh> <%p'>      I would like this               2 : <-Xmx1g> <-XX:OnError='/path/to/a/script.sh %p'>


What command in bash to search for this string?

`file.txt` contains:               aa=testing     sss=whoiam     bbb=findme      What command do I use to search for testing and print it? Expected result:               # you search testing


Which Ubuntu GUI should I install?

I am trying to select a GUI for Ubuntu. If I just asked which one is best, I'd probably get a religious debate until the question was closed. But I'm asking which is the best fit for my needs, so here's a list of background details:   * I just bought a used laptop (Intel Core 2 Duo, 2.1 GHz, 3 GB memory, 150 GB disk to run Unix.   * I'll be using it almost exclusively for programming. I mostly use C/C++ and Java now, but I'll probably learn Python, and maybe Go if it takes off.   * I plan to install Ubuntu on it because it's the distribution that's most widely used among people I know.   * I am comfortable with the Windows 7 and Windows XP user interfaces (but I find Windows 8 annoying enough that I installed Classic Shell and Charm Killer so it looked like 7).   * Aside from system administration and programming on some Sun and Silicon Graphics workstations in the early 1990s, I've done most of my programming (and application use) on Windows. I've done C/C++ with Visual Studio and Borland (all sorts of programming), and Java with Eclipse (mostly Blackberry and plain Java, and a little Android) on Windows.   * I may also use the machine as an extra back-up server for Crash Plan, assuming the laptop doesn't need anything more than a spare external drive to run it.   * I don't need to run any non-programming applications other than a browser on the laptop, because I can do that on other computers. So, given my familiarity with the Windows user interface, the constraints of the five-year-old laptop, and my intended use, ~~which Ubuntu user interface am I most likely to find reasonably easy to use?~~ which Ubuntu user interfaces are most widely used by people switching from software development on Windows? ~~Also, although I found Eclipse perfectly reasonable for Java development, I don't like it much for C++. I could go back to command line, but I wouldn't mind suggestions for an IDE that plays nicely with C++. (I've heard good things about Code Blocks, but I haven't fooled with it yet.)~~ I welcome further comments to help narrow down the scope of the question, if I'm missing anything important.


Enable suspend in linux mint in a dell xps-17

In my vain attempt to get hibernation working in a dell xps-17 by installing (I'm seriously considering getting a mac cause it just works) a hibernate package I have lost my ability to suspend. How to I get suspend back at least cause it makes moving around a PITA?


Where to emit hardware events?

What is the most common way to emit events from hardware sensors? Use ACPI events, send signals via DBUS? My goal is compatibility so other apps can easily use those inputs. What is the Cleanest solution?


Identify and assign most recent file to shell variable

I have a directory of `.jpg` files that continuously grows. I want to copy the most recent one elsewhere. This is what I currently have and it works, just curious if there's a better way to identify the most recent jpg file rather than using `ls` and `tail`.               #!/bin/bash     cd /home/pi/JPGS     fn=$(ls -rt1 | tail -1)     mv -f $fn /home/pi/WWW/webpic.jpg


Email Sent via root@domain.com despite modifying /etc/aliases

First, here are the entries I added/modified in **/etc/postfix/main.cf** file:               mydomain = domain.com     myorigin = $mydomain     relayhost = email-smtp.us-east-1.amazonaws.com:25     smtp_sasl_auth_enable = yes     smtp_sasl_security_options = noanonymous     smtp_sasl_password_maps = hash:/etc/postfix/sasl/amazon-ses     smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt     smtp_use_tls = yes     smtp_tls_security_level = encrypt     smtp_tls_note_starttls_offer = yes     header_checks = regexp:/etc/postfix/header_checks      Now, if I send a test mail like so...               $ sudo sendmail someone@gmail.com     To: someone@gmail.com     From: noreply@domain.com     Subject: Test email!     This is just a test email.     .      and check the mail log ( **/var/log/mail.log** ), I see this:               Feb 17 04:23:16 hostname postfix/pickup[6226]: B3DD4137ED: uid=0 from=<root>     Feb 17 04:23:16 hostname postfix/cleanup[6230]: B3DD4137ED: replace: header From: noreply@domain.com from local; from=<root@domain.com> to=<someone@gmail.com>: From: "WebsiteName Alerts (no reply)" <noreply@domain.com>     Feb 17 04:23:16 hostname postfix/cleanup[6230]: B3DD4137ED: message-id=<20130217042316.B3DD4137ED@hostname.domain.com>     Feb 17 04:23:16 hostname postfix/qmgr[6144]: B3DD4137ED: from=<root@domain.com>, size=353, nrcpt=1 (queue active)     Feb 17 04:23:18 hostname postfix/smtp[6232]: B3DD4137ED: to=<someone@gmail.com>, relay=email-smtp.us-east-1.amazonaws.com[107.22.250.234]:25, delay=25, delays=24/0.03/0.93/0.58, dsn=2.0.0, status=sent (250 Ok 0000013ce6644ae6-69927d25-c4e1-4f25-8ad4-b85b59318e84-000000)     Feb 17 04:23:18 hostname postfix/qmgr[6144]: B3DD4137ED: removed      As you can see, the log shows both `root@domain.com` and `noreply@domain.com` as `from` even though I specifically stated `noreply@domain.com` in the `sendmail` command. That too, despite modifying my **/etc/aliases** file like so:               # /etc/aliases     mailer-daemon: noreply@domain.com     postmaster: noreply@domain.com     nobody: noreply@domain.com     hostmaster: noreply@domain.com     usenet: noreply@domain.com     news: noreply@domain.com     webmaster: noreply@domain.com     www: noreply@domain.com     ftp: noreply@domain.com     abuse: noreply@domain.com     noc: noreply@domain.com     security: noreply@domain.com     root: noreply@domain.com      So, the question is, how do I make `noreply@domain.com` the default email address-out for the system? Put it the other way, how do I change the email address of root user from `root@domain.com` to `noreply@domain.com`? In case this matters, my system's running Debian 7 (Wheezy) 64-bit.


GUI for newsbeuter?

Is there a GUI for the feed reader newsbeuter? Or would there be an easy way to create one for it? Or is there any other graphical feed reader that could use the `cache.db` database (SQLite) of newsbeuter?


google chrome tray icon broken in gnome 3.6

![enter image description here](http://i.stack.imgur.com/GRmw5.jpg) Google Chrome starts up with the correct tray icon but when restarted it has the broken tray icon. Has anyone filed a bug report about this? And is there any workaround at present?


How to sed two same value without affecting the other

I have an xml file and I want to change one value on that file:               param name=swam_license_ports_overdraft_thresh          99          param name="strike_license_ports_overdraft_thresh"          99      The outcome I want is to sed the value 99 to 90 under param name=swam_license_ports_overdraft_thresh and the other value 99 under param name="strike_license_ports_overdraft_thresh" should not be changed.