title: Mysql synonym drop and create

text: I am running into the issue that, when the script is run, the MySql section of it isn't working or is droping the synonym. Is there something else i need to put into the command to have it log into the MySql server and do everything that is stated.               #! /bin/bash          #Subject: Please stage the following TFL09143 Locator Bulletin to all TF90 staging environments:#                    #########################################################################     # This next section is to go to mysql server and make changes.          #     # you can drop and create synonyms                                      #     # truncate a table and insert into a different one.                     #     # you will be able to verify the counts to the different locations      #     #########################################################################          $ mysql -h=app03-bsi -u "" -p ""  "TF90BPS" -bse "drop_view TF90.BTXADDR drop_view TF90.BTXSUPB CREATE_VIEW TF90.BTXADDR FOR TF90BP.TFBPS2.BTXADDR CREATE_VIEW TF90.BTXSUPB FOR TF90BP.TFBPS3.BTXSUPB TRUNCATE TABLE TF90BP.TFBPS3.BTXSUPB SELECT (*) FROM TF90BP.TFBPS2.BTXSUPB; select count (*) from TF90BP.TF90.BTXADDR select count(*) from TF90BPS.TF90.BTXADDR; select count(*) from TF90BP.TF90.BTXSUPB; select count(*) from TF90BPS.TF90.BTXSUPB;"          $ mysql -h=app03-bsi -u "" -p ""  "TF90LMS" -bse "drop_view TF90.BTXADDR drop_view TF90.BTXSUPB CREATE_VIEW TF90.BTXADDR FOR TF90LM.TFBPS2.BTXADDR CREATE_VIEW TF90.BTXSUPB FOR TF90LM.TFBPS3.BTXSUPB; TRUNCATE TABLE TF90LM.TFLMS2.BTXADDR;TRUNCATE TABLE TF90LM.TFLMS3.BTXSUPB;INSERT INTO TF90LM.TFLMS3.BTXSUPB SELECT * FROM TF90LM.TFLMS2.BTXSUPB;Verify select count(*) from TF90LM.TF90.BTXADDR;select count(*) from TF90LMS.TF90.BTXADDR;select count(*) from TF90LM.TF90.BTXSUPB;select count(*) from TF90LMS.TF90.BTXSUPB"          $ mysql -h=app03-bsi -u "" -p ""  "TF90NCS" -bse "drop_view TF90.BTXADDR  drop_view TF90.BTXSUPB CREATE_VIEW TF90.BTXADDR FOR TF90NC.TFBPS2.BTXADDR CREATE_VIEW TF90.BTXSUPB FOR TF90NC.TFBPS3.BTXSUPB; TRUNCATE TABLE TF90NC.TFNCS2.BTXADDR; TRUNCATE TABLE TF90NC.TFNCS3.BTXSUPB; INSERT INTO TF90NC.TFNCS3.BTXSUPB SELECT * FROM TF90NC.TFNCS2.BTXSUPB; Verify select count(*) from TF90NC.TF90.BTXADDR; select count(*) from TF90NCS.TF90.BTXADDR;select count(*) from TF90NC.TF90.BTXSUPB;select count(*) from TF90NCS.TF90.BTXSUPB"          $ mysql -h=app03-bsi -u "" -p ""  "TF90PVS" -bse "drop_view TF90.BTXADDR drop_view TF90.BTXSUPB CREATE_VIEW TF90.BTXADDR FOR TF90PV.TFBPS2.BTXADDR CREATE_VIEW TF90.BTXSUPB FOR TF90PV.TFBPS3.BTXSUPB; TRUNCATE TABLE TF90PV.TFPVS2.BTXADDR;TRUNCATE TABLE TF90PV.TFPVS3.BTXSUPB;INSERT INTO TF90PV.TFPVS3.BTXSUPB SELECT * FROM TF90PV.TFPVS2.BTXSUPB;Verify select count(*) from TF90PV.TF90.BTXADDR;select count(*) from TF90PVS.TF90.BTXADDR;select count(*) from TF90PV.TF90.BTXSUPB;select count(*) from TF90PVS.TF90.BTXSUPB"          #TFL09143 Staging#          cd \\ntsrv\common\To\IT-CERT-TEST\TFL09143 #change to mapped network drive           cp -p TFL09143.pkg /d:/tf90/code_stg /tf90bp/code_stg /tf90lm/code_stg /tf90pv/code_stg           InvalidInput="true"           if [ $# -eq 0 ] ; then         echo "This script sets up TF90 Staging"         echo -n "Which production do you want to run? (RB/TaxLocator/Cyclic)"         read ProductionDistro     else         ProductionDistro="$1"     fi          while [ "$InvalidInput" = "true" ]     do         if [ "$ProductionDistro" = "RB" -o "$ProductionDistro" = "TaxLocator" -o "$ProductionDistro" = "Cyclic" ] ; then                         InvalidInput="false"             break         else              echo "You have entered an error"             echo "You must type RB or TaxLocator or Cyclic"             echo "you typed $ProductionDistro"             echo "This script sets up TF90 Staging"             read ProductionDistro         fi     done          InvalidInput="true"          if [ $# -eq 0 ] ; then         echo "This script sets up RB TF90 Staging"         echo -n "Which Element do you want to run? (TF90/TF90BP/TF90LM/TF90PV/ALL)"         read ElementDistro     else         ElementDistro="$1"     fi              while [ "$InvalidInput" = "true" ]     do         if [ "$ElementDistro" = "TF90" -o "$ElementDistro" = "TF90BP" -o "$ElementDistro" = "TF90LM" -o "$ElementDistro" = "TF90PV" -o "$ElementDistro" = "ALL" ] ; then             InvalidInput="false"             break         else              echo "You have entered an error"             echo "You must type TF90 or TF90BP or TF90LM or TF90PV"             echo "you typed $ElementDistro"             echo "This script sets up TF90 Staging"             read ElementDistro         fi               done           if [ "$ElementDistro" = "TF90" ] ; then              cd /d/tf90/code_stg         vim TFL09143.pkg         export var=TF90_CONNECT_STRING=DSN=TF90NCS;export Description=TF90NCS;export Trusted_Connection=Yes;export WSID=APP03-         BSI;export DATABASE=TF90NCS;         export DATASET=DEFAULT         yum install -y ../TFL09143.pkg     fi          if [ "$ElementDistro" = "$TF90BP" ] ; then         cd /d/tf90bp/code_stg         vim TFL09143.pkg         export TF90_CONNECT_STRING=DSN=TF90BPS;export Description=TF90BPS;export Trusted_Connection=Yes;export WSID=APP03-         BSI;export DATABASE=TF90BPS;         yum install -y ../TFL09143.pkg     fi          if [ "$ElementDistro" = "$TF90LM" ] ; then         cd /d/tf90lm/code_stg         vim TFL09143.pkg          export TF90_CONNECT_STRING=DSN=TF90LMS;export Description=TF90LMS;export Trusted_Connection=Yes;export WSID=APP03-         BSI;export DATABASE=TF90LMS;         yum install -y ../TFL09143.pkg      fi          if [ "$ElementDistro" = "TF90PV" ] ; then         cd /d/tf90pv/code_stg         vim TFL09143.pkg         export TF90_CONNECT_STRING=DSN=TF90PVS;Description=TF90PVS;Trusted_Connection=Yes;WSID=APP03-         BSI;DATABASE=TF90PVS;         yum install -y ../TFL09143.pkg     fi          exit 0


title: Nvidia Update Problem On Debian 7 Stable

text: New User Here Guys bear with me! Specs:   Debian Stable Weezy Gnome 3 edition 64 bit   Video Card: Nvidia GTS 250,   CPU: AMD Phenon X4 Quad core History:   All was going so well, back-ports was added, contrib non-free components were added, multimedia repos were added, Kenerl was updated from 3.2 to 3.14 no problem with that either. Problem came when I tried updating my driver for my nvidia card. Heres is the last command before the issue began.               apt-get -t wheezy-backports install nvidia-kernel-dkms nvidia-glx build-essential nvidia-settings nvidia-xconfig      Upon a system reboot I boot into a command prompt no matter which kernel I pick(3.2 or 3.14) Someone told me to create a new file in `/etc/X11/xorg.conf.d/20-nvidia.conf/` with the following contents:               Section "Device"     Identifier "My GPU"     Driver "nvidia"     EndSection      Or something along those lines( typing this from memory right now ) I also tried editing the main xorg.conf by changing the Identifier from: `Identifier "Device0"` to: `Identifier "My GPU"` to no effect, I still boot into a command prompt after making the changes and rebooting. I dont know what to do next. Im new to debian and really need some help because I dont want to go back to windows if I dont need to. Im typing this on windows now because I have no choice in the matter. Can someone bring me back to linux? Thanks in advance!


title: How to get Flash to work with webkit gtk3 on Fedora?

text: I have Fedora 20 with the following packages:   * flash-plugin-11.2.202.359-release.i386   * flash-plugin-11.2.202.359-release.x86_64   * webkitgtk-2.2.7-1.fc20.x86_64   * webkitgtk3-2.2.7-1.fc20.x86_64   * libwebkit2gtk-2.2.7-1.fc20.x86_64 Flash is loaded with webkit-gtk2 (tried with /usr/libexec/webkitgtk/GtkLauncher) but not with webkit-gtk3 (/usr/libexec/webkitgtk3/GtkLauncher). There is no error message.


