How can I start Apache on Arch Linux w/systemd using passphrase protected SSL keys?

I'm relatively new to using Arch Linux and think I must be missing the obvious way to do this correctly, but –short of starting the daemon on my own– I can't figure out how to get passphrase protected SSL keys unlocked when starting the service normally. With unprotected keys or without the SSL configuration Apache starts normally using the systemd service. As soon as I try to use protected keys, I get something like this:               $ sudo systemctl start httpd     Job for httpd.service failed.          $ sudo systemctl status httpd     httpd.service - Apache Web Server        Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)        Active: failed (Result: exit-code) since Mon 2014-02-10 11:47:07 UTC; 13ms ago       Process: 26035 ExecStop=/usr/bin/apachectl graceful-stop (code=exited, status=0/SUCCESS)       Process: 26042 ExecStart=/usr/bin/apachectl start (code=exited, status=1/FAILURE)      Main PID: 25500 (code=exited, status=0/SUCCESS)          systemd[1]: Starting Apache Web Server...     apachectl[26042]: Apache/2.2.26 mod_ssl/2.2.26 (Pass Phrase Dialog)     apachectl[26042]: Some of your private key files are encrypted for security reasons.     apachectl[26042]: In order to read them you have to provide the pass phrases.     apachectl[26042]: Server {name redacted}:443 (RSA)     apachectl[26042]: Enter pass phrase:Apache:mod_ssl:Error: Private key not found.     apachectl[26042]: **Stopped     systemd[1]: httpd.service: control process exited, code=exited status=1     systemd[1]: Failed to start Apache Web Server.     systemd[1]: Unit httpd.service entered failed state.      Is far as I can tell, Apache knows it needs to unlock my keys, but if systemd knows the passphrase prompt needs to be shown, any attempt to do so is not reaching my shell and silently failing. What is the best practice way (or Arch Way™) to start Apache and unlock protected SSL keys using systemd?


tmux disable automatic-rename on break pane

If I `setw automatic-rename off` on two windows, then join them, when I detach either one `tmux` automatically renames it! And "show-window-options" now has no record of the "automatic-rename off". How can I fix this? How to make `tmux` NOT rename a window after breaking a pane?


I have a 24 Gb disk and a 1Tb Hard Disk How do I get Ubuntu to install on my 24 GB and my home dir on the 1TB

I used the auto installer for Ubuntu on my 24GB drive my disk space looks like this.               kipke@ThePad:~$ df     Filesystem     1K-blocks    Used Available Use% Mounted on     /dev/sda2       16395648 3936132  11603608  26% /     none                   4       0         4   0% /sys/fs/cgroup     udev             2981788       4   2981784   1% /dev     tmpfs             598380    1100    597280   1% /run     none                5120       0      5120   0% /run/lock     none             2991888     236   2991652   1% /run/shm     none              102400      32    102368   1% /run/user     /dev/sda1         497696    3376    494320   1% /boot/efi         ![24gb drive picture](http://i.stack.imgur.com/tSWMV.png)    ![1tb drive picture](http://i.stack.imgur.com/yBnTZ.png)


Select lines from text file which have ids listed in another file

I use a lot of grep awk sort in my unix shell to work with medium-sized (around 10M-100M lines) tab-separated column text files. In this respect unix shell is my spreadsheet. But I have one huge problem, that is selecting records given a list of IDs. Having `table.csv` file with format `id\tfoo\tbar...` and `ids.csv` file with list of ids, only select records from `table.csv` with id present in `ids.csv`. kind of http://stackoverflow.com/questions/13732295/extract-all-lines-from- text-file-based-on-a-given-list-of-ids but with shell, not perl. `grep -F` obviously produces false positives if ids are variable width. `join` is an utility I could never figure out. First of all, it requires alphabetic sorting (my files are usually numerically sorted), but even then I can't get it to work without complaining about incorrect order and skipping some records. So I don't like it. grep -f against file with `^id\t`-s is very slow when number of ids is large. `awk` is cumbersome. Are there any good solutions for this? Any specific tools for tab-separated files? Extra functionality will be most welcome too. UPD: Corrected `sort` -> `join`


What does "link#1" mean?

netstat -rn     Routing tables     Internet:     Destination        Gateway            Flags    Refs      Use    Mtu  Interface     default            75.126.68.49       UGS         7     1203      -   pcn0     1.2.3.3/29    link#1             UC          1        0      -   pcn0     ...      **My question** : What does "link#1" mean? The OS is OpenBSD.


How to give rights to user on server to use programs

I installed a bunch of applications via SSH on a Debian Wheezy server. Now I want to give one extra developer rights to use one folder. I added her to a new group "myappdevs" and gave the group right to read and write the directory. When I login as the new user and check the programs for:               ruby -v      I see an old version returned. And for               rails -v      and               bundle      I get the errors `[program] : command not found`. For `Vim` it did work, but I had to copy my own Vim profile to the home directory of the new user for it to work. I am new to setting up permissions and access. How can I give the new user access to `ruby`, `bundle` and `rails`?


rename files in batch

During importing my music files from backup (thanks to default naming scheme of `rhythmbox`), I have messed up the file names. Now the looks like:               00 - American Pie.ogg.ogg.ogg.ogg     00 - American Pie.ogg.ogg.ogg.ogg.ogg     00 - another brick in the wall.ogg.ogg.ogg.ogg     00 - another brick in the wall.ogg.ogg.ogg.ogg.ogg     00 - candle_in_the_wind.ogg.ogg.ogg.ogg     00 - candle_in_the_wind.ogg.ogg.ogg.ogg.ogg      While the file should look like               American Pie.ogg     another brick in the wall.ogg     candle_in_the_wind.ogg      And I have (as from `wc -l`) 3096 such files. How can I restore it in batch mode? I have tried `rename` and `mmv` to work, as given in the ans of this question, but not working (problem with the `rename` syntax, and for `mmv`,there is collision). Any help please?


udev triggers rule but script fails to execute properly

I am trying to automate a quick and dirty backup of a headless system. (I feel it is relevant to note that I am running Busybox utilities so this is the mount tool I have at my disposal) I have made a udev rule to execute a script when my USB device is plugged in and it does trigger and execute the called script. Currently the script just mounts the device but it fails to do so. If I run the script manually, there is no error. I added the line `exec >/home/user/udev.out 2>&1` to try to figure out why it is failing. Script Contents:               #!/bin/sh     exec >/home/user/udev.out 2>&1     mount -t ntfs-3g /dev/sdb1 /mnt/backup     exit 0      I know I shouldn't use /dev/sdb1 in the script, and I do generate a symlink in the udev rule, but just for error checking I have hardcoded the device. I have also tried adding a 3 second sleep before the mount command to be sure the device could be detected by the system before executing the mount command, to no avail. Results of udev.out:               mount: mounting /dev/sdb1 on /mnt/backup failed: No such device      I know the device is there and it is listed by fdisk. If I call the script from shell, it runs successfully no problem. Has anyone encountered anything similar before? I am not sure how to proceed. edit: udev rule:               SUBSYSTEM=="block", ATTRS{serial}=="serialforusbdrive", SYMLINK+="kingston%n"     SUBSYSTEM=="usb", ATTRS{serial}=="serialforusbdrive", RUN+="/usr/local/bin/backup.sh"      edit: Clarification: udev rule triggers and runs my script. The script when run manually from shell (I type `/usr/local/bin/backup.sh` in shell and the drive is mounted) The script when run by udev rule (RUN+="/usr/local/bin/backup.sh") runs the script but fails to mount the drive.


Want to dual boot MBP with Linux

I just upgraded to a 1tb HDD in my MacBook Pro (non-retina) and would like to dual boot from OS X to a linux distro. I'd like to find out a few things so I can be better prepared and informed for this process. 1) Partitioning... Should I... a) Use BootCamp to create the second partition? b) Use Disk Utility to resizes and create the second partition? c) Create the partition from within the Linux live USB or DVD? 2) Which distro is recommended? I've used both Mint and Ubuntu in the past and definitely prefer distros based on Debian that use `apt-get` as opposed to the others like SUSE. 3) I've heard that it's a pain to get the wifi to work, is that true? If so, how to I enable the drivers? Is there an `apt-get` command I can use in order to do so? 4) Other than the wifi difficulties is there anything else I should be aware of and be prepared for?


FreeBSD: "Too many open files" but should be able to open another 160,000 files

I have a FreeBSD 8 system running ZFS, with a MySQL 5.5 server which is about 355GB and projected to grow to be a couple of Terabytes. MySQL is triggering errors about "Too many open files" on `/etc/hosts.allow`. We don't expressly use `/etc/hosts.allow`, but it is used by hosts_access(3) (`libwrap.a`), which is used by many things.               mysqld[1234]: warning: /etc/hosts.allow, line 15: cannot open /etc/hosts.allow: Too many open files      But when I check 't seem to be hitting any actual limits. The number of open files reported by `kern.openfiles stays` below 40,000 over a sustained period, and our limit is substantially higher:               # sysctl -a |grep files     kern.maxfiles: 204800     kern.maxfilesperproc: 184320     kern.openfiles: 38191          # ulimit -n     184320      Openfiles should be set to unlimited:               # grep openfiles /etc/login.conf         :openfiles=unlimited:\      MySQL says it should be able to open 184320 file handles:               # mysqladmin variables | grep open_files_limit     | open_files_limit                              |     184320                |      And some information from the perspective of the MySQL user. I stopped mysql and hacked `/usr/local/etc/rc.d/mysql-server` to print out these variables, so this should represent the MySQL environment. Note that the number 184320 is consistent with the above.               # /usr/local/etc/rc.d/mysql-server.stefantest start     Starting mysql.     cpu time               (seconds, -t)  unlimited     file size           (512-blocks, -f)  unlimited     data seg size           (kbytes, -d)  33554432     stack size              (kbytes, -s)  524288     core file size      (512-blocks, -c)  unlimited     max memory size         (kbytes, -m)  unlimited     locked memory           (kbytes, -l)  unlimited     max user processes              (-u)  5547     open files                      (-n)  184320     virtual mem size        (kbytes, -v)  unlimited     swap limit              (kbytes, -w)  unlimited     sbsize                   (bytes, -b)  unlimited     pseudo-terminals                (-p)  unlimited      And, for easy reference here are the descriptions for the sysctls:               kern.maxfiles: Maximum number of files     kern.openfiles: System-wide number of open files     kern.maxfilesperproc: Maximum files allowed open per process      **Related**   * This is possibly related to a ZFS on Nexenta question on ServerFault: Why is MySQL unable to open hosts.allow/hosts.deny?   * Also see this similar issue on the FreeBSD forums: [EMFILE] Too many open files


