"mkdir foo; svn mv * foo"

I often want to do some variant of this idiom:               $ mkdir 2010     $ svn mv * 2010      Of course, I get an error because the glob matches 2010 as well:               svn: Cannot copy path '2010' into its own child '2010/2010'      Is there a way to replace `"svn mv * 2010"` with a different one-liner that does the right thing?


Move all files to a new directory excluding that directory

I have the following:               ~@matrix:~/btp200/assignments> ls -la     total 40     drwxr-xr-x 3 molszewski1 users 4096 Feb  6 13:20 .     drwxr-xr-x 6 molszewski1 users 4096 Feb  6 13:14 ..     -rw-r--r-- 1 molszewski1 users 5727 Feb  6 13:20 ISBN.cpp     -rw-r--r-- 1 molszewski1 users  361 Feb  6 13:18 ISBN.h     -rw-r--r-- 1 molszewski1 users 3753 Feb  6 13:17 ISBNPrefix.cpp     -rw-r--r-- 1 molszewski1 users  422 Feb  6 13:15 ISBNPrefix.h     drwxr-xr-x 2 molszewski1 users 4096 Feb  6 13:20 a1     -rw-r--r-- 1 molszewski1 users    0 Feb  6 13:15 a1.cpp     -rw-r--r-- 1 molszewski1 users 6271 Feb  6 13:18 prefixRanges.txt     ~@matrix:~/btp200/assignments> mv * a1     mv: cannot move `a1' to a subdirectory of itself, `a1/a1'      How can I move everything into directory `a1` excluding `a1`?


locales: modify default time format

I need to change the default time format on my Debian Wheezy system. I am following this howto. I have modified the corresponding lines in `/usr/share/i18n/locales/en_US`               d_t_fmt "<U0025><U0059><U002D><U0025><U0062><U002D><U0025><U0064><U0020><U0020><U0025><U0054>"     d_fmt   "<U0025><U0059><U002D><U0025><U0062><U002D><U0025><U0064>"     t_fmt   "<U0025><U0054>"      Than, I ran the command ro compile locales `localedef -f UTF-8 -i en_US en_US.UTF-8` My locales in `/etc/default/locale` are set to en_US.UTF-8 :               LANG=en_US.UTF-8     LC_COLLATE=C     LC_TIME="en_US.UTF-8"      but i don't see any effect of my changes (even after restart). Am I missing a step ? UPDATE: when I run the command in verbose mode, I get lots of errors:               localedef -v -c -f UTF-8 -i custom custom.UTF-8          custom:34: non-symbolic character value should not be used     en_GB:50: non-symbolic character value should not be used     i18n:1756: non-symbolic character value should not be used     en_GB:59: non-symbolic character value should not be used     custom:40: non-symbolic character value should not be used     iso14651_t1:3: non-symbolic character value should not be used     iso14651_t1_common:6323: LC_COLLATE: symbol `pure-ta-zh' not known     translit_neutral:10: non-symbolic character value should not be used     translit_neutral:17: non-symbolic character value should not be used     LC_NAME: field `name_gen' not defined     LC_IDENTIFICATION: no identification for category `LC_MEASUREMENT'     LC_CTYPE: table for class "upper": 10634005407197270931 bytes     LC_CTYPE: table for class "lower": 10634005407197270931 bytes     LC_CTYPE: table for class "alpha": 10634005407197270931 bytes     LC_CTYPE: table for class "digit": 10634005407197270931 bytes     LC_CTYPE: table for class "xdigit": 10634005407197270931 bytes     LC_CTYPE: table for class "space": 10634005407197270931 bytes     LC_CTYPE: table for class "print": 10634005407197270931 bytes     LC_CTYPE: table for class "graph": 10634005407197270931 bytes     LC_CTYPE: table for class "blank": 10634005407197270931 bytes     LC_CTYPE: table for class "cntrl": 10634005407197270931 bytes     LC_CTYPE: table for class "punct": 10634005407197270931 bytes     LC_CTYPE: table for class "alnum": 10634005407197270931 bytes     LC_CTYPE: table for class "combining": 10634005407197270931 bytes     LC_CTYPE: table for class "combining_level3": 10634005407197270931 bytes     LC_CTYPE: table for map "toupper": 10634005407197270931 bytes     LC_CTYPE: table for map "tolower": 10634005407197270931 bytes     LC_CTYPE: table for map "totitle": 10634005407197270931 bytes     LC_CTYPE: table for width: 0 bytes


Is any part of the X.org software multithreaded?

