title: Why $PATH variable different between two directories?

text: When I'm in one directory and echo path               pwd     /Users/me/src/some_proj          echo $PATH     /Users/me/.gem/ruby/2.0.0/bin:/opt/boxen/chruby/versions/2.0.0-     p353/lib/ruby/gems/2.0.0/bin:/opt/boxen/chruby/versions/2.0.0-     p353/bin:bin:/opt/boxen/chruby/bin:/opt/boxen/ruby-     build/bin:node_modules/.bin:/opt/boxen/nodenv/shims:/opt/boxen/nodenv/bin:     /opt/boxen/bin:/opt/boxen/homebrew/bin:/opt/boxen/homebrew/sbin:     /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin      When I'm in a different directory and echo path               pwd     /Users/me/src_personal/my_gems/som_gem          echo $PATH     bin:/opt/boxen/chruby/bin:/opt/boxen/ruby-build/bin:     node_modules/.bin:/opt/boxen/nodenv/shims:/opt/boxen/nodenv/bin:     /opt/boxen/bin:/opt/boxen/homebrew/bin:/opt/boxen/homebrew/sbin:     bin:/opt/boxen/chruby/bin:/opt/boxen/ruby-build/bin:     node_modules/.bin:/opt/boxen/nodenv/shims:/opt/boxen/nodenv/bin:     /opt/boxen/bin:/opt/boxen/homebrew/bin:/opt/boxen/homebrew/sbin:     bin:/opt/boxen/chruby/bin:/opt/boxen/ruby-build/bin:     node_modules/.bin:/opt/boxen/nodenv/shims:/opt/boxen/nodenv/bin:     /opt/boxen/bin:/opt/boxen/homebrew/bin:/opt/boxen/homebrew/sbin:     /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin      I get a different $PATH. I thought $PATH was a global variable in the shell that doesn't change. Why are these paths different in different directories?


title: Is it possible to notify/warn that current path isn't a valid symlink anymore?

text: Let's say we have `./a` and `./b` directories. Then we create a symlink using `ln -s a x` and entering it `cd x` The `pwd` would be `x` Then in another terminal we change the `x` so that it pointed to `b`. But the first one would still return `x` for `pwd` which is not consistent anymore. So is there a way for current terminal (bash) to alert/warn if the current path is the obsolete symlink?


title: Allow AD Groups to SUDO

text: I'm adding some Fedora 20 workstations to our Windows 2003 domain. I've successfully joined the domain with the boxes, and can login with domain accounts. Now I'm trying to allow the default AD group `Enterprise Admins` to use `SUDO`, however whatever I do, it seems that the group cannot be found (or at least it tells me my user account is not in the sudoers file) Structure of the OU (default really):   * mydomain.local      * Builtin     * Computers     * DCOM-Users     * DOmain Controllers     * ForeignSecurityPrincipals     * CompanyName        * Management       * Accounting       * Admins       * SysAccounts       * CustomerService       * Warehouse     * Users I used `realmd` and `sssd` to join the domain, and am trying to allow sudo to groups located under the `Users` OU, but would also like to add some from the `CompanyName --> Admins` OU/Sub-group as well. I'm currently trying this with no luck (in /etc/sudoers)               %MYDOMAIN\\Enterprise^Admins ALL=(ALL) ALL      I've also tried variations as well, such as:               %MYDOMAIN\\Users\Enterprise^Admins ALL=(ALL) ALL     %Enterprise^Admins@mydomain.local ALL=(ALL) ALL      etc... nothing seems to be working. Even after reboots, and/or `systemctrl restart sssd`. If i explicitly add my domain account to the /etc/sudoers file, it works no problem.               myuser@mydomain.local ALL=(ALL) ALL      There are a few resources that seem to indicate it should be possible to add AD groups to sudoers, however so far none of them have worked for me: http://funwithlinux.net/2013/09/join-fedora-19-to-active-directory-domain- realmd/ http://serverfault.com/questions/387950/how-to-map-ad-domain-admins-group-to- ubuntu-admins https://help.ubuntu.com/community/LikewiseOpen


title: setxkbmap switches between 2 out of 3 layouts

text: Issuing that command:               setxkbmap -layout "us,ua,ru" -variant ",winkeys" -option "grp:shift_caps_toggle,grp_led:scroll" -model pc105 -rules xorg      When hitting `Caps Lock`+`Shift` I'm switching between English (us) and Ukrainian (ua) layouts, but not Russian (ru). I've tried to reset it with the following command:               setxkbmap -layout "us,ua,ru" -option ""      and played with many different options - nothing helps. My system is Gentoo Linux and window manager wmii.


title: How to write a systemd .service file running systemd-tmpfiles

text: I need to run `systemd-tmpfiles --create` during the boot process with a systemd distro. So I need to create a systemd .service file doing this job. In this question you can read all the details about what I need and why: How does systemd-tmpfiles work? I have read some docs about it and I am writing the following test:               [Unit]     Description=Execute tmpfiles to disable usb-wakeup # see details in the link above     Requires=multi-user.target # see details in the link above     After=multi-user.target    # see details in the link above          [Service]     Type=oneshot     ExecStart=/usr/bin/systemd-tmpfiles --create          [Install]     WantedBy=multi-user.target      But I'm not sure, because `systemd-tmpfiles` is not a simple program but a piece of systemd itself. I wouldn't like to break my system. Any tips about a correct .service file?


title: When was the threading implemented in unix?

text: Which is the first Unix version or Linux version which implemented threads. And in which version bound and unbound threads were implemented? I know that in current Linux version threads are unbound by default. But is there any version of Unix or Linux in which threads are bound by default instead of unbound. If some one can give a link to a complete change-log of Unix versions that would also be helpful.


title: How do I apply this revert commit patch from git?

text: I have found a patch applicable to my system to fix a problem but I have no idea how to get this patch and then apply it. Can anybody help me please? Patch: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c11e5f35ab490bd30591563816fbc83526521777


title: How is default readahead value determined

text: I have two different devices running XFS and the default readahead value set differs between the two disks. Why is that ? How is the default size computed ? Is it device dependent ? I might also add that the devices are RAID disks and I use `blockdev --getra` to see the readahead value.


title: comm fails on bash variable input

text: I have a script that's supposed to get the list of files of two directories, get differences and execute some code for certain files. These are the commands to get the file lists:               list_in=$(find input/ -maxdepth 1 - type f | sed 's/input\///' | sort -u);     list_out=$(find output/ -maxdepth 1 - type f | sed 's/output\///' | sort -u);      I execute the script in the correct directory, so this shouldn't fail. The unprocessed files are determined by               list_todo=$(comm -23 <(echo "$list_in") <(echo "$list_out"));      since the option `-23` for `comm` only prints lines of the first argument, that don't appear in both arguments and doesn't print lines that uniquely appear in the second argument. However, only occasionally I get an error saying               command substitution: line 3: syntax error near unexpected token `('     command substitution: line 3: `comm -23 <(echo "$list_in") <(echo "$list_out")'      This really puzzles me, since the exact same script worked fine for the last 3 weeks. I'm using this on a cluster, so several processes might execute the script simultaneously. May the error be caused by this? **Update**. The script is called with `./script` and I've obviously set `chmod +x script` before. (Disclaimer: Even though I'm working on a cluster and these first three lines of my script don't include any locking mechanisms: Of course, no file is ever processed twice)


title: How to create a custom region in gnome3?

text: Gnome3 doesn't include my region. I need:   * calendar week to start on monday   * british-english spelling   * 8.5x11 as the default document size for printing   * celsius for temperatures   * miles for distances   * currency in dollars   * etc etc etc How can I make this happen? My thought is, make a new region. Or modify an existing region. But I can't find the documentation for this.


title: Alternatives to xmove, xpra

text: A bit of background information: I'm dealing with a piece of software that is part of a larger system. Most pieces of the system have a background process that runs continually, and a GUI that can be open when that piece of functionality is needed. The particular piece of software that is causing me trouble was instead written as a single program containing both the GUI and the background processing. This means that the GUI must always be running, otherwise the associated processing cannot take place. This is not desired (for a number of reasons). As a workaround, I've looked into various X pseudoservers that will allow me to show/hide the GUI window as appropriate. The three I've looked at specifically are **xmove** , **ximove** , and **xpra** **xmove** is really old (hasn't been developed since Nov 1997) and doesn't support 24-bit graphics, which is a non-starter. I've also found something called **ximove**. The author, Mark C. Ballew started it with the intent of improving upon xmove (XIMove≡Xmove Improved). But, looking at his website it looks like the last status update was 8/16/04, and it links to http://forum.ximove.com/ which does not appear to exist anymore. **xpra** seems like the most promising option, but it hasn't quite worked as hoped. I get a lot of errors complaining about "Cairo" which is something that is not covered in any of the xpra files that discuss dependencies... nonetheless the program does work for small applications, such as a web browser. When I attempt to use it for my problem program though, I get a lot more errors (cairo errors and others). and both xpra and the application itself seem to crash. I'm looking into trying out a clean install of the newest version of xpra, but **I'm wondering whether any of you guys have any insight into some other X pseudoserver applications that I should try.**


title: How can I tell what memory RAM address range is being used by uboot?

text: I am in uboot and was wondering, how could I tell what RAM address range is being used by uboot. uboot needs memory to run so it might be using some of the RAM. I want to avoid modifying those RAM addresses. How do I know which region of memory is uboot loaded?


title: What is wrong with my JDK installation?

text: I tried to compile a Hello world example in java and got a gcc error. As far as I understand it, gcc is trying to compile my java class (and for some reason failing to find the main method, but that's beside the point). I have openSUSE 12.1 64 bit and JDK 1.7 (installed from Oracle's rpm). I have `/usr/java/jdk1.7.0_04/bin/:/usr/java/jdk1.7.0_04/` in my $PATH. When I try to compile a java file, I get:               rumtscho@bradbury:/tmp> javac Hello.java     /usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../lib64/crt1.o:      In function `_start':     /home/abuild/rpmbuild/BUILD/glibc-2.14.1/csu/../sysdeps/x86_64     /elf/start.S:109: undefined reference to `main'      Why is this happening and how can I correct the problem? **Edit** my complete $PATH is: > rumtscho@bradbury:/tmp> echo $PATH > /home/rumtscho/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:.:/home/rumtscho/bin:/home/rumtscho/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/home/rumtscho/android- > sdk-linux/tools:/home/rumtscho/android-sdk-linux/platform- > tools:/usr/java/jdk1.7.0_04/bin/:/usr/java/jdk1.7.0_04/:/home/rumtscho/bin:/home/rumtscho/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/home/rumtscho/android- > sdk-linux/tools:/home/rumtscho/android-sdk-linux/platform- > tools:/usr/java/jdk1.7.0_04/bin/:/usr/java/jdk1.7.0_04/


title: How to make dual boot live dvd