title: Setting up a Gentoo Repository on a Debian Host

text: I have a debian host, on which i want to setup a private Gentoo Repository for my college. I have started syncing the repository by a simple bash script whose snippet is as follows :               RSYNC="/usr/bin/rsync"     OPTS="--quiet --recursive --links --perms --times -D --delete --timeout=300"     SRC="rsync://rsync.de.gentoo.org/gentoo-portage"     DST="      What else I need to do for setting up the repository? Thanks in advance for the help.


title: How can I modify route table?

text: I don't want to delete or add, just want to modify one rule. Is there such a command or do I have to resort to Delete and Add ? Computer is running Debian 6.


title: How to shutdown with consolekit without sysvinit (but with systemd)

text: I have systemd (and no sysvinit) installed on a Arch Linux box. However, I cannot shutdown/reboot with consolekit (dbus interface). `# systemctl {shutdown,reboot}` work just fine, so I guess it's because consolekit doesn't know how to contact the `pid 1` process.


title: How can I source the bashrc file every time I 'clear'

text: This might be a bad idea. The more I think about it the more I come to the realization that I probably shouldn't do it... but I've been trying and failing so I REALLY want to know how to do it, even if it's a bad idea. What I want is for the bashrc file to be sourced every time I run the `clear` command. The reason for this is completely materialistic. I have system information echoed out when I source bashrc and it's cool to me and I'd like that to be at the top every time I clear.   I've tried to set up some aliases for `clear` but I keep running into infinite loops. The obvious fix is to change the aliases to something else besides clear so that I can run the clear command in the alias without interfering but I type clear so often that it's kind of ingrained in my brain at this point. I'd like to be able to type clear and make it clear AND source the bashrc file.


title: Reloading the $PATH from the GUI terminal

text: My machine is running Fedora 16 x86_64 I am trying to figure out why I can not get my GUI terminal window to refresh the path. I recently added a new location to the path (in `.bash_profile`), after closing the GUI terminal and reopening it, the new location is still not showing. When I go to `tty2` the new path is listed. I closed the GUI terminal and reopened again to find the new path entry still is not in the path being used. I did not reboot but I am trying to:   1. avoid rebooting   2. figure out what I need to do so that I do not run into this problem again


title: Krunner equivalent in XFCE?

text: I like Krunner, but nowadays I prefer to use XFCE instead of KDE. Is there any XFCE app that is equivalent or similar to Krunner?


title: Is there any way to install freeBSD from Debian?

text: I know that one can install Debian from (AFAIK) any Linux computer using debootstrap. Is there any way to do the same for freeBSD or do I need to make a CDROM?


title: Why doesn't this Hello World X11 code run on NetBSD?

text: I am on a brand new 5.1 NetBSD box. I copied the "Hello World" code from here `rosettacode.org` The code compiles with this command:               cc -I /usr/X11R7/include -L /usr/X11R7/lib -lX11 helloworld.c      When I run `a.out`, I get the following error:               Shared object "libX11.so.6" not found      I confirmed that `/usr/X11R7/lib/libX11.so.6` does exist. ldd output:               ./a.out:         -lX11.6 => not found         -c.12 => /usr/lib/libc.so.12      How do I properly link against X11 on NetBSD?


title: Avoid display blanking under X

text: I have an Ubuntu Linux box (12.04). I can't prevent the screen blanking under X. I have tried the command `xset s off`, inserted the command line kernel parameter `acpi=off` in grub at kernel boot. Changed `xorg.conf`. Then used the GUI tool in Ubuntu's "Monitor Preferences", the tool "Power Management". I uninstalled `gnome-screensaver` and `xscreensaver`. Nothing has worked and I don't know what to do anymore. How can I disable screen blanking under X?


title: Give user permissions to all files and folders

text: I want to have a user who has access to all the files and folders on the system. This is for the purpose of using RSYNC on a local machine to backup a remote machine. At the moment we are using the user `backups` and although we have added this user to the groups `sudo` and `admin` rsync still returns messages like: > rsync: opendir "/location/to/folder" failed: Permission denied (13) > > rsync: send_files failed to open "/location/to/file": Permission denied (13) Any idea how we give the user `backups` permission to access everything (short of adding the user to all groups ever - the remote server we are trying to backup is a dedicated hosting server where every account has its own user on the system). Thanks for any help.


title: How to interpret the explicit references to GNU in the LSB specifications?

text: The LSB is a specification, and as such, should be provider neutral. But it contains many “hard‑coded” reference to GNU at many places. Ex. the ELF Linux's specific entries `PT_GNU_STACK`, `PT_GNU_RELRO` and al., or with some libraries like `libgcc_s`. How these explicit references to GNU in the LSB should be interpreted?   * Is it there for historical reasons (like the `MZ` magic in one of the Windows executable formats)?   * Is it there to designate GNU as a unique provider for some parts of conforming systems?   * Is it there as an acknowledgement of some role played (currently or in the paste) without any particular mandate? I would not have asked this questions, if the references did not appeared in a standard specification, I mean, the questions should be understood in this particular context.


title: How i create application B that would be able to communicate with running application A?

text: I have background application **A**. I want to create application **B** to configure application **A** on the fly. So, how can I detect if **A** is running and send some messages to **A**?


title: Virtualbox, mounting guest directory on host computer

text: Is there a way to mount a directory residing on my VB guest (linux) on my host (linux)? I know I can do it the other way around with the shared folders feature on Virtualbox, but is there a way to do it this way? I'd really like to actually mount the directory. Not use samba, or something similar to that.


title: Fedora 16 desktop missing workspaces, Applications and Desktop menus at top of window

text: My last system was Fedora 12, and I don't recall doing anything special to get Applications Places Desktop at the top and having multiple workspaces (also switchable at the top). I can't find any of this in my new Fedora 16 installation - what am I missing?


title: Control + Function Key association in Emacs

text: I am trying to associate the keyboard shortcut `Control` + `F10` with `gud- step` in GUD in Emacs. I thought the following would do the trick, but it doesn't:               (define-key gud-mode-map '[C-f10] 'gud-step)      ## Update My mistake. The above actually **works**. Sorry for the confusion. Instead of deleting the question, we can close this thread in case anybody ever needs to set up a similar keyboard shortcut.


title: How do I run uTorrent?

text: I just downloaded the uTorrent archive from their website and unpacked it. Inside were:   * docs   * utserver   * webui.zip `utserver` is an executable, so I'm guessing that's what I'm supposed to run, but when I double-click it nothing happens. What should I do? I'm using Fedora 15


title: GNU Screen and Emacs

text: I upgraded recently to OpenSuSE 12.1 from 11.3 and now when I open any files in emacs from inside a screen session, I get a blank buffer. Let's say I open it as:               emacs myFile.txt      it will open to an empty buffer, not the file, and when I attempt to save something, it will ask for a file name to write to. This worked before the upgrade. I assume screen is the issue here since emacs works fine outside of screen. Is there something I'm missing in the screen settings or is this a bug in something?


title: How can I make my home Linux most closely resemble the Linux used at my school?

text: We have to ssh into our school's server to make sure our programming assignments work on the system that will be used to test them by the teacher. It's running RHEL 6.2. When I test my program on my Mac running RHEL 6.2 in VirtualBox, I get different results than the school's. Are there any steps I can take to get my RHEL running similarly enough to the school's so that we get the same results, or are there too many variables for it to be plausible (hardware, root settings, etc)? EDIT: The programming is in C++ for an Operating Systems class. We're working with system calls and whatnot. It's using tcsh, g++...other than that I'm not sure what else you'd need to know? This is my first unix/linux class.


title: /boot too small to upgrade

text: Trying to upgrade from F15 to F17. I need to find a way to increase /boot size without destroying data. Details: I tried upgrading using preupgrade process and via booting from Net iso on USB and both lead to the same thing: and 'Error' message in the first package (filesystem) transaction indicating the installer needs (about) 1GB more on / Cannot proceed with the install. I also tried the trick of reducing the avail space in /boot to < 100M to trigger a network load of the installer image... but that leads to a series of mirror http/404 messages and no progress. I'd like to not have to nuke everything, yet again, just to do an upgrade. I would have thought that, by now, this issue would have drawn a more elegant solution than continually trying to guess how big /boot will have to be for the next upgrade. (unsnark) I have 4GB freespace on /dev/sdb but it is not contiguous with sdb1 (/boot): the process of shrinking the LVM volume released space at the end and not the beginning of sdb:               > df -kl | grep boot:      /dev/sdb1 3064704 300520 2764184 10% /boot      (note that what is now in /boot is irrelevant since 1G > 300 MB: I have to increase the volume size) fdisk:               /dev/sdb1   *        2048     6146047     3072000   83  Linux     /dev/sdb2         6146048   612354047   303104000   8e  Linux LVM      cfdisk:                                      Pri/Log   Free Space                           1.05*        sdb1        Boot        Primary   ext4                              3145.73*        sdb2                    Primary   LVM2_member                     310378.50*                                Pri/Log   Free Space                        4474.28*      Edit: After attempting to use gparted, watching it crash in horror, and eventually yanking and replacing the drive, I created a 15 GB boot partition (FCS!), reinstalling F15 and all my files. _Then_ preupgrade to F17 succeeded. I accepted the preferred answer assuming that it would have worked had it not destroyed my harddrive ;)