None of the command-line shells that I am aware of are multithreaded. In particular, even those shells that support "job control" (Control-Z, `bg`, `fg`, etc) do so via facilities (namely, `fork`, `exec`, signals, pipes and PTYs) that predate Unix _threads_. Nor is Emacs multithreaded even though it is able to "do many things at the same time". (Again, it forks and execs external programs a lot and uses signals, pipes and PTYs to communicate with those external programs.) My question is, Does the dominant implementation of the X11 protocol (X.org) use Unix threads -- in either the server or any of the client libraries? If so, approximately when did it (or its ancestor, XFree86, or XFree86's ancestor) start doing so?


Distributing thousands of files over subfolders

I have a folder `A` with hundreds of thousands of files. I would like to move these files to **new** subfolders `S_i`, with, say, 100 files in each (the last folder may have less than 100 files) In other words, if my folder `A` has:               file1     file2     ...     file1000      I would later have:               S_1:             file_1         ...         file_100         S_2:         file_101         ...         file_200     ...      Before I write a Zsh script manually to do this task (e.g. using variables to count files), I was wondering if there are any readily available tools (like split) that would facilitate this task.


Can a Gnome Terminal profile use UTF-8 by default?

I am on an Ubuntu (I think) system. I **don't** have root, so I can't change the locale. I want to make my default terminal profile use UTF-8 by default. There should be a way to do this, either in the `.gconf/apps/gnome-terminal/` directory somewhere, or in a environment variable, or something. However, I can't seem to find it. Edit with more details: In a terminal, I have:               grid-unv55$ locale     LANG=en_US.UTF-8     LC_CTYPE="en_US.UTF-8"     LC_NUMERIC="en_US.UTF-8"     LC_TIME="en_US.UTF-8"     LC_COLLATE="en_US.UTF-8"     LC_MONETARY="en_US.UTF-8"     LC_MESSAGES="en_US.UTF-8"     LC_PAPER="en_US.UTF-8"     LC_NAME="en_US.UTF-8"     LC_ADDRESS="en_US.UTF-8"     LC_TELEPHONE="en_US.UTF-8"     LC_MEASUREMENT="en_US.UTF-8"     LC_IDENTIFICATION="en_US.UTF-8"     LC_ALL=     grid-unv55$ gnome-terminal      When try to more a UTF document in that new terminal, I get:               \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd     \noise:bgspeech \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd      Which appears on my screen as dots. (the uffds were a cut and paste. I left the "\noise:bgspeech" in there so you could see that ascii cut and pasted correctly)


Is it possible to install KVM On A VMWare virtual machine? If so, what are the steps?

I want to understand how to use KVM in CenTOS. At the moment, all I have is a VMWare ESX 5.x server to use. Is there a way to get KVM working on a system that is running on VMWare? Essentially, a nested install? This will not be used for production purposes, only testing/learning.


Why binutils and gcc need to install twice in LFS?

I followed LFS doc. I'm not quite understand why it needs 2 pass of compilation. My guess: We need target system's glibc, if we compile by host's gcc, it will not be able to separate with host anymore. So we need to build new system's binutils and gcc first to build target system's glibc let glibc connect with target's binutils and gcc. But first pass of binutils and gcc is using host's glibc, so we need second pass of compilation of target's binutils and gcc. Are those right? Is anything I'm missing or misunderstanding? Thank you~


How can I use my server to compile a kernel for my laptop?

My laptop, an HP pavilion with an nVidia card, has some issues with suspending. Namely firewire breaks on suspend and the nvidia drivers cause Xorg to hang on resume. I'd like to compile my own kernel to build firewire in instead of as a loadable module, and disable `agpart` to see if these changes fix these issues... However, my laptop isn't the fastest nor does it have a ton of RAM, and its fans are on their last legs. I'd like to configure the kernel build on the laptop buy compile the kernel on our in-house VMware server which has a lot more horsepower. Both the laptop and the server have Ubuntu on them (Ubuntu desktop on the laptop, Ubuntu... _wait for it_... Server on the Server. Bet you never would have guessed that!) How can I use one linux system to compile a kernel for the architecture of a different linux system?


How do I configure SELinux to allow outbound connections from a CGI script?

I'm migrating to a new webserver which has SELinux set up (running Centos 5.5). I've got it set up so that it can execute CGI scripts with no problem, but some of the older Perl based scripts are failing to connect to remote webservices (RSS feeds and the like). Running: `grep perl /var/log/audit/audit.log` gives:               type=SYSCALL msg=audit(1299612513.302:7650): arch=40000003 syscall=102 success=no exit=-13 a0=3 a1=bfb3eb90 a2=57c86c a3=10 items=0 ppid=22342 pid=22558 auid=0 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=235 comm="index.cgi" exe="/usr/bin/perl" subj=root:system_r:httpd_sys_script_t:s0 key=(null)      As my crash course in SELinux goes, it looks like it is actively refusing the outbound connection, but how do I configure it to allow for CGI scripts to make outbound requests?


Emacs X toolkit support?

From what I understand, Emacs uses GTK as it's default X toolkit. Does Emacs support X toolkits other than GTK? For example, can I build Emacs to use Qt4 instead of GTK?


Mount HTTP Server As File System

I have a machine on which I wish to mount multiple remote servers to access them all centrally. For remote Linux based systems I am using SSHFS which works fine. But for Windows systems, or systems without SSH, they all have some form of HTTP server installed sharing the files (so they all have directory browsing enabled). Can I mount a HTTP server as a local file system like SSHFS, so I can have all these remote servers mounted locally and presented in a uniform manner?


Rename files and directories with a special characters on solaris machines

The target of the following code ( commands ) is to rename files/directories and also support files/directories with a special characters as "@" or "." etc those commands are run fine on Linux without any problems ,                export NAME_THAT_WE_WANT_TO_CHANGE='.com'      export NEW_NAME='@google'      find /tmp -name '*.com*' -print0 | xargs -0  ./rename.pl   's/\Q$ENV{NAME_THAT_WE_WANT_TO_CHANGE}\E/$1$ENV{NEW_NAME}$2/'      for example the files               /tmp/star.com      /tmp/public.com      will replaced after running the below command to               /tmp/star@google      /tmp/public@google      so now I am tring to covert the find syntax to support Solaris machines ( Solaris 10 ) and this what I write for Solaris:                 export NAME_THAT_WE_WANT_TO_CHANGE='.com'       export NEW_NAME='@google'            find /tmp -name '*.com*' -exec ./rename.pl  {} + 's/\Q$ENV{NAME_THAT_WE_WANT_TO_CHANGE}\E/$1$ENV{NEW_NAME}$2/'      but when I run the find line ... ( I get the following errors )               find: paths must precede expression     Usage: find [-H] [-L] [-P] [path...] [expression]      please advice what I need to fix in my syntax in order to support solaris machines ?   * About the rename.pl script I took it from ( http://docstore.mik.ua/orelly/perl/cookbook/ch09_10.htm )               more /tmp/rename.pl      #!/usr/bin/perl      #      # rename script examples from lwall:      #       rename 's/\.orig$//' *.orig      #       rename 'y/A-Z/a-z/ unless /^Make/' *      #       rename '$_ .= ".bad"' *.f      #       rename 'print "$_: "; s/foo/bar/ if <stdin> =~ /^y/i' *           $op = shift;      for (@ARGV) {      $was = $_;      eval $op;      die $@ if $@;      rename($was,$_) unless $was eq $_;      }


Can I read and write to alternate HFS+ file forks or NTFS data streams from Linux?

It's possible to mount both Apple HFS+ and Microsoft NTFS filesystems under Linux. Both filesystems support multiple content streams per file, though this is not widely used.   * Apple uses the term _fork_.   * Microsoft uses the term _Alternate Data Stream_. Are there (semi) standard ways to access these filesystem features from Linux? If so are the methods uniform between the two filesystems or are only arcane ad-hoc methods available? (Perhaps something with `ioctl`s?)


Follow a pipe using less?

Can less follow (by pressing F) a piped input (similarly to a file)? For a file that is being written to, the command               less <file>      will follow the file when pressing F. But if I have a command that pipes output directly into less, like this               command | less      pressing F will do nothing. So it looks like pipes cannot be followed like files can? Or maybe it has to do with command also writing to STDERR? The effect I'm trying to achieve is always see the latest output of the command: just like keeping PageDown pressed! A related remark holds for G (go to end): when piping directly to less, it won't work.


Samba passwords expiring in x days - how do we fix them to not expire

We use OpenLDAP and Samba v3. Recently some Samba-defined users (no accounts on the shared linux server) started being listed in logwatch as having their passwords come up to "will expire"...I changed the names.                  password for user unicorn will expire in 7 days: 1 Time(s)        password for user xMacAlphbet will expire in 7 days: 1 Time(s)        password for user klbomb will expire in 4 days: 1 Time(s)      None of thee users have a linux user account. How can I fix these?


How can I start a cronjob 1 hour later each day?

I need to start a cronjob every day, but an hour later each day. What I have so far works for the most part, except for 1 day of the year:               0 0 * * * sleep $((3600 * (10#$(date +\%j) \% 24))) && /usr/local/bin/myprog      When the day of year is 365 the job will start at 5:00, but the next day (not counting a leap year) will have a day of year as 1, so the job will start at 1:00. How can I get rid of this corner case?


How to add header and footer to the flat file

I need to add a header and a footer to flat file - I just need to get values from the parameter like system date and report run date in the top line and for the footer I need to get the record count and prepend `00000` to it as shown below: Header:               "A"  "F" "2012-03-01"    "20120229" Footer:               "$M" "0000001252"    "." "0000" How can I achieve this in Unix?


Regular expressions help

what the different between these two regex expression ? AB\{4\} and (AB)\{4\} for the first expression I think that it repeat B 4 times, then for second expression it repeats AB 4 times. When I try to test the second expression using ABABABAB nothing matches.


Moving stuff off of SSD to HDD after installation. Using mount --bind? LiveCD?

I installed Ubuntu 12.10 on my SSD. /dev/sda1. No other partitions. No swap. Then I went about reading how to optimize usage, and have come to the conclusion I want my /home, /var and /tmp mounted on my hard disk drive. I don't have it mounted yet, but I have a line in my fstab that lists the UUID of my HDD and has it (/dev/sdb1) mounted in /media/hdd. Hard disk too, no partitions. Just plain disk space. I do _NOT_ want to create partitions on either my SSD or HDD. All I want however, is to _move_ my /tmp, /home and /var partitions to my HDD. What are my options to do this cleanly, preferably without using a LiveCD to login? (I am imagining I could use a LiveCD, literally do               mv /home /media/hdd/home     ln -s /media/hdd/home /home          mv /var /media/hdd/var     ln -s /media/hdd/var /var          mv /tmp /media/hdd/tmp     ln -s /media/hdd/tmp /tmp      What about permissions? Is my thinking correct? Can I somehow use a mount --bind option to achieve the same?


How to generate a new rootfs and add blobs

Before reading this question please take two seconds to read my last questions : How to add folders and file before compiling kernel To sum up I want to add a folder @ rootfs which one has to hold my own files (not belonging to the Cyanogen ROM source files). To clarify there is an example : Before editing source ROM code :               ~adb shell ls /     data     sdcard     storage     system     sys      After editing :               ~adb shell ls /     data     mynewfolder     sdcard     storage     system     sys     ~adb shell ls /mynewfolder     my1file     my2file      **CREATE A NEW FOLDER @ ROOTFS ("/")** What I did is to locate the init* and fstab file. I edited init.qcmon.rc file :               on init     (+)    mkdir /mynewfolder 771 root root       I recompiled my ROM and I saw my folder had been created. But when I try to create a file Android rise the following error :               mkdir failed for my1file : Read-only file system.      Although I knew that trick won't work because to dirty, I continue my investigation editing the fstab.qcmon held in the same folder. I add the following line :               /dev/block/platform/msm_sdcc.1/by-name/mynewfolder      /mynewfolder   ext4    rw,exec,nosuid,nodev,noatime,noauto_da_alloc,errors=panic      wait      This line is a copy/edition of the /data partition defined in the same file. As expected I changed nothing... I'm sure i'm taking the wrong way, but I have no idea how to do this... **ADD MY FILES WHEN COMPILING THE ROM** With the helpful advise of @mikeserv I read the Cyanogen porting guide, and locate the file which copies blobs to their corresponding folder.               grep -Ri "PRODUCT_COPY_FILES" device/samsung/*     device/samsung/jf-common/jf-common.mk : PRODUCT_COPY_FILES +=       I started by added a test file inside an existing folder, I edited jf- common.mk file :               (+)PRODUCT_COPY_FILES += \            device/samsung/jf-common/myfiles/testfile:system/usr      It worked as expected. But when I try to add it to mynewfolder, it still does not work... I think it's related my dirty tricks used to create a new folder @ rootfs. The line I am currently using in jf-common.mk :               (+)PRODUCT_COPY_FILES += \           device/samsung/jf-common/myfiles/testfile:mynewfolder/testfile      Thanks you.


How to force drop all partitions and erase disk from terminal?

My question is in fact related to OS X, however I'm using Linux tools to resolve my problem. I'm trying to delete all the partitions on my SSD drive and create new GUID (HFS+) partition table. Native Disk Utility is unable to eject disk to re- partition it. From the terminal, which is included in the OS X install, I've ran `diskutil` and here is the output: ![enter image description here](http://i.stack.imgur.com/YrI05.jpg) diskutil unmountDisk force /dev/disk0...12 also can't unmount disks. I've started Ubuntu 12.10 from USB, tried to delete all partitions with GParted (except the recovery partition); it seems to be ok, but the disk is still unavailable for creating partitions with Apple Disk Utility. And certainly I can't create HFS+ partitions in GParted, cause I don't have `hfsprogs` installed, and there is no way to install 'cause I don't have Internet connection (Ubuntu can't work with Mac Book Retina wifi adapters). So, the main question is what are these 12 partitions and how to delete them and create one HFS+ partitions? **upad:** ![enter image description here](http://i.stack.imgur.com/ydclT.jpg)


Make yaourt does not reinstall when already installed

Is there a way to make yaourt does not reinstall when the package (from AUR) already installed                $ yaourt -Q jruby      local/jruby 1.7.3-1      but somehow                $ yaourt --needed --noconfirm -S jruby      keep redownload (even if it has been downloaded before) and reinstall jruby


SSH File Transfer

Is it possible for me to use SSH to transfer files from my linux computer to my macbook, if so, can anyone post a brief tutorial? I kind of understand how to use SSH, but I need to know how to find out my hostname etc.


Understanding btrfs disc usage for single data volume

On my 256 GB disc:               # btrfs fi show /dev/sdd3     Total devices 1 FS bytes used 143.43GiB     devid    1 size 234.22GiB used 234.22GiB path /dev/sdd3     Btrfs v3.12      I don't understand the discrepancy between "143.43GiB" and "used 234.22GiB". I thought, perhaps I have duplication of the data on, but the way I read this:               # btrfs filesystem df /     Data, single: total=230.20GiB, used=142.32GiB     System, DUP: total=8.00MiB, used=32.00KiB     System, single: total=4.00MiB, used=0.00     Metadata, DUP: total=2.00GiB, used=1.19GiB     Metadata, single: total=8.00MiB, used=0.00      my data is stored only once, "single", and I don't understand where the remaining, roughtly 100 GiB, is used. Quote from the the btrfs wiki: > single - data usage matches the raw block group usage on a single device > (data = raw; 1GB of data requires 1GB of disk Mount info:               # mount | grep sdd3     /dev/sdd3 on / type btrfs (rw,noatime,ssd,noacl,space_cache)


what is wrong with my simple choice menu script?

This is a simple script which should let me go to to directory of my choice, but its not working as intended.               #!/bin/bash          showMenu() {         echo "1) ocaml"         echo "2) python"         echo "3) csharp"     }          while [ 1 ]     do         showMenu         read CHOICE         case $CHOICE in             "1")                 "cd ~/projects/practice/ocaml"                 ;;             "2")                 "cd ~/projects/practice/python"                 ;;             "3")                 "cd ~/projects/practice/csharp"                 ;;         esac     done      I have all the necessary folders in place:               (2) [01:19 PM] ls projects/practice/     csharp/  ocaml/   python/  scripts/ web/           Output:               (2) [01:19 PM] choice      1) ocaml     2) python     3) csharp     1     /home/nanda/bin/choice: line 15: cd ~/projects/practice/ocaml: No such file or directory     1) ocaml     2) python     3) csharp      The script can't find the directory apparently. I feel that I need to put the `cd` command, under each option, in some kind of substitution (with `${}` or `{}`), but I am not sure how it could be done. Also, do I need to add a break statement after each `cd` command? * * * I should do `. choice` to make it work as intended. Better yet, I put in an alias like this and it worked:               alias choice='. choice'      References:   http://stackoverflow.com/questions/255414/why-doesnt-cd-work-in-a-bash-shell- script   http://askubuntu.com/questions/84279/how-to-change-directory-using-script   http://stackoverflow.com/questions/874452/change-current-directory-from-a- script


Can asterisk set-up a three-way call on an analog (classic) line?

I would like to know if it is possible for _asterisk_ to establish a three-way call on an analog line. Typically, **I would like asterisk to call 2 numbers, with the same telephonic line, and connect them together**. For a human, this is already possible on the line I'm using, by following those steps:   * pick up and dial the 1st number, wait for it to answer,    * press `R` (the hook flash) and compose the 2nd number, wait for answer,    * press `R` and then `3` so everybody is now in the same conversation.  This is interesting here because the line I'm talking about can make international calls to many destinations without extra charge, so I can use it (as a relay) to call from one country (when travelling) to another without having to ruin myself. Can asterisk reproduce these steps automatically, and do you know how?


Compile Node.js for Raspberry fast

I wan't to know if there is a faster way to compile the node.js code for raspberry then letting the raspberry itself compile the code. Assuming I have cloned the nodejs source into _/home/pi/node/_ on my raspberry.   1. Is it right to run the `./configure` on the raspberry.   2. Then copy the node folder to my desktop computer and run `make`.    3. Then copy the folder back to my raspberry _/home/pi/node_ and run `make install`. Would that work and if yes, are there any downsides to this method? * * * **EDIT:** I accepted to use the precompiled Version suggested by goldilocks as it is truly the fastest way of getting the newest node asap.


Is it possible for grub2 to detect some specific CPU features and choose a proper kernel to boot?

I want to configure grub to check some CPU features on startup and choose a proper kernel to boot (e.g. multiple cores -> kernel with SMP support). Is it possible? If so, then how do I do it?


Echo difference between Ubuntu and Red Hat

I have mostly been experimenting with Ubuntu but recently was using a Red Hat Enterprise system and was surprised at a difference I found setting and displaying environment variables. In Ubuntu I might have an interaction like this:               acomber@mail:~$ export MY_VAR=i686-linux     acomber@mail:~$ echo $MY_VAR     i686-linux     acomber@mail:~$ echo "$MY_VAR"     i686-linux      But on RHEL:               acomber@mail:~$ export MY_VAR=i686-linux     acomber@mail:~$ echo $MY_VAR          acomber@mail:~$ echo "$MY_VAR"     i686-linux      Why this difference? Why do I need to enclose in quotes on RH? There are no spaces in the variable name? On Ubuntu:               acomber@mail:~$ type echo     echo is a shell builtin     acomber@mail:~$ ps aux | grep $$ | head -n 1     acomber   2847  0.0  0.0  26876  3836 pts/7    Ss   10:30   0:00 bash      I will have to wait until I am back at work to try on the RHEL machine.


Mencoder with same quality output

I like `mencoder` for converting video files because it shows me how much time is remaining to the end of the conversion (in opposite to `ffmpeg`).               mencoder file.wmv -ofps 23.976 -ovc lavc -oac copy -o file.avi      The problem is that the resulting file is not the same quality as the input file. With `ffmpeg` there is `sameq` option. Is there similar option for `mencoder` to achieve the same quality? Is this only my feeling or is mencoder faster than ffmpeg when I will achieve the same quality? thank you


man causes a broken pipe when using a pager other than less

I'm trying to write a simple script to format my man pages, but I've run into a broken pipe error. These lines both cause the error:               env MANPAGER=cat man $foo     man -P cat $foo      and this is the script I'm ultimately trying to use (converts underlines into italics)               man -P ul "$1" | sed -e $'s/\033\\[4m/\033\\[3m/g' -e $'s/\033\\[24m/\033\\[23m/g'      I get the same problem with `cat`, `ul`, and `tee`, and the only thing that seems to work is `less`.


How to use a value returned by a script in grep filter?

I'm on FreeBSD's csh. I want to form a row with domains of one user and then use this row to filter exim maillog to get only mail from/to this user's domains. I wrote a script to form a row from a list of DirectAdmin-domains:               #!/bin/sh     user="some-user"              list=$(cat /usr/local/directadmin/data/users/$user/domains.list)         domaincount=$(echo $list|wc -w)         echo $list| tr ' ' '|'      Executing this script returns rows with domains like this: `'domain.com'` or this: `'domain1.com|domain2.net'` Now I want to use this as an argument to `grep`, but               cat /var/log/exim/mainlog |egrep `/path/to/rowscript`      returns nothing, while replacing manually `/path/to/rowscript` with its result returns what I want to see. Tried to use               grep -E "`/path/to/rowscript`",      egrep '`/path/to/rowscript`'      egrep `/bin/sh /path/to/rowscript`     egrep $(/path/to/rowscript)         getting "Illegal variable name."      etc., but still no luck. BTW, `date` in backticks works well:               cat /var/log/exim/mainlog | grep `date +%Y-%m-%d`      What am I doing wrong?


What is sendmail referring to here?

When I install sendmail from the debian repos, I get the following output:               Disabling HOST statistics file(/var/lib/sendmail/host_status).     Creating /etc/mail/sendmail.cf...     Creating /etc/mail/submit.cf...     Informational: confCR_FILE file empty: /etc/mail/relay-domains     Informational: confCT_FILE file empty: /etc/mail/trusted-users     Updating /etc/mail/access...     Updating /etc/mail/aliases...     WARNING: local host name (ixtmixilix) is not qualified; see cf/README: WHO AM I?      Can someone please tell me what this means, what I need to do to qualify my hostname?


Log file not growing beyond a size. Why?

We have a java based web-app running on CentOS 6.0 64bit and it writes out many log files. Some of the files are rotated on daily basis using `logrotate` using the `daily`, `copytruncate` and other few options. One such particular log file stops growing at exactly "102400000" bytes. The process continues working fine. But nothing gets written in the log then. I did a `stat` on the file using `watch` to see if after reaching the "102400000" byte size the modified time changes, but it doesn't. Nothing happens to the file. It just stays there as it is. Other log files in the same directory continue to be written into. The things mentioned in another StackExchange question here do not apply. I checked and rechecked if any where the mentioned ulimit option was set, but there is none any. Doing `strace -f -p PID` showed the process to be trying to write but encountering the "File too large" and "File size limit exceeded" messages:               [pid  5679] write(1, "\n\n\n\n\n23-01-2013 12:00:46:921  Av"..., 128) = -1 EFBIG (File too large)     [pid  5679] --- SIGXFSZ (File size limit exceeded) @ 0 (0) ---      How do I find as to what is imposing this limit on the file size. Other log files in the same directory are quite large (greater than 1Gb in size) and have no issues as such.


How can I copy a git repo from a Makefile?

I'm writing a Makefile to sync my local dotfiles with GitHub. I recently decided to also add my .vim folder to the repo. But when trying to copy the .vim folder I keep getting a Permission denied error. The line in the Makefile that should copy the folder is:               @$(foreach file, $(FILES), echo "Copying $(BASH_DIR)$(file) to ."; cp -R $(BASH_DIR)$(file) . ; )      The permissions for the .vim folder is drwxr-xr-x, and the error message I get is:               cp: ./.vim/bundle/editorconfig-vim/.git/objects/pack/pack-bbb66dd84e2bdd3b05e19454b0800a928ecb94db.idx: Permission denied     cp: ./.vim/bundle/editorconfig-vim/.git/objects/pack/pack-bbb66dd84e2bdd3b05e19454b0800a928ecb94db.pack: Permission denied     cp: ./.vim/bundle/snipmate.vim/.git/objects/4d/e66757eebe4798eaaf02e3762a152d283eca81: Permission denied     cp: ./.vim/bundle/snipmate.vim/.git/objects/58/165f0e58211f8a5910df65414cc637651f046a: Permission denied     cp: ./.vim/bundle/snipmate.vim/.git/objects/6e/e90f3cfbd7c4956892da49896f62614448f851: Permission denied     cp: ./.vim/bundle/snipmate.vim/.git/objects/fc/161ff6515d405831c65c608d63627aa60c4066: Permission denied     cp: ./.vim/bundle/snipmate.vim/.git/objects/pack/pack-182ea16d08e5b471d5ce5f545f599f24ebe306cf.idx: Permission denied     cp: ./.vim/bundle/snipmate.vim/.git/objects/pack/pack-182ea16d08e5b471d5ce5f545f599f24ebe306cf.pack: Permission denied     cp: ./.vim/bundle/vim-jade/.git/objects/pack/pack-20254027167dcc621463c4454ed0fc539cf0b1da.idx: Permission denied     cp: ./.vim/bundle/vim-jade/.git/objects/pack/pack-20254027167dcc621463c4454ed0fc539cf0b1da.pack: Permission denied     cp: ./.vim/bundle/vim-markdown/.git/objects/pack/pack-b18aa89f38b322d622d05d969a9df41915bf9ea8.idx: Permission denied     cp: ./.vim/bundle/vim-markdown/.git/objects/pack/pack-b18aa89f38b322d622d05d969a9df41915bf9ea8.pack: Permission denied      Does anyone know how I can get this to work? Preferably without having to change permissions manually. @vonbrand I am trying to add my vim setup to my dotfiles for easy access on other terminals. I am using pathogen to handle my vim plugins. They are handled by cloning the plugins into the `.vim/bundles` directory. When I try to `cp -r` `.vim` into my dotfiles folder I get the error above. I'd like to find some solution for having these repos as a part of my dotfiles folder without having to manually change the permissions, as this would force me to repeat that process each time I decided to add or change a plugin. I don't know if the solution I'm looking for is passing some option to `cp`, or using some other tool for copying or syncing the `.vim` directory, or if `chown` is the only option I have. `ls -ld ~/.vim/bundle/vim-jade/.git` returns `drwxr-xr-x 12 $USER staff 408 Jan 21 15:26 ~/.vim/bundle/vim-jade/.git`


Move some files on every dir to a different dir

> **Possible Duplicate:**   >  How can I move files by type recursively from a directory and its sub- > directories to another directory? I'm quite new to Linux and specially to the shell and all of its commands. My goal is to move some files in every directory to another directory. To be more clear, I have this:               /DIR       - /dir1         - file1         - file2         - ...       - /dir2         - file1         - file2         - ...       - ...       - /dirn         - file1         - file2         - ...       What I need is to move all the file1 and file2 into a new dir in its own dir, so that I get something like this:               /DIR       - /dir1       - /mydir           - file1             - file2         - ...       - /dir2       - /mydir           - file1             - file2         - ...        For the sake of the question I have to say that dir names are not like "dir1", "dir2" and so on, but are arbitrary names. Files, however, are always named the same (models.py and wrappers.py). Thanks for your help.   P.S.: I'd really appreciate if you could explain me your answers, in order to learn a bit more about Linux and not just copy-pasting the code.


How to make a variable symlink ? (or something similar)

How can I make a variable symlink that would point to a different location according to the current user? Is it possible? Should I use something else instead? A mount point? How? Here is the problem in case you come across a different solution: Here at work we are a team developing on Unix with SVN. We all use the same development machine (remotely). So we have checkouts in different places (not /home but a specific dir mounted on another disk, let's say /svn/[userlogin]/). We use scripts and tools. Some special tools have a complex configuration and project file that includes the path of the source files. This is error prone and we lose a lot of time because of bad config or 'projects' that need to be recreated all the time. I would like to share this complex configuration and the project files across all developers. But for such files to be shared while working on different checkouts, I must either:   * correct on-the-fly the paths stored in config/project to adapt them to the current user   * make a "magic" fixed path that symlink/mount/point points to a different place according to the user (so same project file but pointing to different source) Before that we used clearcase, which was mounting a view of the same path for everyone (let's say /vob), each developer seeing his or her own view. That was convenient. How can I do a similar thing? Can you think of another solution? Thanks. -- Edit -- I was thinking of Eclipse IDE. I want to share some workspace settings, the project and the run/debug configurations. Eclipse (+plugin) settings consist of 50+ small files, so editing them is out of question. With clearcase it was easy thanks to the fixed "/vob" path which, for each terminal, was automatically pointing to the "view" we choose. I would like something similar. I want a _/svn/mysource_ which, for each terminal, point to the user current checkout, which is in a user-dependent path.


What is the difference between running a executable just by name and by appending a dot /slash before it?

This is the output from `ls -all` command :               -rwxr----- 1 subhrcho dba  3600 Nov 13 17:26 jdev     -rw-r----- 1 subhrcho dba  1566 Nov 13 17:26 jdev-Darwin.conf     -rw-r----- 1 subhrcho dba   347 Mar  6  2009 jdev-debug.boot     -rw-r----- 1 subhrcho dba   821 Nov 13 17:26 jdev-logging-debug.conf     -rw-r----- 1 subhrcho dba   584 Nov 13 17:26 jdev-logging.conf     -rw-r----- 1 subhrcho dba  4717 Jul 31 16:09 jdev.boot     -rw-r----- 1 subhrcho dba 12877 Nov 13 17:26 jdev.common     -rw-r----- 1 subhrcho dba  5047 Dec  6 01:43 jdev.conf     -rwxr-x--- 1 subhrcho dba 28160 Nov 13 16:28 jdev.exe     -rwxr-x--- 1 subhrcho dba 28672 Nov 13 16:28 jdev64.exe     -rwxr-x--- 1 subhrcho dba 28672 Nov 13 16:28 jdev64W.exe     -rwxr-x--- 1 subhrcho dba 28160 Nov 13 16:28 jdevW.exe      Now when I just run `jdev` it runs a different version of Oracle JDveloper than when I run it as `./jdev`..Why is it so ?


how to mount this disk?

I'm trying to mount a disc created some time ago in Amazon EC2. This is what I see (line breaks added for the sake of readability):               $ sudo file -s /dev/xvda4     /dev/xvda4: x86 boot sector; partition 1: ID=0x83, starthead 1,      startsector 63, 10474317 sectors, extended partition table (last)\011,      code offset 0x0      When I'm trying to mount it:               $ sudo mount /dev/xvda4 /mnt/foo     mount: wrong fs type, bad option, bad superblock on /dev/xvda4,        missing codepage or helper program, or other error        In some cases useful info is found in syslog - try        dmesg | tail  or so      How can I mount this disc? Maybe this information will help:               $ sudo fdisk -lu /dev/xvda4     Disk /dev/xvda4: 5368 MB, 5368709120 bytes     255 heads, 63 sectors/track, 652 cylinders, total 10485760 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: 0x0952616d       Device Boot      Start         End      Blocks   Id  System     /dev/xvda4p1              63    10474379     5237158+  83  Linux


Use configuration file for ftp with auto login enabled upon initial connection

I would like to so the same thing like in SSH where you can save the server in the config file. I would also like to save my username and password, so that it is not prompted each time I connect. I use the ftp command,


How to stop users from Switching to Root user

I have disabled the root user login from Sshd.conf file so now no one can login using root user even if they know the password SOMEHOW. Now I have 3 users in server ROOT,EMERG and ORACLE. I want to allow switching to ROOT only to EMERG user by using su - and not to ORACLE user. because normally if users know the ROOT password they can switch to root using su -. And i want this feature available only to EMERG user. How to do this Thanks in advance......


ncftp not looking into .netrc

I have sort of this in my `.netrc`:               machine ftp.mydomain.com             login mylogin              password mypassword      and while I can succesfully connect with `ftp`:               ftp ftp.mydomain.com      and passing credentials to `ncftp`:               ncftp -umylogin -pmypassword ftp.mydomain.com      I get this using only `ncftp ftp.mydomain.com`               NcFTP 3.2.4 (May 16, 2010) by Mike Gleason (http://www.NcFTP.com/contact/).     Connecting to xxx.xxx.0.140...                                                         ProFTPD 1.3.1 Server (Debian) [::ffff:xxx.xxx.0.140]     Login incorrect.                                                                     Sleeping 20 seconds...       Any advice welcome...


Screen status bar to display current directory for zsh/bash shell

I use GNU screen a lot with zsh as my shell. It would be a nice feature (I think) to be able to display the current directory name (not the full path) as the tab title. I can do that with `CTRL+A SHIFT+A` but that is manual. I would like it to change whenever I change directory. Does anyone know of a way to do this? Edit: The answer also feature the solution for bash.


Allow 1 hour only in day with PAM

How to allow user to access system only 1 hour in day using PAM? For example I wish to give access to a user only for 1hr on a workstation in 24hrs. First the 24hr time period needs to be defined, as fixed time period like 00:00:00 to 23:59:59 or the time period should be counted from the time the user first logs in. One must also consider the possibility if the user logs in for 3 minutes. logs off and logs in, after an hour. Note: I have successfully configure allow access in time ranges but not only 1 hour in day. Please give me any example of any service.


How to install & run collectd on Solaris 10 x86

I am trying to install and run `collectd` on Solaris 10 x86. I downloaded the Solaris x86 version of the installer. Installed using `pkd_add` command and chose the default folders. Now I am trying to run the daemon, but it doesn't seem to work. Here is the problem / error:               bash-3.00# sbin/collectd     bash: sbin/collectd: cannot execute binary file


Difference between commands in bash script and commands in terminal

Are there any differences between commands that you type into the terminal and commands you include in a script?


ALSA/ASoC: How to correctly load devices/drivers?

I am using Buildroot to build an embedded Linux (2.6.39.2) system for the NXP LPC3250 microcontroller. Right now, I'm trying to get ALSA/ASoC up and running, but I'm having some issues with getting the modules to work together. (I think!) ## Some important background: The board I am testing with is the Embedded Artists 3250 V2 development board. V2 is different from V1 in that it does not have an LCD screen, but _does include_ an I2S audio codec: The NXP UDA1380. Board support for EA3250 **V1** is included in the LPCLinux version of the kernel. There is also a different development board, called Phytec 3250, which contains the same UDA1380 codec chip. The LPCLinux distribution also has support for the Phytec board, along with the audio codec chip. From what I have discerned, the Phytec 3250 board has the UDA1380 codec on I2C address **0x18**. On my EA3250 V2 board, the audio codec is located at I2C address **0x1a**. _(I have verified the chip is powered up, and I can communicate to it by using the I2C-tools package. It responds to i2cdetect and I can read registers from the chip correctly using i2cget.)_ ## Modifying the source: I needed to edit the Phytec 3250 driver files to change the address of the codec chip. I edited this section of lpc3xxx-uda1380.c:                 static struct snd_soc_dai_link phy3250_uda1380_dai[] = {            {                       .name           = "uda1380",                       .stream_name    = "UDA1380 Duplex",       #if defined(CONFIG_SND_LPC32XX_USEI2S1)                       .cpu_dai_name   = "lpc3xxx-i2s1",       #else                       .cpu_dai_name   = "lpc3xxx-i2s0",       #endif                       .codec_dai_name = "uda1380-hifi",                       .init           = phy3250_uda1380_init,                       .platform_name  = "lpc3xxx-audio.0",              //EDIT// .codec_name     = "uda1380-codec.0-0018",  //EDIT//                       .codec_name     = "uda1380-codec.0-001a",                       .ops            = &phy3250_uda1380_ops,               },       };      After I made this change, I went ahead and built the system again and everything compiled OK. After booting into the system, I have the following modules (in addition to the standard core modules) in `/lib/modules/2.6.39.2/kernel/sound`:                ./soc/codecs: snd-soc-uda1380.ko          <-- ASoC codec driver     ./soc/lpc3xxx: snd-soc-lpc3xxx-i2s.ko      <-- ASoC DAI                    snd-soc-lpc3xxx-uda1380.ko  <-- ASoC machine driver                    snd-soc-lpc3xxx.ko          <-- ASoC platform driver      _**Now, how do I actually bind all this stuff together?_** Just inserting the modules with `modprobe` doesn't actually give the device to ALSA/ASoC. I am unable to detect the soundcard. Does this mean I must now make a new device called `uda1380-codec` at address **0x1a** and bind it to a driver? I have tried doing the following:   `echo uda1380-codec 0x01a > /sys/bus/i2c/devices/i2c-0/new_device`   and received:   `i2c i2c-0: new_device: Instantiated device uda1380-codec at 0x1a`   Then I try to bind a driver to the device:   `echo 0x1a > /sys/bus/i2c/drivers/uda1380-codec/bind`   and received:   `sh: write error: No such device`      I get this error for everything I try! I have a feeling I am not creating the device correctly, and then I'm not sure how to bind it to the correct driver. ## Nota Bene: I was playing with this last night and was somehow able to get ASoC to wake up and at least probe for the card. I was playing with different bindings, I guess. It was late and hard to remember my steps, but I was able to at least get the following error somehow:               uda1380-codec 0-001a: asoc: failed to probe CODEC uda1380-codec.0-001a: -22     asoc: failed to instantiate card LPC32XX: -22      I have been unable to recreate this error! ## Edit: I've confirmed my modified code is being compiled, so the driver should be talking to the correct address now. After manually loading the modules, the output of `lsmod` is:               Module                      Size  Used by    Not tainted     snd_soc_lpc3xxx_uda1380     2087  0      snd_soc_lpc3xxx             3089  0      snd_soc_lpc3xxx_i2s         4089  1      snd_soc_uda1380            10865  0      snd_soc_core               51549  4 snd_soc_lpc3xxx_uda1380,snd_soc_lpc3xxx,snd_soc_lpc3xxx_i2s,snd_soc_uda1380     snd_pcm                    52098  2 snd_soc_lpc3xxx,snd_soc_core     snd_timer                  15590  1 snd_pcm     snd_page_alloc              3021  1 snd_pcm     snd                        37286  3 snd_soc_core,snd_pcm,snd_timer      Does this look right? And my device table:               # Audio stuff     /dev/audio      c       666     0       29      14      4       -       -       -     #/dev/audio1    c       666     0       29      14      20      -       -       -     /dev/dsp        c       666     0       29      14      3       -       -       -     #/dev/dsp1      c       666     0       29      14      19      -       -       -     #/dev/sndstat   c       666     0       29      14      6       -       -       -     /dev/mixer      c       666     0       29      14      0       -       -       -     /dev/snd        d       755     0       29      -       -       -       -       -     /dev/snd/controlC0      c       666     0       29      116     0       -       -       -     /dev/snd/pcmC0D0c       c       666     0       29      116     24      -       -       -     /dev/snd/pcmC0D0p       c       666     0       29      116     16      -       -       -     /dev/snd/seq    c       666     0       29      116     1       -       -       -     /dev/snd/timer  c       666     0       29      116     33      -       -       -


Mouse pad error after new Linux kernel install

Yesterday I upgraded my debian laptop with the backports repository. Amongst the packages it installed, a new kernel was added (3.2.0). When booting on this kernel, the right-click on my mouse pad (is it called that way?) doesn't work. I tried booting on my old kernel (2.6.39) and it works like a charm. I have a bunch of live CDs for various distros lying around on my desk, so I tried launching live sessions. It confirmed my idea that it is a kernel issue. My hardware doesn't work well with recent kernels. My question is not how to solve my particular problem (I'm not even giving details about my hardware). What's the way to go when facing such a problem? Can anyone point me to good documentation?


Save HTML from clipboard as markdown text

I want to be able to highlight a section of a web page and copy it to the clipboard then save it to my local disk as markdown. I need an efficient way to do that. My current cumbersome method is:   1. highlight section and copy to clipboard   2. open Libre Office Writer   3. paste into Writer   4. save Writer doc as HTML   5. open terminal    6. `cd` to the directory where I saved the HTML   7. `pandoc -s -r html /home/me/a/b/mydoc.html -o /home/me/a/b/mydoc.md` Obviously, I need a better method! Any suggestions?


Recommended reading to better understand Unix/Linux internals

I've worked on *nix environments for the last four years as a application developer (mostly in C). Please suggest some books/blogs etc. for improving my *nix internals knowledge.


Re-ordering serial ports on a multiport card

I have a Red Hat Enterprise 6.2 machine with two on-board serial ports and a PCIe card with 8 additional serial ports (16C950 UARTs, 16C550 compliant). I've added the kernel option `8250.nr_uarts=10` so that all devices show up under `/dev`. The two on-board devices show up as ttyS0 and ttyS1, as expected, but the serial ports on the PCIe card aren't being ordered by their I/O port as I would expect them to. Otherwise the devices work fine, it's just that it's not very elegant that the tty order doesn't match the order on the breakout cable for the board. Any ideas on how to change the order? Output form `setserial`:               # setserial -g /dev/ttyS*     /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4     /dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3     /dev/ttyS2, UART: 16650, Port: 0xdf30, IRQ: 30     /dev/ttyS3, UART: 16650, Port: 0xdf38, IRQ: 30     /dev/ttyS4, UART: 16650, Port: 0xdf00, IRQ: 30      <-- Why is this one not ttyS2?     /dev/ttyS5, UART: 16650, Port: 0xdf08, IRQ: 30     /dev/ttyS6, UART: 16650, Port: 0xdf10, IRQ: 30     /dev/ttyS7, UART: 16650, Port: 0xdf18, IRQ: 30     /dev/ttyS8, UART: 16650, Port: 0xdf20, IRQ: 30     /dev/ttyS9, UART: 16650, Port: 0xdf28, IRQ: 30      Looking in `dmesg`, it's finding them in the right order, but starting the lowest I/O port out at ttyS4:               # dmesg | grep ttyS     serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A     serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A     00:06: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A     00:07: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A     0000:05:00.0: ttyS4 at I/O 0xdf00 (irq = 30) is a ST16650     0000:05:00.0: ttyS5 at I/O 0xdf08 (irq = 30) is a ST16650     0000:05:00.0: ttyS6 at I/O 0xdf10 (irq = 30) is a ST16650     0000:05:00.0: ttyS7 at I/O 0xdf18 (irq = 30) is a ST16650     0000:05:00.0: ttyS8 at I/O 0xdf20 (irq = 30) is a ST16650     0000:05:00.0: ttyS9 at I/O 0xdf28 (irq = 30) is a ST16650     0000:05:00.0: ttyS2 at I/O 0xdf30 (irq = 30) is a ST16650     0000:05:00.0: ttyS3 at I/O 0xdf38 (irq = 30) is a ST16650      Trying to use `setserial` to change the port doesn't seem to work, it always reports that the device is busy (this is from a fresh reboot, nothing has accessed the device).               # setserial /dev/ttyS2 port 0xdf00     Cannot set serial info: Device or resource busy      **Edit** : Thanks to info provided by Gilles, I have it mostly working now using a udev that writes an ordered **NAME** by matching on the **KERNEL** name. The output from `udevadm` info shows that is the only parameter that can be used to uniquely identify the individual devices (ttyS[2-9] all report the same information, except for the **KERNEL** parameter).               # udevadm info -a -n /dev/ttyS2       looking at device '/devices/pci0000:00/0000:00:07.0/0000:05:00.0/tty/ttyS2':         KERNEL=="ttyS2"         SUBSYSTEM=="tty"         DRIVER==""            looking at parent device '/devices/pci0000:00/0000:00:07.0/0000:05:00.0':         KERNELS=="0000:05:00.0"         SUBSYSTEMS=="pci"         DRIVERS=="serial"         ATTRS{vendor}=="0x494f"         ATTRS{device}=="0x10a9"         ATTRS{subsystem_vendor}=="0x0000"         ATTRS{subsystem_device}=="0x0000"         ATTRS{class}=="0x070002"         ATTRS{irq}=="30"         ATTRS{local_cpus}=="0000ff"         ATTRS{local_cpulist}=="0-7"      My new udev rules:               SUBSYSTEM=="tty", DRIVERS=="serial", ATTRS{vendor}=="0x494f", KERNEL=="ttyS4", NAME="ttyS2"     # [snipped 7 more rules for each device]


CSV file + set CSV parameters and values in bash script

I have the following CSV file:               Alabama,Alaska,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,Florida,Georgia,Hawaii,Idaho,Illinois,Indiana,Iowa     1000,"1 0 0 1",1002,1002,1003,1004,1005,"1 0 0 6",1007,1008,1009,1010,1011,1012,1013     100,101,102,102,103,104,105,"1 0 6 2",107,108,109,110,111,112,113     10001,10011,10021,10021,10031,10041,10051,10061,10071,10081,10091,10101,10111,10121,10131     .     .     .     .      My target is to set the CSV parameters ( all states in CSV ) with their values in my bash script for example               #!/bin/bash          Alabama=1000     .     .     .     Iowa=1013      so in my bash script I can read each parameter example                echo $Alabama      1000      First I just tried to write the following (wrong) code, in order to set the parameters with their values:               #!/bin/bash          counter=1          for CSV_COLUMN in Alabama  Alaska  Arizona Arkansas  California  Colorado  Connecticut Delaware Florida  Georgia  Hawaii  Idaho  Illinois  Indiana  Iowa      do       export $CSV_COLUMN=` echo $CSV_LINE | cut -d',' -f$counter `       counter=$counter+1     done      The test should be (from the bash script)               echo $Alabama     1000      How should I change my code in order to implement my idea?


Skype gtk style not working on debian squeeze 64

I have installed skype on my fresh squeeze 64bit system. It works fine except for the fact that the gtk theme isn't really working and the result is quite ugly: ![enter image description here](http://i.stack.imgur.com/G5Hlo.jpg) How can I fix this?


Isolate a hosts networking with iptables

I want to isolate a host on my home intranet using `iptables` on my linux router. So say for instance, I have a host that has the IP of `10.0.1.50` and I want it to be able to talk to the rest of the Internet, but I don't want the router to allow it to talk to any other host in `10.0.1.0/24`. However, I want to be able to allow hosts in `10.0.1.0/24` to connect to `10.0.1.50` on port `80` only as long as the connection isn't created on the host. I am doing this in case `10.0.1.50` is compromised, so it can't talk to the rest of my network.


Yarbu Execution

I am attempting to use a Project called Yarbu It appears to be exactly what I am looking for. However I am a noob at Linux and am having difficulty getting it to work. I successfully completed the install by following the steps seen here. After following those steps, I created a .conf file (found here) and placed it into /home/john/yarbu-1.4.8/etc/yarbu/conf/default however still nothing happens when I execute the program. I do not know how to proceed from here and I am fairly certain that its user error that is resulting from my unfamiliarity with linux. What should I try next? Why does this program require "sudo" to execute? Did I need to create the .conf file before I did "make install"? Any direction would be helpful and appreciated.


How to solve a file path as a failed dependancy when installing a RPM?

I have a RHEL 6 server without any internet access that is missing a cron installation. I am tyring to install crontabs like this but i get this error:               [root@netsrvr01 cron.d]# rpm -ivh /Downloads/crontabs-1.10-33.el6.noarch.rpm     warning: /Downloads/crontabs-1.10-33.el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY     error: Failed dependencies:             /etc/cron.d is needed by crontabs-1.10-33.el6.noarch     [root@netsrvr01 cron.d]# Error: 'NoneType' object has no attribute 'sendline'      What does it mean `/etc/cron.d is needed`? I do have those directories and I am logged in as root. Unfortunately i don't have a similar machine I can use yum downloader for either. **Edit: RPM contents:**               [root@netsrvr01 Downloads]# rpm -qpl /Downloads/crontabs-1.10-33.el6.noarch.rpm     warning: /Downloads/crontabs-1.10-33.el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY     /etc/cron.daily     /etc/cron.hourly     /etc/cron.monthly     /etc/cron.weekly     /etc/crontab     /usr/bin/run-parts     /usr/share/man/man4/crontabs.4.gz


Email server with automatic + sign aliases?

Is there currently a Linux email server that will allow me to replicate how Gmail or Outlook allow aliases. i.e. with Hotmail (which is now Outlook) or Gmail I can sign up on a site and use myname+askubuntu@outlook.com and it will come to the myname@outlook.com account without first having to set up an alias.


Gnome and Gdm doesn't recognize my password

I installed Archlinux as Virtualbox's guest on Windows. After installation, I can not log in through GDM, though it lists my user name, and the root account doesn't work either. The error info is:`Sorry, that didn't work. Please try again.` Then I try to log in through command line, and `startx` manually. This time it works, however, whenever I need to input my password in terminal, it doesn't recognize either. How do I solve this? I am using Gnome 3.


Debian thinks my file system is encoded as ISO-8859-1

This may not be the appropriate site for this question, because it's more a complaint than a question, but here goes. Today I updated my computer from Mint 15 to Debian 7.6. And after I'd done that, my computer thought that all the existing filenames were encoded as ISO-8859-1 rather than UTF-8. So, for instance, filenames containing "à" now got displayed as "Ã " and so on.   Turns out I needed to tell my system _explicitly_ that the file system uses UTF-8, by putting `export LANG=en_US.UTF-8` in my .bashrc file. And the question is, why? Why should something like that be necessary in this day and age, 2014? The default was UTF-8 for Mint, obviously; why should Debian be any different? What would cause Debian to use such an obscure and outdated default, even if I told it at install time what I wanted my locale to be, and /etc/locale.gen only contains `en_US.UTF8 UTF8` as the only (uncommented) line. And do I need to remember to edit the .bashrc file for every new user account that I create from now on to edit the export line in?


Arch: Is "SigLevel = Never" the only convenient way?

The only way I can install majority of packages without rejection from signature database is to put `SigLevel = Never` in `pacman.conf`. Its not supposed to be the right way, but I don't seem to be able to get pacman going any other options for SigLevel. Is what I'm doing right? And is it a frequent and common security threat that I should worry about, every second, day and night? Thanks.


aptitude: Meaning of curly brackets, i.e. package1{b} package2{a} package3{u}

When using **aptitude** , the list of changed packages sometimes has a single character in curly brackets behind some package names. The man-page has two examples of them but does not explain them (version 0.6.10-1). I have noticed {b}, {a} and {u} so far. The former one seems to show up when running `aptitude install` and tries to re-install packages I deleted (e.g. via debfoster, how can I disable that?), the latter two seem to have something to do with automatic dependency resolution. What do these characters mean, are there others, and what implications do they have for other operations? Is that extra information available to `dpkg` or `apt`?


How big should the rootfs partition should be on Arch Linux?

I've installed ArchLinux yesterday and set up a 10 GB partition for the root file system, 256 MB for swap, and the rest (456 GB) for my /home. However I still have 4.0 GB left on my root file system after installing some packages (GNOME, Firefox, Thunderbird etc...) and running a pacman clear cache. Does it suffice to have 10 GB for root file system, or could I end up running out of space in a couple of weeks/months?


2 Factor Authentication in SSH using public key and PAM

I'm trying to setup 2 Factor Authentication. I want the user to login successfully if:   * The public private/public key matches (authentication method: publickey) or the password is correct   * My pam authentication method is successful. The second authentication method is a PAM file. So I place it into `/usr/lib/pam/` and added `auth required my_pam_module.so` in `/etc/pam.d/sshd`.   So far I can either log in using the (publickey method) or (a password and whatever is required by me pam module). So I added `AuthenticationMethods publickey,keyboard-interactive` in `/etc/sshd_config` and now I'm required to have the public key, password, and "whatever is required by me pam module". What lines do I need to change in order to achieve what I described above? I'm using Mac OS X Mavericks (10.9). If you aren't familiar with Mac, it could also help what you'd do on your Linux system.


Centos apache virtual hosts definition

_Please excuse me if my logic is flawed as I am really new to Centos._ I know I can define multiple virtual hosts in my **_httpd.conf_** file. But what I would like is to define virtual hosts in individual files as I am used to doing under Ubuntu. In Ubuntu, my virtual hosts are defined in files under my **/etc/apache2/sites-available** and individually enabled ... but I can't find a similar structure & system under Centos. Please help!


I want to upgrade to Debian Squeeze, but what are some pre-caution procedures that I should take?

I want to upgrade to Debian Squeeze and there are quite a few guides out there, but I want to be safe and make sure I don't break my system. Is there a way to check if my current install packages are going to work on Squeeze? If so, how? How can I backup my system to ensure it's okay to upgrade?


"Open file" dialog: Focus jumps to text field (LMDE / Cinnamon)

I have a usability problem with the "Open file" dialog. The questions would be:   * Is there any way out? E.g. can I disable the autocomplete?   Otherwise, I might post a bug report..   * Why does this happen?   Which package / component is responsible for this dialog?   (so I know where to report it) Details: I'm on LMDE (Linux Mint Debian Edition) with Cinnamon. The problem happens in the "Open file" dialog i get in GEdit, Chromium, etc.   I don't know which exact package is responsible for the Open file dialog - Cinnamon, Gnome, Nemo or something else. Maybe someone could confirm if this happens in other distros / desktops.   Thus, I also don't know if this is better suited for unix.stackexchange or for askubuntu. Steps to reproduce:   * Hit Ctrl+O in an application (browser, gedit, other) to open the "Open file" dialog.   -> The dialog contains a file browser area, and at the top, a text field for file name / path.   -> focus is on the text field.   * Click into the file browser area   -> this will set the focus on the file browser area   * Start typing   -> this will search in the list of files in the file browser area   * Hit the up/down arrow keys   -> this will move the current selection up and down in the file browser area   * When a directory is selected, hit Enter   -> this will let the dialog dive into that folder.   -> PROBLEM: Now the focus is back on the text field!   -> A dropdown with autocomplete suggestions appears.   * Start typing.   -> this will type in the text field, instead of searching in the file browser   * Hit TAB.   -> this will select an autocomplete option, instead of jumping to the file browser   * Hit the down arrow key.   -> This will go down into the autocomplete dropdown, instead of to the file browser area. This is all quite painful to me. I like to focus on the file browser area, but the dialog won't let me :(


How to get a response from any URL?

I have been asked to write a shell script _To check if a URL is UP/Working or not for my Project._ I tried to find some hints over the internet, but whatever I got is about checking whether the URL exists or not. I first tried with `wget`.               wget -S --spider https://genesis-dev.webbank.ssmb.com:21589/gop-ui/app.jsp 2>&1 | awk '/^  /'     if [ $? -ne 0 ]     then echo "Server is UP"     else     echo "Server is down"     fi      My next attempt was with `curl`.               curl -ivs  https://genesis-dev.webbank.ssmb.com:21589/opconsole-sit/opconsole.html#     if [ $? -ne 0 ]     then echo "Server is UP"     else     echo "Server is down"     fi      But, both are checking existence of the URL not the response.


Chromium browser does not allow setting the default paper size for "Print to File"

In Chromium, as in other web browsers, there is a Print function, which includes printing to physical printers, as well as a "Print to File" function. The default paper size for the physical printers appears to be set to the same default paper size as the printer settings in CUPS itself. So those are fine. However, the default paper size for the "Print to File" option is set to "US Letter", and I can't figure out how to change it. This has been asked on SuperUser two and a half years ago, at time of writing, but there were no sensible answers given. I could not find any obvious issue or bug for this. Am I missing something? My (possibly naive) expectation was that Chromium would get it from a default system setting. The obvious setting is `/etc/papersize`, which happened to be set to `letter`. I changed it to `a4` and restarted the browser, but it doesn't make any difference. The version of Chromium I am using is `35.0.1916.153-1~deb7u` on Debian 7.6 (wheezy), the current default version for that release. UPDATE: Reported this to the Chromium issue tracker as Chromium browser does not allow setting the default paper size for “Print to File”, but I'm not holding my breath for a reply. UPDATE 2: @don_crissti pointed out that Chromium got its default paper size in "Print to File" from LC_PAPER, or at any rate, it is one of the things it looks at. I verified this. I had earlier seen some stuff on the web about this, including this Mozilla bug report with a entry by our very own @derobert, but had not taken the possibility seriously enough to check it out. Here, of course, is also a Debian bug report: Use LC_PAPER. Extra points for anyone who can document how this is done in the Chromium source.


Does ~/.bashrc set environment for users whose shell is /sbin/nologin?

I have an SFTP server and have set user shells to nologin to restrict access to SFTP. I want to set a conditional umask of 0002 so that newly created files are group writable for all SFTP users. Can I put this code in their bashrc to ensure that all newly created files are group writable or is there a better method? Red Hat 5/6 Linux.   NFS3 filesystem


How do I disable the left CTRL on Ubuntu 13.10? Actually I can do it already. All I need to run is               xmodmap -e "keycode 37 = "      The problem I have is this only works if I run it from the terminal _after_ my machjine has booted. I really want this run on bootup. I've tried including the command in a few places:   * /etc/rc.local   * ~/i3/config (I use the i3 window manager) None of them work. Any help greatfully recieved :)


How to power off USB stick or MMC card under linux?

Usually I just unmount the usb stick or mmc before unplugging it but I'd prefer to turn the power off before doing so. I think Windows does this, so the hardware should allow for turning off the power to a specific port but I don't know how to do this on a recent linux kernel (I am not sure if suspending is really the same but afaik it is deprecated/removed from recent kernels anyway). If you know how to do this, please explain. :)


Copy files from remote server to local, ignoring existing files (rsync not available)

I would like to copy a directory of files from a remote server to my local machine. As it is a large number of files, the option of ignoring existing files is desirable.   Unfortunately, `rsync` is not available for some reason (the remote server is from a CDN service, and beyond my control). So I think I am stuck using `scp -r` on the folder in question. Is there anyway of doing this while ignoring existing files?


How to install JDK and eclips in linux mint 15?

I am absolute beginner Linux user, and I want to know simply how to install JDK ( java development kit ) and eclipse IDE in Linux mint 15


sed special character replace not working in shell script

I want to write a script 'test.sh' that will take a user's input and replace all special characters with a '\' + the character. My script:               #!/bin/bash     echo 'input='"$1"     arg=`echo "$1" | sed 's:[]\[\^\$\.\*\/]:\\&:g'`     echo 'modified input='"$arg"      My command works on the string 'xy', which does not have any special characters. I run this in my terminal:               test.sh xy      And I obtain:               input=xy     modified input=xy      However, when I run this:               test.sh x.y      I get:               input=x.y     modified input=x&y      I don't understand why this script is not working. I expect to get:               input=x.y     modified input=x\.y      I think the problem lies in this sed command but I'm not sure where:               sed 's:[]\[\^\$\.\*\/]:\\&:g'


grep for capital words

I have a file that has declarations in it with capital words, something like:               public final Foo BAR;      these declarations are not all uniform. Is there a way for me to grep out just the capital lettered words from the line? I know how to find lines that have capital letters in them, but thats not what I want. I want only the matching capital lettered word. Thanks!


stty before login

We've got some HP-UX Integrity VMs that are difficult to log in to at the console because the `KILL` character is set to `@`, which also happens to be a component of some passwords. Now I know we can get around this by logging in as a different user, and issuing `stty KILL '^U'`, and that's already in the `.login` for all users. I also know that using `\@` will work. The real question is what do I need to do to change the `KILL` character system-wide so that we don't either have to kludge interactive login or avoid passwords with `@`?


What happens to data copied after undoing fdisk?

Suppose I have some drive with a single partition. For some reason I decide to repartition it, using `fdisk`. I create multiple partitions, then write the partition table, then exit `fdisk`. At this point the kernel is still not aware of the new partition table : the initial partition is still mounted through NFS, it was only "lazy-unmounted" (`umount -l`) before `fdisk`, so it triggered the "device or resource busy" error. Now I change my mind, launch `fdisk` again, and merge all partitions into a single one, exactly as it was at first. Then again I write the partition table, exit `fdisk`, and the kernel still has no clue of what just happened. Finally, I `rm -rf` everything on the disk, then copy some new data on it. Question is : what happens at the next reboot, when the kernel will see the "new" (yet same as before) partition table ? Will the data will be straight readable by the system ?


Piping fragments of a document through various commands

I want to send, maybe using escape sequences such as `$$$`, fragments of an article through various commands, possibly with modifiers. The stdin would be replaced by the corresponding stdout. (Deleting the very special modifier should be simple enough with sed, if necessary.) I believe I can do it with python... but I was wondering if there is that special UNIX tool or technique that I don't know about that might do 90% of the trick elegantly. To be more concrete, consider the following document:               $$$ figlet -f script     Title     $$$          Now it's time to visualize the cosine function:          $$$ gnuplot     set terminal dumb     plot cos(x)     $$$          Finally, a simple directed graph:          $$$ graph-easy     digraph G {     A -> B;     }     $$$      After running my program I would get:                ______     _     (_) |o     | |         |  _|_ | |  _       _ ||  |  |/  |/      (_/ |_/|_/|__/|__/               Now it's time to visualize the cosine function:                   1 ++----------***--+---------------****---------------+--***----------++           +          *   * +               * +*               + *cos(x) ****** +       0.8 ++        *    *                *    *                *    *        ++           |         *     *               *     *               *    *         |       0.6 ++        *     *              *      *              *     *        ++           |        *       *             *      *             *       *        |       0.4 ++       *       *             *       *            *        *      ++           |       *        *            *        *            *        *       |       0.2 ++      *         *           *         *           *        *      ++           |       *         *          *          *          *         *       |         0 ++      *          *         *          *          *          *     ++      -0.2 ++     *           *         *          *         *           *     ++           |      *            *        *           *        *            *     |      -0.4 ++    *             *       *            *       *             *    ++           |     *             *      *              *      *             *     |      -0.6 ++    *             *      *               *     *              *   ++           |    *               *    *                *    *               *    |      -0.8 *+  *                 *   *                *   *                 *  +*           +* *             +    *  *         +        *  *    +             * *+        -1 +***-------------+-----**----------+---------**-----+-------------***+          -10              -5                 0                5                10               Finally, a simple directed graph:          +---+     | A |     +---+       |       |       v     +---+     | B |     +---+      Any thoughts will be appreciated. Thanks a lot, and cheers!


kill or kick all clients from a running vncserver without restarting the server

I encounter quite often the problem, that I want to kick all connected clients from a running vncserver. Even better would be to be able to kick / kill even certain clients. With `netstat -tupa | grep 5901` I see that several clients are connected, but I don't know how to disconnect them. I'm using the tigervnc-server.


Understanding Kerberized NFSv4 Authorization

Articles such as this one seem to point out that Kerberizing NFS(v4) mounts not only prevents machines without a Kerberos service ticket from mounting the shared directory but also uses the user's Kerberos ticket to authorize user actions on the shared files. I quote the relevant part: > Before NFSv4, security on NFS was pretty much non-existant. You could > prevent unauthorized machines from connecting to NFS exports, but had to > rely on user ID mappings being the same between systems to use the server's > permissions to adequately protect files. Using Kerberos in this manner makes > NFS much more secure than it used to be. What I'm having trouble understanding is the following scenario, which seems to contradict this statement:               # mount /share #succeeds because I have a service ticket in my keytab     $ klist     klist: No credentials cache found (ticket cache FILE:....)     $ ls /share     ls: cannot access /share: Permission Denied     $ kinit     Password for joe@MYREALM:     $ ls /share     contents of share      So far so good, but when I do this:               $ kdestroy     $ ls /share     contents of share      What's happening here? I was able to access the NFS mountpoint even though I had no Kerberos credentials. Is this behavior expected or is my mount misconfigured? **Info**   1. Running MIT Kerberos V on Debian Wheezy 7.0   2. My mount options:              $ grep nfs4 /etc/fstab     server.myrealm:/nfs_export /share nfs4 sec=krb5,user 0 0        3. My `/etc/exports` on the server:              /nfs_export *(rw,sync,no_subtree_check,sec=krb5)      The `nfs(5)` page says that the GSS API supports two additional flavors of Kerberos security: `krb5i` to check data integrity and detect any tampering and `krb5p` to further ensure that all RPC calls are encrypted for security. I don't think enabling either of these will solve my problem. **Edit** As per dawud's suggestion I tried both `krb5i` and `krb5p` and the behavior persists. My problem, again, is how to make sure the `/share` is inaccessible to anyone who currently holds no Kerberos ticket? Furthermore, can I use the user's Kerberos ticket for authorization purposes ( _i.e._ , control who can access what) as the article I referenced seems to imply?


Windows share suddenly empty

I have a laptop running Mint 15 Olivia that can access a shared folder from a Windows Vista desktop. Normally I can access and modify the files as if it were just another folder on the laptop, both through Nemo's interface and from the terminal. This morning the drive which previously contained the shared folder appeared as empty. Even if I unplug the ethernet connection and turn wired connections off for the laptop (the desktop is not connected to the internet except through the laptop), the desktop still appears in the file system, but it is empty. If I try to access the folder from the terminal, using a command that worked last night, it claims that there is no such drive or directory. This happened once before, and I fixed it by restarting the Linux laptop, so I don't think the Windows computer is the problem here. Toggling the wired connection on/off on the laptop and disconnecting and reconnecting the ethernet do not change anything. Is there a way to fix this without restarting the computer?


Harddrive I/O per Pid

is there any way to see the disk I/O per pid/process ? Monitorix shows me the following and correct me if I´m wrong, but it looks like that the harddrive is slowing down the whole system: ![enter image description here](http://i.stack.imgur.com/qy7Hv.png) ### UPDATE #1 Atop seems to give a great overview above everything.   * Might I ask you what the wait I marked red means?   * Is that the wait from the disk I/O? ![enter image description here](http://i.stack.imgur.com/5ifJi.png)


Allow multiple remote connections to an ssh Dynamic forwarded port

Let us assume I have three machines A - Server to which I am sshing to   B - Client from which I am sshing   C - Another Client in B's subnet Now, I set up dynamic port forwarding for port 1235 by executing this in Client B               ssh -D 1235 a@A      where a is the username at server A. Now, I can connect to this port 1235 only from B as it is bound to localhost. If I modify the command as               ssh -D C:1235 a@A      then only C can connect to the port 1235 of B and not B itself. There is a third option I could use, namely               ssh -D 0.0.0.0:1235 a@A      whereby both B and C can connect to the port 1235 of B, but so can all the other machines in the same subnet as B and C. What I really want is a way to bind the dynamic port to allow only B and C to connect to it and not any other machine. How can I achieve this?


How to connect to an Active Directory

My office has a telemarketing group that is running Windows XP on ancient hardware. I want to move them off of XP as quickly as possible, for obvious reasons. These telemarketers rely solely on web based applications, so I thought why not use Linux? Its free and relatively virus proof. I installed Linux Mint 17 LTS and installed it on a machine and had one of the telemarketers test it out. It worked fine and she said it was faster than XP. I want to connect Mint to Active Directory, there seems to be a number of options, but I am confused. Most of my Google searches point to a product called Likewise Open, but it appears the product is discontinued. Some things point to a product called PowerBroker, but it appears to be a paid product. I also ran across a product called Centrify, but it doesn't support Mint 17. What is the easiest way to connect Mint 17 to AD to use AD logons?


Meaning of log entries from an iptables configuration

My router has Linux as its OS. The system log has a lot of rows about iptable and klogd that I don't understand, could someone explain them to me? The iptables setup:               iptables -t nat -A PREROUTING -i ppp33 -p tcp --dport 44447 -j DNAT --to 192.168.1.101     iptables -I FORWARD 1 -i ppp33 -p tcp -d 192.168.1.101 --dport 44447 -j ACCEPT     iptables -A INPUT -i ppp33 -p tcp --syn -m limit --limit 6/h -j LOG --log-level 1 --log-prefix="Intrusion -> "     iptables -A FORWARD -i ppp33 -p tcp --syn -m limit --limit 6/h -j LOG --log-level 1 --log-prefix="Intrusion -> "     iptables -A INPUT -i ppp33 -j DROP     iptables -A FORWARD -i ppp33 -j DROP      Sample log lines:               klogd: Intrusion -> IN=ppp33 OUT= MAC= SRC=188.11.48.248 DST=2.40.146.60 LEN=48 TOS=0x00 PREC=0x00 TTL=116 ID=12802 DF PROTO=TCP SPT=60584 DPT=64137 WINDOW=8192 RES=0x00 SYN URGP=0     klogd: Intrusion -> IN=ppp33 OUT= MAC= SRC=188.11.48.248 DST=2.40.146.60 LEN=48 TOS=0x00 PREC=0x00 TTL=116 ID=12889 DF PROTO=TCP SPT=60584 DPT=64137 WINDOW=8192 RES=0x00 SYN URGP=0


So we upgraded some of our servers to RHEL 6.5 and I came across pNFS while reading through the release docs. According to various docs available online, the performance improvement is huge over traditional NFS. Sadly, the docs available online about configuring pNFS are not very helpful. I have just this one question: Do we need a separate Metadata server to use pNFS? Example: If I have one NFS server and 10 clients in traditional NFS setup, do I need to have one NFS server, one Metadata server and those 10 clients if I am to implement pNFS there?


Linux kernel 3.10.0-123.4.2 processes [flush] aren't present

I am using CentOS 7 with "3.10.0-123.4.2.el7.x86_64" version, but I don't know why the kernel threads named `flush` aren't present in this kernel version. I tried to look in the kernel change log, but I didn't find anything.                [root@localhost ~]# ps aux | grep flush      [root@localhost ~]# echo $?      1      Without these kernel threads, how are the dirty data flushed?


I think I messed up my Apache on Webmin

Ok, so I'm pretty new to `webmin` and have been playing around with configuring `apache`. Today I was constantly getting errors with my virtual host set up, so thinking I had messed up some config file or something I decided to DELETE all the `apache` modules, then reinstall. I did the `\--purge` command and apache after I deleted it to allow me to reinstall it. Now the problem I have is that it appears I have `apache`, but I have lost the configuration GUI option that is normally under "Servers". I have looked everywhere but cannot seem to get it back. What do I do?


Error message id: cannot find name for group ID after logging in

**BACKGROUND** Trevor logs into his account on ssh://foobar.university.edu as one of the developers on the box, and he gets the message:                id: cannot find name for group ID 131      Trevor then checks this out using                vim /etc/group      **PROBLEM** Trevor discovers that there _is_ no 131 anywhere in the /etc/group file. Trevor then runs id ...                > id trevor      uid=4460(trevor) gid=131 groups=48(foobar),51(doobar),131      To discover his primary group apparently does not have a name attached to it. **QUESTIONS**   * What likely happened to cause this circumstance on the foobar.university.edu box ?   * Suppose trevor wants to fix this (e.g., by just creating a "trevor" group that maps to GID 131) what is the best way to do this without potentially breaking anything else on the server ?


arrow keys are not working with terminal server telnet (termnetd) session

I am using terminal server package `termnetd 3.2`, which reads serial port and gives output on telnet port. I logged into terminal server port, every thing works fine except the arrow keys, `Home` and `End` keys. I updated bash to `bash 4.2`, with latest `readline` package. Still the issue remains same. Is handling arrow keys related to readline library or termios' settings ??


Erasing HDD , re-write only headers , is that safe?

I want to erase my HDD quickly with `dd`, so If I only "zeroify" the partition headers , like destroy the inode table, block size etc. But is that safe? **UPDATE** I have some partition not encrypted (all ext4) , by "safe" I mean there should be no possibility of data recovery


Ethernet Sniffing Embeded Device

I recently dug out some prototyping equipment from the trash and I want out figure out what the heck it is. It has a port labelled 'Ethernet' and when I plug it into a router the lights flash like its trying to pull an ip but it does not. My router is running DD-Wrt and I have a netbook with Knoppix I can use on the router. How could I go about sniffing the communication and figure out what IP the device wants and how to communicate with it?


Start and monitor process with CRON

There is a stub application written in C. Now I want to run this application periodically, say at 11.30am daily. I thought of using the _cron_ process but I don't know how to do it. Please help. Also I want the _cron_ to periodically check if the application is running normally or not. If the application crashes or hangs, _cron_ should be able to restart the application within a certain period of time.


How can I activate the current session in ConsoleKit?

I have a live Debian Squeeze system on a USB drive, containing a script I use to image another drive. This script uses `udisks` to mount a drive by label, but it doesn't work over a serial console. The reason is that the session associated with the serial console does not appear to be "active", which means that `udisks` fails with:               user@my-live-usb:~$ udisks --mount /dev/disk/by-label/image-data --mount-options ro     Mount failed: Not Authorized      Changing the `allow_any` key in `/usr/share/polkit-1/actions/org.freedesktop.udisks.policy` doesn't help, so I'd like to know how to tell ConsoleKit that the serial console is "active". Trying to do this via the DBUS interface fails:               user@my-live-usb:~$ dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Session7 org.freedesktop.ConsoleKit.Session.Activate     Error org.freedesktop.DBus.GLib.UnmappedError.CkSeatError.Code0: Unable to activate session      Session7 is the one listed as being on /dev/ttyS0. So how can I get ConsoleKit to recognise the serial console as an active session? (In my case, udisks version is 1.0.1+git20100614-3, consolekit is 0.4.1-4.) It's also probably worth noting the the Debian live system automatically logs the live user in on all 6 video consoles and the serial console.


Permissions for making some some (but not all) files visible directly under a directory

On wikipedia I read the following: > The read permission, which grants the ability to read a file. When set for a > directory, this permission grants the ability to read the names of files in > the directory (but not to find out any further information about them such > as contents, file type, size, ownership, permissions, etc.) With this, is there any way to only let people in my group see (read) **the names** of a subset of the files/directories I have in a directory? E.g. if I have               A ---- B       |       |----C       |       |----D      can I modify permissions so that members of my groups can only see (read) **the names** `C` and `D` but not `B`? (if they `ls A` for example). If this is not possible, what is the **rationale behind it**? What if I want to completely hide some files I have in my folders? What would the "UNIX way" of dealing with this situation?


Where is the best place to put a local repo?

I've made a custom repo to install ruby 2.0 on Ubuntu 12.04 Currently, I have the repo in '/vagrant/files' for testing.               root@gitlab:~# tree /vagrant/files/     /vagrant/files/     |-- default     |-- ruby2-repo     |   |-- libruby2.0_2.0.0.299-2_amd64.deb     |   |-- Packages.gz     |   |-- rake_10.0.4-1_all.deb     |   |-- ruby2.0_2.0.0.299-2_amd64.deb     |   |-- ruby2.0-dev_2.0.0.299-2_amd64.deb     |   `-- rubygems-integration_1.2_all.deb          root@gitlab:~# cat /etc/apt/sources.list.d/ruby2-0.list     deb file:///vagrant/files/ruby2-repo /      I'm thinking I'll just put the ruby2-0.list directory in home or /opt. Is there a best practice or standard for where to store local repos?


Install Zentyal 3.2 on btrfs with raid 1 and luks

I want to install Zentyal 3.2 with btrfs, raid1 and luks on a server with 3 harddrives. at first i created 2 partitions on each device (sda,sdb,sdc). the first with 1G, and the secound with the rest. after that, i did a `cryptsetup luks -c aes-xts-plain64 -s 512 sdX` on each device, followed by a `cryptsetup luksOpen /dev/sdaX rootX`. Then i've formated it with a `mkfs.btrfs -m raid1 -d raid1 /dev/mapper/root[012]` and rebooted into the Zentyal Installation. But now i couldn't install the Zentyal on the btrfs, cause the installer detect's the three crypted harddrives (after luksOpen) but doesn't detects the btrfs on it. did somebody have an idea, how i can install zentyal on a raid-btrfs with luks?


Remote control an Ubuntu machine from a Windows machine

How can I access and remotely control an Ubuntu 10.04 machine from my Windows XP machine. I googled this subject, and noticed that there are several options: someone people use VNC, while some use Remote Desktop Protocol, etc. Which is the most secure and efficient tool available? * * * **Update** : My Windows machine and Ubuntu machine are far away from each other (one is at home while the other is in my office); that's they are in different networks but both are connected to Internet.


Unable to boot using self built kernel

I built kernel 3.11.3 following the instructions here. There were no issues in the build. The steps I followed automatically made entries in grub and copied the image to /boot too. At boot time, when I choose the new kernel, booting gets stuck with the following message               [   1.563345] MODSIGN: Problem loading in-kernel X.509 certificate (-129)     [1.734622] ata3: softreset failed (device not ready)     [1.735638[ ata1: softreset failed (device not ready)      But I get the same message when booting with my original kernel (kernel-3.9.5-301.fc19.x86_64) and it immediately disappears and boots normally. > /boot/grub2/grub.cfg looks like this `               #     # DO NOT EDIT THIS FILE     #     # It is automatically generated by grub2-mkconfig using templates     # from /etc/grub.d and settings from /etc/default/grub     #          ### BEGIN /etc/grub.d/00_header ###     if [ -s $prefix/grubenv ]; then       load_env     fi     if [ "${next_entry}" ] ; then        set default="${saved_entry}"        set next_entry=        save_env next_entry        set boot_once=true     else        set default="${saved_entry}"     fi          if [ x"${feature_menuentry_id}" = xy ]; then       menuentry_id_option="--id"     else       menuentry_id_option=""     fi          export menuentry_id_option          if [ "${prev_saved_entry}" ]; then       set saved_entry="${prev_saved_entry}"       save_env saved_entry       set prev_saved_entry=       save_env prev_saved_entry       set boot_once=true     fi          function savedefault {       if [ -z "${boot_once}" ]; then         saved_entry="${chosen}"         save_env saved_entry       fi     }          function load_video {       if [ x$feature_all_video_module = xy ]; then         insmod all_video       else         insmod efi_gop         insmod efi_uga         insmod ieee1275_fb         insmod vbe         insmod vga         insmod video_bochs         insmod video_cirrus       fi     }          terminal_output console     set timeout=5     ### END /etc/grub.d/00_header ###          ### BEGIN /etc/grub.d/10_linux ###     menuentry 'Fedora (3.11.3Mephisto) 19 (Schrödinger’s Cat)' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.9.5-301.fc19.x86_64-advanced-ebc305eb-2826-4aa0-91ae-f74f3e12b496' {         load_video         set gfxpayload=keep         insmod gzio         insmod part_msdos         insmod ext2         set root='hd0,msdos7'         if [ x$feature_platform_search_hint = xy ]; then           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 --hint='hd0,msdos7'  b6603ac8-e004-4cd6-b141-9bc95409e32a         else           search --no-floppy --fs-uuid --set=root b6603ac8-e004-4cd6-b141-9bc95409e32a         fi         linux   /vmlinuz-3.11.3Mephisto root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/swap rd.md=0 rd.dm=0 vconsole.keymap=guj  rd.luks=0 vconsole.font=latarcyrheb-sun16 rd.lvm.lv=fedora/root rhgb quiet LANG=en_US.UTF-8         initrd  /initramfs-3.11.3Mephisto.img     }     menuentry 'Fedora, with Linux 3.9.5-301.fc19.x86_64' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.9.5-301.fc19.x86_64-advanced-ebc305eb-2826-4aa0-91ae-f74f3e12b496' {         load_video         set gfxpayload=keep         insmod gzio         insmod part_msdos         insmod ext2         set root='hd0,msdos7'         if [ x$feature_platform_search_hint = xy ]; then           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 --hint='hd0,msdos7'  b6603ac8-e004-4cd6-b141-9bc95409e32a         else           search --no-floppy --fs-uuid --set=root b6603ac8-e004-4cd6-b141-9bc95409e32a         fi         linux   /vmlinuz-3.9.5-301.fc19.x86_64 root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/swap rd.md=0 rd.dm=0 vconsole.keymap=guj  rd.luks=0 vconsole.font=latarcyrheb-sun16 rd.lvm.lv=fedora/root rhgb quiet         initrd  /initramfs-3.9.5-301.fc19.x86_64.img     }     menuentry 'Fedora, with Linux 0-rescue-7725dfc225d14958a625ddaaaea5962b' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-0-rescue-7725dfc225d14958a625ddaaaea5962b-advanced-ebc305eb-2826-4aa0-91ae-f74f3e12b496' {         load_video         insmod gzio         insmod part_msdos         insmod ext2         set root='hd0,msdos7'         if [ x$feature_platform_search_hint = xy ]; then           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 --hint='hd0,msdos7'  b6603ac8-e004-4cd6-b141-9bc95409e32a         else           search --no-floppy --fs-uuid --set=root b6603ac8-e004-4cd6-b141-9bc95409e32a         fi         linux   /vmlinuz-0-rescue-7725dfc225d14958a625ddaaaea5962b root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/swap rd.md=0 rd.dm=0 vconsole.keymap=guj  rd.luks=0 vconsole.font=latarcyrheb-sun16 rd.lvm.lv=fedora/root rhgb quiet         initrd  /initramfs-0-rescue-7725dfc225d14958a625ddaaaea5962b.img     }          ### END /etc/grub.d/10_linux ###          ### BEGIN /etc/grub.d/20_linux_xen ###          ### END /etc/grub.d/20_linux_xen ###          ### BEGIN /etc/grub.d/20_ppc_terminfo ###     ### END /etc/grub.d/20_ppc_terminfo ###          ### BEGIN /etc/grub.d/30_os-prober ###     ### END /etc/grub.d/30_os-prober ###          ### BEGIN /etc/grub.d/40_custom ###     # This file provides an easy way to add custom menu entries.  Simply type the     # menu entries you want to add after this comment.  Be careful not to change     # the 'exec tail' line above.     ### END /etc/grub.d/40_custom ###          ### BEGIN /etc/grub.d/41_custom ###     if [ -f  ${config_directory}/custom.cfg ]; then       source ${config_directory}/custom.cfg     elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then       source $prefix/custom.cfg;     fi     ### END /etc/grub.d/41_custom ###      ` /etc/fstab looks like this `               #     # /etc/fstab     # Created by anaconda on Tue Jan  1 11:58:46 2002     #     # Accessible filesystems, by reference, are maintained under '/dev/disk'     # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info     #     /dev/mapper/fedora-root /                       ext4    defaults            1 1     UUID=b6603ac8-e004-4cd6-b141-9bc95409e32a /boot ext4    defaults            1 2     /dev/mapper/fedora-home /home                   ext4    defaults            1 2     /dev/mapper/fedora-swap swap                    swap    defaults            0 0     /dev/sda1       /mnt/media      ntfs-3g gid=admin,umask=0007    0 0     /dev/sda5       /mnt/setups     ntfs-3g gid=admin,umask=0007    0 0     /dev/sda6       /mnt/documents      ntfs-3g gid=admin,umask=0007    0 0      ` I'm using Fedora 19 on a x86_64 architecture


Access a linux machine from a windows machine

I have two laptops, one is installed with **Ubuntu 10.04** , the other one is installed with **Windows XP**. The Ubuntu laptop is located in one place with internet connection while the windows laptop is in another place with internect connection too. I know, the **putty client** can be used to access a Linux mahine from windows. But not sure **how exactly can I access my Ubuntu machine from my windows machine**? Is it so that I only need to find out the IP address of my Ubuntu machine, then use that IP address as the Host Name on **Putty** , then enter my Ubuntu laptop username and password on Putty on my windows machine , I will get the access to the Ubuntu machine? Or is there any other tricks I am missing?


What filesystem has best support for shrinking?

Most mainstream filesystems can be grown fairly reliably, but what if I think I would like to shrink in future? XFS is a non runner. Reiser seems to have good support but gives scary BETA warnings , it works really fast though. Btrfs seems to promise good things but I've no experience with it.


Changing service startup order

I use wpa_supplicant to configure the wireless connection. Now I have a problem in that the network service starts before wpa_supplicant so this happens:               Bringing up interface wlan0:       Determining IP information for wlan0... failed; no link present.  Check cable?      When I after that restart the network service the wireless connection then gets an IP and works. I was reading about altering the start order by changing the the start order number in the respective init script. This is it in wpa_suplicant:               # chkconfig:   - 23 88      And this is it in network:               # chkconfig: 2345 10 90      So if I understand correctly I could change the 23 to 9 and it would start before. Is it a good idea?