How to measure total disk I/O per hour

I have a cloud server were we get billed also for disk IO usage. Here is an example from the stats:               04/Sep/2013 07:24:19     04/Sep/2013 08:24:19     0,5 GB / 1 vCPU (0,08 Kr. per hour): Charge for 44.7578125GB disk I/O      So for one hour we get billed for around 45 GB disk I/O. To me that sounds like a lot of traffic and I would like to do some monitoring to check it myself. I know about tools like `dstat` and `sysstat` etc but I have not found any examples showing totals for one hour (or other timeframe). Most examples is averaging the results, like this command:               dstat -tdD total 60      Here, it shows disk I/O measuring for 60 seconds, but it is averaged. So if I copy a large file, I will see the number increase while copying, but as soon as it is finished, the number will decrease again. I other words, I don't end up with a true total for that period. **How can I log the total amount of disk I/O in a given timeframe?**


Spam don`t get rejected from Amavisd?

I see the following in my maillog:               (20448-09) Passed SPAMMY {RelayedTaggedInbound}, [12.21.30.50]:63138 [12.21.30.50] <advertisebz079guqn@gmail.com> -> <sales@censored.com>, Message-ID: <DA134EA6.72A01797@gmail.com>, mail_id: HHUQ8IsrTDBj, Hits: 17.262, size: 1950, queued_as: 8A0CE10564585, 9634 ms      So it hits: Hits: "17.262" My configuration (`/etc/amavisd/amavisd.conf`):               $sa_tag_level_deflt  = 3.0;  # add spam info headers if at, or above that level     $sa_tag2_level_deflt = 10;  # add 'spam detected' headers at that level     $sa_kill_level_deflt = 12;  # triggers spam evasive actions (e.g. blocks mail)     $sa_dsn_cutoff_level = 999;   # spam level beyond which a DSN is not sent     # $sa_quarantine_cutoff_level = 25; # spam level beyond which quarantine is off     $penpals_bonus_score = 8;    # (no effect without a @storage_sql_dsn database)     $penpals_threshold_high = $sa_kill_level_deflt;  # don't waste time on hi spam          $sa_mail_body_size_limit = 400*1024; # don't waste time on SA if mail is larger     $sa_local_tests_only = 0;    # only tests which do not require internet access?      and               #     # Quarantine settings     #          $final_virus_destiny = D_REJECT;     $final_spam_destiny = D_REJECT;     $final_banned_destiny = D_REJECT;     $final_bad_header_destiny = D_PASS;      So why the mail will be delivered and tagged as SPAMMY but not rejected? It is really strange but it looks like that the settings are not used or overwritten. * * * Fullconfig: http://pastebin.com/P0iYTaz4


Why and how to track /var/log/dmesg with version control

On this wiki they recommend tracking `/var/log/dmesg` using Mercurial. I wanted to set up a cron job on CentOS 6.4 like on this page to remind myself to make commit messages for such a repo. However, the output of `hg diff` on `/var/log/dmesg` is pretty long, and I don't really understand what it is I'd be looking for. If you track this file yourself, why? What problems do you watch out for with it? How frequently does yours change?


What file type categories do colors in the terminal represent in various distros (by default)?

I'm discovering new file type categories (if one can call different colors in the terminal in such a manner) almost on a daily basis. Still, I haven't found an exhaustive list of all recognized file types (compressed, pipe, directory, music, etc.) and the respective colors on the terminal, and that's a resource I'd appreciate to have. Is there a complete list for any Unix-based system? I'd like a full table for many distros, options, etc.; but if you'd give me a few really useful informative links, perhaps someone can add it up into a table (maybe this should be a community-wiki question, however, I can't mark it as such).


Oidentd problem with centos 6.5

I have installed oidentd and it is not working with ipv6s only, it works with ipv4 just fine. I have done some search on google and applied a patch on oidentd to work with ipv6 but i still cant make it to work. Here is the copy/paste.               root@mustang [~]# lsof -i -n -P | grep oidentd     oidentd 6065 nobody 6u IPv4 5906 0t0 TCP *:113 (LISTEN)     oidentd 6065 nobody 7u IPv6 5907 0t0 TCP *:113 (LISTEN)          telnet ::1 113     Trying ::1...     Connected to ::1.     Escape character is '^]'.      I also tried changing the value 0 to 1 in `/proc/sys/net/ipv6/bindv6only` still doesn't help. I even tried editing the setting in `/etc/init.d/oidentd` to execute oidentd with -a :: still nothing. All of my users are getting ~ symbol ifront of their ident. Here is one example               Nick is ~d34m0n@2607:5300:60:5177::21e3:4232 * ...      what am I missing? it's been a week and i am still scratching my head.


How to check for a folder inside a particular folder in shell script?

I am working on a shell script and python script as well. Python script is passing certain parameters to my shell script and then I am using those parameters in my shell script. Below is my shell script -               #!/bin/bash          readonly MACHINES=(machineB machineC)     readonly MAPPED_LOCATION=/bat/peta/t1_snapshot     readonly FILE_TIMESTAMP=$file_timestamp          // old code which I am using to get the full path of the latest folder in each machine     dir1=$(ssh -o "StrictHostKeyChecking no" david@${MACHINES[0]} ls -dt1 "$MAPPED_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] | head -n1)     dir2=$(ssh -o "StrictHostKeyChecking no" david@${MACHINES[1]} ls -dt1 "$MAPPED_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] | head -n1)          echo $dir1     echo $dir2          // not sure what should I do here?     dir3=$MAPPED_LOCATION/$FILE_TIMESTAMP      In each machine `(machineB and machineC)`, there will be a folder in this format `YYYYMMDD` inside this folder `MAPPED_LOCATION`. Now what I am trying to do is - I am passing `file_timestamp` from the python script which will be in this form `YYYYMMDD` so now I need to check whether this folder is there inside `MAPPED_LOCATION` folder or not in each machine. If it is there then print out the full path of that folder for each machine, otherwise exit out of the shell script with non-zero status. If it is not there in any one of the machine, I will exit out of the shell script with a message that this folder is not present in this machine with non zero status. I am not sure how can I do this check in the shell script?


How to exclude directories from `ls -R` output?

If `ls -aR | grep ":$"` returns               ./.hiddendir2:     ./dir1:     ./dir3:     ./dir3/.hiddendir4:      then how can you update the pattern given to grep so that you only get               ./dir1:     ./dir3:      (note that the last line containing .hiddendir4 was omitted even though it's parent was not hidden) * * * Here is a wordy version of the same question with some context: I found a great script at http://www.centerkey.com/tree/ for printing a directory tree, but the output is cluttered sometimes by the descendants of the .git directory for repos I'm working on. If I read the source correctly I need to change the pattern given to grep at this line: `ls -aR | grep ":$"` So far I came up with `^\\./(?!\\.)\w+:$` which seemed to work in testing at http://regexpal.com/, but then broke when I tried running in bash. I suspect the combination of (1) differences between regex testing tools i'm using to how grep parses a pattern, (2) bash escape character requirements, and (3) pattern design all need to be addressed to solve this. Help appreciated before I end up spending too long on this.


Printing fields using awk

< pool.sam awk '       /./ {printf $1}       {printf $7+1,"\t"}       {printf $3,"\t"}       {         if($2 !=16) {print "\t", "+";} else {print "\t","-";}         {printf $4,"\t" ,length($10)+$4, "\t", "1"}       }'      I am getting all the values, but in a weird manner. I am printing 7 values, value1 value2 value3 value7 I want all these 7 values, separated by a TAB, in each Line. I tried my best to figure out if to use `print` or to use `printf` Seems, I lost in that. Kindly guide me.


iw fails to configure interface

I have two PCs:   * Ubuntu 12.04.4, 3.5.0-45-generic (let's call it "myGoodPC")   * Ubuntu 12.04.3, 3.8.0-35-generic (let's call it "myBadPC") `myBadPC` operates in a virtual machine of ESXi 5.0.0. In `myGoodPC` I manage to configure the wireless interface properly:               root@myGoodPC:~# sudo iw --debug dev wlan0 set channel 10 HT40-     -- Debug: Sent Message:     --------------------------   BEGIN NETLINK MESSAGE ---------------------------       [HEADER] 16 octets         .nlmsg_len = 44         .nlmsg_type = 24 <0x18>         .nlmsg_flags = 5 <REQUEST,ACK>         .nlmsg_seq = 1398703424         .nlmsg_pid = 14796       [PAYLOAD] 28 octets         02 00 00 00 08 00 03 00 08 00 00 00 08 00 26 00 99 09 ..............&...         00 00 08 00 27 00 02 00 00 00                         ....'.....     ---------------------------  END NETLINK MESSAGE   ---------------------------     -- Debug: Received Message:     --------------------------   BEGIN NETLINK MESSAGE ---------------------------       [HEADER] 16 octets         .nlmsg_len = 36         .nlmsg_type = 2 <ERROR>         .nlmsg_flags = 0 <>         .nlmsg_seq = 1398703424         .nlmsg_pid = 14796       [ERRORMSG] 20 octets         .error = 0 "Success"       [ORIGINAL MESSAGE] 16 octets         .nlmsg_len = 16         .nlmsg_type = 24 <0x18>         .nlmsg_flags = 5 <REQUEST,ACK>         .nlmsg_seq = 1398703424         .nlmsg_pid = 14796     ---------------------------  END NETLINK MESSAGE   ---------------------------      Also I successfully sniff WiFi data packets (ICMP / ping packets). In `myBadPC` an error appears when trying to configure:               root@myBadPC:~# sudo iw --debug dev wlan0 set channel 10 HT40-     -- Debug: Sent Message:     --------------------------   BEGIN NETLINK MESSAGE ---------------------------       [HEADER] 16 octets         .nlmsg_len = 44         .nlmsg_type = 25 <0x19>         .nlmsg_flags = 5 <REQUEST,ACK>         .nlmsg_seq = 1398698982         .nlmsg_pid = 14533       [PAYLOAD] 28 octets         02 00 00 00 08 00 03 00 03 00 00 00 08 00 26 00 99 09 ..............&...         00 00 08 00 27 00 02 00 00 00                         ....'.....     ---------------------------  END NETLINK MESSAGE   ---------------------------     -- Debug: Received Message:     --------------------------   BEGIN NETLINK MESSAGE ---------------------------       [HEADER] 16 octets         .nlmsg_len = 64         .nlmsg_type = 2 <ERROR>         .nlmsg_flags = 0 <>         .nlmsg_seq = 1398698982         .nlmsg_pid = 14533       [ERRORMSG] 20 octets         .error = -16 "Device or resource busy"       [ORIGINAL MESSAGE] 16 octets         .nlmsg_len = 16         .nlmsg_type = 25 <0x19>         .nlmsg_flags = 5 <REQUEST,ACK>         .nlmsg_seq = 1398698982         .nlmsg_pid = 14533     ---------------------------  END NETLINK MESSAGE   ---------------------------     command failed: Device or resource busy (-16)      Obviously I fail to sniff data packets (ICMP/ping) after this command (but broadcast are visible). Note: I removed other commands from the above code for clarity (like `ifconfig wlan0 down` that comes before `iw` or `iwconfig wlan0 mode monitor` and `ifconfig wlan0 up` that come after). What could make wlan0 to have errors in `myBadPC`?


Change network values from sysctl.conf

Can I change the value of those parameters (`spoofprotect`, `syncookies`, `dynaddr_hack`, `notimestamps`, `nobroadcasticmpecho`, `ip_forward`) from `sysctl.conf` file in `systemd`?


Why I can't send mail to remote mailbox?

I have installed Postfix on my CentOS machine. I can nicely send mails to local accounts with `mutt`, but when I try to send one to a remote mail like myactualmail@gmail.com, I cannot understand why I can't receive anything. Here my `main.cf`:               queue_directory = /var/spool/postfix     command_directory = /usr/sbin     daemon_directory = /usr/libexec/postfix     data_directory = /var/lib/postfix     mail_owner = postfix     myhostname = server.example.com     mydomain = example.com     myorigin = $mydomain     inet_interfaces = all     inet_protocols = all     mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain     unknown_local_recipient_reject_code = 550     mynetworks = 192.168.200.0/24, 127.0.0.0/8     alias_maps = hash:/etc/aliases     alias_database = hash:/etc/aliases     debug_peer_level = 2     debugger_command =          PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin          ddd $daemon_directory/$process_name $process_id & sleep 5               sendmail_path = /usr/sbin/sendmail.postfix     newaliases_path = /usr/bin/newaliases.postfix     mailq_path = /usr/bin/mailq.postfix     setgid_group = postdrop     html_directory = no     manpage_directory = /usr/share/man     sample_directory = /usr/share/doc/postfix-2.6.6/samples     readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES      In the maillog I find these:               Jan 22 14:33:15 server postfix/qmgr[5025]: 316FEBF65E: from=<diego@example.com>, size=430, nrcpt=1 (queue active)     Jan 22 14:33:15 server postfix/smtp[5276]: connect to gmail-smtp-in.l.google.com[2a00:1450:400c:c05::1b]:25: Network is unreachable     Jan 22 14:33:15 server postfix/smtp[5276]: connect to gmail-smtp-in.l.google.com[173.194.66.26]:25: Connection refused     Jan 22 14:33:15 server postfix/smtp[5276]: connect to alt1.gmail-smtp-in.l.google.com[2a00:1450:400c:c05::1a]:25: Network is unreachable     Jan 22 14:33:15 server postfix/smtp[5276]: connect to alt1.gmail-smtp-in.l.google.com[173.194.70.26]:25: Connection refused     Jan 22 14:33:15 server postfix/smtp[5276]: connect to alt2.gmail-smtp-in.l.google.com[2a00:1450:400c:c05::1b]:25: Network is unreachable     Jan 22 14:33:15 server postfix/smtp[5276]: 316FEBF65E: to=<myactualmail@gmail.com>, relay=none, delay=2662, delays=2661/0.04/0.08/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[2a00:1450:400c:c05::1b]:25: Network is unreachable)      But I can ping nicely the host:               ping gmail-smtp-in.l.google.com     PING gmail-smtp-in.l.google.com (173.194.66.26) 56(84) bytes of data.     64 bytes from we-in-f26.1e100.net (173.194.66.26): icmp_seq=1 ttl=128 time=29.2 ms     64 bytes from we-in-f26.1e100.net (173.194.66.26): icmp_seq=2 ttl=128 time=29.6 ms     64 bytes from we-in-f26.1e100.net (173.194.66.26): icmp_seq=3 ttl=128 time=31.0 ms


I have a couple of questions, and am a complete newbie, so please be kind.   1. How do you change the desktop theme in CentOS?    2. How does one download CentOS themes from the internet?   3. How do you install them?


ssldump: PCAP: syntax error

I'm using:               # uname -ro     FreeBSD 9.0-RELEASE-p3      And the latest `ssldump`:               # pkg_info | grep ssldump     ssldump-0.9b3_4     SSLv3/TLS network protocol analyzer      When I try starting it with decryption - I got the following error:               # ssldump -Xnd -i em0 port 8443 -k name.pem -p password     PCAP: syntax error      I've installed `libpcap`:               # pkg_info | grep libpcap     dnstop-20121017     Captures and analyzes DNS traffic (or analyzes libpcap dump     libpcap-1.4.0       Ubiquitous network traffic capture library      Found one reference about possible problems with some network interfaces: > Support is provided for only for Ethernet and loopback interfaces So I tried to eun `ssldump` with `lo0`:               # ssldump -Xnd -i lo0 port 8443 -k name.pem -p password     PCAP: syntax error      So - how I can run`ssldump` with packets decryption? Where is my mistake?


Compiling and installing a kernel.org kernel to a custom volume on disk

I want to compile and install a kernel.org kernel on a custom HDD volume, say `/dev/sda5`, instead of being merged with my current Ubuntu's directories. I can find information about configuration and compilation process all over the web, but there's no track of how to put the kernel on a custom volume (different than the booted distro you're using at the moment of compile). What I'm asking for is like how we can install 2 different distros on 2 different volumes on 1 HDD, now think of my custom kernel as another distro.


awk command for parsing a file

I have a following text file. I am showing you the first 3 lines.               chrom   st  end gene    strand  c1  c2  c3  c4  c5  c6  c7  c8  c9  c10 c11 c12 c13 c14     chr6    3345    3543    geneA   +   36  -23 -1  3   1250    946 416 458 475 417 58  80  2   14     chr9    1302    1389    geneB   -   8   -10 -18 -8  2896    2128    635 955 372 385 -20 31  -7  -7      I want to print out first line as it is since it's the header line. Then for subsequent lines(i.e. from lines 2 and onwards), I want to print the first 5 fields as it is(till the strand info) and after that if the field(from 6th field onwards) has value >= 100 print that value as it is and if the field has value < 100 just replace it with NA. So my output file should look something like this (ideally, tab-delimited)               chrom   st  end gene    strand  c1  c2  c3  c4  c5  c6  c7  c8  c9  c10 c11 c12 c13 c14     chr6    3345    3543    geneA   +   NA  NA  NA  NA  1250    946 416 458 475 417 NA  NA  NA  NA     chr9    1302    1389    geneB   -   NA  NA  NA  NA  2896    2128    635 955 372 385 NA  NA  NA  NA


Issue with WINCH signal - what am I overlooking?

I am having an issue with the WINCH signal in the following code which is from a tutorial located at developerWorks®:               #!/bin/bash     trap 'get_window_size' WINCH                    # trap when a user has resized the window          _UNDERLINE_ON=`tput smul`                       # turn on underline     _UNDERLINE_OFF=`tput rmul`                      # turn off underline          get_window_size() {       _WINDOW_X=`tput lines`       _WINDOW_Y=`tput cols`            _FULL_SPACES=`echo ""|awk '       {         _SPACES = '${_WINDOW_Y}'         while (_SPACES-- > 0) printf (" ")       }'`       _FULL_UNDERLINE=`echo "${_UNDERLINE_ON}${_FULL_SPACES}${_UNDERLINE_OFF}"`            unset _FULL_SPACES       show_menu            return 0     }          set_color() {       tput clear       PS3="Enter Selection[1-9]:"       select _COLOR in "Black" "Blue" "Green" "Cyan" "Red" "Magenta" "Yellow" "White" "Exit"       do         case ${REPLY} in            [1-8])  _X=`expr ${REPLY} - 1`;;                9)  break;;                *)  echo "Invalid Color"; continue;;         esac              if [[ ${1} = "b" ]]         then           tput setb ${_X}             else           tput setf ${_X}         fi       done     }          show_menu() {       while [[ -z ${_ANS} ]]       do         tput civis         tput clear              cat <<- EOF     Window Size: ${_WINDOW_X} / ${_WINDOW_Y}               Select => ${_UNDERLINE_ON}     ${_UNDERLINE_OFF}          ${_FULL_UNDERLINE}     B) Background Text Color     F) Foreground Text Color          X) Exit     EOF              tput rc         tput smul         tput cnorm              read _ANS         tput rmul              case ${_ANS} in           [Bb])  set_color "b";;           [Ff])  set_color "f";;           [Xx])  tput clear; exit;;              *)                  echo -e "Invalid Selection: ${_ANS}\c"                  sleep 2                  ;;         esac         unset _ANS       done     }          tput sgr0     tput civis     tput clear     tput cup 3 10     tput sc     tput cup 0 0          [[ -n ${_ANS} ]] && unset _ANS     get_window_size          exit 0      Since I am trapping the WINCH (window change) signal, I expect that (each time I adjust the window which contains this running script) the get_window_size function will be invoked. However, on my machine, it only traps the WINCH signal once (under specific conditions). The trap happens only if I use the xterm (in this case, gnome- terminal) `Terminal` menu to choose one of the default sizes (80x24, 80x43, 132x24, 132x43); further, it happens only the first such time. If I subsequently change the window size (using the `Terminal` menu item), no trapping occurs. Also, if I don't use the `Terminal` menu item, but re-size using a pointing device, even the first trap does not happen. Can someone help me to understand what is wrong (either with the code or with my expectation)?


'find'  across directories named .../dirnameXX/... with XX variable

I am executing this command to find certain files in specific directory:               find ./rgs/test/maesXX/master/stdlist -name \*.extract \          -mtime +30 \! -size 0 -exec ls -lrt {} \;      where XX could be any number between 1-100. Can I use a regex for this purpose? How would I do that? Are there other ways?


closing socket after forcing terminal close

I'm running Bluetooth socket server, this server is listening to incoming connection. but I forced the terminal close ctrl + Z . after that the server is not listeing any more and show me the output `accepted connection from 00:00:00:00:00:00` to make it run again I should restart my computer. how can I close properly the socket to I can run the server again without reboot               int main(int argc, char **argv)     {         struct sockaddr_rc loc_addr = { 0 }, rem_addr = { 0 };         char buf[1024] = { 0 };         int s, client, bytes_read;         socklen_t opt = sizeof(rem_addr);         s = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);         loc_addr.rc_family = AF_BLUETOOTH;         loc_addr.rc_bdaddr = *BDADDR_ANY;         loc_addr.rc_channel = (uint8_t) 1;         bind(s, (struct sockaddr *)&loc_addr, sizeof(loc_addr));         listen(s, 1);         client = accept(s, (struct sockaddr *)&rem_addr, &opt);         ba2str( &rem_addr.rc_bdaddr, buf );         fprintf(stderr, "accepted connection from %s\n", buf);         memset(buf, 0, sizeof(buf));         bytes_read = read(client, buf, sizeof(buf));         if( bytes_read > 0 ) {             printf("received [%s]\n", buf);         }         close(client);         close(s);         return 0;     }


A combination of uniq and agrep?

I have a file full of long SQL queries, one per line. I need to create a list of unique queries, but most of the queries include parameter values that make using an exact matching tool like `uniq` impossible. Is there a way to find unique lines "fuzzily", like `agrep`?


How to copy text from vim to an external program?

I'm trying to copy-paste some text from vim. I'm doing **v** to enter visual mode, then **y** once I selected my block. It appears to copy the text into vim's clipboard, because p will paste it. But in another program (e.g. Chrome), right-click->paste doesn't paste the correct text. How do I copy text to the correct clipboard?


dd vs cat -- is dd still relevant these days?

I recently realized we can use `cat` as much as `dd`, and it's actually faster than `dd` I know that `dd` was useful in dealing with tapes where block size actually mattered in correctness, not just performance. In these days, though, are there situations where `dd` can do something `cat` can't? (Here I would regard a less than 20% performance difference irrelevant.) Concrete examples would be nice!


gnome-music 3.12 playlist duplicated

![enter image description here](http://i.stack.imgur.com/V3ISN.png) I am pretty sure the file is not duplicated in `Music` folder


Get latest Rekonq developmental source code

I see that I can get the latest stable Rekonq through http://sourceforge.net/projects/rekonq/, but I want to get the latest developmental-version/daily-build. Where can I obtain the developmental source code?


How to find which package provides a file?

For example, I can't install package `qcad` because of error: "can't find qdict.h".   How can I find the package which provides the file `qdict.h` so I can install the package `qcad`?


Error installing gnome-shell-extension-common from AUR on Arch

I'm new to Arch Linux and just wanted to theme my Gnome Shell by installing gnome-shell-extension-user-theme for the Gnome Tweak Tool. However I keep getting an error when trying to build gnome-shell-extension-common-git from AUR. The version number contains a hypen but if I edit the PKGBUILD it just gets written over again. I run:               yaourt gnome-shell-extension-common-git      View contents of PKGBUILD:               # Maintainer: Alucryd <alucryd at gmail dot com>     # Contributor: Sebastian Lenz <sebastian@archusers.de>          pkgname=gnome-shell-extension-common-git     pkgver=3.8.1.7     pkgrel=1     pkgdesc="Common files for the GNOME Shell Extensions"     arch=('any')     url="http://live.gnome.org/GnomeShell/Extensions"     license=('GPL' 'LGPL')     depends=('gnome-shell')     makedepends=('git' 'gnome-common' 'intltool')     provides=('gnome-shell-extension-common')     conflicts=('gnome-shell-extension-git' 'gnome-shell-extension-common')     source=('git+http://git.gnome.org/browse/gnome-shell-extensions#branch=gnome-3-8')     sha256sums=('SKIP')          pkgver() {       cd "${srcdir}"/gnome-shell-extensions            git describe | sed 's|\(.*-.*\)-.*|\1|;s|-|.|'     }          build() {       cd "${srcdir}"/gnome-shell-extensions            ./autogen.sh --prefix=/usr --disable-schemas-compile --enable-extensions=""       make     }          package() {       cd "${srcdir}"/gnome-shell-extensions            make DESTDIR="${pkgdir}" install     }          # vim: ts=2 sw=2 et:      Get an error when building:               ==> Starting pkgver()...     ==> Updated version: gnome-shell-extension-common-git 3.8.3.1.real-2-1     ==> ERROR: pkgver is not allowed to contain colons, hyphens or whitespace.     ==> ERROR: Makepkg was unable to build gnome-shell-extension-common-git.     ==> Restart building gnome-shell-extension-common-git ? [y/N]      New Contents of PKGBUILD:               # Maintainer: Alucryd <alucryd at gmail dot com>     # Contributor: Sebastian Lenz <sebastian@archusers.de>          pkgname=gnome-shell-extension-common-git     pkgver=3.8.3.1.real-2     pkgrel=1     pkgdesc="Common files for the GNOME Shell Extensions"     arch=('any')     url="http://live.gnome.org/GnomeShell/Extensions"     license=('GPL' 'LGPL')     depends=('gnome-shell')     makedepends=('git' 'gnome-common' 'intltool')     provides=('gnome-shell-extension-common')     conflicts=('gnome-shell-extension-git' 'gnome-shell-extension-common')     source=('git+http://git.gnome.org/browse/gnome-shell-extensions#branch=gnome-3-8')     sha256sums=('SKIP')          pkgver() {       cd "${srcdir}"/gnome-shell-extensions            git describe | sed 's|\(.*-.*\)-.*|\1|;s|-|.|'     }          build() {       cd "${srcdir}"/gnome-shell-extensions            ./autogen.sh --prefix=/usr --disable-schemas-compile --enable-extensions=""       make     }          package() {       cd "${srcdir}"/gnome-shell-extensions            make DESTDIR="${pkgdir}" install     }          # vim: ts=2 sw=2 et:      If I edit the file to remove the hypthen it makes no difference as it is added again when I try to build again.


Volume too quiet at maximum

I recently replaced my broken Sennheiser PC350 to a Beyerdynamic DT770 Pro 80 Ohm headphones and I've encountered a really annoying issue. Everything is too low. I can listen to it, but it's almost as if I'm on 10% of max volume. On Windows this issue isn't present at all, and is almost a little too loud on 100%. Pulseaudio settings are set to 100%, and every slider in the alsamixer are set to 100% too. If I set the volume to 150%, the sound gets too saturated and distorted. My sound chip is the Realtek ALC1150. I'm running Arch. Edit After thinking it was solved, the issue came back but I believe I have more of an understanding of the issue now. Using the line out port, green one, works from time to time, but more often than not, using any of the other ports will output the what you'd expect from line out. In a way, the issue is resolved since if I use any other ports than the line out, the sound is working like it should. I'd rather not though as Windows doesn't output anything at all when not using line out, and there are times where linux too won't output to anything but line out. How come linux gets so confused? It's almost as if it believes the line out port is all of the other ports except for line out.


How to create a patch ignoring indentation differences in the code?

I'm trying to create patch a file using diff tool.But facing an issues.The way I am doing is below. I've created one Directory named a and put original file in to it.               a/original_file.c      Now I have created other Directory named b and put same file with modified content in to it.               b/original_file.c      Now content of `b/original_file.c` file I have copied from internet and put it into some text editor. After giving command: `diff -Naur a b > patch_file.patch`, the file `patch_file.patch` is generated and it has some unwanted changes (its related to indentation). For example:               return mg_nw (MG_READY_NOY, &rmsg, seqnr,     -                 sizeof (struct mg_rdy_notify));     +                  sizeof (struct mg_rdy_notify));       Now you can see there are changed related to indentation where `sizeof (struct mg_rdy_notify))` is replaced by same `sizeof (struct mg_rdy_notify))` but one basis of indentation which is what we don't want.


For downloading, youtube file format changes depending on OS?

Oh! its sad to see what I saw. I am downloading a file from youtube (the video is of 1 hr) using command line from Ubuntu13.04 as below:               ravbholua@ravbholua-Aspire-5315:~$ youtube-dl "http://www.youtube.com/watch?v=d4Z8VI3myBw"     [youtube] Setting language     [youtube] d4Z8VI3myBw: Downloading video webpage     [youtube] d4Z8VI3myBw: Downloading video info webpage     [youtube] d4Z8VI3myBw: Extracting video information     [download] Destination: d4Z8VI3myBw.mp4     [download]   0.1% of 718.62M at   13.70k/s ETA --:--      See the size is 718 MB and type is mp4. The same file I downloaded earlier from Windows 7 OS using youtube downloader. Then the type and size of the file was flv and 130 MB only. Similarly, yesterday and today I downloaded files from youtube via my Ubuntu13.04 and all were downloaded as mp4 and very very big size. But when I downloaded many videos via Windows earlier all the files had flv type and very less size as compared to mp4. I can't download youtube videos if they are downloaded like this (mp4 with big sizes). One thing is clear: the difference lies with the OS and/or the youtube downloader for Windows7. What setting needs to be changed please here in Ubuntu13.04?


Configure syslog.conf file

How can I configure `/etc/syslog.conf` file in order to save log information about `iptables` in a specific file. I want to save these information separately, so I can extract what I want easily and rapidly.


dmesg email digest

I have a remote server which has some issues (Seem hardware related) which means that it logs `KVM` errors and then sometime later it becomes unresponsive and locked up. There is an often an early indication of it failing, in the `dmesg` log output, so I would like to know, is there a Debian utility which can send me (daily?) digests of the `dmesg` (`/var/log/kern.log`) output?


With grep, how can I match a pattern and invert match another pattern?

With `grep`, I want to select all lines that match a pattern, and that don't match another pattern. I want to be able to use a single invocation of `grep` so that I can use the `\--after-context` option (or `\--before-context`, or `\--context`). `-v` is not viable here, as it negates all patterns I pass to `grep` using the `-e` option. ### Example I want to look for lines matching `needle`, ignoring lines matching `ignore me`, with one line of following context. Here's my input file:               one needle ignore me     two     three     four needle     five      The output I want is:               four needle     five      As you can see, this naive solution doesn't work:               $ cat file | grep --after-context=1 needle | grep -v 'ignore me'     two     ---     four needle     five


description of linux kernel boot parameters 'real_root' and 'cdroot'

I am looking for a formal description of the following boot parameters in the linux kernel:   * real_root    * cdroot  I have problems tuning them to create my own bootable LiveUSB system. Are they specific to my distribution (Gentoo)? They do not appear in the gitweb kernel documentation.


in which directory should Firefox be compiled?

I want to compile Firefox browser in RHEL.   I found two directories one is `/root/.mozilla/firefox` and other one is `/usr/lib64/firefox`.   Which directory is the one where Firefox should be compiled?


Restoring the old 'lenny' Debian desktop

In _lenny_ , the Debian desktop's default image was the red Debian logo, and it looked like this: ![enter image description here](http://i.stack.imgur.com/893gv.jpg) However, in _squeeze_ , the desktop has been replaced by this: ![enter image description here](http://i.stack.imgur.com/jsOU4.png) How can one restory the _lenny_ look-and-feel; at least the background image? Are those graphics still bundled with _squeeze_ , and if not, how do I get at them?


How can I tell cron to run a command every other day (odd/even)

When configuring cron to run a command every other day using the "Day of Month" field, like so:               1 22 */2 * * COMMAND      it runs every time the day of month is odd: 1,3,5,7,9 and so on. How can I configure cron to run on days of month that are even like 2,6,8,10 and so on (without specifying it literally, which is problematic as every month has a different number of days in the month)?


doing OpenLDAP config changes in RHEL 6

I've been configuring OpenLDAP on RHEL 6 and its seems you have run the following to rebuild the config dirs. I'm ok with that, but my issues is, say I want to change the server passwd, do I have to go through the whole process every time I change the config? Is there a way of changing the slapd config after its been built using the RHEL6 method? Below is the advice I've found on the net here. > This example assumes that the file to convert from the old slapd > configuration is located at /etc/openldap/slapd.conf and the new directory > for OpenLDAP configuration is located at /etc/openldap/slapd.d/. Remove the > contents of the new /etc/openldap/slapd.d/ directory: > > `rm -rf /etc/openldap/slapd.d/*` > > Run slaptest to check the validity of the configuration file and specify the > new configuration directory: slaptest -f /etc/openldap/slapd.conf -F > /etc/openldap/slapd.d > > Configure permissions on the new directory: chown -R ldap:ldap > /etc/openldap/slapd.d > > `chmod -R 000 /etc/openldap/slapd.d` > > `chmod -R u+rwX /etc/openldap/slapd.d` To clarify: I'm after help on how to edit the slapd configuration using the newer versions of openldap where the config is held in a schema rather than the original `slapd.conf`.


Reverse a chmod command on a directory

Is there a way to undo a `chmod` command on a directory in **CentOS** ?


Connecting multiple USB RNDIS devices to PC in the same network

Running an Ubuntu 12.04.4 I have the following issue: I want to connect multiple USB RNDIS devices to one PC. Additionaly, every device should be in the same network. **The problem** is that only one device is reachable via the PC. My following example is for two USB RNDIS devices. One with the IP `192.168.0.15` and the other with `192.168.0.16` The two USB devices are detected correctly with the following `/etc/network/interfaces` file:               # The device for 192.168.0.15     auto usb0     iface usb0 inet static     address 192.168.0.200     netmask 255.255.255.0          # The device for 192.168.0.16     auto usb1     iface usb1 inet static     address 192.168.0.201     netmask 255.255.255.0      If I connect the devices and run `ifconfig` it looks as follows:               usb0      Link encap:Ethernet  Hardware Adresse 22:d0:9c:4f:65:77                 inet Adresse:192.168.0.200  Bcast:192.168.0.255  Maske:255.255.255.0               inet6-Adresse: fe80::20d0:9cff:fe4f:6577/64 Gültigkeitsbereich:Verbindung               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metrik:1               RX-Pakete:5 Fehler:0 Verloren:0 Überläufe:0 Fenster:0               TX-Pakete:50 Fehler:0 Verloren:0 Überläufe:0 Träger:0               Kollisionen:0 Sendewarteschlangenlänge:1000                RX-Bytes:308 (308.0 B)  TX-Bytes:8803 (8.8 KB)          usb1      Link encap:Ethernet  Hardware Adresse 8e:f4:be:bf:6d:1c                 inet Adresse:192.168.0.201  Bcast:192.168.0.255  Maske:255.255.255.0               inet6-Adresse: fe80::8cf4:beff:febf:6d1c/64 Gültigkeitsbereich:Verbindung               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metrik:1               RX-Pakete:0 Fehler:0 Verloren:0 Überläufe:0 Fenster:0               TX-Pakete:29 Fehler:0 Verloren:0 Überläufe:0 Träger:0               Kollisionen:0 Sendewarteschlangenlänge:1000                RX-Bytes:0 (0.0 B)  TX-Bytes:5929 (5.9 KB)      But here comes the drawback. Unfortunately only the `usb0` device is reachable. So if I type in `ping 192.168.0.15` everything works fine. But if I try `ping 192.168.0.16` nothing happens, even with `ping 192.168.0.16 -I usb1` literally nothing happens:               $ ping 192.168.0.16 -I usb1     PING 192.168.0.16 (192.168.0.16) from 192.168.0.201 usb1: 56(84) bytes of data.     ^C     --- 192.168.0.16 ping statistics ---     45 packets transmitted, 0 received, 100% packet loss, time 44351ms      `ping` does even not say, that the host is unreachable (note the `time 44351`). The next strange thing is, that packages have been send (not the TX in ifconfig regarding usb1) but never recieved (not the RX in ifconfig regarding usb1).


Where might the dbus development (.h) files be for RHEL5?

A quick search from yum for dbus fails to turn up the devel related package that should provide dbus.h et al. Anybody have experience locating the relevant package? Should I just resort to getting the dbus source itself?


Detecting that a device is mounted to a particular folder?

As part of revamping my backup scheme, I'm now adding rotating external hard drives, keeping one safely off-site at all times while the other is receiving backup data. Naturally, to ensure that my backups actually get done, the backups will be scripted and cron'd. My plan is to manually plug in and mount the hard drive, and then leave it there until it's time to unmount it (again manually), take it away, bring in the next one, and (manually) mount that one. Both drives would be mounted to e.g. /mnt/backup. Now, here comes the question: I don't want the backup script to run if I forget to plug in or mount the hard drive. So I need to be able to detect if there is a device mounted to /mnt/backup before the script is allowed to run. My first thought is to put a file named e.g. 'NO_DRIVE_MOUNTED' in the (unmounted) /mnt/backup directory, and then make sure that that does _not_ exist before running the backup routine, but that just feels hackish. (Likewise, the inverse of putting a file named e.g. 'BACKUP_DEVICE_READY' in each external hard drive and checking that that file _does_ exist feels just as hackish.) Is there a better way to detect whether or not a device is mounted to a given directory? I'd rather avoid checking for the device itself, as my experience is that plugging in a drive in Linux just assigns it to the next available /dev/sdX, so while the backup drive might be /dev/sdf one day, if I have a different drive plugged in when connecting the backup drive the next time it would be /dev/sdg, which means testing for /dev/sdf would fail! I'd also prefer to avoid device-specific identification (e.g. by UUID) so that I can more easily and more transparently replace/upgrade the drives. This will be on Ubuntu 10.10 (or possibly 11.04 if I drag my feet long enough, as I'm in the process of rebuilding the whole server anyway), and ideally I'd like a simple one-line test that I can prefix to my backup command directly in my crontab (but I'm not afraid of Bash scripts, either, if that's what's necessary).


what is the difference between qsub and ./

Can anyone tell me the difference between the following ways of submitting a script:               $ qsub script_name.sh      and               ./script_name.sh      What are the differences between the above two ways of submitting a job to a cluster? Also how come sometimes I need to type:               $ chmod +x script_name.sh       ...before I can type `./script_name.sh` to submit a job? How come sometimes I just need to type `qsub script_name.sh`? Sorry I'm not very familiar with Unix.


Getting better resolution using X on OpenBSD w/VMWare Fusion

Just setup an OpenBSD 4.8 VM for VMWare Fusion. Can't seem to force X to any decent resolution. I attempted to try and use the VMWare tools for FreeBSD, but no dice. Any suggestions to try and get at least 1280x1024?


NIS+ Solaris 10, Master Server Setup

this is my first time with NIS+ Naming Service. I want to configure my host to be a master root server using this script > /usr/lib/nis/nisserver -r -d doc.com. And I got this error:               > ********        ********    WARNING    ********        ******** NIS+ might not be supported in a future release. Tools to aid the migration     > from NIS+ to LDAP are available in the Solaris 9 operating     > environment. For more information, visit     > http://www.sun.com/directory/nisplus/transition.html     > ********        ********    *******    ********        ********     >      > This script sets up this machine "master" as an NIS+ root master     > server for domain doc.com..     >      > Domain name             : doc.com. NIS+ group              :     > admin.doc.com. NIS (YP) compatibility  : OFF Security level          :     > 2=DES     >      > Is this information correct? (type 'y' to accept, 'n' to change) y     >      > This script will set up your machine as a root master server for     > domain doc.com. without NIS compatibility at security level 2.     >      > WARNING: this script removes directories and files related to NIS+     > under /var/nis directory with the exception of the client_info     > NIS_COLD_START file which will be renamed to <file>.no_nisplus.  If     > you want to save these files, you should abort from this script now to     > save these files first.     >      > WARNING: once this script is executed, you will not be able to restore     > the existing NIS+ server environment.  However, you can restore your     > NIS+ client environment using "nisclient -r" with the proper domain     > name and server information.     >      > Do you want to continue? (type 'y' to continue, 'n' to exit this     > script) y     >      > setting up domain information "doc.com." ...     >      > setting up switch information ... switch configuration file already     > set to use NIS+.     >      > killing NIS and NIS+ processes ... stopping nscd ...     >      > setup NIS_GROUP environment variable ...     >      > rm /var/nis files ...     >      > running nisinit ... This machine is in the "doc.com." NIS+ domain.     > Setting up root server ... All done.     >      > starting root server at security level 0 to create credentials...     >      > running nissetup to create standard directories and tables ...     > doc.com.: NIS+ servers unreachable. couldn't create org_dir.doc.com.     > **ERROR: it failed to create the tables.      I looked for this error, and didn't find any solution.


Disabling (or removing) X from CrunchBang home server

I've just installed crunchbang linux (based on Debian) on some really old hardware (we're talking single cores and DDR memory here) for a simple home server. However, seeing as the hardware sucks (or for some other reason) X cannot start gdm. This really doesn't bother me because the server won't have a display, I will be ssh'ing in via my workstation. However it's a problem because when I reboot the machine it gets stuck on an X error message (something like "Cannot start X blah blah") and needs direct input to continue. Is there a way I can disable (or even remove) X and the X server from my machine so that I only ever boot into a command line? Is it safe?


Using SAR to monitor free disk space data

Is there a way to make `sar` (from `sysstat`) collect free disk space data?


How can I modify variables

I have the following variable:               col=1,3,4,      Is there anyway to select the numbers within the variable: (i.e. 1 3 4 and work with them? Such as choosing the "1", "3", or "4" column from a `.txt` file?


calling functions within a function

I need to fetch the results of different time ranges and email the results, but i am having trouble with the email part of the script, how can i send an email with both results? (15min range and cumulative results) here's the line :                echo -e "Enter Start hour : xx:00:00"#ask user to input base time         read tI              echo "Select minute range, Enter 1 to 4"#ask user to select minute range         echo -e "\t1) XX:15:00 \n\t2) XX:15-30 | XX:30  \n\t3) XX:30-45 | xx:45 \n\t4) XX:45-00 | 1hour"         read NUM                if [ "$NUM" == "1" ] ; then             for Time in "$tI:(0[0-9]|1[0-4]:[0-5][0-9]|$tI:15" ; do #time grep c/o of Caleb, thanks!             mail             done                elif [ "$NUM" -eq "2" ] ; then             for Time in "$tI:(1[5-9]|2[0-9]:[0-5][0-9]|$tI:30)" "$tI:([0-2][0-9]:[0-5][0-9]|$tI:30)" ; do # 2nd time was commulative              mail             done                elif [ $NUM -eq 3 ] ; then             for Time in "$tI:(3[0-9]|4[0-4]:[0-5][0-9]|$tI:45)" "$tI:([0-3][0-9]||4[0-4]:[0-5][0-9]|$tI:45)" ; do             mail             done                elif [ $NUM -eq 4 ] ; then              tI=${tI#${tI%%[!0]*}}              newTime=$((tI + 1))              sTime=`printf '%02d\n' "$tI"`              fTime=`printf '%02d\n' "$newTime"` # thanks to Gilles and Mark and geekosaur              for Time in "$sTime:(4[5-9]|5[0-9]:[0-5][0-9]|$fTime:00)" "$sTime:([0-5][0-9]|[0-5][0-9]|$fTime:00)" ; do              mail             done      else        exit 1       fi          exit 1              function Count()         {         textfile="/some/path/to/text.txt"         time="$1"         C=0         echo " " > $textfile         for ((d=0; d<12; d++))          do          dec110=`egrep "$GivenDate $time" * | grep -c "$var ..  ${DECLINE[$d]}" | awk '{SUM += $1} END { print SUM }'`          COUNT[$C]="$SUMdec"               ((C++))         .... so on and so fort         echo -e "tons of to be echoed above /n end of the results to be emailed" >> $emessage         }      **NOW HERE'S MY PROBLEM:** ive tried several atempts but non of them seems to be working as they should.               function mail()     {        echo "declarations above of this | start of message" > $emessage        for ((t=0; t<2; t++)) do        Count "$Time"        done          /bin/mail -s "$SUBJECT" "$EMAIL" < $emessage       echo -e "Email Sent!\n\n"       cat $emessage     }      -- this will send out 1 email but only shows the result of the first grep,               function mail()     {        echo "Hi Team," > $emessage        Count "$Time"          /bin/mail -s "$SUBJECT" "$EMAIL" < $emessage       echo -e "Email Sent! \n\n"       cat $emessage     }      -- would send out 2 separate email if i choose option 2-4. **Note :** _without the email part this script is working fine._


Why can I append to a file but not overwrite it?

If I do this:               iptables -nvL > output.txt      `output.txt` ends up empty. If I do:               iptables -nvL >> output.txt      It works fine. Appending is working, but overwriting is not. Why?


Entered wrong installation path in Ubuntu

I was trying to install Huwaie 3G modem on Ubuntu. The install.txt said: >   1. Run `./install` in TERMINAL to install MobilePartner eg: # bash > //install > >   2. If you had installed this software in your system before, you will get > a prompt: "The software is exist, do you want overwrites? ([Y]/[N])", enter > "y" to overwrites or "n" to exit. > >   3. If you do not had installed this software in your system before, you > will get a prompt: "Please input the install > path[/usr/local/Mobile_Partner]:". Then you can input install > path(fullpath), or you may using the default path(/usr/local/Mobile_Partner) > by press ENTER direct > >   4. Finish installing > > > > --How to run-------------------------- > >   * From shortcut in desktop >   * Run MobilePartner in your install path eg: # `/<install > path>/MobilePartner` > But accidentally I gave it   1. Run `./install` in TERMINAL to install MobilePartner eg: # bash //install   2. If you had installed this software in your system before, you will get a prompt: "The software is exist, do you want overwrites? ([Y]/[N])", enter "y" to overwrites or "n" to exit.   3. If you do not had installed this software in your system before, you will get a prompt: "Please input the install path[/usr/local/Mobile_Partner]:". Then you can input install path(fullpath), or you may using the default path(/usr/local/Mobile_Partner) by press ENTER direct The path `/usr.local.bsnl3g`. Now the software is not getting installed. I was trying to make fresh install (by `./install`) but it prompted me to rewrite in the same {wrong} path where I have installed already. How to proceed to make it work.


Why is Wingpanel-Slim not working in Elementary Luna after installing and activating it?

~via a question that says: _I am using wingpanel-slim, but it reverts back to wingpanel after each logout, even though wingpanel-slim is still shown as activated in Tweaks. Any ideas how I can stop this happening?_


copy consumed output to stdout when stdout is redirected to a file

Given a command the output of which is being processed by, for example, grep I also want the actual output to be included in the log file for debugging purposes. For example if I have the following               useful=$(curl -s http://example.com/some/data | grep 'useful line')     echo "useful=$useful"      I want to see               This page has a number of lines in it, but'     useful lines are the only ones I care about     except when something goes wrong and then     I'd really like to see what the heck was in     the output that grep consumed.     useful=useful lines are the only ones I care about      This _can_ be done with tee like so               useful=$(curl -s http://example.com/some/data | tee /proc/$$/fd/1 | grep 'useful line')     echo "useful=$useful"      _but_ if stdout is being redirected to a file `tee` clobbers the rest of your log file. `tee -a` fails in largely the same way.


Firmware for wireless card on Ubuntu/Debian?

This is a follow up to my previous question about Debian support for Linksys Wusb600n. I have tried running the Ubunut/Xubuntu LiveCDs and the WiFi does not come up. The Gnome Network Manager menu informs me that my wireless network "device is not ready (firmware missing)" as shown here: ![Network connections on Xubuntu](http://i.imgur.com/JFpm0.jpg) Where can I find Ubuntu packages with the firmware and drivers needed to support the Linksys Wusb600n USB WiFi stick?


How to use OSLEC with Alsa as default, not with Pulseaudio or other thirdparty package involved?

Oslec Echo canceller I have seen some packages used OSLEC and there echo cancle was very well. So for a test simulation, how could i install the OSLEC only with Alsa (i do not use PulseAudio at all, cause it has many broken packages cause unstable). How can you install OSLEC and Alsa configuration on Ubuntu 12.04 64/bit kernel 3.x


Avoid infinite loops in file operations

In many programs, such as in this example filezilla, when I go to use certain directories they get stuck in an infinite loop. So I might be uploading a folder to an FTP server, but this folder links back to itself in some way, so the program gets stuck in: folder1 > someotherfolder > aliasforfolder1 > folder1 > someotherfolder... How can I avoid this without manually copying all of the different possibilities besides that redirect? Note: The only similar question I found was Infinitely Nested Directories, however that was solved by a command option where this cannot be (that I know of).


netcat to capture ethernet

How can I make sure the result of the following command:               nc eth0 &> capture.txt      would capture the data + errors transmitted via eth0?


How does mdraid resync work?

I have two drives in a mirror (linux sw raid/mdadm); one drive somehow left the mirror in the past and its content is now several days old. At this moment, I'm using degraded mirror (with one drive missing) and considering:   * clone uptodate drive to the second one with `dd`   * add second drive and resync, but I don't know how resync process works and which data will be overwritten (there are LVM volumes on that mirror) I think `dd` is safe way, anyway I'm interested in how resychronization works.


Solaris 10, pkgtrans command

What is the difference between these two commands? `1\. pkgtrans /cdrom/cdrom0/Solaris_10/Product /var/spool/pkg/stream.pkg all` `2\. pkgtrans -s /cdrom/cdrom0/Solaris_10/Product /var/spool/pkg/stream.pkg all` The two commands make the same action. **The second question is:** If I have file stream format package in `/export/home/memam/` which called `SUNWipc.pkg` and I want to translate it to file system format, does this command `pkgtrans /export/home/memam/SUNWipc.pkg /var/spool/pkg` translate make this operation


Single-user binary installation location?

I'd like to install a binary for only my user, because I don't have root, and therefore don't have access to `/usr/bin`. I've tried `~/bin`, and it can't find the binary. I'm on Mac OS 10.6.7. Is there any other binary folder that can usually be user-modified, or any way to get it to recognize `~/bin`? My `.profile`:               # Setting PATH for Python 2.7     # The orginal version is saved in .profile.pysave     PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"     export PATH


Command/scripts to check the Reverse DNS Lookup time

I am working on a project in which one master communicates with numbers of slaves. For that it has to make connection with hosts in network. But sometimes it hangs. I think that the reason behind is extra time consumption during **Reverse DNS Lookup**. So please tell me any command or script which checks or makes the list for the **Reverse DNS Lookup** time. **EDIT no. 1** Tell also that where can I add that command in rsh source code so that I got a list of time consumed by every request, whenever it connects to other hosts. So that I can find the reason behind the hanging of server.


Installing a D-LINK dwa-131 wireless adaptor on Linux

I am new to Linux and a complete novice, I have just installed Linux Ubuntu on a desktop, I want to use a wireless adapter for my internet connection. The model is a D-Link DWA-131 Nano wireless adapter. It came with a CD but this will only run on Windows. If someone could help me out it would much appreciated.


Change icons of application in Linux Mint

I installed a new icon set (numix), however not all icons were changed (e.g. the software manager). How can I manually change icons? ![screenshot](http://i.stack.imgur.com/lE43i.png)


Can not mount NFS from server on local network

I set up my NFS server without doing any bigger changes in configuration files. After that I added these entries to `/etc/exports`(both paths are valid) on server(192.168.1.11):               /export         192.168.1.0/192.168.255.255(rw,fsid=0,insecure,no_subtree_check,async)     /export/users   192.168.1.0/192.168.255.255(rw,nohide,insecure,no_subtree_check,async)      Then I restarted the computer and I tried to get exports list:               $ showmount -e 192.168.1.11     /export        192.168.1.0/192.168.255.255     /export/users  192.168.1.0/192.168.255.255      According to this output there's not problem with connection. Now I want to mount `/export` to client filesystem(192.168.1.12):               sudo mount -t nfs4 192.168.1.11:/export /mnt      After typing this there's no output and I can't do anything. Another terminal line start is not being displayed. Command is stuck. Does anybody know am I doing wrong? Please help me.


How to create cross-platform keyboard bind commands?

I'd like to have the same keyboard shortcuts in all the terminals I use. Since they don't have the same *nix on them, and since terminals can be very different, I'm looking for a reasonably portable way to get keyboard shortcuts from one *nix terminal (at least supported by a standard Ubuntu 12.04 installation) to other terminals (Bash only). That is, I'm trying to _generate commands in one terminal to execute on another terminal_ , in order to use _the same keyboard shortcuts in the second terminal_. Especially things like `Alt`-`Del` (delete the word to the right of the cursor) and `Ctrl`-`Left` (move the cursor one word to the left), which on some hosts I work on simply prints the escape code instead of performing the expected actions. This is also meant as a precursor to possibly changing the `.inputrc` on the target host. The important points are to be able to   1. Figure out which keyboard shortcuts are defined on my local host.   2. Figure out whether any commonly used shortcuts are not defined from the remote host.   3. Copy the shortcut definitions to the remote host.   4. Verify that the shortcuts work as expected on the remote host.   5. **Be reasonably sure that the shortcuts would also work on a third host** , possibly with very old versions of Bash and standard tools like `grep` and `sed`.


Permanently change per-process stack size

When I use `ulimit -s` to change the per-process stack size, it only lasts for that login; if I restart the setting is lost. How can I permanently change the maximum stack size on my system?


Is mkdir atomic over sshfs?

I am using `mkdir` as a locking mechanism, and to my knowledge `mkdir` is atomic, but it is not atomic over `nfs`. So my question is simple, is `mkdir` atomic over `sshfs`?


Clear Xfce4 session

How to reset Xfce session? When I start Xfce4, it always opens 2 windows of Evince, Emacs and one terminal emulator. I remember I used this configuration once a week ago, but now it starts every time after logging in. How can I make Xfce4 start cleanly with no applications?


Log off user using terminal

I am having a situation where I logged in to a RHEL 5.6 system and started VirtualBox. After closing the VirtualBox, I am having a situation where the menu bar which has the option to _shutdown_ or _lock screen_ or _log off_ the system is not present. I believe the reason might be due to network load or something. I can _shutdown_ or _restart_ from the terminal, but again they take considerable amount of time. All I need is to just **Log off** from the system when the menu bar is not present. I need to get the **login** screen like how we have, when we initially boot the system. Is there any option to just **Log off** the user using the terminal? **EDIT:** ps -ax | grep dm output               Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ      2352 ?        S<     0:00 [rdma_cm]      2908 ?        Ss     0:00 rpc.idmapd      3287 ?        Ss     0:00 sendmail: accepting connections      3297 ?        Ss     0:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue      3504 ?        Ss     0:00 /usr/sbin/gdm-binary -nodaemon      3547 ?        S      0:01 /usr/sbin/gdm-binary -nodaemon      3549 ?        S      0:00 /usr/libexec/gdm-rh-security-token-helper      5080 tty7     Ss+    7:20 /usr/bin/Xorg :0 -br -audit 0 -auth /var/gdm/:0.Xauth -nolisten tcp vt7     18166 pts/1    S+     0:00 grep dm


How can I get sublime text to run from the command line?

I am trying to get sublime text to run from the command line using this tutorial. It says to run this command:               ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl      But when I try to run that command I get an error "no such file or directory." Sublime text 2 is in my applications folder -- but it looks like there is no bin folder in my home directory. Do I need to create one? Is this something that should be there? Am I doing something wrong?


Linux Distro specifically for benchmarking?

At my current position, we use some outdated proprietary software in order to benchmark new computers that the company is testing and evaluating for purchase. We would like to move on to something more current. It would seem to me that using a GNU/Linux distro with a completely automated installation process would be ideal for this task. Basically, what I want to have is a minimalist GNU/Linux distribution that will allow me to simply input a network location to store the benchmarking results, and will install the OS and run a suite of benchmarking software completely automated. This seems like a problem that others have likely come across, but I have been unable to find anything similar that fits my needs. Any suggestions on where to start with this? Does a distro like this exist out there somewhere? If not, I currently plan on just writing a script that will install a list of benchmarking software onto the machine and run them. Any suggestions on specific software choices for this?


Linux Mint Search launcher doesn't do anything

In Mint 17, using Cinnamon, if I go to `System Settings > Keyboard > Keyboard shortcuts > Launchers` there is an option to set a shortcut for something called `Search`. However, whatever key binding I set this to, it doesn't seem to do anything. What is this supposed to do, and how do I make it do it?


VNC - Arch - Gnome; I can't type in the password on the login screen because it is cleared every second

I have an Arch linux box that is almost running perfectly but when i connect to the vncserver and the sreensaver turns the screen black, i am forced to reenter the password on the loginscreen of gnome but! and here is the problem, this screen is constantly refreshed so i can't type more than two letters. I keep every package updated with pacman -Syu. I use tigervnc in version 1.3.1.1. The connection is running over SSH. Gdm in version 3.12.0-1. Can anyone help here? ~/.vnc/xstartup:               #!/bin/sh     export XKL_XMODMAP_DISABLE=1     exec gnome-session


How to display duplicates between 2 repositories

I got 2 repos locally. One is a copy of Squeeze and another is a custom one, and is managed by reprepro. Are there ready-made tools that would generate a list of duplicate packages between the two?


Delete key doesn't work properly in PHP interactive shell

In the interactive shell oh PHP `Delete` key is not working and produce `~` instead. Anyone know how to get this key to work? I am using Ubuntu 13.04 if this does matter.


How to set up an SSD as a cache for the big Hard Drive?

I want to order https://www.fdcservers.net/order-1-w.php?plan_id=538 According to http://arstechnica.com/information- technology/2013/04/linux-3-9-brings-ssd-caching-and-drivers-to-support-modern- pcs/ linux have built in capability to allow using SSD to cache hard drive. How to do so? Where is the tutorial? This feature is already in the standard kernel right? WOuld it work on centosh? Can I just upgrade existing kernel?


How to give permission of a folder to a specific user in LINUX/UNIX?

How can I give permission to a specific user for a particular folder? I don't want to give permission to the entire group but only to a particular user in the group. I don't have root permissions.


How to generate a lot of (blank) images files?

For a test, I need to quickly create 1700 jpg-images (even blank) in a defined size 1000x706. I wonder if we could do this with a shell script or a program (like ImageMagick). I wish they called `img_0.jpg`, `img_1.jpg`… Someone knows a simple solution?


DIY: how to make double-layer install DVD?

Facts:   * online repo (official) is more than 20GB -- I have access to it   * downloadable DVD is for single layer disks -- I have access to it   * boxed openSUSE DVD is double layer -- I do **NOT** have access to it Is it possible and if yes -- how -- to make this double-layer DVD on your own? Legally of course.


Fedora location of /usr/share/v86d/initramfs

I compiled and installed v86d, yet I can only locate one binary file in /sbin. There is supposed to be the initramfs file in /usr/share/v86d, but this directory does not exist. I don't think that the location of this file should vary between distros, but I am using fedora 15 and it isn't there. Notes: Compiled with klibc against a custom kernel tree I can't think of anything else.


What's the difference between STDIN and arguments passed to command?

I could use the either form to execute the `cat` method:               cat file_name     cat < file_name      The result is the same Then I want to execute `man` in the format of STDIN               man < file_name      For the `file_name` contains:               # file_name     cat      But it pops up `What manual page do you want?` instead of execute `man cat`. I want to know the why `cat` could accept STDIN as arguments but `man` cannot. And what's the difference between command line arguments and stdin?


Change the red border between windows in xmonad

Is it possible to set somewhere in configuration the color of the border between windows from red to black or remove the border completely?


Tips for putting ~ under source control

I want to put my home directory (~) under source control (git, in this case), as I have many setting files (.gitconfig, .gitignore, .emacs, etc.) in there I would like to carry across machines, and having them in git would make it nice for retrieving them. My main machine is my MacBook, and the way that OS X is set up, there are many folders i want to ignore (Documents, Downloads, .ssh). There are also folders which are already using git (.emacs.d). My thought was to just add all these directories to my .gitignore file, but that seems kind of tiresome, and could potentially lead to some unforeseen consequences. My next thought was to periodically copy the files I want to store into some folder in home, then commit that folder. The problem with that will be that I have to remember to move them before committing. Is there a clean way to do this?


iptables does not list rules i have created

I'm using this guide to set-up a shared internet connection between two PC's. At **step 8** it says I should run the commands:               iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE     /etc/rc.d/iptables save     /etc/rc.d/iptables start      Doing this seems to have no effect on iptable's **rules** , if I run `iptables -nvL` my output is:               Chain INPUT (policy ACCEPT 2223 packets, 2330K bytes)      pkts bytes target     prot opt in     out     source         destination          Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)       pkts bytes target     prot opt in     out     source        destination          Chain OUTPUT (policy ACCEPT 2272 packets, 277K bytes)       pkts bytes target     prot opt in     out     source        destination      Is that correct or am I doing something wrong?


using find in Bash Script and checking if file is present

var= "$(find . -name 'gen*.bt2')"                 if [ "$var" == "" ]         then              echo bad         else              echo great        fi      I get errors **./script.sh: line 4:** ./gen.4.bt2 ./gen.rev.1.bt2 ./gen.rev.2.bt2 ./gen.1.bt2 ./gen.3.bt2 ./gen.2.bt2: **No such file or directory** great However, when I run the same code in terminal, files are listed perfectly, without any error. Can someone correct me, where am I going wrong? I need to check, if certain files are present or not, if present then proceed.


How to convert multiple XCF files to PNG?

I have a folder with a lot of `xcf` files which I want all to be converted to `png` files, at best via a one-liner from bash. How can I achieve such a task?


Why there are multiple shells in a Unix like system?

I have just started learning the fundamentals of Unix and wondering why there are so many shells in a unix like system . From the book Advanced programing in Unix Environment: > A shell is a command-line interpreter that reads user input and executes > commands.The user input to a shell is normally from the terminal (an > interactive shell) or sometimes from a ﬁle (called a shell script). And then the book goes on to list a number of shell programs like Bourne shell,Bourne-again shell,Cshell, etc . My question is basically why do we need multiple shells ?


How to stop mail with PHP error messages to root?

Today, my Centos has a problem. When I type `df -h` in `SSH` I get:               /dev/vzfs  61G  61G   0.3G  99% /      The disk is full. I found that `/var/spool/mail/root` is nearly `53GB`. `tail /var/spool/mail/root -n 50 | more`, I find there are full of `php errors`. Now I use `cat /dev/null > /var/spool/mail/root` to clean the `error logs`, the hard disk is normal:               /dev/vzfs  61G  7.3G   53G  13% /      But how can I stop `sendmail` sent php error message? I do not want them stored there (I have set php error in `/var/log/httpd.log`).


> **Possible Duplicate:**   >  Why does this compound command report errors when copying directories? if one executes the following two commands in one line, as follows, > rm -rf dir ; cp -r dir2 dir it may complain that cp can not create directory `dir/subdir`: File exists but if these two commands are executed in two lines, no errors will be thrown. I am just wandering what is the difference? and more importantly, how to execute two commands in one line, with the effect exactly the same as by two lines... PS: what is in `dir` or `dir2` is hugh, typically 4gb


Bash: passing braces as arguments to bash function

I love using the following pattern for searching in files:               grep --color=auto -iRnHr --include={*.js,*.html,} --exclude-dir={release,dev,} "span" .      I'd like, however, to have this one wrapped into a bash comand like this:               findinfiles {*.js,*.html,} {release,dev,} "span"  // syntax is just a guessing      I cannot solve the problem of passing this kind of braces into a bash function and using them with `$1`, `$2` and so on. When I use the following:               function findinfiles() {         echo $1, $2, $3     }      Then:               me@pc ~> findinfiles {*.js,*.html,} {release,dev,} "span"     *.js, *.html, release      Ofc, passing arguments to grep won't work this way. It seems that arguments are indexed but not properly grouped. Can anyone teach me how to deal with this kind of arguments?


proxy settings ignored by apt-get manager in Ubuntu 13.04

I am using Ubuntu 13.04 in company network, http proxy works fine with my user account but still I cannot install or update anything with apt-get : Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ) I have system-wide proxy in System configuration > Network > Network Proxy > manual configured properly and : env | grep proxy shows both http_proxy, https_proxy variables with proper settings. but still apt-get still fails to connect. What to try next ?


How to install kdesudo in OpenSUSE 12.3

I'm hoping this is a stupid question with a simple answer, but I've been hunting around for half an hour and cannot find a way to install kdesudo in OpenSUSE 12.3. I need to use kdesudo because kdesu (which is pre-installed in OpenSUSE 12.3) is a basic tool which does not obey the sudoers configuration. I'm happy to build from source if it comes to it, but I can't work out where the authentic source can be safely downloaded for kdesudo.


Reload ~/.profile for desktop

> **Possible Duplicate:**   >  how do i tell gnome to reread my ~/.profile   >  How to change environment variables without re-logging to UI? I'm trying to reload my ~/.profile without login out. I can use `source` to reload it in bash for example, but I haven't found out how to reload it for the whole desktop. When I launch applications from menus, they aren't aware of the changes in ~/.profile. Those changes are exclusively `export` commands. How can I reload it for the whole desktop?


how do i tell gnome to reread my ~/.profile

Gnome reads `~/.profile` upon login. When I change something in `.profile` (for example `LC_MESSAGES`) I want gnome to reread the `.profile` file without logging out and back in. In bash I can tell bash to source `.profile`. How can I do that for the running gnome session?


How can I change the keyboard layout before I log in?

In order to switch to a new keyboard layout I have added an `setxkbmap` command to my Openbox's `autostart.sh`. However, this only takes effect once I log in (when Openbox starts). _While_ logging in, in GDM (I suppose), the layout I chose when installing the system is still active - which is distracting in my efforts. What do I have to do to have this default layout changed? (OS: Debian 7.1)


VIM only files, cd only directories

When using `Tab` for completion on the Bash shell prompt, is there any way to configure it to complete only files for the command `vim` and only directories for the command `cd`? In large directories with many files and subdirectories, the should reduce by half the amount of corrections to be done while completing. Note that moving to a different shell is impractical, but I would still be interested in hearing non-Bash solutions if no Bash solution exists.


Fixing a broken X initialization

### Here are the symptoms: On reboot of my Fedora 14 system, I get to the Fedora loading screen progress bar. The system seems to progress normally, then the nvidia logo flashes, a wait cursor shows, then it kicks back to Fedora loading bar. This flashes across the screen about 4 or 5 more times before kicking me back to the completed fedora progress bar. At this point it does NOT start the GUI. ### What I can do: I can `ctrl`+`alt`+`F2` (or `F3` to `F6`) to get to a login shell. In the login shell I can run the `startx` command and I get to my GUI, but with limited functionality (I.e. my network devices are not initialized) ### What I think I broke: I had mistakenly deleted the `/tmp/.X0-lock` file on experiencing some other odd behavior with my X server (odd behavior = starting a gnome gui program and receiving an error I cant recall now about the X server not being valid and the program never starting) ### Question This is now occurring on every reboot. How can I troubleshoot the X initialization and fix it so that the Fedora GUI starts auto-magically as it did before?


What makes a distribution GNU and are there Linux distributions, that are not GNU?

So GNU/Linux is an operation system, consisting of several programs at a minimum: Linux kenel, gcc, gnu-binutils, Gnome desktop, etc.   * _What makes a Linux distribution GNU? Is it the tools, with which the kernel was compiled? Is it the tools, with which the distribution is shipped?_   * _Do there exist fully functional, desktop operating systems, that are Linux based but not GNU?_


Extracting help message from script itself

I want that my help message be extracted from the script itself.               #!/bin/bash     #     # foo - do things     # Author: John Doe <jhon@doe>     # ----------------------------------------------     # SYNOPSIS     #   foo [OPTIONS] FILE     #      # DESCRIPTION     #   At vero eos et accusamus et iusto odio     #   dignissimos ducimus qui blanditiis praesenti     #   voluptatum deleniti atque corrupti quos.     # ----------------------------------------------          sed -n '/# -\+$/,/# -\+$/ p' $0      It works! It prints only what is between the two `# -\\+$` delimiters, inclusive. The problem is that I don't want print the delimiters. And do you have suggestions for a man page generator with human friendly syntax? **Update:** Maybe stated my problem poorly. I want to print only what is between the two lines starting with `# -----` and ending with `\----`. I know this solution:               sed -n '/# -\+$/,/# -\+$/ p' $0 | head -n -1 | tail -n +2      But I want a clean and elegant solution that doesn't look hackish.


How do I specify the keyserver with GPG?

Tutorials online say to use the option `\--keyserver`, like this:               gpg --send-keys <keyID> --keyserver 'hkp://keyserver.ubuntu.com:11371'      but `gpg` doesn't recognise the option `\--keyserver`. What am I doing wrong?


Recursively compare two directories with diff -r without output on broken links

I am using `diff -r a b` to recursively compare directories **a** and **b**. It often happens though that there are some broken links (the same broken links in both **a** and **b** directories and to the same, non-existing targets). **diff** then outputs error messages for those cases and exists with a non- zero exit code though I would like it to stay silent and exit with 0 as the directories are the same in my book. How can I do that?


Smallest linux distribution for PPTP VPN server (poptop)?

I want to run Poptop, an Open Source PPTP Server for Linux. I need the smallest possible GNU/Linux distribution which I can install in VMware Workstation 8 and which will be able to support this software. Which Linux distribution should I choose/download? A GUI would also be nice because I'm the regular windows- user/programmer/whatever I can call myself. (but is not required, I am comfortable with command lines) I would also be very thankful if someone could post step-by-step installation and configuration instructions for this specific setup.


Installing Linux on a SATA partition, with Windows installed on SSD

My computer has a SSD drive along with a HDD drive. I've installed Windows on the SSD drive (Intel) already and I would like to install Linux Mint on a partition created on the HDD hard drive. So I partitioned the HDD like so:   * linux-swap   * EXT4    * FAT32 partition.  I installed Mint on the EXT4 partition, and when I restarted the computer, there is no GRUB! It starts Windows automatically without asking to choose the OS. I'm assuming I have to do something with GRUB. Or no? I really don't want to mess up my Windows installation and start over. How do I fix this? ### UPDATE: my motherboard has a shortcut key `F8` which if pressed during bootup, allows me to pick which hard drive to boot from and I've gotten to prefer this method over GRUB. This way I can install different OS's on separate hard drives without messing up my other installations (Thanks to cheap hard disk though!)