title: Accidentally removed dev-libs/mpc from Gentoo

text: It seems I accidentally removed `dev-libs/mpc` instead of `media-sound/mpc`. Now I can't compile anything (including a replacement `dev-libs/mpc`) because in doing so I apparently murdered GCC. How does one fix something like this?


title: Distro- lightweight and easy to install

text: Ubuntu was too slow on my computer and Arch installation had many problems too. Which distro do you recommend to me that's lightweight as well as easy to install?


title: Fedora 14 Xen virtual machine does not detect network

text: I'm trying to create a para-virt Fedora 14 Xen vm on a host running CentOS 5.5. The VM appears to initially install correctly (the installer finds `eth0` and can access the installation media). But when I restart the VM after the installation is completed the VM no longer sees any network, only lo. The VM does have one network connection according to virt-manager. The host is running CentOS 5.5 64bit - completely up-to-date The VM I am tring to install is F14 64bit (installing only the minimal group) Update: After taking a look at this again, I think the problem has to do with my network setup. In the server I have two NICs (eth0, eth1) that I've bonded together (bond0). I'm guessing that I need to make changes to xen so it recognizes the bonded NICs, though I don't know why the guest gets a network interface during installation.


title: crypt() on different machines

text: Because of a hardware issue i need to migrate many virtual users to a new machine. Their passwords stored in MySQL encrypted with `ENCRYPT` which using `crypt()`eventually. Maybe it's my fault but `salt` wasn't added when passwords were stored so they're totally random. My basic idea was to dump the database then import it. When i tried to store the same string in the same machine with `ENCRYPT` it gave me different results. Will users' passwords work on the new machine? Update on environment and encrypting method:   * The old machine is running Debian Etch with MySQL 5.0   * New machine will run Debian Squeeze with MySQL 5.1   * The encrypting method is MySQL's default `ENCRYPT`   * Salt wasn't added originally   * I don't know the passwords Thank you for your feedback, fabrik


title: How do I find on which physical device a folder is located?

text: Specifically: I did `sudo mkdir /work`, and would like to verify it indeed sits on my harddrive and not mapped to some other drive. How do I check where this folder is physically located?


title: Looking for tools to build minimal linux desktop

text: Increasingly I am dissatisfied by the fact, that configuring my linux _desktop_ usually means removing bloat instead of adding and tweaking features. I have come to the conclusion that I would rather begin with something very minimal and then add packages I learn about that provide additional functionality. So I am **looking for either a very minimal desktop distribution or even better a tool to build such a distribution**. Or in other words I want to **replace the package manager with a pre-runtime build tool**. A package manager won't hurt but I am looking for a distribution that focuses on advanced upfront configuration instead of a huge package repository I have looked at various minimal desktop distributions but they all appear to solve different problems, e.g. are designed to run on older hardware or run from cd/stick/ramfs. But I don't want a minimal distribution because my I have old hardware but because I want to know what purpose the various parts play. Running from main memory doesn't help there either, I want something minimal _and_ simple. Since it appears there are no distributions that are designed for the kind of minimalism I have in mind an obvious choice would be to build Linux From Scratch. However while I want the build process to be highly customization it also has to be automated because I will have to run it quite a few times until I have a system I am satisfied with. While a tool for lfs exists that can automate the build process it's not really integral part. Basically it extracts the steps required to build the system from the documentation and then does it automatically. I am looking for something a little more robust and advanced and also don't feel like editing xml. After a bit of searching I found Buildroot which is intended to build _embedded_ distributions but also allows the installation of X11. Before building a toolchain and then a rootfs the build can be configured using `make menuconfig` just like Linux. This looks exacly like what I had in mind, except that it is intended for cross compiling for embedded systems. What I currently have in mind is using buildroot but first ripping out all the embedded specific part replacing them with the respective parts from lfs. Lot's of work. Also there are some problems with buildroot most importantly (as it appears from my limiting testing) just enabling an additional package results in the hole thing being rebuild from scratch, but for trivial changes I would like to avoid that. Before I make that time investment I will continue my search for a desktop distribution with a _pre-installation_ build tool like buildroot, are an alternative to/fork of buildroot intended for building desktop distributions. **Edit:** The answers so far point me to distributions like e.g. Gentoo, which is what I am currently using. But I am _looking for an alternative_ to distributions like Gentoo, Arch, Debian etc. as these distributions are not minimal enough. Also one has to customize these distributions after installation. I want something that can be customized before installation. While all of the mentioned distributions are fine distribution they are not what I am looking for. What I am looking for is **"buildroot for desktop"**. If you do not know what buildroot is then you probably won't be able to provide an answer which satisfies me. Also I don't think that this question is subjective. I simply can not find anything that comes close to my needs and am therefor asking you to point me to projects that might provide at least parts of what I need.


title: Powertop strange results