text: Can we make a live dvd with a dual boot option between Ubuntu and Linux mint? I have both the iso's. They both are larger than 800mb. If I will burn 2 dvd's, Then a lot of space will be wasted. So I wanted to make one live cd that can boot both of them. I have searched the net but did not find any result.


title: How do I know if acct is running? (The Linux user accounting system)

text: I have installed the `acct` package and it is running because I can see file activity in the log file. I know there is the command `accton on` to turn it on, but how do I determine that its running short of checking that there is activity in the log file? I believe from my reading that there is no daemon running as the accounting is managed as part of the kernel and this program simply enables the activity to be logged. PS: There is no process called "acct"


title: Generate own (stronger) RSA host key for OpenSSH?

text: I would like to replace the default 2048 bit host key generated when installing OpenSSH or starting it the first time with one of 4096 bit length. This leads to two questions:   * Does OpenSSH allow running with a 4096 bit RSA host key (for SSH2 obviously)?   * How can `ssh-keygen` be convinced not to prompt for a passphrase? The version of OpenSSH I am running is 6.6p1.


title: Skype webcam upside down but v4l1compat missing

text: I am running Linux Mint, but i think this issue will be mutual with Ubuntu. My webcam in Skype is upside down (in Cheese it's ok). There are a lot of topics dealing with this coming up with fix like this:               $ LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so skype      or similar modifications. Unfortunately, I don't have this file.               $ locate v4l1compat.so      outputs only:               /usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so      which doesn't work:               $ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so skype     ERROR: ld.so: object '/usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so' from LD_PRELOAD cannot be preloaded: ignored.      Skype loads, but the webcam is still upside down. I remember I've read somewhere that I should use 32bit libraries because of skype. But how can I get those? I tried simple copy from another Linux machine, but that unsurprisingly did not help.


title: cURL <- feature

text: $ cat file | curl -F 'sprunge=<-' http://sprunge.us      So the output of `echo` gets passed as a POST parameter to cURL. Is this a cURL specific feature?


title: Why does "yum update" fails with many duplicates, after many months of no upgrades?

text: After many months (> 6) of no software upgrades, I logged into an EC2 instances running:               Linux version 2.6.32-358.23.2.el6.x86_64 (mockbuild@x86-022.build.eng.bos.redhat.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Sat Sep 14 05:32:37 EDT 2013      and then tried to do the usual yum-update:               # yum update      Well, that failed with errors like these:               --> Finished Dependency Resolution     Error: Package: coreutils-libs-8.4-19.el6_4.2.x86_64 (@rhui-us-east-1-rhel-server-releases)                Requires: coreutils = 8.4-19.el6_4.2                Removing: coreutils-8.4-19.el6_4.2.x86_64 (@rhui-us-east-1-rhel-server-releases)                    coreutils = 8.4-19.el6_4.2                Updated By: coreutils-8.4-31.el6_5.1.x86_64 (rhui-REGION-rhel-server-releases)                    coreutils = 8.4-31.el6_5.1                Available: coreutils-8.4-9.el6.x86_64 (rhui-REGION-rhel-server-releases)                    coreutils = 8.4-9.el6                Available: coreutils-8.4-13.el6.x86_64 (rhui-REGION-rhel-server-releases)                    coreutils = 8.4-13.el6                Available: coreutils-8.4-16.el6.x86_64 (rhui-REGION-rhel-server-releases)                    coreutils = 8.4-16.el6                Available: coreutils-8.4-19.el6.x86_64 (rhui-REGION-rhel-server-releases)                    coreutils = 8.4-19.el6                Available: coreutils-8.4-19.el6_4.1.x86_64 (rhui-REGION-rhel-server-releases)                    coreutils = 8.4-19.el6_4.1                Available: coreutils-8.4-31.el6.x86_64 (rhui-REGION-rhel-server-releases)                    coreutils = 8.4-31.el6     Error: Package: abrt-addon-python-2.0.8-16.el6_4.1.x86_64 (@rhui-us-east-1-rhel-server-releases)                Requires: abrt = 2.0.8-16.el6_4.1                Removing: abrt-2.0.8-16.el6_4.1.x86_64 (@rhui-us-east-1-rhel-server-releases)                    abrt = 2.0.8-16.el6_4.1                Updated By: abrt-2.0.8-21.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-21.el6                Available: abrt-1.1.13-4.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 1.1.13-4.el6                Available: abrt-1.1.16-3.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 1.1.16-3.el6                Available: abrt-2.0.4-14.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.4-14.el6                Available: abrt-2.0.8-6.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-6.el6                Available: abrt-2.0.8-6.el6_3.2.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-6.el6_3.2                Available: abrt-2.0.8-15.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-15.el6     Error: Package: abrt-addon-ccpp-2.0.8-16.el6_4.1.x86_64 (@rhui-us-east-1-rhel-server-releases)                Requires: abrt = 2.0.8-16.el6_4.1                Removing: abrt-2.0.8-16.el6_4.1.x86_64 (@rhui-us-east-1-rhel-server-releases)                    abrt = 2.0.8-16.el6_4.1                Updated By: abrt-2.0.8-21.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-21.el6                Available: abrt-1.1.13-4.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 1.1.13-4.el6                Available: abrt-1.1.16-3.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 1.1.16-3.el6                Available: abrt-2.0.4-14.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.4-14.el6                Available: abrt-2.0.8-6.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-6.el6                Available: abrt-2.0.8-6.el6_3.2.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-6.el6_3.2                Available: abrt-2.0.8-15.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-15.el6     Error: Package: abrt-addon-kerneloops-2.0.8-16.el6_4.1.x86_64 (@rhui-us-east-1-rhel-server-releases)                Requires: abrt = 2.0.8-16.el6_4.1                Removing: abrt-2.0.8-16.el6_4.1.x86_64 (@rhui-us-east-1-rhel-server-releases)                    abrt = 2.0.8-16.el6_4.1                Updated By: abrt-2.0.8-21.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-21.el6                Available: abrt-1.1.13-4.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 1.1.13-4.el6                Available: abrt-1.1.16-3.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 1.1.16-3.el6                Available: abrt-2.0.4-14.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.4-14.el6                Available: abrt-2.0.8-6.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-6.el6                Available: abrt-2.0.8-6.el6_3.2.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-6.el6_3.2                Available: abrt-2.0.8-15.el6.x86_64 (rhui-REGION-rhel-server-releases)                    abrt = 2.0.8-15.el6     Error: Package: glibc-devel-2.12-1.107.el6_4.5.x86_64 (@rhui-us-east-1-rhel-server-releases)                Requires: glibc-headers = 2.12-1.107.el6_4.5                Removing: glibc-headers-2.12-1.107.el6_4.5.x86_64 (@rhui-us-east-1-rhel-server-releases)                    glibc-headers = 2.12-1.107.el6_4.5                Updated By: glibc-headers-2.12-1.132.el6.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.132.el6                Available: glibc-headers-2.12-1.7.el6.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.7.el6                Available: glibc-headers-2.12-1.7.el6_0.3.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.7.el6_0.3                Available: glibc-headers-2.12-1.7.el6_0.4.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.7.el6_0.4                Available: glibc-headers-2.12-1.7.el6_0.5.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.7.el6_0.5                Available: glibc-headers-2.12-1.25.el6.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.25.el6                Available: glibc-headers-2.12-1.25.el6_1.3.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.25.el6_1.3                Available: glibc-headers-2.12-1.47.el6.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.47.el6                Available: glibc-headers-2.12-1.47.el6_2.5.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.47.el6_2.5                Available: glibc-headers-2.12-1.47.el6_2.9.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.47.el6_2.9                Available: glibc-headers-2.12-1.47.el6_2.12.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.47.el6_2.12                Available: glibc-headers-2.12-1.80.el6.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.80.el6                Available: glibc-headers-2.12-1.80.el6_3.3.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.80.el6_3.3                Available: glibc-headers-2.12-1.80.el6_3.4.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.80.el6_3.4                Available: glibc-headers-2.12-1.80.el6_3.5.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.80.el6_3.5                Available: glibc-headers-2.12-1.80.el6_3.6.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.80.el6_3.6                Available: glibc-headers-2.12-1.80.el6_3.7.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.80.el6_3.7                Available: glibc-headers-2.12-1.107.el6.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.107.el6                Available: glibc-headers-2.12-1.107.el6_4.2.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.107.el6_4.2                Available: glibc-headers-2.12-1.107.el6_4.4.x86_64 (rhui-REGION-rhel-server-releases)                    glibc-headers = 2.12-1.107.el6_4.4      You could try using --skip-broken to work around the problem     ** Found 143 pre-existing rpmdb problem(s), 'yum check' output follows:      After reading several articles, I tried several things to correct the issue:   * Ran `yum clean all`, then `yum update`.   * Ran `rpmdb --rebuilddb`, then `package-cleanup --dupes`, then `package-cleanup --cleandupes`.   * Ran `yum-complete-transaction`, etc. In all cases, I ended up in the same place. One article suggested that I might have conflicting packages for glibc. In any case, I cannot tell what is going on. Should I re-instance my EC2, or does someone have a solution? Thanks!


title: Copy a file to a directory that doesn't exist with only one command (Linux)

text: Is it possible to copy a file to a dir that doesn't exist such that it creates the directory, using only one command? Without using `&&` and more than one command. Edit: It is not duplicate, in the other ask the answer is a function, I ask about a command, only one command, without &&, functions, |, etc. It is a question for learn more and for know if exist commands that do it, because cp don't. Is a question for explain it in a high school.


title: How do I run 32-bit programs on a 64-bit Debian/Ubuntu?

text: I have a 64-bit (amd64 a.k.a. x86_64) Debian or Ubuntu installation. I need to run 32-bit (i386/i686) programs occasionally, or to compile programs for a 32-bit system. How can I do this with a minimum of fuss? Bonus: what if I want to run or test with an older or newer release of the distribution?


title: share vpn conneciton using router

text: I want to share my VPN connection with other devices. I just got a D-Link router, and I'm a little bit lost about how to deal with it. I connect to internet using the VPN of my university (PPTP). The LAN has a DHCP server, giving to each computer an IP address according to their MAC address (if the mac address is unknown by the DHCP server, then it gives an IP address under a subnetwork that cannot connect to the VPN). The connection to internet can be successful only if the combination IP:VPN_login:VPN_password is correct. I already connected to the router, using telnet on port 23. I know how to change MAC address using `ifconfig ethx down && ifconfig ethx up hw ether <mac address>`. So changing the mac address of the router to mine (which is recognized by the university), the router will get my usual IP address. But now? To connect to vpn, I usually use network-manager on ubuntu, and the toolkit `nmcli`


title: Cursor movement in terminals

text: I'm trying to wrap my head how shells move the screen cursor around (Moving around input the arrow keys and such). I've been doing a lot of testing, and I haven't found any system call that allows for movement of the screen cursor in a terminal. Is this done using specific terminal extensions? If so, is there any documentation as to how this is achieved for, say, xterm? This has been driving me crazy, any light you can shed on this is appreciated.


title: How to append end of every line with the line itself

text: This is in `file.txt`:               redcar     bluecar     greencar      Im looking for ways to make it become:               redcar redcar     bluecar bluecar     greencar greencar      I've tried many ways using `sed` with no luck


title: How to disable swap file after install or during Kubuntu install?

text: My computer has more than 64KB of RAM (8GB), if I run out of memory I want things to crash so I know I'm out of RAM so I'll buy some instead of say wandering why my computer is running slowly when I can just spend another $40 for another 8GB of RAM. I'm running Kubuntu in VirtualBox. I'm not sure if there is any way to permanently disable the swap file after the installation has finished. As with previous Linux installs I've found that the newer GUI installers do NOT provide an option to have a single partition without a swap forcing me to use the old DOS/Console styled installers which do. If I have to reinstall from scratch (not a huge ordeal for me) are there multiple installers or does the regular Kubuntu installer provide a manner to install without a swap file?   * I'm absolutely sure I want to do this, I have not run a pagefile in years in both XP and other Linux distros I've tried and enjoy my systems being responsive.   * I'm semi-capable in the console though please do not ask me to type a hundred lines to do a simple copy/paste or text edit, I'm interested in Linux for production not a hobby.   * I'll be happy to both accept and up-vote whatever answer works as well as clarify anything.


title: How to determine if X server runs with root privileges

text: This is a one-liner: Is there a way/command to check if the X server is run as root or as user? * * * This was supposed to be a one-liner but alas... I recently upgraded my `Arch Linux` box. After the upgrade I was notified that `X` now runs rootless. I checked on the official `Arch Linux` page and it states: "X is now rootless with the help of systemd-logind [...]" [1] This got me interested in how to check whether `X` is run rootless or not. How can this be done?


title: Unable to login to my server using ssh

text: Yesterday I was migrating to my new server, needed to use rsync, I created a RSA key, so that rsync could connect, I saw an error that says `add to trusted key in location x` I didn't have that location on my new server, so basically when I do `mv rsakey /location.x` The directory didn't exist. I tried regenerating the key. but that didn't help, now I'm unable to login to ssh nor to filezilla `scp protocol` it says `Error: Network error: Software caused connection abort. Error: Could not connect to server` I'm almost certain that the error is caused by RSA key. How can I fix it? By the way I have Ispcp installed, so I might be able to fix it from there. **Note:** I have generated RSA keys on the old and the new server, I can login to the old but not the new one. **EDIT** using terminator on ubuntu 12.04:               $ ssh root@server_ip     Connection closed by server_ip      **EDIT 2** after doing `mv ~/.ssh ssh_backup` i tried to connect and it says `Read from socket failed: Connection reset by peer` i retried and it gave me the `connection closed` error shown above **EDIT 3** the output of `ssh -vv root@server_ip`               OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: /etc/ssh/ssh_config line 19: Applying options for *     debug2: ssh_connect: needpriv 0     debug1: Connecting to my_ip_address [my_ip_address] port 22.     debug1: Connection established.     debug1: identity file /home/me/.ssh/id_rsa type -1     debug1: identity file /home/me/.ssh/id_rsa-cert type -1     debug1: identity file /home/me/.ssh/id_dsa type -1     debug1: identity file /home/me/.ssh/id_dsa-cert type -1     debug1: identity file /home/me/.ssh/id_ecdsa type -1     debug1: identity file /home/me/.ssh/id_ecdsa-cert type -1     debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-6+squeeze3     debug1: match: OpenSSH_5.5p1 Debian-6+squeeze3 pat OpenSSH*     debug1: Enabling compatibility mode for protocol 2.0     debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1     debug2: fd 3 setting O_NONBLOCK     debug1: SSH2_MSG_KEXINIT sent     Connection closed by my_ip_address      **@mattdm** I named the location `x` because i forgot what it was, you know that error where it basically says: please move rsa key to trusted sources location, or something like that. maybe it was `/.ssh`


title: Is there a search utility which can binary split search a large sorted (sequential) text file?

text: Yes, I know it sounds odd. Sequential and Binary-splits don't mix.. That is unless the sequence is the byte offset within the file itself... I've scrambled together a binary split search in bash script, using `dd`. It has Search-and-Find times of 3-9 seconds for an 8 GB file.. so it works (but slower than I know it can be)... I'd really prefer to not have to polish this wheel; It just took my fancy to do it as an exercise in bash (having a project is the best way to learn a language, etc). I think this would be pretty straight forward in C/++, etc... I'm curious to see some other examples (particularly bash ones.


title: can't connect to dnsmasq on local machine, port is open but connection refused

text: I'm running Scientific Linux 6.3 and just updated the machine to dnsmasq-2.48-13.el6.x86_64. The machine is on local ip 192.168.1.100. I have a local caching DNS setup that was working until the update. /etc/dnsmasq.conf configuration:               strict-order     listen-address=192.168.1.100     bind-interfaces     cache-size=5000      I confirmed that dnsmasq is running, the ports open and close as I start and stop dnsmasq.               $ netstat -nl # shows that the port was opened     Proto Recv-Q Send-Q Local Address           Foreign Address        State     tcp        0      0 192.168.1.100:53        0.0.0.0:*              LISTEN     udp        0      0 192.168.1.100:53        0.0.0.0:*      but trying to resolve fails               $ nslookup google.com 192.168.1.100     ;; connection timed out; trying next origin     ;; connection timed out; no servers could be reached      even trying to telnet fails               $ telnet 192.168.1.100 53     Trying 192.168.1.100...     telnet: connect to address 192.168.1.100: Connection refused      I don't seen anything in /var/log/messages related to dnsmasq. Stopping iptables didn't help. I'm not sure where to go from here.


title: Extend my LVM After Upgrading SSD

text: So, I have a 120 GB SSD (/dev/sdb) that I have a dual boot of Windows 7 and Fedora 17. When I first started I only have a 60 GB SSD so my space was very limited. I have a partition on my SSD (dev/sdb4) which I created with gparted, that shows a "Partition 5 LVM2" (dev/sdb5) below it which I believe is what the LVM is stored on(?). Anyways, using gparted I extened my /dev/sdb4 to 27GB, which then created a "Free Space" of 17GB within /dev/sdb4. Now I need to combine /dev/sdb5 and the free space into one. I've tried: `lvextend -L+16G /dev/vg_mine/lv_root` which results in:               Extending logical volume lv_root to 20.97 GiB     Insufficient free space: 512 extends needed, but only 0 available      I then used a `resize2fs /dev/vg_mine/lv_root` which results in: `The filesystem is already 1302528 blocks long, nothing to do!` Anybody point me in the right direction? Am I on the right track so far?


title: Determine if Git working directory is clean from a script

text: I have a script which runs `rsync` with a Git working directory as destination. I want the script to have different behavior depending on if the working directory is clean (no changes to commit), or not. For instance, if the output of `git status` is as below, I want the script to exit:               git status     Already up-to-date.     # On branch master     nothing to commit (working directory clean)     Everything up-to-date      If the directory is not clean then I would like it to execute some more commands. How can I check for output like the above in a shell script?


title: Do the "play" utility in Linux really have a "delay" to stop it's process with really small files?

text: I have a wav file, Duration: 00:00:00.17 (less than a second!) When I call `play` to execute it, `play` executes it fine, but my terminal becomes idle for ~4s until play process is done. Is this by design? Is it possible to just play the sound and be done in less than a second? **EDIT** : Running `time` as suggested by @jsbillings:                File Size: 1.89k     Bit Rate: 90.3k       Encoding: Unsigned PCM         Channels: 1 @ 8-bit         Samplerate: 11025Hz           Replaygain: off                Duration: 00:00:00.17            In:100%  00:00:00.17 [00:00:00.00] Out:1.85k [!=====|=====!]        Clip:0         Done.          real    0m2.912s     user    0m0.004s     sys         0m0.008s


title: Executing a shared library

text: Some shared libraries provide an output when called from the command line as if they were executables. For example:               $ /lib/libc.so.6      GNU C Library stable release version 2.13, by Roland McGrath et al.     Copyright (C) 2011 Free Software Foundation, Inc.     This is free software; see the source for copying conditions.     There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A     PARTICULAR PURPOSE.     Compiled by GNU CC version 4.5.2.     Compiled on a Linux 2.6.37 system on 2011-01-18.     [...]      In a shared library of my own written in C, how can I provide this output? I've executed now a library I just made and I get a `segment fault`.


title: How to get history search to start afresh?

text: When I do a search using `Ctrl``R`, the search gets limited to entries older than displayed hit. How do I reset this so that it starts from the beginning (i.e. from latest history entry) without leaving the shell?


title: How to search the whole of bash history without needing to go forwards and backwards?

text: At times when I do `Ctrl``R` to search through command history, I find that I don't reach the entry I was looking for, even though I know it's in history. I think this is due to me having passed the entry, forcing me to use another command to go the other direction. Is there a command that allows the whole of history to be searched by looping through it (restarting the cycle) when it reaches the end?


title: How can I run my own scripts in kate 3.8.2? "External tools" isn't available in the plugins section

text: I am using Kubuntu 12.04 LTS. How can I run my own scripts in `kate` 3.8.2? It appears that the plugin named _External tools_ is no longer available. I would like to run Python or shell scripts in kate and invoke them using a keyboard shortcut, such as `F4`. As an example, this simple script would ideally change to a specific window when I press `F4`.               #!\bin\sh     wmctrl -a "<Window name>"


title: Can I redirect logfiles to syslog?

text: I have a Node.js server that is being monitored by forever. Forever generates three logfiles: the server STDOUT, STDERR and the log of forever itself.               $ forever -l forever.log -o out.log -e err.log app.js      But instead of logging to logfiles I would like to log everything to syslog, optionally with adding a prefix of some sorts so my syslog processing servers can sort everything out. On StackOverflow, someone suggested that this can be handled using some bash wrapper and suggested I ask here. So, how would I get those logs into syslog instead of into files?


title: I accidentally deleted the sudoers file on Mac OS X; is there any way to recover it?

text: I accidentalley deleted the sudoers file on Mac OS X; is there any way to recover it?   And once you've recovered it, how do you set it to mode 0440? I presume not but I am desperate to get it back!


title: mounting to non-empty directory, then later deleting original files

text: I have some unused space on my disk, and decided to use a little of it to create a separate /var partition. There might be an easier way to do this, but my idea is to   1. copy the existing /var directory to the partition;   2. mount the partition over the existing /var directory;   3. using another system, either another distro on the disk or a live CD, to delete the original /var contents while the partition is not mounted. I've done the first 2 steps, and it seems OK so far. I've made an entry in fstab to mount on boot, which I'll test before deleting. But I'm wondering if this is a valid strategy, and also if it's a good idea and/or if there is a better way. It's somewhat of a learning experience for me to play around more with mounting beyond the basics. Edit (results): Thanks to the suggestions below, I completed step 3 without the need to use a 2nd system. The method I used was to remount the root fs using the command `mount --bind / /mnt/temp`, then going to `/mnt/temp/var` and deleting the files and directories there. The one suggestion made after I did it was to create a dummy file, and then check the mounted /var directory to confirm that it was not seen in that directory. But I compared timestamps to see that they were different, so I felt confident that I was OK. Thanks for the suggestions, everyone.


title: Run sudo as another non-root user and save in this user's home directory

text: I added a new group: `ircuser` and a new user: `ircuser` In `visudo` I placed this line:               myuser localhost=(ircuser) NOPASSWD: /usr/bin/irssi      Created `ircuser` directory, where config files, caches, etc should be saved:               drwxrwx--- 2 ircuser ircuser 4096 Mar  2 10:28 ircuser      When issuing the command:               sudo -Hu ircuser /usr/bin/irssi      or               sudo -u ircuser /usr/bin/irssi      The program can't save the config file in the `ircuser` directory.               ** ERROR **: Couldn't create /home/myuser/_web/ircuser/.irssi directory     aborting...     Aborted      But, it is being run as `ircuser`:               ps auxw | grep irssi     ircuser  11962  0.0  0.0  23684  2504 pts/6    S+   11:18   0:00 /usr/bin/irssi      So, albeit `irssi` is run by `ircuser` it can't write to a directory owned by the same user? What do I need to change to allow it saving there?


title: root account expired

text: I have two accounts on my computer: james and john. james is the only administrative account and a few days ago I set it to expire out of curiosity. Now am stuck. I can not login using james because it has expired, I can not use john for anything because it is not a member of sudoers. I can not login as root probably because root and james shared a password. Kindly help.


title: Generating sets of files that fit on a given media size for tar -T

text: Can anyone suggest a script that will take as input the name of one or more directories and a media size, and output lists of files for input to tar using `-T` (assuming no compression)? `scdbackup`/`sdvdbackup` sort of does this, but it's full of bloat that I don't need. So basically looking for something like this:               ./splitTars file1 file2 .... 2.0T      where `file` can be a file or directory, and the last argument is the size of the media (e.g. 2TB). It should then output a file list for each tar archive and give a warning for files that are too big to fit on the media. If nothing like this exists, one way to do it would be to create the list of files using find, re-arrange them in increasing or decreasing size, then start cutting the list up into pieces.


title: SSH Bash Jail Session

text: I've seen some game tunneling service providers that jails the customer's account to a Information screen upon login and any input is ignored. Ctrl+C closes the SSH session, and disconnecting. This basically jails the user, but maintains the Tunnel. This made me very curious how it's done. Does anyone knows how this could be done?


title: Split pages in pdf

text: I have a scanned pdf file which has scanned two pages on one virtual page (page in pdf file). The resolution is with good quality. The problem is I have to zoom when reading and drag from left to the right.   Is there some command (`convert`, `pdftk`, ...) or script that can convert this pdf file with normal pages (one page from book = one page in pdf file)?


title: How does using linux affect your career and computer skills overall?

text: so I would really love to move to linux as my only OS, i had linux installed several times(different distros) But i always go back to windows. Sad, i know Anyway I'm really into computers, i like programming (even though i'm no good at any particular language) i like graphics and simply said i like tinkering with my computer both on hardware and software side. What I'm worried about how will this affect my career in this industry? Well from programming point of view it depends if i code websites or applications. I don't think it really matters in the first case but what about .NET there is pretty big amount of jobs for .NET developers. When we take a look on graphics on linux compared to other OS (by other i mean windows and apple's osx) Adobe products are standard. Period. Well there are ways for running adobe products on linux via wine but i don't like that idea anyway because if i did that it definitely wouldn't be legal copy Even though the gap between photoshop and gimp is getting thinner all the time still it's a standard and i'm worried if i get too comfortable in gimp i will forget my photoshop skills that i have right now... and i'm not sure how would gimp look on my resume :/ The other thing... similar to the case above with adobe. Windows is standard, i've been using windows since i was 10 (18 now) and i can fix all my problems by myself (well with the help of the internet) And i plan on running my own computer store at some point in my life. But even if it won't come to that how can i troubleshoot windows when i will no longer keep up with their updates and new interfaces(i mean windows 8 is such a mess) Sure with the help of internet there shouldn't be much trouble but still, i don't want to end up googling all the time for some ****** software like windows anyway i hope this post is at least a little bit intelligible and i'm looking forward to your answers


title: using environment variables in tmux.conf files

text: Is it possible to use an environment variable in a tmux.conf file? I am trying to set a default-path to an environment variable. Currently what I am trying is:               set -g default-path $MYVAR      further I would like to check if $MYVAR is set already so I could do:               if($MYVAR == "") set-environment -g MYVAR /somepath/      Any ideas?


title: login and su internals

text: I am trying to understand how user permissions work in Linux. The kernel boots and starts `init` as root, right? Init then runs startup scripts and runs `getty` (`agetty`), again as root. Agetty just reads user name and runs `login`, still as root, I think. Nothing interesting yet. But what does _login_ do? I wasn't able to find anything better than "it attempts to log in". Suppose login finds that password matches (and we trying to log in as usual user), how does it change user id? I thought that there should be system call for that but I wasn't able to find it (maybe I'm just blind?) * * * Also, about `su`. `su` has the 'setuid' bit set so when we run it, it always runs as root. But when we tell it to log in as usual user, it again needs to change user id. Do I understand correctly that the same "magic" happens in `su` and `login` when they need to change user? If so, why have two different programs? Is there any additional sorts of serious business happening when running login?


title: What functionality do I lose by disabling GDM/KDM/SLIM/CDM etc display managers?

text: I've been wondering lately why do I need GDM, so I got it disabled for the sake of experiment sake by modifying upstart file /etc/init/gdm (I run Ubuntu 10.10 desktop). So now computer boots to command prompt and I just type in startx if I need GUI. So far everything runs just fine. But, does anyone know if there are any drawbacks to not using gdm? Would I lose any functionality?


title: In zsh how can I list all the environment variables?

text: I want to get a list of all environment variables (shell variables? exported variables?) and their values at a given time, in zsh.   What is the proper way to do this?


title: How can I connect mail(1) to my Gmail/Yahoo/Hotmail account?

text: I would like to use the `mail` command in a shell script to automatically connect to my Gmail/Yahoo/Hotmail account and send/receive messages. How can I do this?


title: How to remove URI encoding in file names

text: I realise this might be quite a simple question, but I'm still quite new to the command line and only have a grasp of basic commands. I've downloaded some lecture presentations (~25 or so) from my University however on doing so they've been named things like...               L2%20Development%20of%20immune%20system.pptx     L4%20Molecular%20Recognition.pdf      As you can see they've downloaded with the URL encoding `%20` instead of a space. My question is how to batch rename all of these files so that the `%20` is removed and replaced with a space instead?


title: Notational Velocity on Linux?

text: Is there a Linux equivalent of the note-taking software Notational Velocity?


title: Portable way to get script's absolute path?

text: What is a portable way for a (zsh) script to determine its absolute path? On Linux I use something like               mypath=$(readlink -f $0)      ...but this is not portable. (E.g., `readlink` on darwin does not recognize the `-f` flag, nor has any equivalent.) (Also, using `readlink` for this is, admittedly, a pretty obscure-looking hack.) What's a more portable way?


title: Is there a way to assign a shortcut key to nautilus' right click context menu?

text: Does anyone know of a way to assign a shortcut key combination to the menu items in the context menu that pops up in nautilus when you click on a file?


title: What's a good example of piping commands together?

text: If you were helping someone to learn the concept of pipes on the command line what example would you use? The example that actually came up was as follows:               cat whatever.txt | less      I feel like that's not the best example, namely because there's only one step. What's a good, but fundemental, use of `|`? Ideally the example I'll present will use programs that have outputs themselves that can be run independently and then shown piped together.


title: How can I share a desktop / log in graphically for an Ubuntu that I have ssh but not console access to?

text: http://www.ubuntugeek.com/share-your-ubuntu-desktop-using-remote-desktop.html tells how to share a desktop by setting multiple features from within a GUI. Is there such a HOWTO that is based on ssh command line access? I would like to know how I can remotely access a desktop from Ubuntu or any other operating system where I have ssh access and can install packages, but not graphical console access.


title: Does OpenSUSE Instlux overwrite Windows?

text: You seem to be able to install OpenSUSE from Windows using Instlux. Does anyone here know what the result is for the Windows installation on the machine? Is it overwritten, or does Instlux work like Ubuntu's Wubi and leave the Windows installation intact? Does it add an item to the Windows bootloader? Does it change the MBR to boot with GRUB?


title: How to access through terminal to a ntfs partition mounted?

text: Using Debian 7, I can access (and mount, indeed) to a ntfs partition of my hard drive.I do this by clicking on the 446 GB Filesystem shorcut in the _"Files"_ applicacion which comes with Debian. How can I access to such mounted partition from terminal? And how can I make this partition to be always loaded automatically?


title: Dropbox, notify-send and OSD interfere with Ctrl-shortcuts

text: I'm using Ubuntu 13.04 with i3 4.5.1. When i3wm starts, Ctrl-C/-D/-K etc. are working fine. When I start Dropbox, notify-send or change the volume, all Ctrl-something shortcuts stop working. I can reproduce the issue:   1. restart X, login to i3wm   2. open terminal, verify that Ctrl-C, Ctrl-A, Ctrl-K and Ctrl-D work => works   3. start one of the following programs:      * Dropbox with `/usr/bin/dropbox start`     * trigger an OSD notification with `notify-send "Test"`     * change the volume with the volume key   4. try Ctrl-C, -A, -K and -D in terminal again => does not work anymore To restore the Ctrl-something shortcuts, I have to restart X. Interestingly, commands with Shift-Ctrl-something still work, if Shift is pressed first. Here's the output from `xev` when I press Ctrl-C. Before executing step 3 above:                   KeyPress event, serial 33, synthetic NO, window 0x1a00001,             root 0x259, subw 0x0, time 7988829, (-219,177), root:(505,197),             state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,             XLookupString gives 0 bytes:              XmbLookupString gives 0 bytes:              XFilterEvent returns: False              KeyPress event, serial 33, synthetic NO, window 0x1a00001,             root 0x259, subw 0x0, time 7988878, (-219,177), root:(505,197),             state 0x4, keycode 54 (keysym 0x63, c), same_screen YES,             XLookupString gives 1 bytes: (03) "^C"             XmbLookupString gives 1 bytes: (03) "^C"             XFilterEvent returns: False              KeyRelease event, serial 33, synthetic NO, window 0x1a00001,             root 0x259, subw 0x0, time 7988949, (-219,177), root:(505,197),             state 0x4, keycode 54 (keysym 0x63, c), same_screen YES,             XLookupString gives 1 bytes: (03) "^C"             XFilterEvent returns: False              KeyRelease event, serial 33, synthetic NO, window 0x1a00001,             root 0x259, subw 0x0, time 7988970, (-219,177), root:(505,197),             state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,             XLookupString gives 0 bytes:              XFilterEvent returns: False      After step 3 from above:                   KeyPress event, serial 33, synthetic NO, window 0x1e00001,             root 0x259, subw 0x0, time 8064649, (-238,542), root:(486,562),             state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,             XLookupString gives 0 bytes:              XmbLookupString gives 0 bytes:              XFilterEvent returns: False              FocusOut event, serial 33, synthetic NO, window 0x1e00001,             mode NotifyGrab, detail NotifyAncestor              FocusIn event, serial 33, synthetic NO, window 0x1e00001,             mode NotifyUngrab, detail NotifyAncestor              KeymapNotify event, serial 33, synthetic NO, window 0x0,             keys:  2   0   0   0   32  0   0   0   0   0   0   0   0   0   0   0                    0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0              KeyRelease event, serial 33, synthetic NO, window 0x1e00001,             root 0x259, subw 0x0, time 8064926, (-238,542), root:(486,562),             state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,             XLookupString gives 0 bytes:             XFilterEvent returns: False      I have no idea where I should start debugging the problem. Can you give me some pointers how to find the cause of this problem? Thanks! Benedikt


title: Is it possible to generate a separate file list when creating a tarball?

text: When using `tar` for backups I'd like to create a separate list of the files that is included in the archive for storing alongside the backup tarball. I also want to be able to store the error messages from tar in a log. Solutions that's not so good:   * `tar --verbose` ... `&> filelist.txt` But this would give errors + file list in one file.   * `tar --list` after the tarball has been created. But this takes a long time. Is there some way to get the file list and store it in a separate file at the same time as I'm rolling the ball for the first time?


title: Elementary OS - can't take properly a screenshot or record a desktop

text: Yesterday I installed Elementary OS Linux distro and it seems that I have this weird issue when trying to take a screenshot or record a desktop. I only get black images or black videos. Funny thing is that I can see a cursor. But all background remains black. I tried by reinstalling FGLRX driver for my ATI graphics card. Didn't help. Can anyone tell me what's going on?


title: Why command `ls -d` only print the `.` directory?

text: I have tried `man ls`, and then I got > >     -d, --directory >   > > list directory entries instead of contents, and do not dereference symbolic > links As the manual says, `-d` means listing all the directories, but when I type `ls -d` I got               drwxr-xr-x 35 *user group* 4.0K *date* 00:16 .


title: Use CloneZilla to backup disk2image (Primary Boot) without CD or USB Drive?

text: Since I won't be near the physical machine, I need to find a way to disk2image backup/restore the Primary Boot HDD in case I mess it up somehow. How do you use CloneZilla to backup disk2image (Primary Boot) without using CD or USB drive?


title: NFSv3 with Kerberos "unmatched host" error

text: I've setup NFSv4 using Kerberos (works great), but now I need to add NFSv3 with Kerberos. When trying to mount the NFSv3 export, I get a permission needed error on the client and on the server the error is "unmatched host".               In /etc/export I just have:      /test gss/krb5(rw,sync)      The "unmatched host" error usually means that you haven't specified that the client can access the server in the export file. But with kerberos you shouldn't need to. The export man file states: > **RPCSEC_GSS security** To restrict access to an export using rpcsec_gss > security, use the special string "gss/krb5" as the client. It is not > possible to simultaneously require rpcsec_gss and to make requirements on > the IP address of the client. I'm pretty sure Kerberos is setup correctly (again NFSv4 with kerberos works) and from what I've read on the web, I think the NFS server is setup correctly (settings are below) and the necessary services are running. I currently testing on Ubuntu 10.4, but had the same problem on Novell SLED 10.3. Anyone have an idea what I could be doing wrong? or can point me to a NFSv3 w/kerberos how-to?               nss-common:     NEED_STATD=yes     STATDOPTS=     NEED_IDMAPD=no     NEED_GSSD=yes          nss-kernel-srever:     RPCNFSDCOUNT="8 --no-nfs-version 4  --no-nfs-version 2"     RPCNFSDPRIORITY=0     RPCMOUNTDOPTS="--manage-gids"     NEED_SVCGSSD=yes     RPCSVCGSSDOPTS=" -vvv "


title: How to use rsync or scp to efficiently copy the files from machineB and machineC to machineA?

text: I am running my shell script on `machineA` which copies the files from `machineB` and `machineC` to `machineA`. If the file is not there in `machineB`, then it should be there in `machineC` for sure. So I will try to copy from `machineB` first, if it is not there in `machineB` then I will go to `machineC` to copy the same files. In `machineB` and `machineC` there will be a folder like this `YYYYMMDD` inside this folder -               /data/pe_t1_snapshot      So whatever date is the latest date in this format `YYYYMMDD` inside the above folder - I will pick that folder as the full path from where I need to start copying the files - so suppose if this is the latest date folder `20140317` inside `/data/pe_t1_snapshot` then this will be the full path for me -               /data/pe_t1_snapshot/20140317      from where I need to start copying the files in `machineB` and `machineC`. I need to copy around `400` files in `machineA` from `machineB` and `machineC` and each file size is `1.5 GB`. Currently I have my below shell script which works fine as I am using `scp` over `rsync` but somehow it takes `5 hours` to copy the `400` files in machineA which is too long for me I guess. :( Below is my shell script -               #!/bin/bash          readonly PRIMARY=/export/home/david/dist/primary     readonly SECONDARY=/export/home/david/dist/secondary     readonly FILERS_LOCATION=(machineB machineC)     readonly MEMORY_MAPPED_LOCATION=/data/pe_t1_snapshot     PRIMARY_PARTITION=(0 3 5 7 9)     SECONDARY_PARTITION=(1 2 4 6 8)          dir1=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[0]} ls -dt1 "$MEMORY_MAPPED_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] | head -n1)     dir2=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[1]} ls -dt1 "$MEMORY_MAPPED_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] | head -n1)          echo $dir1     echo $dir2          if [ "$dir1" = "$dir2" ]     then         # delete all the files first         rm -rf $PRIMARY/*         # below for-loop copies one file at a time in PRIMARY folder         for el in "${PRIMARY_PARTITION[@]}"         do             scp david@${FILERS_LOCATION[0]}:$dir1/t1_weekly_1680_"$el"_200003_5.data $PRIMARY/. || scp david@${FILERS_LOCATION[1]}:$dir2/t1_weekly_1680_"$el"_200003_5.data $PRIMARY/.         done         # delete all the files first         rm -rf $SECONDARY/*         # below for-loop copies one file at a time in SECONDARY folder         for sl in "${SECONDARY_PARTITION[@]}"         do             scp david@${FILERS_LOCATION[0]}:$dir1/t1_weekly_1680_"$sl"_200003_5.data $SECONDARY/. || scp david@${FILERS_LOCATION[1]}:$dir2/t1_weekly_1680_"$sl"_200003_5.data $SECONDARY/.         done     fi      I am copying `PRIMARY_PARTITION` files in `PRIMARY` folder and `SECONDARY_PARTITION` files in `SECONDARY` folder in `machineA`. Now my question is - how would I use `rsync` here instead of `scp(ing)` the files? As I have read that `rsync` is much faster than `scp(ing)` the files. I would like to have same logic as I have in my shell script in `rsync`. I have never worked with `rsync` before so having some issue. Can anyone provide an example? Given my use case does `rsync` will be faster as compare to scp? And if not what other options I can try out to speed up the file transfer? **UPDATE:-** To clarify terdon question - In the question I am only showing 10 files just for example -               PRIMARY_PARTITION=(0 3 5 7 9)     SECONDARY_PARTITION=(1 2 4 6 8)      In general in `PRIMARY_PARTITION` array, I will around 150 file numbers and then in `SECONDARY_PARTITION` I will have another 200 files numbers. Now what I need to do is whatever file number I have in `PRIMARY_PARTITION`, I need to go and find out those files in the `machineB` directory, if the files is already there, then copy it to `PRIMARY` folder in `machineA` but if the file is not there in `machineB` then it should be there in `machineC` so go and copy the files from `machineC` now and put it in `PRIMARY` folder in `machineA`. Similarly I need to do same thing for `SECONDARY_PARTITION`, I will go and find out those files in `machineB` directory, if it is there copy it in `machineA` secondary directory but if it is not there in `machineB`, then it should be there in `machineC` so copy it from `machineC` and put it in `machineA` secondary directory. So all the file numbers we have is in - `PRIMARY_PARTITION` and `SECONDARY_PARTITION`. In general I will have `PRIMARY_PARTITION` and `SECONDARY_PARTITION` like this -               PRIMARY_PARTITION=(0 548 272 4 544 276 8 556 280 12 552 284 16 256 564 20 260 560 24 264 572 28 268 568 516 304 32 512 308 36 524 312 40 520 316 44 288 532 48 292 528 52 296 540 56 300 536 60 68 608 340 64 336 76 348 72 344 84 324 80 320 92 332 88 328 576 372 100 580 368 96 584 380 108 588 376 104 356 592 116 352 596 112 364 600 124 360 604 120 136 408 140 412 128 400 132 404 152 392 156 396 144 384 148 388 440 168 444 172 432 160 436 164 424 184 428 188 416 176 420 180 204 476 200 472 196 468 192 464 220 460 216 456 212 452 208 448 508 236 504 232 500 228 496 224 492 252 488 248 484 244 480 240)          SECONDARY_PARTITION=(1101 1374 1641 1371 1647 1098 1635 1365 1095 1638 1089 1362 1659 1359 1119 1113 1662 1353 1350 1650 1110 1347 1653 1107 1134 1407 1611 1401 1131 1614 1602 1125 1398 1122 1605 1395 1389 1149 1626 1629 1146 1386 1617 1143 1383 1377 1623 1137 1305 1581 1578 1311 1299 1575 1302 1569 1599 1290 1593 1293 1590 1281 1587 1287 1551 1338 1341 1545 1071 1329 1542 1335 1539 1083 1566 1323 1086 1563 1326 1557 1074 1314 1317 1077 1554 1221 1494 1491 1218 1503 1230 1227 1497 1479 1239 1233 1473 1245 1485 1482 1242 1254 1527 1251 1521 1263 1533 1530 1257 1509 1269 1266 1506 1278 1518 1275 1515 1155 1425 1431 1158 1434 1161 1167 1437 1410 1170 1173 1413 1419 1179 1422 1182 1671 1458 1185 1665 1191 1461 1677 1194 1467 1470 1197 1674 1203 1443 1206 1446 1449 1209 1215 1455)      **Another Update:-** After removing `2>/dev/null`, I ran the script again but I got the below error - `ssh: Could not resolve hostname machineB : Name or service not known rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: unexplained error (code 255) at io.c(605) [Receiver=3.0.9] ssh: Could not resolve hostname machineC : Name or service not known rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: unexplained error (code 255) at io.c(605) [Receiver=3.0.9] ssh: Could not resolve hostname machineB : Name or service not known rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: unexplained error (code 255) at io.c(605) [Receiver=3.0.9] ssh: Could not resolve hostname machineC : Name or service not known rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: unexplained error (code 255) at io.c(605) [Receiver=3.0.9] ` Any thoughts what is going on? I have replaced `machineB` and `machineC` with actual names before running the shell script and my system is -               root@machineA:/home/david# uname -a     Linux machineA 3.2.0-24-generic #37-Ubuntu SMP Wed Apr 25 08:43:22 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux      Below is my shell script which I am running -               #!/usr/bin/env bash          readonly PRIMARY=/export/home/david/dist/primary     readonly SECONDARY=/export/home/david/dist/secondary     readonly FILERS_LOCATION=(machineB machineC)     readonly MEMORY_MAPPED_LOCATION=/data/pe_t1_snapshot     PRIMARY_PARTITION=(0 3 5 7 9)     SECONDARY_PARTITION=(1 2 4 6 8)          dir1=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[0]} ls -dt1 "$MEMORY_MAPPED_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] | head -n1)     dir2=$(ssh -o "StrictHostKeyChecking no" david@${FILERS_LOCATION[1]} ls -dt1 "$MEMORY_MAPPED_LOCATION"/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9] | head -n1)          echo $dir1     echo $dir2          ## Build your list of filenames before the loop.      for n in "${PRIMARY_PARTITION[@]}"     do         primary_files="$primary_files :$dir1"/t1_weekly_1680_"$n"_200003_5.data     done          ## Repeat for $SECONDARY_PARTITION     for n in "${SECONDARY_PARTITION[@]}"     do         secondary_files="$secondary_files :$dir2"/t1_weekly_1680_"$n"_200003_5.data     done          echo $primary_files     echo $secondary_files               if [ "$dir1" = "$dir2" ]     then         find "$PRIMARY" -mindepth 1 -delete         find "$SECONDARY" -mindepth 1 -delete              rsync -avz david@${FILERS_LOCATION[0]}"${primary_files}" $PRIMARY/         rsync -avz david@${FILERS_LOCATION[1]}"${primary_files}" $PRIMARY/              ## Do the same for $secondary_partition files         rsync -avz david@${FILERS_LOCATION[0]}"${secondary_files}" $SECONDARY/         rsync -avz david@${FILERS_LOCATION[1]}"${secondary_files}" $SECONDARY/     fi      I am suspecting may be `rsync` syntax is not right. Because if I run single command like this, then it worked fine -               rsync -avz david@machineB":/data/pe_t1_snapshot/20140317/t1_weekly_1680_0_200003_5.data" /export/home/david/dist/primary      **Another Minor Update:-** If I am running like this -               root@machineA:/export/home/david# rsync -avz david@machineB':/data/pe_t1_snapshot/20140317/t1_weekly_1680_0_200003_5.data :/data/pe_t1_snapshot/20140317/t1_weekly_1680_1_200003_5.data' /data01/primary     receiving incremental file list     rsync: change_dir "/home/david/:/data/pe_t1_snapshot/20140317" failed: No such file or directory (2)     t1_weekly_1680_0_200003_5.data          sent 30 bytes  received 504982813 bytes  6196108.50 bytes/sec     total size is 1761988281  speedup is 3.49     rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1536) [generator=3.0.9]      Above command should copy the files to `/data01/primary` directory but it is copying only one file and it doesn't copies second file. But this works fine and the one file get copied -               root@machineA:/export/home/david# rsync -avz david@machineB':/data/pe_t1_snapshot/20140317/t1_weekly_1680_0_200003_5.data' /data01/primary     receiving incremental file list     t1_weekly_1680_0_200003_5.data          sent 30 bytes  received 504982698 bytes  6351984.00 bytes/sec     total size is 1761988281  speedup is 3.49


title: Should i get red hat desktop?

text: So I want to learn about Linux more and to an extent Red hat, and I think the asking price ($49p/a) is a decent price to learn, I don't want centos because I would prefer Red Hat software, but is it worth having? I of course plan to get a RHCE at some point so would it be worth investing now so I can learn the distro? Many thanks


title: llvm and clang on CentOS 5 without root permissions?

text: I am trying to have llvm and clang on a centOS 5 without root permissions. I tried to do it downloading llvm and clang src packages and trying the ususal configure, make and make install steps as such:               wget http://llvm.org/releases/3.3/llvm-3.3.src.tar.gz     wget http://llvm.org/releases/3.3/cfe-3.3.src.tar.gz     tar xzf llvm-3.3.src.tar.gz && cd llvm-3.3.src/tools/ && tar xzf ../../cfe-3.3.src.tar.gz      I tried with a newer version of gcc compiled for this 64bit CentOS system, because the older version wouldn't work (see below). When I try it with the newer version, I get this:               export LD_LIBRARY_PATH=/home/avilella/src/gcc/gcc-4.7.2/lib64:/home/avilella/src/gcc/gcc-4.7.2/lib     export CC=/home/avilella/src/gcc/gcc-4.7.2/bin/gcc     export CXX=/home/avilella/src/gcc/gcc-4.7.2/bin/g++       export PATH=/home/avilella/src/python/python-2.7.3/bin:$PATH     cd ~/src/llvm/latest/llvm-3.3.src     ./configure --prefix=/home/avilella/src/llvm/latest/llvm && make clean && make -j8 && make install      After these steps, I don't see clang in the bin directory:               /home/avilella/src/llvm/latest/llvm/bin          So I followed the instructions in the clang directory, and ran `make -j8` on it:               cd ~/src/llvm/latest/llvm-3.3.src/tools/cfe-3.3.src     make -j8      Doing so, I get this `clange/Config/config.h` error:               [...]     InitHeaderSearch.cpp:17:51: fatal error: clang/Config/config.h: No such file or directory     [...]      This is mentioned in a bug report from 2011, which I would be solved by now: http://llvm.org/bugs/show_bug.cgi?id=11903 Any ideas? * * * PREVIOUS ATTEMPTS:               cd ~/src/llvm/latest/llvm-3.3.src     ./configure --prefix=/home/avilella/src/llvm/latest/llvm && make clean && make -j8 && make install          checking for clang... clang     checking for C compiler default output file name... configure: error: C compiler cannot create executables     See `config.log' for more details.      Some of the contents of `config.log`:               configure:2047: checking for clang     configure:2063: found /home/avilella/bin/clang     configure:2074: result: clang     configure:2110: checking for C compiler version     configure:2117: clang --version >&5     clang: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by clang)     clang: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by clang)     clang: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by clang)     clang: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by clang)     clang: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by clang)     [...]      * * * I tried to use the fedora18 binary versions available on the llvm website, but it complains about a GLIBC version that cannot be found in the system:               [~/src/llvm/clang+llvm-3.3-x86_64-fedora18/bin] $ ./clang     ./clang: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by ./clang)     ./clang: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./clang)      I've got more recent version of gcc on this system, but I am guessing I need to either download binaries or recompile versions of libc to have this working. The question is how. I tried downloading rpms from here: http://pkgs.org/centos-5-rhel-5/centos-rhel- updates-x86_64/glibc-2.5-107.el5_9.5.x86_64.rpm/download/ I placed the contents of the rpm into a folder:               rpm2cpio $rpm | cpio -idmv      and added that folder lib64 into my LD_LIBRARY_PATH env variable, but that didn't solve the problem either (and made simple command like `ls` and `less` crash):               clang: /home/avilella/src/llvm/glibc/lib64/libc.so.6: version `GLIBC_2.15' not found (required by clang)     clang: /home/avilella/src/llvm/glibc/lib64/libc.so.6: version `GLIBC_2.14' not found (required by clang)


title: Press a html button via shell script?

text:
i am currently trying to write a script to change some parameters on a webpage via a shell script. I can change the values in the textboxes without any problems, but i can't seem to figure out how i can "press" the Apply button. This is how i change the values, as you can see i need one final "Apply" button press.               setJitterDelay()     {         rate=${1}         if [ "${rate}" == "low" ]; then                 ((htmlJitterNegDelta = 5))                 ((htmlJitterPosDelta = 5))                 ((htmlJitterDelayMax = 10))                 jDelta=5         else                 if [ "${rate}" == "med" ]; then                         ((htmlJitterNegDelta = 25))                         ((htmlJitterPosDelta = 25))                         ((htmlJitterDelayMax = 50))                         jDelta=25                 else                         if [ "${rate}" == "high" ]; then                                 ((htmlJitterNegDelta = 50))                                 ((htmlJitterPosDelta = 50))                                 ((htmlJitterDelayMax = 100))                                 jDelta=50                         else                                 echo "error: low, med, high not selected! Skipped..."                                 return                         fi                 fi         fi         ### APPLY BUTTON     }      I used Firebug to know which values i had to change and the Apply button says this:                 <input id="appFlowBw" type="submit" value="Apply" name="appFlowBw">     <form action="http://wanemu/XGEM_REV_BW_FLOW?blade=1&profile=0" method="post" name="rev_bw_form"></form>      The input is inside the form in the source code:
               	               <INPUT type="submit" name="appFlowBw" id="appFlowBw" value="Apply" disabled>	           </FORM>      But i don't know how i can now "press" this button. I hope you understand my problem and can help. //edit: added form


title: Issues with .bash_profile and terminal commands

text: I added some data to my `.bash_profile` to run two aliases ruby version 19 and the proper gems. As soon as I added the data I could not longer run any commands such as the MacPorts command port nor the command mate to run TextMate. As soon as I deactivated `.bash_profile` and `.bash_login` and even `.bash_history` all was well again. `.bash_history` got regenerated and soon thereafter I got `.bash_profile` reinstated with my badly needed aliases, but then I lost the option to run these commands again. Here is some of the output of all these files:               jaspersmbp:~ jasper$ cat .bash_profile         alias ruby='/opt/local/bin/ruby1.9'         alias gem='/opt/local/bin/gem'     jaspersmbp:~ jasper$ cat .bash_login     jaspersmbp:~ jasper$ cat .bashrc         HISTFILESIZE=1000000000         HISTSIZE=1000000     jaspersmbp:~ jasper$ cat .profile         #Django path         export PATH=/opt/local/bin:opt/local/sbin:/opt/local/lib/python2.4/site-packages/django/bin:$PATH         # Apache alias         alias apacherestart='sudo /opt/local/apache2/bin/apachectl -k restart'         #Subversion OSX for Eclips Joomla Development         export PATH=/opt/subversion/bin:$PATH         #Test         #echo $PATH         ##         # Your previous /Users/jasper/.profile file was backed up as /Users/jasper/.profile.macports-saved_2012-05-18_at_09:47:58         ##         # MacPorts Installer addition on 2012-05-18_at_09:47:58: adding an appropriate PATH variable for use with MacPorts.         export PATH=/opt/local/bin:/opt/local/sbin:$PATH         # Finished adapting your PATH environment variable for use with MacPorts.      Does anyone know why making `.bash_profile` active anihilates the use of commands such as mate and port? I really need `.bash_profile` to work so I can use aliases and I need MacPorts port command for all kinds software.


title: How to sync two directories?

text: I have an "A" HDD (1,5TB) next to me (on a netbook running OpenBSD 5.1, it's a fileserver)      And I have a "B" HDD (1,5TB) 200km's away from me on an OpenWrt 10.04 router (also "fileserver").      I always put files on the netbook next to me. I need to sync this local storage (on the OpenBSD netbook) with the B storage 200 km's away with max 30 KByte/sec speed. I found a solution for this via google :)      sync files recursively between two folders where files are less than 24 hours old   **Question** : How can I configure that, when I sync to the "B" storage that they will not see these "half-uploaded" files? So I'm searching for a solution like: "If file is not fully copied from A to B, then put a dot before it's name, so they will not see as it is a hidden file.. if the upload finishes to a file, then after that the dot must be removed from their name, so that they can see it.."


title: Red Hat Enterprise Linux 6 wakes up spontaneously after sleeping

text: I have a Lenovo ThinkPad T430 running Red Hat Enterprise Linux 6.5. Today I put my computer to sleep, double checked 10 seconds later, only to find out after arriving to my office that my computer woke up inside my backpack. If ThinkPads weren't made of adamantium it would be probably fried. What's happening?


title: Is there a VPN client for Kali?

text: I'm pentesting a network using Kali Linux, however sometimes I have to be outside the network. I'd like to perform this via VPN if possible, else I have to drive home each time (10 miles, 15km) which wastes me a lot of time. I there any VPN client available for Kali Linux? It should have PPTP. Thanks!


title: Git - remove deleted files

text: I'm using this simple git alias                   rmdel = "!git rm $(git ls-files -d)"      meant "remove deleted", i.e. to remove from the staging area all files deleted from the file system. It works fine except when there are any files containing blanks. Then obviously the list gets split on them as well leading to file names of non-existing files. I think it should be possible to solve it using IFS, but IFS doesn't seem to work in cygwin and I doubt that something like                   rmdel = "!IFS=' ' git rm $(git ls-files -d)"`      could work at all. Any better idea?


title: Where are wine package for BOSS Linux?

text: In Wine website, i see different type of Operating system but cant find BOSS LINUX. in which category does it come? Is it called with an other name?


title: Create partition aligned using parted

text: I'm partitioning a non-SSD hard disk with _parted_ because I want a GPT partition table.               parted /dev/sda mklabel gpt      Now, I'm trying to create partitions correctly aligned so I use the next command to know where begins the first sector:               parted /dev/sda unit s p free          Disk /dev/sda: 488397168s     Sector size (logical/physical): 512B/512B     Partition Table: gpt          Number  Start  End         Size        File system  Name      Flags             34s    488397134s  488397101s  Free Space      We can see that it starts in the sector 34 (it's by default when this partition table is used). So, to create the first partition I tried:               parted /dev/sda mkpart primary 63s 127s      to align it in the sector 64 since it's multiple of 8 but it shows: **Warning: The resulting partition is not properly aligned for best performance.** The sector size logical and physical in my hard disk are both of 512 bytes:               cat /sys/block/sda/queue/physical_block_size     512          cat /sys/block/sda/queue/logical_block_size      512      How to create partitions correctly aligned? What I'm doing wrong?


title: Pulseaudio, Phonon, KDE and forwarding sound to headset

text: Some days ago I bought headet (Jabra BT2045) and I want to use it in Skype voicechat and for example to forward to it another sound streams from my KDE. I've successfully paired and setup as headset Jabra with Blueman or BlueDevil. After that Jabra interface appeared in Phonon list and I moved it to the top of list to transfer music to Jabra, not to my main output. But! There is no sound even if I change output manually with kmix for the streams, or when I've already setup Jabra as default output interface, microphone even don't work! Skype don't see that Jabra interface at settings and sound will appear if I reset all to my standard output (loudspeakers). What am I doing wrong? My dist is Linux Mint and pulseaudio/kde/blueman/bluedevil are up to date from mint repos.


title: “Grep-ing” from A to B in hexdump's output

text: Here is the situation: I have to find in the output from an `hexdump` the bytes between a string A and a string B. The structure of the hexdump is something like:               -random bytes     -A + useful bytes + B     -random bytes     -A + useful bytes + B     -random bytes      And now, the questions: - Is it possible to grep "from A to B"? I haven't seen anything like that in the man page or in the internet. I know i can do it manually, but I need to script it. - Is it possible to show the hexdump output without the line numbers? It seems very reasonable, but I have no found the way to do it. Thanks! Edit: I'm trying to recover 2 deleted JPEG images from a loopback device, so I can't show all the output (it's extremely long), but here's a piece of it:               0010400 ff d8 ff e0 00 10 4a 46 49 46 00 01 01 00 00 01     0010410 00 01 00 00 ff fe 00 3c 43 52 45 41 54 4f 52 3a     [...]     0030f50 3e e9 fb a4 54 37 70 7f cb 55 03 fd af f1 a2 32     0030f60 e8 26 8f ff d9 00 00 00 00 00 00 00 00 00 00 00      the standard says that the JPEG files start with 0xff 0xd8 and finish with 0xff 0xd9, so I want to get all the information between that 2 strings (I think that should work, but i haven't tested it yet)


title: Where can I find documentation about the "sudo !!" command

text: I just learned that Linux has a `sudo !!` command which literally applies `sudo` to the last entered command. I had never heard about it. Is that a common control? Where can I find documentation about it?


title: extract only a specific folder Contents from a zipped archive to a given directory

text: This is very close to the SO How to extract only a specific folder from a zipped archive to a given directory? I need something close but I always get the folder with the contents, not it's contents only This is what was suggested:                #note $2 is passed in and would be == "magefoler"      unzip /srv/file.zip "$2-master/*" -d /srv/www/mage/      What I need to do it to take a zip that has this structure in it               file.zip      |-magefoler-master/      |-magefoler-master/app/*tons of files      |-magefoler-master/skin/*tons of files      and I need to move it to another folder but, I can't move the `magefoler`, I only want the `app` and `skin` folders. This doesn't mean that it'll always be those two folders, just that any child content, files or folders, in the `magefoler` is what I need to get out. What is trying to be avoided is to export all to a folder and then just move it from there. The end result I'm looking for is from the zip file I output to the `/mage` folder like this:               /srv/www/mage/          |--/mage/app/*tons of files          |--/mage/skin/*tons of files


title: Job server with web/email interface to run remote commands

text: I'm looking for a solution to run remote commands for my Linux server. Unfortunately I cannot use SSH just only HTTPS (corporate firewall blocks everything different from HTTP/HTTPS on 80/443 ports). I tried a web shell over HTTPS but it is not comfortable and doesn't suit my needs. I just need something to pass a remote command to the server (optionally check the results), queue the commands to be done sequentially, see the statuses and completion for every job (remote command). It would be nice to have a job queue-schedule-runner server with a Web GUI. Another solution that come to my mind is an email interfaced server (I remember something like that from ancient Internet history, but couldn't remember the name) that would run the commands from the emails. If anybody knows something like that please name any of them.


title: Set custom locales in Gnome3 (on Fedora 20)

text: I've created my own custom `locale`s and placed them in `/etc/locale.conf` which successfully takes effect if I log in on a virtual console (Ctrl+Alt+F2). In my Gnome3 session those variables are not set, though. For terminal applications I could just place them in the `.bashrc` but that won't help me with graphical applications like Thunderbird and Pidgin. I have tried to follow these hints: Locale settings in shell initialization not used by GNOME session and even emulated the bug in Locale - ArchWiki by creating a `.pam_environment` file, but the `locale`s are still those set by Gnome3. There is a configuration dialogue in the Gnome settings but it only allows to set a very limited set of predefined `locale` combinations and no way to customize them. The relevant files in my home directory:               user@localhost:~$ ls -lah .dmrc .pam_environment .session .xsession .xsessionrc     lrwxrwxrwx. 1 user user 16 12. Jun 08:57 .dmrc -> /etc/locale.conf     lrwxrwxrwx. 1 user user 16 11. Jun 20:23 .pam_environment -> /etc/locale.conf     lrwxrwxrwx. 1 user user 16 12. Jun 09:09 .session -> /etc/locale.conf     lrwxrwxrwx. 1 user user 16 12. Jun 09:07 .xsession -> /etc/locale.conf     lrwxrwxrwx. 1 user user  9 13. Jun 11:22 .xsessionrc -> .xsession     -rw-rw-r--. 1 user user 66 13. Jun 11:13 .profile          user@localhost:~$ cat .profile      source /etc/locale.conf      The contents of `/etc/locale.conf`:               LANG="en_US.utf8"     LC_TIME="de_MY.utf8" # NB: de_MY     LC_MONETARY="de_DE.utf8"     LC_PAPER="de_DE.utf8"     LC_NAME="de_DE.utf8"     LC_ADDRESS="de_DE.utf8"     LC_TELEPHONE="de_DE.utf8"     LC_MEASUREMENT="de_DE.utf8"     LC_IDENTIFICATION="de_DE.utf8"      Does anyone know how to set custom `locale`s in Gnome3 ?


title: Write data to both a file and a serial port — can I use tee?

text: I am trying to take the input from a serial port and write it to a file and also then read the file and send it back out the serial port to the host computer. A coworker suggested using the "tee" command but I can't find a good example/wrap my mind around the command. Is it possible to do this with "tee"? it seems that tee can only do one command, like cating a file to a different place, but not cating the port then writing to the document then reading the document and then sending it over the port. Or am i just not understanding the basics of the "tee" command.


title: How to extend a command in bash so that it expands based on options?

text: I've started working with a git repository that includes a large amount of content that should be assumed readonly. So, every time I throw a new branch:               git checkout -b newBranch      it should be followed by the command               git update-index --assume-unchanged LARGE_READONLY_DIRECTORY      I figured this would be a perfect opportunity to try my fledgling bash skills, so that all I need to do at the shell is the first line, and it would execute that, then the second, without me remembering to do it (which I won't). I figured what I want to do is have a function in my .bashrc that checks whether the first argument is 'checkout', and the second it '-b'. That first check is easy, but I can't figure out how to note the presence of -b.               git() {         if [[ $1 == 'checkout' ]] && [[$2 == '-b']];                  then echo 'yep!';         fi;              command git "$@";     }      When I execute this, it complains that `[[-b: command not found`. Presumably the fact that it's an option, rather than an argument, is important here. Can anyone tell me how to check for the presence of that argument, so I know to execute the follow-up command?


title: Show a notification across all running X displays

text: Using the command line, I'd like show a notification on every running X display. ( and running console ) Something like:               notify-send-all 'Warning' 'Nuclear launch in 5 minutes, please evacuate'      Is there a program that will do this? If not, can this be implemented with bash?


title: Print like Firefox

text: Made a CLI script to print Wikipedia articles:               WIKI='https://en.wikipedia.org/w/index.php?title='     TITLE=$1     PRINTABLE='&printable=yes'          SRC=$WIKI$TITLE$PRINTABLE          HTML=$1".html"     PS=$1".ps"          wget $SRC          mv index* $HTML          html2ps $HTML > $PS          lpr -P pr1444 $PS      It works in the respect that if you write `./print Shane_Mosley` this article is printed. But, compared to using Firefox --- navigate to the site, and print from the menus --- the printed result is inferior: much less compact layout (especially tables), no pictures, and cannot handle "unusual" characters. So, my question: Is Firefox "monolithic" or is it actually composed of modular tools, that I can replicate? Or could I use Firefox as a server, that I can feed commands (like go there and print)? If no: are there ways to use my tools in a better way, or are there other tools that would enhance the result?


title: how do I reference a variable in fish shell with a default fallback

text: What is the fish shell equivalent to the following bash:               echo ${TEST:-1}      In bash this would print the value of TEST if there was one, or 1 if there was not.


title: CentOS vs RedHat on hp DL 380 G5

text: hp lists downloads for:               »   Red Hat Enterprise Linux 5 Server (x86)     »   Red Hat Enterprise Linux 5 Server (x86-64)     »   Red Hat Enterprise Linux 6 Server (x86)     »   Red Hat Enterprise Linux 6 Server (x86-64)      but only               »   CentOS 5      Since, as I understand it, CentOS is basically repackaged RHEL, is there any reason I shouldn't be able to run CentOS 6.4 x86_64 on an hp DL 380 G5, including running the management rpms meant for EL 6? (I've come across threads about CentOS 6.2 having some issues, but not 6.4.) (The management rpms are somewhat key since they would allow me to keep tabs on how the RAID array is functioning via a script, which is what I'm used to.) Can anyone confirm success/trouble with 6.4 64-bit on a G5?


title: Why is my tar file bigger than the directory backed up

text: This question did not help me (despite having the same title). So I post this even though this is a duplicate question. As far as I can tell, the total in `du -k` includes all the subdirectories and indicates I have 77 megabytes of data               /raid/fpuData/oldOutput>du -ks     77063332        .     /raid/fpuData/oldOutput>tar -cvzf ../oldOutput.tar.zip *      The backup is sill running, but already the file is considerably bigger than 77 megabytes               /raid/fpuData>ls oldOutput.tar.zip     -rw-r--r-- 1 nobody nobody 14470610944 Jul  1 22:18 oldOutput.tar.zip      The files I'm backing up are all huge text files filled with numbers, like a huge comma delimited spreadsheet). Something like this               0.3454915028125262743685653,0.5590169943749474512628694,...     0.221761776923297210251107,0.3588180924674668759166707,...     -0.06101864995889930837202897,-0.09873024958113109372792593,...     -0.3001958820500086333460388,-0.4857271404396689140625654,...     ...      Why is the `tar` file bigger than the directory? It should be compressed because I'm using the data with the `z` option. What's the point of `tar`ring it, then?


title: Minimizing hardware interrupts

text: I am using a modified Linux kernel as a soft real-time OS, on a system that has an architecture like this: ![a busy cat](http://i.imgur.com/ttKPNU9.png) CPU1 and CPU2 have 8 cores each. I have 4 processes that need to be run with minimum jitter, so **what should I do (on both OS-level and hardware configuration level) to minimize the effect of hardware interrupts on these processes**? This is what I'm doing now:   1. Bind the processes to 1 core each on CPU2.   2. Disable SAS2208 controller and connect boot disk only to the SATA controller on C602 PCH. It seems that I can disable most of the features on the C602 PCH to reduce hardware interrupts on CPU1, am I right that this is unnecessary if I isolate the processes to CPU2 (i.e. no remote memory access to DIMMs #1-1 to #1-4 and no interprocess communication between CPU1 and CPU2)?


title: delete line in vi

text: How can I delete a line in VI? Here what I am doing right now:   1. Open up the terminal `alt` + `ctrl` + `t`   2. `vi a.txt`   3. I move my cursor to the line which I wan to delete, then **what key-combination is should use to delete line in vi editor**?


title: Installing XVFB on Suse

text: I'm setting up an OpenSuse web server and need to run CutyCapt and XVFB, but can't find either in any of the repositories. I'm running OpenSuse 11.4 x64 with no desktop GUI. Any advice on where to start?


title: Where to download Wolfenstein: Enemy Territory for linux?

text: Hey Guys, I'm using KUBUNTU 10.10 I would like to use Wolfenstein: Enemy Territory for linux, I know this game is free, right? Please could someone give me the list of the last version of the game? Thank you


title: Ways to update Ubuntu (debian-based distros) offline

text: What is the easiest way to update/upgrade an offline Ubuntu machine with the help of a Windows machine that has internet access? This question also applies to installing new packages offline and not only updates/upgrades. The Linux system shall remain completely cut off from the Windows machine, meaning there should be no ethernet connection or the likes between the two computers. **Update:** Please have patience, since I haven't updated this since two weeks.   There are some complications getting apt-offline to work properly on Lubuntu and all other methods seem to be too old and deprecated: AptOff - last update 2006   AptMedium - last update 2007   Keryx - last update 2011, looks like this project was discontinued I hope I will be able to somehow update the offline machine, finally. While I was still not able to update/upgrade the offline system due to authentication errors, I accepted an answer, because it's taking too long.


title: Getting "A hard disk may be failing" on startup

text: ![Error](http://i.stack.imgur.com/KQ8Qx.png) I keep getting this error message each time I start GNOME, even though I created a new partition table on this drive, I formatted all the partitions, and created them again, and this just won't go away. Any suggestions? **Edit:** I ran badblocks, and this is what I got > badblocks -svw /dev/sdb Checking for bad blocks in read-write mode From > block 0 to 80042206 Testing with pattern 0xaa: done   >  Reading and comparing: done   >  Testing with pattern 0x55: done   >  Reading and comparing: done   >  Testing with pattern 0xff: done   >  Reading and comparing: done   >  Testing with pattern 0x00: done   >  Reading and comparing: done   >  Pass completed, 0 bad blocks found


title: Change command-line "environment" to programs command

text: In a console, is it possible to change into a commands "environment"? To explain, I take "git" as an example. While programming and using a git repository, I change to the repos path and then do many "git" commands like "git x ...", "git y ... " etc. So what I want is to somehow change "into" git so that I don't have to type "git" all the time, only "x ..." and "y ...". Or is this a feature you normally wouldn't want?


title: Plesk 10 migration failure

text: I have 2 dedicated servers both running CentOS 5.3 and Plesk 10.0.0. I'm trying to migrate stuff from one to the other but it's not happening, just after I fill out "Migration settings" and press "Next" I get "Host xx.xx.xx.xx is not accessible" What I've done so far that didn't have any effect whatsoever:   * stopped the firewall on the source server   * enabled "PermitRootLogin yes" in `/etc/ssh/sshd_config`   * and restarted the service Any ideas? UPDATE: I was able to initiate the migration from the new server (which is blank) to an old one (I need vice versa), so there's definitely something relating settings. I pulled out a log file, and this is where it fails:               23117: 2011-08-22 16:34:22,949 INFO Executing <subprocess[23118] '/usr/local/psa/admin/bin/launchpad --send-scout --host=XX.XXX.XXX.XXX --login=root --session-path=/usr/local/psa/PMM/msessions/2011082216342281'>     23117: 2011-08-22 16:34:32,983 INFO Subprocess raised ExecuteException: Subprocess <subprocess[23118] '/usr/local/psa/admin/bin/launchpad --send-scout --host=XX.XXX.XXX.XXX --login=root --session-path=/usr/local/psa/PMM/msessions/2011082216342281'> was finished with exit code 10     == STDOUT ====================          == STDERR ====================     Cannot send scout to the remote host     23117: 2011-08-22 16:34:32,983 ERROR Subprocess <subprocess[23118] '/usr/local/psa/admin/bin/launchpad --send-scout --host=XX.XXX.XXX.XXX --login=root --session-path=/usr/local/psa/PMM/msessions/2011082216342281'> was finished with exit code 10     == STDOUT ====================          == STDERR ====================     Cannot send scout to the remote host     23117: 2011-08-22 16:34:32,983 INFO Outgoing packet:     <?xml version="1.0" encoding="UTF-8"?>     <response>     <errcode>130</errcode>     <errmsg>Host XX.XXX.XXX.XXX is not accessible</errmsg>     </response>


title: Slow down CPU when it heats up

text: I run Gentoo Linux on my laptop. I have an issue, though, where if I'm building some very large piece of software (as I do fairly frequently, since the purpose of this laptop is development), the CPU tends to heat up more than I'd like. I used to use `cpufreqd` to manage this, since it has an `lm_sensors` plugin and can reduce the CPU frequency once it reaches a particular temperature threshold. However, this is no longer going to be a good option, since (apparently) `cpufreqd` is no longer actively maintained, and as such is going to be removed from Gentoo's package tree. Because of this, my question is: **is there some other way I can solve this problem**? I am aware of other similar CPU frequency management daemons, as well as the drivers that are built into the Linux kernel, but as far as I know they do not manage CPU frequency _as a function of CPU temperature_.


title: I can open a Debian installation DVD but I can't boot the laptop from it

text: I recently download a DVD from http://cdimage.debian.org/debian- cd/7.6.0/amd64/iso-dvd/debian-7.6.0-amd64-DVD-1.iso and I have an old Toshiba laptop which is running old Debian system on it. After I burn a DVD for above ISO, I try to open it from the target laptop and it works fine. But after I set the laptop to boot from CD/DVD, it can never boot up and fallback to the original GRUB in the laptop. Does anyone know if it is due to I burned this DVD with a tool from Microsoft which originally used to burn Windows installation disk? Thanks!


title: SSH when to use public key and password?

text: I think I understand the difference between Public Key authentication and Password. But how do I decide which one to use and which one is most secure in what situation? Can anybody give me some real life example about when to choose public key and when to choose password?