text: I have installed Ubuntu 11.04 and battery life decreased by 2 times. Powertop documentation says that there should be 3 wakeups per second, I have 800-900. I think it's very strange because I didn't touch any settings except for disabling nvidia graphic card. ![enter image description here](http://i.stack.imgur.com/MwgSv.png) How can i improve battery life?


title: Fastest way combine many files into one (tar czf is too slow)

text: Currently I'm running `tar czf` to combine backup files. The files are in a specific directory. But the number of files is growing. Using `tzr czf` takes too much time (more than 20 minutes and counting). I need to combine the files more quickly and in a scalable fashion. I've found `genisoimage`, `readom` and `mkisofs`. But I don't know which is fastest and what the limitations are for each of them.


title: Errors when working with stackoverflow, when connecting through squid proxy

text: I get errors when using Squid 3.1.10 proxy under Linux Slackware 14.0. My squid.conf has 5674 lines, so I can't put it into the question, using pastebin: http://pastebin.com/3jjKNVvu ## Problem description When reviewing a post, and clicking approve button, the system hangs, but not always. The same happens when submitting an answer or a comment. My investigations of the issue: I am reviewing a post and clicking approve (I approved 1 edit before, and everything was ok). In firebug after I approve the 2-nd edit, I get the following: ![enter image description here](http://i.stack.imgur.com/75ejH.png) `/vote/approve` keeps spinning forever, until I get the popup: ![enter image description here](http://i.stack.imgur.com/lUOBw.png) And this status in firebug: `NetworkError: 504 Gateway Time-out - http://stackoverflow.com/suggested- edit/977221/vote/approve` It is related to proxy - when I don't use it, no errors occur. Unfortunately, squid.conf has so many parameters, that I don't know, what are related to the problem. What should I do to fix?


title: bash multi line command with comments after the continuation character

text: Consider               echo \ # this is a comment     foo      This gives:               $ sh foo.sh      # this is a comment     foo.sh: line 2: foo: command not found      After some searching on the web, I found a solution by DigitalRoss on sister site Stack Overflow. So one can do               echo `: this is a comment` \     foo      or alternatively               echo $(: this is a comment) \     foo      However, DigitalRoss didn't explain why these solutions work. I'd appreciate an explanation. He replied with a comment "There used to be a shell goto command which branched to labels specified like : here. The goto is gone but you can still use the : whatever syntax ... : is a sort of parsed comment now.", but I'd like more details and context, including a discussion of portability. Of course, if anyone has other solutions, that would be good too. See also the earlier question How to comment multi-line commands in shell scripts?.


title: vim - better colors so comments aren't dark blue?

text: Mostly I edit ruby files, although shell script file comments are also `#` Currently my comments show as dark blue on black which is really hard to read. See screenshot. How can I change their color? I'm willing to conside different schemas for all colors though I do like the black background as a base. ![enter image description here](http://i.stack.imgur.com/7TlPT.png)


title: How can I run as another user?

text: This is the bash code that should be runned. So first it substitutes the user to openproject and than runs all the code               su openproject -c "bash -l"      cd ~/openproject     git checkout Gemfile.lock     git pull          bundle install     RAILS_ENV="production" bundle exec rake db:migrate     RAILS_ENV="production" bundle exec rake db:seed     RAILS_ENV="production" bundle exec rake assets:precompile      I have tried chnaging the above script into this:               su - openproject -c "cd ~openproject/openproject"          su - openproject -c "git checkout stable"          su - openproject -c "git checkout Gemfile.lock"     su - openproject -c "git pull"          su - openproject -c "bundle install"          su - openproject -c "RAILS_ENV="production" bundle exec rake db:migrate"     su - openproject -c "RAILS_ENV="production" bundle exec rake db:seed"     su - openproject -c "RAILS_ENV="production" bundle exec rake assets:precompile"      but this does not run properly and at every steps asks for password. How can the translated script be improved so it works? **UPDATE 1:** After receiving sugestions about this I am the point where the code has been modified into:               cd ~openproject/openproject          sudo -u openproject git checkout stable          sudo -u openproject git checkout Gemfile.lock     sudo -u openproject git pull          # the output is good thill here     sudo -u openproject bundle install          sudo -u openproject RAILS_ENV="production" bundle exec rake db:migrate     sudo -u openproject RAILS_ENV="production" bundle exec rake db:seed     sudo -u openproject RAILS_ENV="production" bundle exec rake assets:precompile      The output is ok till the line that states so into the code. From there I get 4 error > sudo: bundle: command not found **UPDATE 2:** After trying the suggestion from Dmitry Vasilyanov I found that if i insert the -i it will simulate as user login. However this is not the final way to do it. If I run `echo $PATH` after logging in as openproject the ouput is `/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/openproject/.rvm/bin` If I run `echo $PATH` after `su openproject -c "bash -l"` the output is `/home/openproject/.rvm/gems/ruby-2.1.0/bin:/home/openproject/.rvm/gems/ruby-2.1.0@global/bin:/home/openproject/.rvm/rubies/ruby-2.1.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/openproject/.rvm/bin`


title: Compare two numbers read from a file

text: I have a script that reads a file with a standard format where the 9th word is a number. I am trying to compare the number that is read from the file. I am able to read the line correctly and it works exactly as I want it to. But I get an error that says :               ./age.sh: line 8: [: age: integer expression expected      Here is my script:               #!/bin/bash     if [ -f $1 ] ;     then         while read -r LINE || [[ -n $LINE ]]; do             name=$( echo $LINE | cut -d " " -f1 -f2)             ago=$( echo $LINE | cut -d " " -f9)                  echo "$name ----- $age"             if [ $ago -gt 30 ] ; then                 echo "You get a discount"             fi         done < $1         else             echo "No file found"     fi      Here is a sample input file               #FirstName LastName SuperheroName Powers Weapons City Enemy isOutOfEarth Age     Bruce Wayne Batman Martial_arts No_Guns Gowtham Joker No 31     Clark Kent Superman Extreme_strength None Metropolitan Lex_Luther Yes 32     Oliver Queen Green_arrow Accuracy Bow_and_Arrow Star_city Cupid No 30


title: Is there a log for sshd where I can see who has used ssh to access my PC?

text: I am running the OpenSSH daemon (sshd) on CrunchBang Linux, and I want to see a history of who (i.e. IP address) has logged in using SSH.


title: Where to find a list of device drivers supported by linux?

text: I have read here that `linux` supports a large number of device drivers and by extension, it also supports a large number of devices connected via the `USB` port. Excerpt from that site: > Linux today supports more hardware devices than any other operating system > in the history of the world. It does this using a development model > significantly different from the familiar Windows device driver model. Is there a list of all the different devices which are supported by `linux`? and/or list of devices which are connected via `USB` and supported by linux`? This is different from just finding out which device drivers are currently supported in a given distribution by using the commands `lsmod`, `lspci` and `dmesg | grep <string>` as the distribution providers only support few common drivers out of all the drivers supported by `linux`.


title: control apache referrer to restrict downloads in htaccess file

text: i want to restrict a file server just for people come from an specific URL: `http://graymind.ir` how should i config `.htaccess` file to do this. sorry but i didn't find an answer in sites search.


title: Why are filenames that start with a dot hidden? Can I hide files without using a dot as their first character?

text: Initially I thought it was a coincidence, but now I see there's even a tag for it: all hidden file names start with a dot. Is this a convention? Why was it chosen? Can it be changed? Or in other words (as a related question @evilsoup suggested that implies the answer to a bunch of others): can I hide files without renaming them (using `.` as the first character of their name)?


title: Why don't I see a file being copied right away with ls?

text: Is it due to the buffering in memory? I did `cp /network/large_file . &` and I kept doing `ls -lh` to monitor progress, but the file didn't appear until it was about 400MB. Linux 2.6 kernel, Bash 4, 4GB swap, 16GB RAM.


title: RasPi - USB microphone locks up

text: On my RasPi board, Debian Linux, the USB microphone occasionally gets locked up such that nothing can use it. The microphone has a LED which is usually flashing, when it's locked, it turns off. The utility `arecord` describes it as follows:               card 1: Device [DYNEX USB MIC Device], device 0:USB Audio [USB Audio]         Subdevices: 1/1         Subdevice #0: subdevice #0      When the microphone stops working, `arecord` gives diagnostics like this:               > arecord -D plughw:1,0 > recording.wav     Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono     arecord: set_params:1145: Unable to install hw_params:     ACCESS:  RW_INTERLEAVED     FORMAT:  U8     etc...      Unplugging and plugging the microphone fixes it, only because the current dip forces the RasPi to reboot! Not an ideal situation. Is there a way to fix this from the command line or a C executable? I also tried using `ioctl(fd, USBDEVFS_RESET, 0)` using the output from `lsusb` to provide the bus and device number. That turns the LED back on, but it's overkill. The device has to be re-setup using alsamixer.


title: Upgrading Red Hat 9 (Shrike) kernel manually

text: I am following the instructions here on how to manually perform a kernel upgrade in Red Hat. The current Kernel RPM's are:               kernel-2.4.20-8     kernel-headers is not installed     kernel-ibcs is not installed     kernel-pcmcia-cs-3.1.31-13     kernel-source is not installed          mkinitrd-3.4.42-1     SysVinit-2.84-13     initscripts-7.14-1      Under the "Getting the updates" section, all the links are dead, and there doesn't seem to be a `ftp://updates.redhat.com/9.0/en/os/i386/` Does anybody know where the packages can be downloaded from? **Edit** Realising now that RH9 support was dropped a few hundred years ago along with the legacy project, found a working mirror here http://ftp-stud.fht- esslingen.de/


title: Can't do SSH public key login under encrypted home

text: I can't do ssh public key login to my server and I think this issue is related to the fact my home is encrypted. I chose the option "encrypt my home folder" under the Ubuntu install setup. The permissions on `/home/MY-USER` are 700. I've tried another workstation and everything works fine. I would be glad if someone help me to get out this without removing the encryption.


title: TeXstudio: open file at line number n

text: I am creating a script to produce some `.tex` files with a lot of lines (a kind of automatic sample). The script finishes with `texstudio /home/$USER/foo.tex` where `foo.tex` is the file created before. My question is: is it possible to open the file with `texstudio` with the cursor at line N, that is, I would like to run the script to open the file and start typing right now, exactly at the right line. Thanks for a while. Below is the script. * * *               file=/home/$USER/fastex-temp.tex     exec 3>&1 # save file descriptor to stdout     exec > "$file" # redirect output to file     printf '\\documentclass[11pt,a4paper]{amsart}\n'     printf '\\usepackage{amsfonts,amsthm,amsmath}\n'     printf '\\usepackage[latin1]{inputenc}\n'     printf '\\usepackage[T1]{fontenc}\n'     printf ' ' >&3 # output to normal stdout instead of file     printf '\\begin{document}\n'     printf ' ' >&3     printf '\\end{document}\n'     exec >&3  # restore stdout     exec 3>&- # close / discard temporary fd          texstudio "$file"


title: Setting up Apache 2 Local Development Environment & Permissions

text: I frequently find myself encountering problems (usually permissions) when trying to setup a local development server. Or creating a new site (alias). Very common problem is I need to allow `www-data` (apache use on ubuntu) access to all directories leading to the working directory. Another problem is since I am logged in as my personal user `jiewmeng`, when I create new files, they are owned by me, and sometimes, apache cant read/write to it How is your local development setup like? I am using Ubuntu 11.10 btw ...


title: SFTP: give user access to folder outside home

text: I have a machine running Ubuntu 12.04 LTS with OpenSSH server installed. I have created a user with a jailed home account. When I log in with the user's account, I can only access his home (duh). In addition to the user's home folder, I would like to give the him read access to a particular partition (`/Volumes/Storage`). How can I do this?


title: CUPS can't print to printer on network

text: I am having problems printing to the printer connected to my (SBS2003) business's network. I know the IP of the printer and I can ping it and even print files from it by going to 192.168.0.50 in firefox and uploading a file. If I do an `nmap` on the IP of the printer I get this:               jamesmaddison@development:~$ nmap 192.168.0.50          Starting Nmap 5.21 ( http://nmap.org ) at 2013-07-11 16:12 BST     Nmap scan report for 192.168.0.50     Host is up (0.46s latency).     Not shown: 991 closed ports     PORT      STATE SERVICE     21/tcp    open  ftp     23/tcp    open  telnet     80/tcp    open  http     443/tcp   open  https     515/tcp   open  printer     631/tcp   open  ipp     5900/tcp  open  vnc     9100/tcp  open  jetdirect     50001/tcp open  unknown          Nmap done: 1 IP address (1 host up) scanned in 4.55 seconds      I can't get my local cups server to print to it no matter what protocol I use. I am in the business workgroup and the printer even lists my computer in the workgroup. I have tried:               smb://MASTERMAGNETS/SBSSRV/Sharp%20MX-M314N/     smb://jamesmaddison:password@MASTERMAGNETS/SBSSRV/Sharp%20MX-M314N/     socket://192.168.0.50:9100     ipp://192.168.0.50/ipp?version=1.0     lpd://192.168.0.50/lp      and all of the "Discovered Printers" that CUPS lists. (They're dnssd protocols) The Printer is a Sharp MX-M314N. All Windows computers on the network can print to it fine, just my ubuntu machine that won't. Here's what the CUPS error log says for the last job I tried. http://pastebin.com/YL7p1Zsp And I often get a notification saying "Printer Error: printer error Printer Name: `connecting-to-device`" Here's what `nmap` reports when I run it on the SBS               jamesmaddison@development:~$ nmap mastermagnets          Starting Nmap 5.21 ( http://nmap.org ) at 2013-07-11 16:35 BST     Nmap scan report for mastermagnets (192.168.0.2)     Host is up (0.00055s latency).     rDNS record for 192.168.0.2: mastermagnets.local     Not shown: 957 closed ports     PORT      STATE SERVICE     25/tcp    open  smtp     42/tcp    open  nameserver     53/tcp    open  domain     80/tcp    open  http     88/tcp    open  kerberos-sec     135/tcp   open  msrpc     139/tcp   open  netbios-ssn     389/tcp   open  ldap     443/tcp   open  https     444/tcp   open  snpp     445/tcp   open  microsoft-ds     464/tcp   open  kpasswd5     593/tcp   open  http-rpc-epmap     636/tcp   open  ldapssl     691/tcp   open  resvc     1025/tcp  open  NFS-or-IIS     1027/tcp  open  IIS     1042/tcp  open  unknown     1045/tcp  open  unknown     1046/tcp  open  unknown     1048/tcp  open  unknown     1049/tcp  open  unknown     1054/tcp  open  unknown     1081/tcp  open  unknown     1087/tcp  open  unknown     1094/tcp  open  unknown     1104/tcp  open  unknown     2301/tcp  open  compaqdiag     2381/tcp  open  unknown     3268/tcp  open  globalcatLDAP     3269/tcp  open  globalcatLDAPssl     3389/tcp  open  ms-term-serv     5633/tcp  open  unknown     6001/tcp  open  X11:1     6002/tcp  open  X11:2     6004/tcp  open  X11:4     6101/tcp  open  backupexec     6106/tcp  open  isdninfo     8080/tcp  open  http-proxy     8081/tcp  open  blackice-icecap     8082/tcp  open  blackice-alerts     8443/tcp  open  https-alt     10000/tcp open  snet-sensor-mgmt          Nmap done: 1 IP address (1 host up) scanned in 1.18 seconds[/CODE]      I just can't get it to work, the problem seems to be between Cups and the windows server as if I go to 192.168.0.50:9100 in firefox the printer prints the GET header it receives. I can also go to 192.168.0.50 and upload a file directly to the printer. Lastly I can ftp into the printer and upload files that way. Here's what smbclient gives me:               ~$ smbclient -U MASTERMAGNETS/JamesMaddison -L //SBSSRV               Sharename       Type      Comment     ---------       ----      -------     Line100         Disk           print$          Disk      Printer Drivers     C$              Disk      Default share     S$              Disk      Default share     Technical       Disk           IRS             Disk           Designjet 500-24 Printer   HP Designjet 500 24 by HP     Accounts        Disk           RICOH           Printer   RICOH Aficio 1027     clients         Disk      Windows Small Business Server Client Setup     tsclient        Disk           IPC$            IPC       Remote IPC     Resources$      Disk      "Event logging files"     FxsSrvCp$       Disk      Common Fax Cover Pages Folder     tsweb           Disk           SHARP MX-M314N  Printer   192.168.0.50     ADMIN$          Disk      Remote Admin     faxclient       Disk      Microsoft Shared Fax Clients     ClientApps      Disk      Windows Small Business Server Client Applications     DLOAgent        Disk      Symantec DLO Share     Magnets-database files Disk           Magnet-database files Disk           D$              Disk      Default share     Users           Disk      Users Shared Folders     Public          Disk           actsql          Disk           SYSVOL          Disk      Logon server share     Address         Disk      "Access to address objects"     Confidential    Disk           NETLOGON        Disk      Logon server share     SBSSRV.LOG      Disk      Exchange message tracking logs          Server               Comment     ---------            -------     ANDY                     DESIGN1                   DESIGN2                   DESIGN3                   DEVELOPMENT          development server (Samba, Linux)     FRANK                     JOE                       JONATHAN                 KIM                  Kim     ORDERPRINT           Purchase Order Printer     PHIL                     SBSSRV                   TERMSRV                        Workgroup            Master     ---------            -------     MASTERMAGNETS        SBSSRV


title: Samba Shared Folder

text: I want to share a folder on my RHEL to all windows users. My requirements are:   1. users need to access from windows   2. users need read only access   3. no authentication required What I have tried:   1. Samba Server is up and running   2. Webmin module installed to use SambaUI   3. Webmin > Servers > Samba Windows File Sharing    4. Created a new file share with path as /home/guest/testfolder   5. Used myshare as share name   6. In security:     * -Writable :no     * -Guest access: Guest Only     * -Guest unix user: nobody     * -Hosts to allow: all     * -Hosts to deny: none I am able to see the folder testfolder but I am not able to browse its contents


title: How to limit P2P/torrent traffic on an OpenWrt 10.03 router?

text: We have a WRT160NL router with OpenWRT 10.03, and a 60-70 Mbit connection (from ISP, don't ask why). This router can do 30-35 Mbit on ethernet(i mean cable)..ok! There are ~7 PC's using this Wireless router, 6 through wifi (wep, because of the speed.. :\ ), 1 with cable. Question: How can we limit P2P/torrent traffic, to have very-very-very-very low priority? I mean if someone downloads from torrent, the speed is getting about e.g.: ~0,5 Mbit/sec etc. Without recompliing (i only want to use "stock" packages) are there any chances that i can do this? how? max connection limiting? how? topology: ISP -> WRT160NL -> 7 clients (NAT, 192.168.1.0/24).. I don't want to completely "disable" P2P/torrent traffic, I just want to slow them down, so the network would be usable even if several people use it, and e.g.: one of them is downloading st. over torrent. But if only e.g.: 1 person is using the network, then allow him to use all the bandwidth without limiting P2P.


title: Logwatch ignores self-defined service, but explicit setting --service $service works

text: I am using SSLH on my server to accept both SSL and SSH connections on Port 443. As the logs of sshd and apache2 show each incoming connection via SSLH originating from 127.0.0.1, I want to add the log of SSLH to Logwatch. To achieve this, I first filtered all entries regarding sslh into a seperate logfile with the following code in `/etc/rsyslog.d/sslh.conf`:               if $programname == 'sslh' then /var/log/sslh.log     if $programname == 'sslh' then ~      In the file `/etc/logwatch/conf/logfiles/sslh.conf` I added this to tell Logwatch about the logfile:               LogFile = /var/log/sslh.log     LogFile = /var/log/sslh.log.0     Archive = /var/log/sslh.log.*.gz          *ApplyStdDate =      The service definition in `/etc/logwatch/conf/services/sslh.conf` looks like this:               Title = "SSLH SSH / HTTPS Multiplexer"     LogFile = sslh      At last, I added the service script `/etc/logwatch/scripts/services/sslh` with this content:               #!/bin/bash          echo "Date Range: $LOGWATCH_DATE_RANGE"     echo "Detail Level: $LOGWATCH_DETAIL_LEVEL"     echo "Temp Dir: $LOGWATCH_TEMP_DIR"     echo "Debug Level: $LOGWATCH_DEBUG"          grep -v 'forwarded to SSL$'      When I run Logwatch with the service sslh explicitly specified, everything works like a charm and I get the filtered output for the desired timespan:               logwatch --service sslh --output stdout          ################### Logwatch 7.4.0 (05/02/12) ####################            Processing Initiated: Fri Jul 12 11:37:46 2013            […]     ##################################################################          --------------------- SSLH SSH / HTTPS Multiplexer Begin ------------------------          Jul 11 22:51:13 example sslh[2225]: connection from […].adsl.alicedsl.de:3643 to […].yourvserver.net:https forwarded from localhost:59788 to localhost:https     Jul 11 22:51:13 example sslh[2225]: connection from […].adsl.alicedsl.de:3644 to […].yourvserver.net:https forwarded from localhost:59789 to localhost:https     […]          ---------------------- SSLH SSH / HTTPS Multiplexer End -------------------------               ###################### Logwatch End #########################      The problem occurs in regular operation, when calling Logwatch like this:               logwatch --mailto webmaster@example.com      I redirected the output of Logwatch into a file and found some strange lines like this one for example, where sslh is listed as disabled:               Service List:     [0] = all     [1] = -zz-network     [2] = -zz-sys     [3] = -eximstats     [4] = -sslh      Grepping for `sslh` in the Logwatch output produced this:               root:~# grep -r -i -n sslh ~/logwatch_out          38:[4] = -sslh     75:[4] = -sslh     4747:ReadConfigFile: Opening /etc/logwatch/conf/services/sslh.conf     4748:ReadConfigFile: Read Line: Title = "SSLH SSH / HTTPS Multiplexer"     4749:ReadConfigFile: Name=Title, Value="SSLH SSH / HTTPS Multiplexer"     4750:ReadConfigFile: Read Line: LogFile = sslhReadConfigFile: Name=LogFile, Value=sslh     6431:ReadConfigFile: Opening /etc/logwatch/conf/logfiles/sslh.conf     6432:ReadConfigFile: Read Line: LogFile = /var/log/sslh.log     6433:ReadConfigFile: Name=LogFile, Value=/var/log/sslh.log     6434:ReadConfigFile: Read Line: LogFile = /var/log/sslh.log.0     6435:ReadConfigFile: Name=LogFile, Value=/var/log/sslh.log.0     6436:ReadConfigFile: Read Line: Archive = /var/log/sslh.log.*.gz     6437:ReadConfigFile: Name=Archive, Value=/var/log/sslh.log.*.gz     6527:[85] = sslh     6594:[47] = sslh     6867:Service Name: sslh     6868:   Logfile = sslh     7181:Logfile Name: sslh     7183:   Logfile = /var/log/sslh.log      After figuring out that my configuration for Logwatch regarding sslh works, when I specify the service sslh explicitly, I have absolutely no idea, why sslh is excluded when running Logwatch regulary. Even the category "SSLH" is not included in the E-Mail, with or without any content. Any help would be appreciated.


title: How to make nemo support compressing files by context menu?

text: I use Cinnamon on ArchLinux and Nemo is it's default file manager. I've tried 3 GUI file archivers (`p7zip` with WxGTK, `peazip` & `file-roller`), but none of them add a "compress option" in the context menu. How can I add a "compress option" to Nemo's right click context menu?


title: Privoxy redirect blacklist sites to whitelist site

text: For my application, I need a WiFi hotspot that has the entire internet blocked except for one website. I am thinking about using a Raspberry Pi configured as a WiFi hotspot and using Privoxy. Privoxy has the capability to whitelist and blacklist sites (in my case there would be just one whitelisted site, with everything else blocked). http://raspberrypi.stackexchange.com/questions/16957/whitelist-internet-filter What I now need is for any blocked site to be redirected to the the whitelisted site. An additional bonus is for the white listed site to appear immediately once users have connected to the WiFi, just like the captive portal on a WiFi hotspot. Does anyone know how to do this?


title: Wireless connection connecting and disconnecting all the time

text: I am running Ubuntu 11.04 on my laptop and I use a 3G USB modem for my Internet connection. I wanted to share this Internet connection with my girlfriend's laptop that is running Window XP. Basically, I created the the wireless connection on my laptop and now it just connects and disconnects all the time. Why is it doing this? I am connected to the Internet via the 3G USB modem while I am also trying to connect the wireless set up, could that be the reason? Is there anything I should do on the Windows computer during the wireless set up?


title: Connecting to Github from server

text: I am trying to connect to Github from a server running Jenkins. To do this, I'm copying my public key from another server, into the authorized_keys on the new server. All I'm getting is the following error:               git ls-remote -h git@github.com:Company/client.git HEAD     Warning: Permanently added the RSA host key for IP address 'xxx.xxx.xxx.xxx' to the list of known hosts.     Permission denied (publickey).     fatal: The remote end hung up unexpectedly      All I did was this:   1. Go into the .ssh directory on the user account I want, on the old server   2. Copy the public key, in id_rsa.pub.   3. Log into the new server, go into /root/.ssh, and put that key into "authorized_keys"   4. Attempt the above command. What am I doing wrong? My suspicion is that I'm not copying the key to the correct location, and that in actuality I want to have the entire id_rsa.pub as well as the private key up there, and I'm actually trying to copy a user setting - but I'm not quite sure. How do I access github from this new server?


title: Installing vim/emacs on solaris 8

text: At my new job, they want me to use a solaris 8 operating system, but all my coding experience has been on linux. Linux had a lot of tools built into the system, but it seems like the solaris I'm using is extremely stripped down. I was wondering if someone can tell me how to install vim or emacs (preferably emacs) on solaris 8. I tried google but I couldn't find any download links for solaris 8. I tried using vi, but it's a little annoying to use after using vim and emacs (I can't even get the editor to backspace correctly!). Also, there is no syntax highlighting in vi which is a little annoying. Can anyone here help me install a more modern text editor? (And also help me become a little more proficient in solaris 8 :) ). Thank you.


title: How to see package version without install?

text: I want to see the version of a package before I install it. How can I do this?


title: Chkconfig on Linux Mint 12 giving tons of errors

text: I'm trying to disable some services from starting at boot time on my Linux Mint 12 laptop. So I installed `chkconfig`, which has worked great for me before on Fedora. However, on Linux Mint 12, it gives me tons of errors. Here is an example, trying to disable the `rsync` service:               $ sudo chkconfig rsync off     insserv: warning: script 'K01acpi-support' missing LSB tags and overrides     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'cryptdisks-udev' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `cryptdisks-udev'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `cryptdisks-udev'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'acpid' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `acpid'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `acpid'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'plymouth-upstart-bridge' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `plymouth-upstart-bridge'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `plymouth-upstart-bridge'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'rsyslog' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `rsyslog'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `rsyslog'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'friendly-recovery' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `friendly-recovery'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `friendly-recovery'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'udevtrigger' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `udevtrigger'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `udevtrigger'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'udev-finish' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `udev-finish'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `udev-finish'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'plymouth-stop' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `plymouth-stop'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `plymouth-stop'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'apport' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `apport'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `apport'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'dbus' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `dbus'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `dbus'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'cryptdisks-enable' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `cryptdisks-enable'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `cryptdisks-enable'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'hwclock' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `hwclock'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `hwclock'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'lightdm' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `lightdm'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `lightdm'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'udevmonitor' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `udevmonitor'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `udevmonitor'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'ufw' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `ufw'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `ufw'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'binfmt-support' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `binfmt-support'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `binfmt-support'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'udev' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `udev'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `udev'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'irqbalance' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `irqbalance'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `irqbalance'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'cron' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `cron'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `cron'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'nmbd' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `nmbd'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `nmbd'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'plymouth-splash' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `plymouth-splash'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `plymouth-splash'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'procps' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `procps'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `procps'     insserv: warning: script 'acpi-support' missing LSB tags and overrides     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'network-manager' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `network-manager'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `network-manager'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'smbd' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `smbd'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `smbd'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'dmesg' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `dmesg'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `dmesg'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'module-init-tools' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `module-init-tools'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `module-init-tools'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'network-interface' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `network-interface'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `network-interface'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'console-setup' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `console-setup'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `console-setup'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'anacron' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `anacron'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `anacron'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'modemmanager' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `modemmanager'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `modemmanager'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'udev-fallback-graphics' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `udev-fallback-graphics'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `udev-fallback-graphics'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'plymouth' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `plymouth'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `plymouth'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'network-interface-security' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `network-interface-security'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `network-interface-security'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'alsa-store' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `alsa-store'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `alsa-store'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'alsa-restore' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `alsa-restore'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `alsa-restore'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'avahi-daemon' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `avahi-daemon'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `avahi-daemon'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'plymouth-log' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `plymouth-log'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `plymouth-log'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'mysql' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `mysql'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `mysql'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'atd' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `atd'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `atd'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'hostname' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `hostname'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `hostname'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'cups' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `cups'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `cups'     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'hwclock-save' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `hwclock-save'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `hwclock-save'     insserv: script virtualbox: service vboxdrv already provided!     insserv: script virtualbox: service virtualbox already provided!     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'setvtrgb' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `setvtrgb'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `setvtrgb'      It seems to have worked when I run:               # chkconfig rsync       rsync  off      Is it bad to continue to use `chkconfig`? Can anyone suggest an alternate service-managing program, or a way to fix the errors when running `chkconfig`?


title: I am having some technical issue with awk code

text: This is related to one of my previous question: Comparing text files using Bash and AWK file1.txt               Name  Col1  Col2  Col3       -----------------------     row1  1     4     7             row2  2     5     8              row3  3     6     9       file2.txt               Name  Col1  Col2  Col3       -----------------------             row1  1     4     7     row2  2     5     999      I have somewhat figured out a way to compare two files. But for some reason it is not giving me the result that I want. Bare with me as I am a beginner. Here is the code I use to compare the files.               awk '     FNR < 2 { next }     FNR == NR {         for (i = 2; i <= NF; i++)          {             a[i,$1] = $i;          }             b[$1];         next;          }     ($1 in b) {        for (i = 2; i <= NF; i++)         {           if (a[i,$1] == $i)                printf("%s->Col%d: %d vs %d: Equal\n", $1, i-1, a[i,$1], $i);           else                printf("%s->Col%d: %d vs %d: Not Equal\n", $1, i-1, a[i,$1], $i);        }     } ' file1.txt file2.txt      Expected result:               row2->Col1: 1 vs 1: Equal     row2->Col2: 4 vs 4: Equal     row2->Col3: 7 vs 7: Equal     row1->Col1: 2 vs 2: Equal     row1->Col2: 5 vs 5: Equal     row1->Col3: 8 vs 999: Not Equal      Actual result:               row2->Col1: 1 vs 1: Equal     row2->Col2: 4 vs 4: Equal     row2->Col3: 0 vs 7: Not Equal     row1->Col1: 2 vs 2: Equal     row1->Col2: 5 vs 5: Equal     row1->Col3: 0 vs 999: Not Equal      I don't know why 0 is part of the output. Does anyone know why 0 is there? EDIT: Here is the problem. The first for loop only iterates once. Does anyone know why?


title: Fullscreen applications and dual monitor setup ( + cursor grab )

text: I have dual screen monitor setup. There are applications (like VLC), where everything works out of the box. If you fullscreen a video, you can use your other screen normally. This is the setup I would expect. Then there are mostly Linux games and ones you can run via Wine. If you run a fullscreen game, other screen just turns black, violet or flickers like crazy. Moreover, when you exit the game, the second screen is off, so I have to restart X. Does anyone know how I make this work better? Is this just a matter of those applications not using the appropriate library, or are there more fundamental issues with mutli-monitor support right now? Added later: Apparently there is no solution, Xorg is just fundamentally broken: http://www.maketecheasier.com/run-fullscreen-games-in-linux-with-dual- monitors/2010/03/01


title: What tool to execute a command on repeated syslog entries?

text: Occasionally, one VPS under my control gets bombarded with POP3 login attempts. They all fail, but the huge number of spawned processes and active connections pretty much amount to a DoS attack. When I see that going on, I usually go in and manually block the offending IP address in iptables. **What I would like** is to have a process running on the server monitoring the system log (or some other appropriate place) and, if there are repeat log entries matching a particular pattern, pass them to a command which would then extract the relevant part (the remote host IP address, in this case) and execute a command (to add a DROP rule to iptables). _For example_ , do so if log entries with the same message-part are logged five times within one minute. The VPS runs syslog-ng in case that helps. I have set up rate limiting in iptables which helps somewhat, but certainly isn't perfect as it blocks my own connection attempts just as much as those of an attacker (it becomes the luck of the draw who gets an established connection). Since the clients that are supposed to connect have IP addresses from dynamic blocks, it's difficult to just add an override rule without rate limiting. Since the VPS runs on Virtuozzo, while I do have root access to the guest, I cannot load custom kernel modules, or a custom kernel. So it has to be done in userspace. What software will help me?


title: What is the best way to implement hotkeys support in Linux?

text: What is the best way to implement hotkeys support in Linux (ie support for brightness, audio or keyboard backlight keys)? By "best way" I mean robust, without code duplication, with minimal work required to add support for new hardware.   1. Who should capture the hotkeys? Kernel module / daemon / X server / desktop environment / something else?   2. Who should do the actual work (e.g. setting brightness)?


title: How is my domainname determined?

text: If I look into `/etc/hostname/` I can see the hostname of my device. This is however not the name that shows up when I use nslookup on our network. How do I tell the DNS server which name it should use? To clarify I am on a small local network. Edit: I think I have to explain this a little further. I have a file `/etc/hostname` with only one line:               my_hostname      We have a LAN that has the name `our_network.local`. I was expecting if there isn't any kind of conflict, the nameserver would create the name `my_hostname.our_network.local`, but when I issue the command `nslookup` on my ip-address, the name is not found.


title: Vanishing permission on device file (RHEL 6.1)

text: I want to set world read/write permissions on a raw block device file (yeah, I know). I can set the permission to 666, but it goes back to 660 immediately after I touch it or write to it. Why?               [root@mysystem udev]# ll /dev/sdz6     brw-rw-rw-. 1 root disk 65, 150 Aug 30 12:09 /dev/sdz6     [root@mysystem udev]# touch /dev/sdz6     [root@mysystem udev]# ll /dev/sdz6     brw-rw----. 1 root disk 65, 150 Aug 30 13:58 /dev/sdz6     [root@mysystem udev]# chmod 666 /dev/sdz6     [root@mysystem udev]# ll /dev/sdz6     brw-rw-rw-. 1 root disk 65, 150 Aug 30 13:58 /dev/sdz6     [root@mysystem udev]#      I don't see anything in /var/log/messages, /var/log/dmesg or /var/log/secure. I turned off SELinux (`setenforce 0`). **edit** - here's the script I wrote to fix it:               [root@mysystem rules.d]# cat /etc/udev/rules.d/99-drives.rules     KERNEL=="sd*", SUBSYSTEM=="block", MODE="0666"          [root@mysystem rules.d]# udevadm info -q path -n /dev/sdz     /devices/pci0000:80/0000:80:03.0/0000:8b:00.0/0000:8c:01.0/0000:8e:00.0/host19/rport-19:0-2/target19:0:2/19:0:2:12/block/sdz          [root@mysystem rules.d]# udevadm test /devices/pci0000:80/0000:80:03.0/0000:8b:00.0/0000:8c:01.0/0000:8e:00.0/host19/rport-19:0-2/target19:0:2/19:0:2:12/block/sdz 2>&1 | grep '99-drives'     parse_file: reading '/etc/udev/rules.d/99-drives.rules' as rules file     udev_rules_apply_to_event: MODE 0666 /etc/udev/rules.d/99-drives.rules:1


title: Cron jobs and mail notification

text: I have (from one tutorial) cron job which make weekly backup on my website and is working fine.               #!/bin/bash     NOW=$(date +"%Y-%m-%d-%H%M")     FILE="mysite.com.$NOW.tar"     BACKUP_DIR="/home/user/backups/"     WWW_DIR="/home/user/public_html/"          DB_USER="my_site_db_username"     DB_PASS="password"     DB_NAME="mysite_dn_name"     DB_FILE="mysite.com.$NOW.sql"          WWW_TRANSFORM='s,^home/username/public_html,www,'     DB_TRANSFORM='s,^home/username/backups,database,'          tar -cvf $BACKUP_DIR/$FILE --transform $WWW_TRANSFORM $WWW_DIR     mysqldump -u$DB_USER -p$DB_PASS $DB_NAME > $BACKUP_DIR/$DB_FILE          tar --append --file=$BACKUP_DIR/$FILE --transform $DB_TRANSFORM $BACKUP_DIR/$DB_FILE     rm $BACKUP_DIR/$DB_FILE     gzip -9 $BACKUP_DIR/$FILE      Question is, can someone help me how can I made when backup is done to send me email? I'm using bash for first time and I'm not sure what I doing.


title: ZSH: Stripping path, filename and extension from a list of files for piping a command

text: The syntax for the command `convert` in ImageMagick is               convert source_filename.ext1  destination_filename.ext2      I would like to use zsh to feed it with files in a folder `path_to_source` and output the result (files with same name, but with a **different extension** ) under the folder `path_to_destination`. I believe I can use `find` and `xargs` for this, but I didn't come up with anything that worked. Also I presume that ZSH may have some builtins that are useful for this. Any pointers would be greatly appreciated. **NOTE:** As far as I know, `convert` does not have a native way of handling a batch of files, so I need to feed the files one by one. In either case, I'm interested in solving the problem of feeding a command file by file with these arguments.


title: Multiple 'Host *' in ssh_config?

text: My understanding of the way ~/.ssh/config works is that each 'Host ' line takes effect for any host matching after that point in the config file. I have a number of personal servers and work servers that I need to connect to. I'm trying to do something like the following:               # General Settings     ControlMaster auto     ControlPath   ~/.ssh/controlmaster/%r@%h:%p     ForwardAgent  yes     ForwardX11    yes     GSSAPIAuthentication no     PubkeyAuthentication yes          # Personal Servers     Host *     User harleypig     IdentityFile ~/.ssh/personal_id_rsa          Host host1     Hostname host1.com          Host host2     Hostname host2.com          # Work Servers     Host *     User alan.young     IdentityFile ~/.ssh/work_id_rsa          Host work1     Hostname work1.companyserver.com          Host work2     Hostname work2.companyserver.com          Host *     User devuser          Host dev1     Hostname dev1.companyserver.com          Host dev2     Hostname dev2.companyserver.com      The docs seem to indicate that host1 and host2 should use 'personal_id_rsa' and the user harleypig. work1, work2, dev1 and dev2 should use 'work_id_rsa' and the first two should be the user 'alan.young' and dev1 and dev2 should be the user 'devuser' However, this is not happening. Whatever 'Host *' I put first is what all of the following hosts try to connect with. Am I misunderstanding or missing something?


title: mixed raid types

text: I am about to reinitialise my (SW) raid array. Previously the array was raid5 with 4 disks. I've removed one disk in order to install a new additional (larger) drive. What I'd ideally like to do is mix types of raid across the 3 disks. Having 1 section of 3 way mirrored raid1, a section of raid5 and a section of raid0 offering various levels of protection for my more and less important files, while wasting as little space as possible. I can do this by creating 3 separate raid partitions on each disk and assembling 3 arrays from this, but this has a number of downsides:   1. The size of each section would be fixed from the outset and changing this would be rather tricky   2. I would be limiting my directory layout options and probably end up resorting to symlinks to retain a logical layout What I would really like is a single filesystem, where I can set a property on individual files/directories, indicating the level of protection required for those files, resulting in the file being mirrored as appropriate. Is there any way to achieve this on SUSE, perhaps with an esoteric filesystem format?


title: Ubuntu with Gnome and Openbox

text: I've in my laptop Ubuntu 12.04.03 which comes by default with Unity. I like Unity, and Gnome. It has a nice look, some nice apps, things frequently works nice. However I would prefer to use Openbox. It is very lightweight, the 'context menu' is fantastic, and so on. But some times Openbox sucks, for instance, the wallpaper does not appear no matter what I do, the backlight also isn't working, etc.. I read somewhere that it is possible to run openbox and gnome together. My question is: what are the pros and cons of doing this? In my laptop in GDM when I log using Gnome/Openbox seems that there is no difference between the conventional Gnome environment. If I use openbox+gnome would I be able to use the right-button mouse click context menu?


title: Variable value is not recognized after using gnu parallel?

text: I have a below shell script from which I am trying to copy 5 files in parallel. I am running my below shell script on `machineA` which tries to copy the file from machineB and machineC. If the file is not there in `machineB`, then it should be there in `machineC` for sure. I am using GNU Parallel here to download five files in parallel.               #!/bin/bash          readonly PRIMARY=/tech01/primary     readonly FILERS_LOCATION=(machineB machineC)     readonly MEMORY_MAPPED_LOCATION=/techbat/data/be_t1_snapshot     PRIMARY_PARTITION=(550 274 2 546 278 6 558 282 10 554 286 14) # this will have more file numbers          dir1=/techbat/data/be_t1_snapshot/20140501          find "$PRIMARY" -mindepth 1 -delete          do_copy() {       el=$1       scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 david@${FILERS_LOCATION[0]}:$dir1/t1_weekly_1680_"$el"_200003_5.data $PRIMARY/. || scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 david@${FILERS_LOCATION[1]}:$dir1/t1_weekly_1680_"$el"_200003_5.data $PRIMARY/.     }     export -f do_copy     parallel -j 5 do_copy ::: "${PRIMARY_PARTITION[@]}"      **Problem Statement:-** The problem I am facing with the above script is - It is not able to recognize `${FILERS_LOCATION[0]}`, `${FILERS_LOCATION[1]}`, `$dir1` and `$PRIMARY` inside `do_copy` method? And I am not sure why? If I try to print out like this inside `do_copy` method nothing is printed out?                 echo ${FILERS_LOCATION[0]}           echo ${FILERS_LOCATION[1]}      But if I print out same thing just above `do_copy` method, then it works fine? Anything I am missing here? **Update:-** Below is the code I am using -               #!/bin/bash          export PRIMARY=/tech01/primary     export FILERS_LOCATION=(machineB machineC)     export MEMORY_MAPPED_LOCATION=/techbat/data/be_t1_snapshot     PRIMARY_PARTITION=(0 548 272 4 544 276 8 556 280)          export dir1=/techbat/data/be_t1_snapshot/20140501          find "$PRIMARY" -mindepth 1 -delete          do_copy() {       el=$1       scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 david@${FILERS_LOCATION[0]}:$dir1/t1_weekly_1680_"$el"_200003_5.data $PRIMARY/. || scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 david@${FILERS_LOCATION[1]}:$dir1/t1_weekly_1680_"$el"_200003_5.data $PRIMARY/.     }     export -f do_copy     parallel -j 8 do_copy ::: "${PRIMARY_PARTITION[@]}"      **Another Update:-** This is what I got after running the below script -               #!/bin/bash          export PRIMARY=/tech01/primary     export FILERS_LOCATION=(slc4b03c-407d.stratus.slc.ebay.com chd1b02c-0db8.stratus.phx.ebay.com)     export MEMORY_MAPPED_LOCATION=/techbat/data/be_t1_snapshot     PRIMARY_PARTITION=(0 548 272 4 544)          export dir1=/techbat/data/be_t1_snapshot/20140501          find "$PRIMARY" -mindepth 1 -delete           echo ${FILERS_LOCATION[0]}          echo ${FILERS_LOCATION[1]}          do_copy() {       el=$1       echo "scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 bullseye@${FILERS_LOCATION[0]}:$dir1/t1_weekly_1680_"$el"_200003_5.data $PRIMARY/. || scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 bullseye@${FILERS_LOCATION[1]}:$dir1/t1_weekly_1680_"$el"_200003_5.data $PRIMARY/."     }     export -f do_copy     parallel -j 3 do_copy ::: "${PRIMARY_PARTITION[@]}"      Output I got -               david@tvxdbx1143:/home/david$ ./scp_files5.sh     machineB     machineC     When using programs that use GNU Parallel to process data for publication please cite:            O. Tange (2011): GNU Parallel - The Command-Line Power Tool,       ;login: The USENIX Magazine, February 2011:42-47.          This helps funding further development; and it won't cost you a cent.          To silence this citation notice run 'parallel --bibtex' once or use '--no-notice'.          scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 david@:/techbat/data/be_t1_snapshot/20140501/t1_weekly_1680_0_200003_5.data /tech01/primary/. || scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 david@:/techbat/data/be_t1_snapshot/20140501/t1_weekly_1680_0_200003_5.data /tech01/primary/.     scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 david@:/techbat/data/be_t1_snapshot/20140501/t1_weekly_1680_548_200003_5.data /tech01/primary/. || scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 david@:/techbat/data/be_t1_snapshot/20140501/t1_weekly_1680_548_200003_5.data /tech01/primary/.     scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 david@:/techbat/data/be_t1_snapshot/20140501/t1_weekly_1680_272_200003_5.data /tech01/primary/. || scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 david@:/techbat/data/be_t1_snapshot/20140501/t1_weekly_1680_272_200003_5.data /tech01/primary/.     scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 david@:/techbat/data/be_t1_snapshot/20140501/t1_weekly_1680_4_200003_5.data /tech01/primary/. || scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 david@:/techbat/data/be_t1_snapshot/20140501/t1_weekly_1680_4_200003_5.data /tech01/primary/.     scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 david@:/techbat/data/be_t1_snapshot/20140501/t1_weekly_1680_544_200003_5.data /tech01/primary/. || scp -o ControlMaster=auto -o 'ControlPath=~/.ssh/control-%r@%h:%p' -o ControlPersist=900 david@:/techbat/data/be_t1_snapshot/20140501/t1_weekly_1680_544_200003_5.data /tech01/primary/.


title: Zsh - Disable Tab Insert

text: I'm trying to configure zsh to closely fit how bash behaves before I fully switch, and one behavior I'm trying to modify in zsh is when it inserts a Tab character. I see how it could be helpful for writing functions interactively, but I prefer bash's behavior of listing the directory contents. Ideally, I would like to cycle through the directories using a menu, but my main priority is to list directories like Bash after one or two Tab presses instead of inserting a Tab. I did try to look this up, but everything I found only pertained to disabling Tab Completion entirely. **EDIT:** I mistakenly thought bash's default completion on empty input was to list the directory when I posted this, I feel like it may have caused some confusion with what I was asking. My main objective is to prevent zsh from inserting a Tab when there is only whitespace.


title: creating patition in debian with more inodes on a beaglebone black

text: I have a beaglebone black that i've installed debian wheezy from http://www.armhf.com onto the eMMC While this was working great up until recently when I ran out of inodes on the patition even though I had 40% of space free on the device. Now I understand I cant increase inodes on a filesystem that has unix installed and I need to recreate the patition which I am happy to do after having backed up my work. Only issue is how do I go about doing this? This is what I have tried so far Create a microSD with bootable debian, boot into debian on the USB then format the emmc `mkfs.ext4 -i 4096 /dev/mmcblk1` my understanding is that using the -i argument I can specify for every 4096 bytes a inode should be created I have tried this twice now, once with 4096 a second time with 2048 get the debian image `wget http://s3.armhf.com/debian/wheezy/bone/debian- wheezy-7.2-armhf-3.8.13-bone30.img.xz` extract it to the new partition `xz -cd debian-wheezy-7.2-armhf-3.8.13-bone30.img.xz > /dev/mmcblk1` Which to me seems like the correct steps although each time I do this when I type df -i the result is always the same amount of inodes (11,7000~) or something like that Would really appreciate some guidance on how I can achieve increasing the inodes above the default. Cheers Tim


title: Shifting GNOME 3 notification corner to bottom-left!

text: I like that GNOME 3's (v3.4 on Ubuntu 12.04) 'Hot Corner' and 'notification corner (?)' response really fast, but the latter, for me, would have been better off at the bottom-left corner; leaving the bottom-right for other status menus, chat menus, etc. While reaching for such menus of the full-sized windows, my cursor often touch the notification corner and the try is up instantly like you can see in the snapshots where I was meaning close the 'downloads' bar of my web browser. ![snap1](http://i.stack.imgur.com/3N0Di.png) ![snap2](http://i.stack.imgur.com/PryTs.png) Can I get the _Notification Corner_ shifted to the bottom-left?


title: How to move to a different drive or partition?

text: I'm relatively new to Unix... or at least doing anything beyond `ls`. I need to get to a partition that is larger than where I'm at to import a project that won't fit where I'm currently. Also I'm running Linux on a VM on Windows.               jack@ubuntu:~$ sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL     NAME   FSTYPE   SIZE MOUNTPOINT LABEL     sda              20G     ââsda1 ext4    15.7G /     ââsda2            1K     ââsda5 swap     4.3G [SWAP]     sdc              40G     ââsdc1 ext4      40G            work     sdb              20G     ââsdb1 ext4      20G /mnt/disk     jack@ubuntu:~$ sudo fdisk -l          Disk /dev/sda: 21.5 GB, 21474836480 bytes     255 heads, 63 sectors/track, 2610 cylinders, total 41943040 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: 0x000750e0             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048    32956415    16477184   83  Linux     /dev/sda2        32958462    41940991     4491265    5  Extended     /dev/sda5        32958464    41940991     4491264   82  Linux swap / Solaris