title: Brute force access to a Firebird database?

text: Ok, so here's the deal. When migrating a certain product with terrible documentation to another database type, my Firebird database was deleted. I then proceeded to recover it from the filesystem using a recovery tool. Now, I need to get into it to be able to dump the data and transfer it to MySQL, the new database. The problem is that the company who makes the software won't give me the username and password to the Firebird database so I can migrate it. The client is justifiably upset as we've had downtime for over a week on this service. What can I use to get the username and password for the database?


title: Can executables from a mounted distro's disk be run without booting into it?

text: This question, "Figuring out what OS is on which partition?", got me into thinking if you could run the executables from a mounted distro without actually having booted into said distro. The answer to this question, "How to recover from a chmod -R 000 /bin?", got me into thinking that perhaps you could call the loader from the mounted distro's partition. Is this possible? ### Example When I tried it, it didn't work, but I'm thinking I might be missing some other bits. The command I was trying this with was `lsb_release`. I'm on a 64-bit Fedora 14 installation at the moment, if that matters.               $ sudo /lib/ld-2.13.so /usr/bin/lsb_release     /usr/bin/lsb_release: error while loading shared libraries: /usr/bin/lsb_release: invalid ELF header


title: -bash: command: command not found

text: I'm trying to run a program from the command line, and I got a `-bash: command: command not found` error. What can I do to troubleshoot/fix the problem?


title: How to set what field names are displayed in listings?

text: When I execute a command in Ubuntu, which results in a listing, I get results without the field names. Example is `ls -l` or `ps l`. I am not very experienced and always need to go digging through man pages and online documentation. And the names are quite crypcit already. Is there a way to turn on field name listing globally i.e. for all commands? Note: actually `ps l` shows field names, while `ls -l` does not. It is true that the second is very trivial. However, the question stands - is there a way to overwrite this behaviour?


title: Why don't find and locate search /bin?

text: What gives? Normal `find` and `locate` commands don't turn up the verify program that lives at `/bin/verify`. In fact, it seems they don't turn up anything that lives in `/bin`               [jake@jace]/bin% "find" /bin/ -iname "verify" 2>/dev/null     /bin/verify     [jake@jace]/bin% "find" /bin -iname "verify" 2>/dev/null      [jake@jace]/bin% "find" / -iname "verify" 2>/dev/null      /home/jake/android/cts/tools/vm-tests-tf/src/dot/junit/verify     /usr/share/cmake/Modules/FortranCInterface/Verify     /usr/bin/verify      .               [jake@jace]/bin% locate "verify" | grep "bin"     /usr/bin/db_log_verify     /usr/bin/db_verify     /usr/bin/fprintd-verify     /usr/bin/json_verify     /usr/bin/ldns-verify-zone     /usr/bin/rpmverify     /usr/bin/verify     /usr/bin/verifytree      .               [jake@jace]/bin% "ls" -lh /bin/verify     -rwxr-xr-x. 1 root root 32K May 22  2012 /bin/verify


title: How to automate Linux server configuration?

text: Is there any way to automate Linux server configuration? I'm working on setting up a couple of new build servers, as well as an FTP server, and would like to automate as much of the process as possible. The reason for this is that the setup and configuration of these servers needs to be done in an easily repeatable way. We figured that automating as much of this process as possible would make it easiest to repeat as needed in the future. Essentially, all the servers need is to install the OS, as well as a handful of packages. There's nothing overly complicated about the setups. So, is there a way to automate this process (or at least some amount of it)? EDIT: Also, say I use Kickstart, is there a way to remove the default Ubuntu repositories, and just install the packages from a collection of .deb files we have locally (preferably through apt, rather than dpkg)?


title: How to limit administrative privileges to various config files?

text: I want one administrator to be able to edit the /etc/fstab file but one administrator to not be able to edit the fstab file. Both administrators need access to all other administrative tasks. Is this possible? I am assuming I would need to somehow setup what files "sudo" gives them access to. Or possible just make non administrative accounts and then create a group called fstab-access and add one of the users to that and setup privileges for that group... ? Am I on the right track?


title: accessing Maildir locally with Mutt and remotely over IMAP simultaneously

text: I have `Postfix` + `Maildir` + `Dovecot` + `IMAP` on my mailserver. I am accessing my mailbox remotely over `IMAP` with one or more clients (Thunderbird). Additionally, on the server I have mutt configured for local (`Maildir`) access. When I am connected over `IMAP` with Thunderbird, and simultaneously start `mutt` locally on the server, `Mutt` seems to be confused. When I move a message in Thunderbird (over `IMAP`), `Mutt` notices something has changed and reports:               Mailbox was externally modified.  Flags may be wrong      The problem seems to be one-sided. When I manipulate a message in `Mutt`, Thunderbird registers the change and has no problem with it. **Thus my question:** How can I make remote `IMAP` client and local `Mutt` client acccess `Maildir` without any conflicts/data corruption/errors? **Important:** I am looking for a solution where the `Mutt` access is local. For reasons beyond this discussion, I don't want `Mutt` to access the Maildir over `IMAP.` **Sidenote:** I don't understand why `Mutt` complains that mailbox was externally modified. After all, Postfix also modifies the mailbox when it delivers new emails.


title: Is Grub installed to all the MBR of a RAID array by default by the Debian Installer?

text: If I use the Debian Stable (Squeeze) Installer to install Debian, booting from a RAID1 pair of drives, does it write grub to the MBR of both drives - if not, how should I best protect against a drive failure - if I just clone the MBR won't it still point to the failed device?


title: How to use pv with dd?

text: I'm trying to use dd with pv to write an iso to a usb drive. I did:               iso="myiso.iso"; dd if="$iso" bs=1M | pv --eta --size $(ls -l "$iso" | awk '{print $5}') --progress --bytes --rate --wait > /dev/sdg      Following this guide: https://gist.github.com/rriemann/1406035 However, what happens is that the iso is "written" very quickly according to the output of pv. I'm guessing it's all put into disk cache or similar. Then pv just hangs. ps shows that pv is still running, but dd isn't. I tried stracing pv, but there is no output, and strace hangs as well! ctrl+c has no effect on strace. In fact, it does not respond to signals 15, 3, 2, or 1. Waited a few minutes for each signal. I was eventually forced to send 9. According to this: http://www.reddit.com/r/linux/comments/1xvr25/linux_tip_dont_use_kill_9/ The strace binary is badly behaved. Here are my questions:   1. How can I make pv report more useful data? I know it is probably doing what it is "supposed to", ie, just reporting on bytes that it pipes. But that is not helpful for what I want to know, which is rough estimate for bytes written to usb drive, eta, etc.    2. Why is strace not responding to any signals? My guess is that strace waits for a system call from the process it is watching before handling the next signal, which I would consider a bug. But that is just a guess. strace version 4.5.20.


title: Crash and exit code 721035

text: Where can I find what this exit code means? I have process (A) that calls program (B) using clib system(). Sometimes program (B) returns with exit code 721035 and AIX kills process A. This is random and I would like to figure out what the exit code means and why it happens. Here is a dbx stack trace:               [using memory image in core-prod]     reading symbolic information ...warning: Unable to access the stab file. Some info may not be available          Segmentation fault in pth_signal.pthread_kill [/usr/lib/libpthread.a] at 0xd05098c0 ($t1)     0xd05098c0 (pthread_kill+0xa0) 80410014         lwz   r2,0x14(r1)     (dbx) where     pth_signal.pthread_kill(??, ??) at 0xd05098c0     pth_signal._p_raise(??) at 0xd0508d28     raise.raise(??) at 0xd01373e0     skgesigOSCrash(??) at 0xd737cb7c     kpeDbgSignalHandler(??, ??) at 0xd73e2c54     skgesig_sigactionHandler(??, ??, ??) at 0xd737ce8c     get_from_list() at 0xd013cf04     malloc_buckets(??, ??) at 0xd01d9070     malloc_common@AF103_86(??) at 0xd012a448     pth_spinlock._lib_spinlock_create(??) at 0xd04f1344     _rec_mutex_init@AF20_14(??) at 0xd012b658     __bsd_child_post_fork() at 0xd0bdb230     pth_fork._atfork_child() at 0xd0515238     __fork() at 0xd0231378     system(??) at 0xd0303420     CSSCLIPal::System(const CSSCLIString&)(??) at 0xdbeb9880


title: Delete lines beginning with #

text: How do I delete lines beginning with a `#`, given that there can be whitespace on the left and right of the `#`?                 # Master socket provides access to userdb information. It's typically


title: Linux 2.6.32, busybox, Identify physical SD device

text: I have a USB card reader with two SD card interfaces and two USB ports (so it can also act as a USB hub) all on the same device. I am running an embedded Linux device that is unsupervised in its use and intend to use 2 SD cards in the reader for storing data collected over several hours of operation. Each card is meant to hold specific data and the two data types cannot be mixed. Using mdev's ability to fire off a script when a USB SCSI device (either an SD card or a USB flash disk) is mounted, I can note the physical location of the USB device so that I can identify which disk is which, but there is one exception to this. The card reader reports that both of the SD cards in the reader are physically located on port 1 of the reader. This means that I'm unable to (with my current knowledge) identify in my custom-written programs the physical card that data is being written to. I can't bring the user into the loop to tell the system which card is which (the user simply plugs 2 fresh cards in, turns the device on, and walks away). How can I determine which filesystem belongs to which physical disk by using tools compatible with Busybox? Thank you.


title: Git based package manager/installer for Linux

text: Is there any linux distro that has a git based package manager/installer. I want something similar to FreeBSD Ports (which is CVS based, I think) or Mac OS X Homebrew (git based).


title: Integer part from float operations without | bc

text: I read a billion of discussion about this but still have confused thoughts. I just need to use bash to calculate some parameters, and for this operation I need to get the integer part of a float operation. I tried many ways, but each time I get some errors. Here is the last one:               fkeypar "ex1.fef[1]" TSTARTI         #### fkeypar is an external command to get some values to assign to the subsequent variables     t0i="$(expr $(pget fkeypar value) - 11544)"                                               fkeypar "ex1lc.fits[2]" TELAPSE     lengthini=`pget fkeypar value`     fkeypar "ex7lc.fits[2]" TSTOP     lengthfin=`pget fkeypar value`     fkeypar "ex1lc.fits[2]" TSTART           ijd=`pget fkeypar value`          i=$(echo "scale=0; ($ijd - $t0i)/$period + 1" | bc)     ifin=$(echo "scale=0; ($lengthfin - $ijd)/$period + 1" | bc)          echo $i     for ((n=$i; n<=$ifin; n++))     do         echo $n      where all the parameters in `i` and `ifin` are defined. This code is within a `for` cycle, and it returns me an error (many times):               ./gti_user_tot: line 34: ((: n=: syntax error: operand expected (error token is "=")     bc: symbol lookup error: /science/heasoft-6.14/x86_64-unknown-linux-gnu-libc2.9/lib/libreadline.so.6: undefined symbol: PC     bc: symbol lookup error: /science/heasoft-6.14/x86_64-unknown-linux-gnu-libc2.9/lib/libreadline.so.6: undefined symbol: PC          ./gti_user_tot: line 34: ((: n=: syntax error: operand expected (error token is "=")      The `echo $i` seems ignored, the `for` cycle over `n` has some problems. I could avoid `bc` but I can't find a stable way to workaround.


title: Is there a single '03 registered UNIX which can't do rm -- -foo at this point?

text: I'm trying to dispel this uncertainty I have about the use of the _double- dash_ (two hyphens, --) as an end of options delimiter(as opposed to a long option prefix). It's possible some confusion arose when someone read that long options are a _GNU_ convention and long options begin with `\--`. But this is just unrelated to the _end of optiondelimiter_. The usage of Which is fully compliant with _IEEE Std 1003.1, 2013 Utility Syntax Guideline 10_ : > The first -- argument that is not an option-argument should be accepted as a > delimiter indicating the end of options. Any following arguments should be > treated as operands, even if they begin with the '-' character. So one can look at the `rm` manpages for OSX(or FreeBSD), AIX, Solaris and HPUX - the well known UNIX '03 registered Unices:   * OSX, AIX and Solaris1 refer to the `\--` delimiter verbatim in _man rm_   * HPUX doesn't discuss it in _man rm_ but has other commands which allow the said delimiter(such as `touch`) * * * Is there a single _UNIX 03_ registered product which can't do `rm -- -foo` today? Is it Solaris... HPUX? Can they do it even though they don't document it? Can we generalize this to all commands on those platforms at this point? * * * 1. The Solaris 11 manual says in a final note: _If a - - and a - both appear on the same command line, the second is interpreted as a file._ And there is a space in between the first two hyphens. Is it just the hyphen or anything that would start with the hyphen in this context which would be interpreted as a file?


title: How to implement logwatch functionality on top of systemd journal?

text: Logwatch scans logfiles with regular intervals, collects errors and stuff, then mails it to the admin. This was back in syslog and logfiles days. What's the corresponding solution for systemd's journal?


title: How to monitor the last PID assigned by the kernel?

text: To monitor process creation I'd like to periodically write the last PID assigned by the kernel to _any_ process on the system (not just processes created by the PID-monitoring program) with a time stamp to a file (using a daemon to avoid creating any extra processes). Any language would be fine, but I have a feeling this should be possible (even easy) in POSIX shell.


title: Where is iptables script stored on DD-WRT filesystem?

text: I have an **ASUS RT-N16 router** that I've flashed with the open-source **DD- WRT** firmware. According to my `ssh` login, I'm running:               DD-WRT v24-sp2 mega (c) 2010 NewMedia-NET GmbH     Release: 08/07/10 (SVN revision: 14896)      I'd like to be able to customize the iptables rules, but before I do that, I'd like to see the output of the built-in rules that get configured when manipulating the browser/GUI interface settings. I am aware of the firewall script tab in the browser interface for entering custom firewall rules, but I can't find someplace to see the output. **On a full-blown Linux system, the iptables rules would be stored somewhere like`/etc/sysconfig/iptables`. Where would I find these on a DD-WRT filesystem?** I can do               iptables -L -vn --line-numbers      and _see_ them output, but what I'm looking for is more of what the `iptables- save` command might output... so that I can incorporate the appropriate rules into my custom script. I understand that this build does not have an `iptables-save` command. I don't necessarily want the command itself, just output that it generates. If there was something like `/etc/sysconfig/iptables`, I wouldn't care about having `iptables-save`. I've seen that there may be different builds of DD-WRT that give something like `iptables-save`, but I'm not at the point where I'm ready or willing to flash the router again. Maybe as a last resort. **EDIT:** The _usual_ Linux locations for startup scripts and the like, (e.g., `/etc/init.d`, `/etc/rc`, ...) do not seem to have anything useful (at least in the build of DD-WRT that I have installed). For example, taking a look in `/etc/init.d`:               [/etc/init.d]# ll     -rwxr-xr-x    1 root     root           84 Aug  7  2010 rcS     -rwxr-xr-x    1 root     root           10 Aug  7  2010 S01dummy     [/etc/init.d]# cat rcS     #!/bin/sh     for i in /etc/init.d/S*; do       $i start 2>&1     done | logger -s -p 6 -t '' &     [/etc/init.d]# cat S01dummy     #!/bin/sh


title: Listing previous logins through sftp

text: Hello people of the stackexchange, I am having a little difficulty trying to find a location of a particular log file which i'm hoping someone on here could help me with. What i am trying to do is list the login dates/times for a particular user on our sftp server. From researching online i have so far come up ` cat /var/log/auth.log | grep "username" ` which has listed some of the logins but not as far back as i am looking for. I have also tried ` last -n 1000 | grep "username" ` but unfortunately this only seems to work for ssh access to the server rather than sftp (as far as i am aware) Can anyone think of any other methods of listing the logins from a particular user of an sftp user? many thanks in advance, daark. N.B. the user is chrooted to their own home directory if that helps in any way. **Edit:** I didn't notice some of the archive files in the first instance, these gave me up to one month worth of logins which is better. New question: By default how long does CentOs hold onto the archived auth logs? If it is more than one month where do the older archives move to? I have checked the logrotate.conf and there is no mention of `/var/log/auth.log` so i'm assuming it is using default values. **Edit:Edit** I think I may have found the answer I was looking for but posting this anyway just in case it is of any use to some one else. The logrotate script is `/etc/logrotate.d/rsyslog`. By default these rotate weekly and store up to 4 weeks worth of logs. I do not yet have the reputation to put this as an answer but if an admin see's this please feel free to close it. Best wishes ~ daark


title: How do I specify arguments to return all dot files, but not . and ..?

text: Normally dot files are not included for wildcard expansion:               % echo *     Applications Desktop Documents Downloads Library Movies Music Pictures Public bin      If I explicitly ask for dot files, I get them:               % echo * .*     Applications Desktop Documents Downloads Library Movies Music Pictures Public bin . .. .CFUserTextEncoding .DS_Store .Trash .adobe .bash_history .cups .gitconfig .gnupg .history .lesshst .netbeans .scanview.cfg .sqlite_history .ssh .swt .systemmodeler .tcshrc .viminfo      However I _also_ get `.` and `..`. I don't want those, for example if I'm passing to `du -s` where I want the size of every item in the directory. Is there some pattern that gives me just what's in the current directory, and everything in the current directory without `.` and `..`? I use tcsh. _(With regard to the "This question may already have an answer here:" note above: no this question doesn't have an answer there, since that answer only works for bash.)_


title: Which of proc, sys etc. should be bind-mounted (or not) when chrooting into a "replacement" distribution?

text: This answer to another question basically boils down to `chroot`ing into another Linux distribution in order to mainly use that as a replacement to its too restricted (but irreplaceable) parent. The suggested actions before running `chroot`, which I would like to understand better, are:               cp /etc/resolv.conf etc/resolv.conf     cp -a /lib/modules/$(uname -r) lib/modules     mount -t proc archproc proc     mount -t sysfs archsys sys     mount -o bind /dev dev     mount -t devpts archdevpts dev/pts        * Copying `resolv.conf` is clear (network/internet access), while I'm not sure about the `modules` - this actually seemed unnecessary when `chroot`ing into a stage3 Gentoo system, right?   * But why are `proc`, `sys` and `dev/pts` remounted instead of using bind-mounted? What is the _actual_ difference in this situation, which is "more correct"?   * This HowTo bind-mounts `proc` and `dev`, but neither `dev/pts` nor `sys` are mounted at all. Additionally it copies `/etc/{hosts,fstab}` over to the new root. Does that make sense? Shouldn't I include `/etc/mdadm.conf` then as well?


title: How to set proper monitoring of my services in a automated way? So that if one crash it auto on the fly restarts?

text: How can i setup monitoring to my system services? Either using automated script which scan every moment, if `httpd, mysqld, and my custom daemon` is running or not, if not running it will automatically on the fly restart it? Any idea? **For example:** > >     *Day 1:* System is running in Rail way where no support can be 24/7 > available, Day 1 was fine. >     *Day 2:* System in the middle of the Rail way crashed cause httpd and > mysqld for some reason not running the service >   How can it be automated so that the `service httpd` remain running and `service mysqld` remain running?


title: Difference between Dovecot and Z-push

text: I am trying to understand how email on a Linux system works. From Google searches I encountered both Dovecot and Z-push in the context of push mail, and sometimes used together. I was under the impression that IMAP is push so why would anything else be needed? Am I wrong? So if Dovecot handles IMAP then what exactly is the difference between Dovecot and Z-push and what are their purposes?


title: How can I add an alias for my pwd to an existing file?

text: I want to add another alias to my "aliases" file for the directory I'm currently in (Present Working Directory) I've tried               printf "alias aaa=cd " + pwd >> myfile      It's close, but I end up getting:               alias aaa=durrantm@Castle2012-Ubuntu-laptop01:~/Dropnot/webs/rails_v3/linker      instead of:               alias aaa=cd ~/Dropnot/webs/rails_v3/linker/      In other words, my machine-user name are there and I don't want them, I want the pwd at time of execution


title: find command for the newest 500 files in a directory tree and also be POSIX compliant

text: I am looking for a single line shell script or unix command to find the newest 500 files in a directory. Major constraints are it should be POSIX complaint and the directory can have tons of files.


title: How can I programatically add entries to Bash history and have timestamps work properly?

text: On CentOS 6.2 and Bash 4.1.2(1), I have added a file in `/etc/profile.d` which contains:               HISTTIMEFORMAT='%c : '     history -s "# some text as a marker"      That works insofar as the the variable gets set and the marker is written to the user's history list (and to `~/.bash_history` when they `exit`). The problems are:   * `history -s` doesn't add a timestamp when it adds the marker   * scrolling back through history stops at the marker (the `~/.bash_history` file isn't read into memory)   * the history entry for the marker comment has "??" instead of the (missing) timestamp I tried adding:               history -s "#$(date +%s)"      before the other `history -s` command, but Bash sees this as a command in history rather than a timestamp even though it's in the same format. Another option is to append the marker and a timestamp directly to `~/.bash_history`, but then they are not contiguous with the activity in the session's history when it later gets appended. There may be other sessions that get appended between the marker and its related session due to other users or multiple sessions by a single user. Is there any way to solve these problems? **Update:** I have tried adding `set -o history` (and removed the `history -s "#$(date +%s)"` line) and it seems to solve the history scrolling problem mentioned above, but the lack of timestamp is still a problem.


title: What do I need to be aware of if I want to write an application that will run on any Linux distro?

text: I'm planning on writing an app that I would like to be able to run on any Linux installation without having to rewrite any of the code in doing so (except maybe the interface, GNOME vs KDE, etc). I'm not very experienced in the minutiae of the differences between distros, and I also can't provide details about the project as it's only just entered the planning stage other than it's going to be poking around deep inside the kernel in order to interact with as much of the computer's hardware as possible.


title: Sawfish and fvwm bindings not working when logging in with a display manager

text: On one machine running Debian squeeze, when I log in with a display manager (I tried xdm, gdm or kdm), none of my Sawfish key or mouse bindings have any effect. If I log in in text mode then run `startx`, everything works fine. If I try fvwm, most bindings don't work either, but some mouse bindings do. When I log in with a display manager, I execute a custom session that loads my `~/.xsession`. That file is essentially `. ~/.profile; . ~/.xinitrc`, so my session should be exactly the same in both cases (same environment variables, same programs, etc.). What is causing Sawfish and Fvwm not to recognize my bindings? How is using a display manager different from running `startx`? How can I make my bindings work?


title: Providing /bin and /lib inside a chroot jail

text: I need to be able to provide the /bin and /lib directories inside a chroot jail so that programs can dynamically link properly. Is there a way to accomplish this without making a copy of the /bin and /lib dirs to the chroot jail? I've tried symlinks, and they don't work from inside chroot jails, and directories can not be hardlinked.


title: modify keyboard layout locally

text: I haven't found the correct keyboard layout for my macbook pro yet. I've found one that looks like it though (in `.xinitrc`):               setxkbmap -layout us -variant mac      yet this has one difference: the `(',~)` key and the `(§,±)` keys are switched. I've always managed this by editing the corresponding file in §/etc/share/X11/xkb`but it is a drag to have to do this everytim`X11` updgrades. Can it be done from a local file e.g. `.xinitrc`?


title: Why is GDM 2.20 still in Squeeze?

text: Both gdm (based on **2.20** ) and gdm3 (based on **2.30** ) are available in Debian Squeeze. Supposing that gdm3 should replace gdm, why are they both still supported?


title: Add new user in solaris

text: I tried to add a new user in solaris 10, but got an error:               $ useradd -g oinstall -G dba -d /export/home/oracle oracle     UX: useradd: ERROR: Inconsistent password files.  See pwconv(1M).      I ran `pwconv`, but nothing was displayed. I also tried to sync the `shadow` & `passwd` files, but there's still an error:               $ wc -l /etc/passwd /etc/shadow       17 /etc/passwd       17 /etc/shadow       34 total


title: Disa stig viewer don't read the log file

text: I'm working with a dev group deploying RHEL 6.5. I have used the stig-fix-el6 stig master to stig my system. I attempted to use the Disa stig viewer to view the log, but it doesn't read the file. It is there but it is greyed out?


title: How to give password directly while doing ssh command?

text: I am using Putty to connect to host xxxxxx. I want to produce a shell script in which I should give the command `ssh user@yyyyyy` along with my password instead of giving it when prompted.


title: How to write an alias function to make dd show progress bar?

text: According to this article, by replacing:               $ dd if=/dev/sda of=/dev/sdb [additional options]      with:               $ pv -tpreb /dev/sda | dd of=/dev/sdb [additional options]      one can augment the default `dd` behaviour by displaying a progress bar, similar to that in `wget`. This works well when I can remember to use it, so I thought aliasing the first command to the second was the logical next step. After some research, it would appear a simple `alias` in `.bash_rc` can't accomplish this. Could someone provide a BASH function to capture the `if=...` and work it into the resultant command?


title: Uniquely identifying a drive (not a partition)

text: I'm writing some automation scripts for full disk backups and I'd like to be _fairly_ precise with which devices are used. I know that one can uniquely identify a partition using UUIDs and `blkid`, but is there a way to uniquely identify a disk? My use case is that I'm not entirely sure which order disks will be mounted on the Clonezilla distribution, and I'd like to make sure that my backups are targeting the right (whole) disk for backup. Is there a way to find the device identifier (`/dev/sdX`) for a given disk by certain criteria?


title: Can't obtain the connected forms of some unicode grapheme clusters with combining diacritical marks

text: In Arabic and some other languages a character has two or three forms which will find its appropriate one automatically when you type a word (according to its previous and next characters). How can one change or add these automatic rules? For example there's no rule for this character and so if I set a key for this character, it will not find its appropriate form in a word, unless I set different keys for different forms . How can I add/program a mapping rule for this character? or set the same rule as this character for it? * * * I want to know which script, program, etc finds the appropriate form of character (ه) and how can I set the same thing for character (ۀ). there's a key for the first one and if I select Arabic language layout then press the key several times: هههه but for the second: ۀۀۀۀۀ. something is missing for the second character. I want to bridge the gap.


title: Make a deb package that installs data under /var/www/data

text: I recently set up a PPA on Launchpad for distributing my web application. Since it's a server-app, I need to put my data into `/var/www/html` which apparently is not wanted by Lintian ("dir-or-file-in-var-www"). So far, I accomplish the task via a `postinst` script, which copies the files after installation, but there has to be a more elegant way, isn't there?


title: Connectivity between 2 remote Linux machines

text: I have two remote machines, I'm running a script on one of them.   There's some part of the script that should be running on the other one, then the script will continue in its further tasks/commands.   For some reasons I cannot establish a `ssh-without-password` connection, additionally, I'd not want any password prompts. N.B: I have shared mount between them.


title: Bluetooth Device not working debian wheezy

text: i just installed debian wheezy on msi cx640dx. my bluetooth device not working. here is some information. Kernel version:               $uname -r     3.2.0-4-amd64      when i use `hcitool dev` it don't show any device.               $ hcitool dev     Devices:      and with scanning it says that i don't have that device:               $ sudo hcitool scan     Device is not available: No such device      i think following information is may be helpful.               $lsmod | grep -i blue     bluetooth             119455  12 btusb,ath3k,rfcomm,bnep     rfkill                 19012  5 cfg80211,bluetooth     crc16                  12343  2 ext4,bluetooth      and.               $ lspci      00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)     00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)     00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)     00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)     00:1a.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)     00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)     00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)     00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b5)     00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b5)     00:1c.5 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6 (rev b5)     00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)     00:1f.0 ISA bridge: Intel Corporation HM65 Express Chipset Family LPC Controller (rev 05)     00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 05)     00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)     01:00.0 VGA compatible controller: NVIDIA Corporation GF108 [GeForce GT 540M] (rev a1)     03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)     04:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)     05:00.0 Ethernet controller: Atheros Communications Inc. AR8151 v2.0 Gigabit Ethernet (rev c0)      and this is kernel ring buffer:               $ dmesg  |grep -i blue     [    7.408956] Bluetooth: Core ver 2.16     [    7.408977] Bluetooth: HCI device and connection manager initialized     [    7.408980] Bluetooth: HCI socket layer initialized     [    7.408982] Bluetooth: L2CAP socket layer initialized     [    7.408987] Bluetooth: SCO socket layer initialized     [    7.460972] Bluetooth: Generic Bluetooth USB driver ver 0.6     [    7.485478] Bluetooth: Atheros AR30xx firmware driver ver 1.0     [    7.537981] Bluetooth: Error loading firmware     [   22.886593] Bluetooth: RFCOMM TTY layer initialized     [   22.886602] Bluetooth: RFCOMM socket layer initialized     [   22.886605] Bluetooth: RFCOMM ver 1.11     [   23.042310] Bluetooth: BNEP (Ethernet Emulation) ver 1.3     [   23.042316] Bluetooth: BNEP filters: protocol multicast


title: getting last logins since $time

text: I want to get last logins from a certain date using `last` Running               last -f /var/log/btmp -t 20140723123000      Always shows my whole lastb log. This:               last -t 20140723123000      Shows my whole last log. eg:               bob     pts/1        172.16.14.37     Thu Feb 27 09:38 - 09:56 (4+00:18)     tim     pts/1        172.16.14.37     Wed Feb 19 11:32 - 09:34 (7+22:02)     root     pts/1        172.16.14.37     Mon Feb 17 09:50 - 12:04 (1+02:14)      The manual seems to say "Display the state of logins as of the specified time" There is no year outputted, is this an issue? Update: Red Hat 5.5 Running last -V returns : last: invalid option -- V (running man last shows no -V option) Running last -s returns : last: invalid option -- s (running man last shows no -s option)


title: After printing the previous line where the file contains a single token now need to traverse through the result to meet the requirement

text: I have used the below code to print the previous line where the file contains a single token               #! /bin/ksh          file=input.txt     while read line     do     awk 'NF == 1 { print LAST } { LAST=$0 }'     done < "$file"      Now I need to traverse through the result and need to check 9th position, 11th, 13th, etc. till the end of the line with the consecutive odd positions and if those positions are not matching with any of the mentioned numerics:               201      230      197      193      229      200      215      226      001      198       It should print the error as `CORRUPTED`, if not `AVAILABLE` should be printed. Here is the example of my file :               59 6 18 2014 169 7 14 2 7671912 7849744 201 4     60 6 19 2014 170 5 49 2 7671912 7849744 201 5     61 6 20 2014 171 6 8 2 7671912 7849744 201 6     62 6 23 2014 174 5 3 2 7671912 7849744 201 7     63 6 23 2014 174 7 17 2 7671912 7849744 201 8     64 6 24 2014 175 16 13 2 7671912 7849744 201 9     65 6 25 2014 176 8 20 2 7671912 7849744 201 10     10     1 1 49 6 16 2014 7 39 201 1 0 1043 <au_launchpad_back.gif> 201 gif <SIZE> 871     1 2 49 6 17 2014 13 15 201 1 0 1043 <au_launchpad_back.gif> 201 gif <SIZE> 871     1 3 49 6 18 2014 1 38 201 1 0 1043 <au_launchpad_back.gif> 201 gif <SIZE> 871     1 4 49 6 18 2014 7 14 201 1 0 1043 <au_launchpad_back.gif> 201 gif <SIZE> 871     1 5 49 6 19 2014 5 49 201 1 0 1043 <au_launchpad_back.gif> 201 gif <SIZE> 871      If we consider this as example 9th position is 7671912 NOTE : The code should be feasible at any other file as well.


title: Trying to understand Auto reconnect WIFI method

text: Iv'e found this method of reconnecting the WIFI dongle from this post , but want to be clear on how it works, before I try and implement it. > 1) Go to `/etc/ifplugd/action.d/` and rename the **ifupdown** file to > **ifupdown.original** ,   >  2) Then do: `cp /etc/wpa_supplicant/ifupdown.sh ./ifupdown`   > 3) Finally: `sudo reboot` 1) When is `/etc/ifplugd/action.d/ifupdown` called ?      2) What does the script `/etc/wpa_supplicant/ifupdown.sh` essentially do in laymens terms, it looks pretty complex to me; and when is it called too.      3) Could doing steps 1 to 3 cause any other unforeseen problems that would prevent my WIFI from working? I'm trying to implement this on a Raspberry PI, via SSH, without a keyboard and monitor in a hard to reach location. Iv'e tried to Google various bits, but got a bit lost!


title: Verify line endings from a text created by perl script

text: I am interested in seeing the contents of a text file in hex mode. I have tried `:%!xxd` and the problem is that I can not really understand which hex code represents each letter e.g. when you use an editor like Ultra Edit as you go over the hex code the corresponding letter is highlighted. So how can I do something similar in my case? To give you a context of my problem, I have a `perl` script that creates the file and I want to make sure that each line ends only with a `0x0A` (LF). Strange enough opening the file in `vim` and using `:set list`, I can see only `$` even if I explicitly did on the script `$line .= "\r\n"`


title: Alternative to .bashrc

text: Is `~/.bashrc` the only place where I can specify **user specific** `ENV` Variables, aliases, modifications to `PATH` variable, etc? I ask because it seems that `~/.bashrc` would be BASH only...


title: Fedora 7 server export in .bashrc not getting set

text: I'm trying to set the JAVA_HOME environment variable in my .bashrc but every time I log back in it gets unset again to its original value, below is my .bashrc file               # .bashrc          # User specific aliases and functions          export JAVA_HOME=/usr/java/latest          alias rm='rm -i'     alias cp='cp -i'     alias mv='mv -i'          # Source global definitions     if [ -f /etc/bashrc ]; then             . /etc/bashrc     fi      What am I doing wrong? Thanks


title: How do I set the preferred wireless network in Linux Mint 17?

text: I'm currently in an environment with two wireless networks: `OrganizationFoo`, which is present pretty much everywhere I go, and `OrganizationFooSubset`, which is only present in a certain location. When possible, I'd like to connect to `OrganizationFooSubset` because it's a faster, more reliable network. If this is out of range, I'd like to connect to `OrganizationFoo`. ![Network connections dialog](http://i.stack.imgur.com/fwK6o.png) How can I configure this from within Linux Mint 17 Cinnamon (64-bit)? I've found the network connections configuration dialog, but there are no "Move Up" or "Move Down" buttons, and drag-and-drop has no effect. In the actual `/etc/NetworkManager/system-connections/` directory, each connection gets its own file, and I don't see a master list where I could reorder them. Thoughts?


title: Permission Denied (PublicKey,keyboard-interactive) linux raspberry pi

text: I know there are a ton of questions on this. I have read almost all of them. I have also googled this problem to no avail I attempted to               git clone git@git.assembla.com:myhubname.git      and I get > Permission Denied (PublicKey,keyboard-interactive) as a response I have tried setting the `PasswordAuthentication` to `yes` and uncommenting it in `ssh_config` this didn't work I have set the `user.name` and `user.email` to what git repo is setup for. They actually have pretty clear instructions so I am at a loss to what I am doing wrong. I also saw an article that said modify the `authorized_keys` file in ssh which doesn't exist for me. I created it and it still didn't work.


title: What does the "rc" stand for in /etc/rc.d?

text: Does anybody have an idea about the full form of rc.d in, for example, `/etc/rc.d`? It contains scripts to used to control the starting, stopping and restarting of daemons. But what exactly is the meaning of **rc** here?


title: reinstall all FreeBSD packages with pkg_add, pkg_info

text: In OpenBSD, I have the possibility to take a snapshot with all my installed packages, with               pkg_info -m > output.txt       and then move this file to a different server and on this new server run a:               pkg_add -lz output.txt       and all packages will be re-installed. checking the man page from FreeBSD pkg_info and pkg_add I didn't find it. Is there any recipe to do it?


title: Share background jobs between shells

text: I use Screen with a lot (more than 10) of local Bash sessions inside. I send some processes (like `vi file`) to the background and switch between sessions very often and sometimes it's very annoying to find out where the file I have to edit is being already opened. Is there a way to share such background processes to be able to access it from any Bash sesssion inside this screen?


title: mv files to a different path which is constructed via a regex replacement

text: I have a directory full of files stored in subdirectories according to their filename, i.e.:               20d1/d325/52d1/20d1d32552d1a95249e62662fbdf924dd72c4027.jpg     ccaf/13cf/3199/ccaf13cf319930e80f5f2ad02525b93e1326c160.jpg     ec07/53bd/2355/ec0753bd2355fa8ec5cf5163e219c162cce3b03a.jpg     ...      As you can see, the first 12 characters of the filename are used to create three levels of subdirectories. Unfortunately four characters per directory name were chosen, and as it happens the amount of files has grown beyond the directory limit of 32000 entries per directory on the filesystem. So they need to be rewritten to:               20d/1d3/255/2d1/20d1d32552d1a95249e62662fbdf924dd72c4027.jpg     cca/f13/cf3/199/ccaf13cf319930e80f5f2ad02525b93e1326c160.jpg     ec0/753/bd2/355/ec0753bd2355fa8ec5cf5163e219c162cce3b03a.jpg     ...      So three letters per directory instead of four. There are a ton of files, so the process should be as fast as possible. I have dabbled around with `find`:               find /path/to/files -mindepth 4 -type f -regextype posix-extended -regex \     ".*/([0-9a-f]{4}/){3}(([0-9a-f]{3})([0-9a-f]{3})([0-9a-f]{3})([0-9a-f]{3})[0-9a-f]+\.\w+)"       This prints all the files nicely, but I'm not sure how to proceed with the rewriting. I'd like to use the regex capture groups in the rewrite process to rewrite the path to `$3/$4/$5/$6/$2` (backreferences to `find` regex). But `find` doesn't seem to support something like:               find ... -exec cp {} /elsewhere/$3/$4/$5/$6/$2 ;      What is the best approach to handle this? Some combination of `sed` and `xargs` (I'm not very experienced with those)? Should I go for a loop instead of a `find` action? I'm a little lost.


title: iptables string not dropping packet from tcp streams while using conntrack and string

text: I'm facing an unusual issue where specific TCP steams are not getting dropped by iptables; instead it's like iptables is just removing those specific packets. We're getting the following traffic:               x.x.x.x - - [27/Jul/2013:11:52:16 -0400] "POST /?CtrlFunc_wCsFbzYvU4RoBXK6fFpOyk7gT3cCl8 HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     x.x.x.x - - [27/Jul/2013:11:52:16 -0400] "POST /?CtrlFunc_orvy148BFILOSVYbeilptwz2BEHLOR HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     x.x.x.x - - [27/Jul/2013:11:52:16 -0400] "POST /?CtrlFunc_uqIxPsKm2UxPs7Z2UjCeuM2HjzRg9O HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     x.x.x.x - - [27/Jul/2013:11:52:16 -0400] "POST /?CtrlFunc_HKMPRTWYadfhkmpsuxz1368ADFIKMP HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     x.x.x.x - - [27/Jul/2013:11:52:16 -0400] "POST /?CtrlFunc_JKKKKKKKKLLLLLLLLLLLLLMMMMMMMM HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     x.x.x.x - - [27/Jul/2013:11:52:16 -0400] "POST /?CtrlFunc_8CJMQTXaehkoswz37AEHKOSVZchlpt HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     x.x.x.x - - [27/Jul/2013:11:52:16 -0400] "POST /?CtrlFunc_KRYfmu18FMSZgov29FMTahpw39GNUb HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     x.x.x.x - - [27/Jul/2013:11:52:16 -0400] "POST /?CtrlFunc_y26AEIMQUYcgkptx159DHLPTXbfjos HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     x.x.x.x - - [27/Jul/2013:11:52:16 -0400] "POST /?CtrlFunc_HHHHIIIIIIIIIIIIIJJJJJJJJJJJJJ HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     x.x.x.x - - [27/Jul/2013:11:52:16 -0400] "POST /?CtrlFunc_CCDDDDDDDDDDDDDDDDDDDDDEEEEEEE HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"      We've tried to block it with:               iptables -I INPUT -p tcp -s 0.0.0.0/0 --dport 80 -m string --string ".*CtrlFunc_.*" --algo bm -j DROP      and:               iptables -I INPUT -p tcp -s 0.0.0.0/0 --dport 80  -m conntrack --ctstate INVALID,NEW,ESTABLISHED,RELATED --ctstatus EXPECTED,ASSURED,CONFIRMED,NONE -m string --string "CtrlFunc_" --algo bm -j DROP      However what occurs is the following:               x.x.x.x - - [27/Jul/2013:11:52:34 -0400] "POST / HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     x.x.x.x - - [27/Jul/2013:11:52:34 -0400] "POST / HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     x.x.x.x - - [27/Jul/2013:11:52:34 -0400] "POST / HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     x.x.x.x - - [27/Jul/2013:11:52:34 -0400] "POST / HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     x.x.x.x - - [27/Jul/2013:11:52:35 -0400] "POST / HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     x.x.x.x - - [27/Jul/2013:11:52:35 -0400] "POST / HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     x.x.x.x - - [27/Jul/2013:11:52:35 -0400] "POST / HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     x.x.x.x - - [27/Jul/2013:11:52:35 -0400] "POST / HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"     x.x.x.x - - [27/Jul/2013:11:52:35 -0400] "POST / HTTP/1.1" 403 380 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"      Is it possible to block TCP based streams with iptables?


title: linux on arm bios-less netbook running android

text: I have a netbook running Android 4.0 with an ARM processor. It does not have a normal bios at the startup so I cannot boot from USB. Is there a way to load a Linux distro in it? This is the netbook: http://www.amazon.co.uk/Notebook-Sandwich-Processor-supported- Compatible/dp/B0090463E4


title: Getting information about a process' memory usage from /proc/pid/smaps

text: For a given process in `/proc/<pid>/smaps`, for a given mapping entry what are:   1. Shared_Clean   2. Shared_Dirty   3. Private_Clean   4. Private_Dirty Is `Shared_Clean` + `Shared_Dirty` the amount of memory that is shared with other processes? So it is like shared RSS? Similarly is `Private_Clean` + `Private_Dirty` the amount of memory that is **available for only one process**? So it is like private RSS? Is the PSS value = PrivateRSS + (SharedRSS / number of processes sharing it)? _**Some more questions after reading this link:LWN**_ _Now lets talk about the process as a whole, whose smaps entry we are looking at._ I noticed that if I do `Shared_Clean` + `Shared_Dirty` + `Private_Clean` + `Private_Dirty` for every smaps entry for the process I get the RSS of the process as reported by `ps`, which is pretty cool. For e.g.               ps -p $$ -o pid,rss      Will give me the (approx) same value for rss as the sum of every `Shared_Clean` , `Shared_Dirty` , `Private_Clean` , `Private_Dirty` entry in /proc/$$/smaps. **But what about PSS** for the entire process? So, from the example above how do I get the PSS for $$ ? Can I just add the PSS entry for every smaps mapping and arrive at PSS for $$ ? **And what about USS** for the entire process? Again taking the example above I am guessing that I can arrive at the USS for $$ by summing up only the Private_* entries for every smaps entry for $$..right? Notes:   PSS= Proportional set size.   USS= Unique set size.


title: linux + match IP ADDRESS with 3 octets or with 4 octets

text: how to match IP address with 4 octets or with 3 octets in one command? target - match xxx.xxx.xxx or xxx.xxx.xxx.xxx ( syntax should fit for Linux and Solaris ) how to merge the following commands in one command ?                echo $IP_ADDRESS  | grep  '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'      echo $IP_ADDRESS  | grep  '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}'       I also try this ( But its not work )                       echo $IP_ADDRESS | egrep "[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}|[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}"


title: Learning how to build my own linux kernel

text: Reference - http://www.linode.com/wiki/index.php/PV- GRUB#Building_Your_Own_Kernel > In order to work with Xen, a number of options that must be selected:               CONFIG_PARAVIRT_GUEST=y     CONFIG_XEN=y     CONFIG_PARAVIRT=y     CONFIG_PARAVIRT_CLOCK=y     CONFIG_XEN_BLKDEV_FRONTEND=y     CONFIG_XEN_NETDEV_FRONTEND=y     CONFIG_HVC_XEN=y     CONFIG_XEN_BALLOON=y     CONFIG_XEN_SCRUB_PAGES=y      Where exactly do I specify these configuration? I have done these steps so far:-               wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.3.3.tar.bz2     tar -xf linux-3.3.3.tar.bz2     cd linux-3.3.3     make menuconfig      `make menuconfig` brings me to the `ncurses` "GUI" but there are so many options I am completely lost.... Any suggestions how I should proceed?


title: Replace all occurences of \ except \N

text: I have a file like this:               1,2,subjects,\mat\hs,unix\,\Nato,\N,123,\N      I want to replace all occurences of \ with #, except for \N, such that the output looks like this:               1,2,subjects,#mat#hs,unix#,#Nato,\N,123,\N      I am trying to write a sed command which looks like-               sed -e 's@\\([^N])@#\1/g' filename      but this will fail for all values wherever there is a \N at the start for ex. `\Nato` in above example. Could somebody please help me figure out a sed command(regex) for my requirement.


title: How do I make KDE open mail links to a webmail client in a browser?

text: I use webmail,specifically gmail. How do I make it so that when I click a mailto: link it opens gmail, in a browser (chromium) with the email address, in KDE? _bonus points for listing other browsers and other popular webmails_


title: Who started xterm in my debian xterm+lightdm kiosk system?

text: I have stripped my full desktop debian 7 x64 to the bare, leaving just xorg and lightdm for a kiosk application. I have changed the lighdm configuration to auto-login a user. When I boot, this works fine, xorg starts up and without prompt the user is logged in. However upon login an xterm window starts in the upper left-hand corner of the screen. I have tried in vain to figure out which instance actually started that xterm! I would of course want to replace it with my kiosk binary wrapped in a watchdog script.


title: Fluxbox dual screen configuration

text: I recently set up a second monitor for my home computer. Through the use of nvidia-settings I was able to set up my two monitors. My second monitor is set up as a seperate X screen to the right of the main one, and Xinerama is enabled. The effect that this has is it treats both monitors as one huge monitor, and as such the background and toolbar are stretched across both screens I have been unable to find a way to keep my toolbar on one screen and have two seperate backgrounds on each monitor. Does anybody know of such a method?


title: Open Character Device without creating a Device Node

text: I'm having an issue where a 3rd party application is opening a device node it shouldn't. I wrote a SPI Slave device driver that does some processing of messages. When the driver loads its in "Initialize Mode" which only replies to a specific message. To re-initialize communications I must unload and reload the driver. The problem is that the system has a 3rd party application, running as root, that opens all character devices. The only way to make this all work is to stop the app and unload which causes a huge problem with the over all project. Is it possible to open a connection to a Character Device without actually having a device node? Right now I use fopen('/dev/spi') and everything works fine until I need to reload and the above issue ensues. Is there any sort of system call that can be made that would result in a file descriptor to a specific Major/Minor node number without having the actual /dev/spi file?


title: Strange kind of "stealth" directory on Linux

text: I am in a Linux machine and am working with a directory that is aptly named "stealth", because it runs and hides! Take a look at this behavior:               bash-3.2$ ls /net     bash-3.2$ ls -la /net     total 4     drwxr-xr-x  2 root root    0 Jun 19 16:10 .     drwxr-xr-x 29 root root 4096 Jun 15 09:51 ..     bash-3.2$ ls /net/stealth     dir1  dir2  SERVER_LINK     bash-3.2$ ls /net     stealth     bash-3.2$ ls -la /net     total 4     drwxr-xr-x  3 root root    0 Jun 19 16:59 .     drwxr-xr-x 29 root root 4096 Jun 15 09:51 ..     dr-xr-xr-x  6 root root    0 Jun 19 16:59 stealth     bash-3.2$ uname -a     Linux cfnyps1u 2.6.18-348.18.1.el5 #1 SMP Fri Sep 6 12:37:18 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux      (Note the difference between the output of ls /net before and after the contents of the stealth directory are listed) What is the name of this type of directory, and why would it "hide" until it is "found"? I eventually figured out what was going on, but I'd never seen this behavior before and it definitely makes the directory's contents harder to find using standard approaches.


title: What's the difference between ULOG and NFLog?

text: Various places suggest to use ULOG or NFLOG instead of LOG for getting dedicated netfilter logging (see for example here or here). From looking at `man iptables` those two look quite alike. Except that NFLOG talks about some "nfnetlink_log backend" while ULOG doesn't talk about any backend.   1. What's the difference?   2. Are there typical situations for using one or the other?


title: multiplication of every line

text: I would like to calculate a value on every line of a file such as this:               1  1441792,11534336     2  1048576,8388608     3  1441792,1153433     4  1966080,15728640     5  393216,3145728     6  2621440,20971520     7  2490368,19922944      I need to acquire the second value (`11534336`, `8388608`, [...]) and multiply by, for example, 3, and save this value to a new file.


title: PPPoE connection problem

text: I have just installed Backtrack 5 R2 and I'm finding it difficult to make a DSL internet connection. What troubles me is that I think I have all the steps figured out, and after completing them, the browser still won't load the page. The steps are:   1. run `pppoeconf`   2. after the window pops out i follow the steps, enter my username & password and after finishing (basically just approving everything it says by clicking on yes) it automatically starts `pon dsl-provider`   3. Finally I start the networking service. The browser doesn't load the requested page. I don't know if I'm doing anything wrong here. I have tried to start the networking service before step 1 but it still doesn't load. However, after starting it, the konsole outputs `networking stop/waiting` (both times). It might be an issue. Also I instantiate my network interface which is eth0 but still doesn't work. It is a wired connection btw.


title: Lock screen shortcut not working after update of Fedora 16

text: I recently ran a bunch of updates (I didn't pay attention to which, I was just prompted to update a bunch of stuff), and after running them, the lock-screen shortcut (CTRL-Alt-L) no longer works. I tried modifying the keyboard shortcut in the keyboard system settings to no avail. Does anyone know what the problem might be or how I can find out?


title: wpa_supplicant connection issue: iw dev wlan1 link shows connection, but network unreachable

text: I've been testing a Wifi card in my machine and I can't seem to get it to connect to my home router. The card is a `ralink rt37`, I compiled the modules that I needed into the kernel and downloaded a firmware file, I can now see the card using `ifconfig -a`. I can also bring the card up using `ip link wlan1 up`. Then when the device is up, if I run `iw dev wlan1 scan` I can see the SSID of my home router. Now it seems the card is functional I want to connect to my router. The router is secured with WPA, so I need to use `wpa_supplicant` (as far as I understand). I tried following this tutorial to get set up. I have followed their steps and have the following files:   * /etc/wpa_supplicant.conf:              ctrl_interface=/var/run/wpa_supplicant     ap_scan=1          network={       key_mgmt=NONE     }          network={     ssid="SKY183C6"     scan_ssid=1     proto=WPA RSN     key_mgmt=WPA-PSK     pairwise=CCMP TKIP     group=CCMP TKIP     psk=719d0a2d74b09536ce21cecda0851142a2e83d2a56b406098b22012ea0f536f9     }        * /etc/network/interfaces:              # Configure Loopback     auto lo     iface lo inet loopback          auto eth0     iface eth0 inet static      address 192.168.0.20     netmask 255.255.255.0          auto wlan1     iface wlan1 inet static     address 192.168.0.90     netmask 255.255.255.0     gateway 0.0.0.0     pre-up wpa_supplicant -Dwext -iwlan1 -c/etc/wpa_supplicant.conf     post-down killall -q wpa_supplicant      I can then run the command `wpa_supplicant -Dwext -iwlan1 -c/etc/wpa_supplicant.conf &` and then run `ip dev wlan1 link` and I see the following output:                   Connected to 4c:17:eb:a1:83:c7 (on wlan1)     SSID: SKY183C6     freq: 2462     RX: 295890 bytes (1942 packets)     TX: 53549 bytes (1379 packets)     signal: -82 dBm     tx bitrate: 36.0 MBit/s       It seems that I'm past the authentication stage but I don't have a connection, there's no IP assigned to wlan1, and when I try `ping 8.8.8.8` I get a message saying `network unreachable`. If I run `route` I see this:                   Kernel IP routing table         Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         192.168.0.0     *               255.255.255.0   U     0      0        0 eth0      My suspicion is that I've not set the interface file up properly, in particular the `gateway` line. If anyone can give me any help I'd be really grateful. Sorry for the long post, just wanted to give as much of the relevant info as possible


title: Pipe system sound to another computer

text: I have no speakers in my PC (Cent-OS 5.5) but there is a stereo speaker connected to the computer next to my computer (also Cent-OS 5.5). Both computers are networked. Is there any way to pipe my system sounds to that computer's speaker?


title: Why wouldn't Perl CGI script run

text: I'm using Apache on CentOS and am trying to run a Perl CGI script as directory index so it will run automatically as a subdomain. I added `DirectoryIndex script.cgi` and added a `Directory` stanza noting the path `/var/www/folder` enabling the script to run. The only way the script would run is if I also add a `File *.cgi` stanza within the directory stanza (or even outside of it) and move the relevant section to it:                   Options +ExecCGI and SetHandler perl-script      I'm still learning Apache, and wondering why just referencing the folder wasn't enough. Why do I also have to add a File stanza and reference `*.cgi`? The CGI script would have been the only file in the folder.


title: How to set up a taskbar in enlightenment DE?

text: There is no taskbar in e17 and it is not comfortable to check and switch between open windows. While ibar module provides some limited functionality it shows only minimized windows. There was itask module, but it is discontinued as it seems. Is there any other way to set up a taskbar in e17?


title: What are the absolute minimal requirements to boot a linux system

text: I figured that I would need a kernel image and a bootloader (grub), but is there anything else needed to boot a linux system?


title: Code templates with emacs

text: How can I configure `emacs` to generate some code skeleton? For instance, for C files:               #include <stdio.h>     #include <stdlib.h>          int main (int argc, char **argv) {              return EXIT_SUCCESS;     }      or something more dynamic in Python:               #!<insert result of `which python` here>          def main():          if __name__ == "__main__":         main()      I would like to define 2 modes for inserting the templates:   * create a function `insert-template` (or something), binding it to a certain key combination (`C-c C-t`) that would insert the correct template according to the major mode.   * create an option to automatically insert the template upon file creation, detecting the correct type by the filename suffix (similar to how major mode is detected). This option should be easily set on/off in the `.emacs` file. Ideally I'd like to avoid 3rd party modules/packages. But I'm not completely against it.


title: Create and set custom keyboard layout

text: I want to create and set a custom keyboard layout with setxkbmap. I created a file in `~/.xkb/prog` with this content:               partial default alphanumeric_keys     xkb_symbols "basic" {          include "latin(type4)"          name[Group1]="es for developers";          key <AE01> {[           1,           exclam,    exclamdown,          bar   ]};         key <AD03> {[           e,                E,      EuroSign,     sterling   ]};     key <AB06> {[           n,                N,        ntilde,       Ntilde   ]};         key <AB07> {[           m,                M,            mu,           mu   ]};         key <AB10> {[       slash,         question,  questiondown,    dead_hook   ]};          include "level3(ralt_switch)"     };       And I tried to load it with `setxkbmap -I$HOME/.xkb "prog"`, but I get a 'Error loading new keyboard description' I also tried it with `setxkbmap -I$HOME/.xkb "prog" -print | xkbcomp -I$HOME/.xkb - $DISPLAY`, but I get this error: 'Can't find file "prog" for symbols include'


title: Why can't mv preserve permissions when moving between Android SD cards?

text: After mounting both SD cards on an Android phone using the "USB mass storage" mode I keep getting these messages when moving files between them:               mv: failed to preserve ownership for ‘/.../foo’: Function not implemented     mv: preserving permissions for ‘/.../foo’: Function not implemented      Is this a problem in any way? And is it simply because of the possibly unusual combination of file systems?               $ mount | grep /run/media     /dev/sdc on /run/media/... type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)     /dev/sdb on /run/media/... type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=100,fmask=0022,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)


title: "Remote function call interrupts" (CAL in /proc interrupts). What is it?

text: I'm running a test program which generates a large number of threads and asynchronous I/O. I'm seeing very high counts of these interrupts in /proc/interrupts, the program cannot scale beyond a certain point because CPUs are 100% saturated with softirq processing. According to: http://www.kernel.org/doc/man- pages/online/pages/man5/proc.5.html CAL stands for 'remote function call interrupt' but that's all the info I can find on google. So...what does that mean? I have smp_affinity assigned for my I/O adapter cards and those are not the CPUs taking a huge number of CAL interrupts. Is it a sign my program is running with incorrect SMP affinity?


title: htaccess Rewrite Issue

text: I have been attempting to correct an issue that I'm experiencing with WordPress. Following the advice on the WordPress.SE site I've tried to resolve it with an `.htaccess` rewrite rule, but for some reason I cannot get the rule to quite work properly. I've shorted my urls here for legibility. My wordpress site is at `/r.info/blogs/th`. I installed the network features to allow a friend to blog under the same site without making a second installation. Unfortunately the new url for his part of the site comes out as `/r.info/blogs/th/st` which is not what I had in mind. I would prefer `/r.info/blogs/st`. Moving the site itself seems very difficult without data loss, I've already investigated this through WP.SE.               -bash-3.2$ cat .htaccess     #RewriteEngine On    # Turn on the rewriting engine     #RewriteRule    /blogs/st/(.*)$    /blogs/th/st/$1    [NC]          # BEGIN wtwp_cache     <IfModule mod_mime.c>                  # Text             AddType text/css .css             AddType application/x-javascript .js             AddType text/html .html .htm             AddType text/richtext .rtf .rtx             AddType text/plain .txt             AddType text/xml .xml                  # Image             AddType image/gif .gif             AddType image/x-icon .ico             AddType image/jpeg .jpg .jpeg .jpe             AddType image/png .png             AddType image/svg+xml .svg .svgz                  # Video             AddType video/asf .asf .asx .wax .wmv .wmx             AddType video/avi .avi             AddType video/quicktime .mov .qt             AddType video/mp4 .mp4 .m4v             AddType video/mpeg .mpeg .mpg .mpe                  # PDF             AddType application/pdf .pdf                  # Flash             AddType application/x-shockwave-flash .swf                  # Font             AddType application/x-font-ttf .ttf .ttc             AddType application/vnd.ms-fontobject .eot             AddType application/x-font-otf .otf                  # Audio             AddType audio/mpeg .mp3 .m4a             AddType audio/ogg .ogg             AddType audio/wav .wav             AddType audio/wma .wma                  # Zip/Tar             AddType application/x-tar .tar             AddType application/x-gzip .gz .gzip             AddType application/zip .zip     </IfModule>          <IfModule mod_expires.c>             ExpiresActive On                  # Text             ExpiresByType text/css A31536000             ExpiresByType application/x-javascript A31536000             ExpiresByType text/html A3600             ExpiresByType text/richtext A3600             ExpiresByType text/plain A3600             ExpiresByType text/xml A3600                  # Image             ExpiresByType image/gif A31536000             ExpiresByType image/x-icon A31536000             ExpiresByType image/jpeg A31536000             ExpiresByType image/png A31536000             ExpiresByType image/svg+xml A31536000                  # Video             ExpiresByType video/asf A31536000             ExpiresByType video/avi A31536000             ExpiresByType video/quicktime A31536000             ExpiresByType video/mp4 A31536000             ExpiresByType video/mpeg A31536000                  # PDF             ExpiresByType application/pdf A31536000                  # Flash             ExpiresByType application/x-shockwave-flash A31536000                  # Font             ExpiresByType application/x-font-ttf A31536000             ExpiresByType application/vnd.ms-fontobject A31536000             ExpiresByType application/x-font-otf A31536000                  # Audio             ExpiresByType audio/mpeg A31536000             ExpiresByType audio/ogg A31536000             ExpiresByType audio/wav A31536000             ExpiresByType audio/wma A31536000                  # Zip/Tar             ExpiresByType application/x-tar A31536000             ExpiresByType application/x-gzip A31536000             ExpiresByType application/zip A31536000     </IfModule>     <FilesMatch "\.(?i:css|js|htm|html|rtf|rtx|txt|xml|gif|ico|jpg|jpeg|jpe|png|svg|svgz|asf|asx|wax|wmv|wmx|avi|mov|qt|mp4|m4v|mpeg|mpg|mpe|pdf|swf|ttf|ttc|eot|otf|mp3|m4a|ogg|wav|wma|tar|gz|gzip|zip)$">             <IfModule mod_headers.c>                     Header set Pragma "public"                     Header append Cache-Control "public, must-revalidate, proxy-revalidate"                     Header unset ETag             </IfModule>     </FilesMatch>     <FilesMatch "\.(?i:css|js|gif|ico|jpg|jpeg|jpe|png|pdf|swf|ttf|ttc|eot|otf)$">         <IfModule mod_headers.c>                     Header unset Set-Cookie             </IfModule>     </FilesMatch>     # END wtwp_cache          # BEGIN wtwp_security     <IfModule mod_rewrite.c>             RewriteEngine On             RewriteBase /blogs/th/st/             RewriteRule ^wp-admin/includes/ - [F,L]             RewriteRule !^wp-includes/ - [S=3]             RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]             RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]             RewriteRule ^wp-includes/theme-compat/ - [F,L]     </IfModule>     <Files "wp-config.php">             Order allow,deny             Deny from all     </Files>     Options -Indexes     # END wtwp_security          # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /blogs/th/     RewriteRule ^index\.php$ - [L]          # add a trailing slash to /wp-admin     RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]          RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]     RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]     RewriteRule . index.php [L]     </IfModule>          # END WordPress      I've tried including something simple like `RewriteRule ^r.info/blogs/st/$ r.info/blogs/th/st/` at the top of the file (with an engine on line as well). I also tried, per the suggestion on WP.SE:               RewriteCond %{REQUEST_URI} "/th/st/"     RewriteRule (.*) $1 [L]      But I'm assuming I insufficiently understand what the rule is in fact doing. I'm getting 500 errors when using the above.


title: gtk2/mate apps are choppy on debian testing

text: I have recently upgraded to a core-i7 system and now all the apps from mate (GTK2 based) are very slow. Basically when I switch to a workspace that has a couple mate-terminals open, they are redrawn as if these were sent over the network. GTK3 apps and firefox work properly and are refreshed instantly. I'm running Debian testing. I have tried to reinstall xorg and related packages and everything seems to work fine except for this. Here is my xorg.log. Any hints?


title: How to create a variable $ldir at your home directory that contains the relative path to letters?

text: If there's a directory on your Desktop called letters: 1) How to create a variable `$ldir` at your home directory that contains the relative path to letters? 2) How to copy a text file `f1.txt` to the directory letters by using the variable `$ldir`?


title: Is it possible to use the meta-files in rtorrent?

text: I've used `rtorrent` on some magnetic-links and it created some "meta"-files, which seemed to be named by the hash... Is there a way to somehow use these meta-files to start `rtorrent` to download the torrents, rather than having to locate the actual magnet? E.g. rtorrent 637778299.meta or somethin?


title: Nautilus ugly with custom GTK themes

text: Nautilus, for some reason, becomes very ugly when using custom GTK+ themes. I can't figure out why. There are only a few ones GTK+ themes work properly with Nautilus. ![enter image description here](http://i.stack.imgur.com/PjVc1.png) How do I fix this? Is this a Nautilus issue? Here's a list of data that I think might be relevant:   * I'm using GNOME 3 on ArchLinux   * Icon themes aren't working under any account but root for Nautilus (works for other applications)   * Window themes are being ignored by Nautilus, Gnome Tweak Tool and System Monitor   * System restart, GNOME restart or Nautilus restart does not fix anything   * Some themes work (Zukitwo and Numix)


title: Change the number of the partition from sda1 to sda2

text: I have a disk with two partitions: sda1 and sda2. I would like change the number of sda1 to sda2 and sda2 to sda1. It's possible but I don't remember the procedure. i.e. My first partition will be sda2 and the second sda1, so I need specify a manual order, not a automatic ordering like in fdisk -> x -> f. How I change the order? Links to manuals or tutorials are also useful. Thanks. The reason: I have a application that needs read data from sda1 but the data is in sda2. Change the partition table is the fast solution for this issue. The system isn't critical but I don't want halt the system for too much time. **Update** : the fdisk version of OpenBSD includes that functionality.


title: How to use grep/ack with files in arbitrary encoding?

text: On my Linux desktop I have a UTF-8 locale. When I try to search some KOI8-R encoded files with grep (ack), it fails. If I manually encode the pattern into KOI8-R and pass that as an argument, it works. Is it possible to tell grep what encoding to use for the pattern? Or any other tool?


title: Can I use dd to make an ISO of a DVD that is only as large as the data on the DVD?

text: I am starting to make backups of my movie DVDs at home. I am using DD to make ISO images of my DVD as follows:               dd if=/dev/dvd of=~/dvd/abc.iso      However, even though the content of the DVD is only, for example, 5.4GB (I check this with `du -sh`), the resulting image is still 7GB, so it seems as if it is making an ISO image of the entire disc, even the unused portion. Is there a way to make an ISO backup of the DVD using dd that is only as large as the used portion of data on the disc?


title: Fdisk partition alignment, NAND, not showing specified heads

text: I ran `fdisk` with these options,               fdisk -H 32 -S 32 /dev/sdc      Then I made a new label, and created an aligned first partition.               Disk /dev/sdc: 7743 MB, 7743995904 bytes     32 heads, 32 sectors/track, 14770 cylinders, total 15124992 sectors      However when I run,               fdisk -l /dev/sdc      My heads are reported at 16, like this,               Disk /dev/sdc: 7743 MB, 7743995904 bytes     16 heads, 32 sectors/track, 29541 cylinders, total 15124992 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0xd84c4698          Device Boot      Start         End      Blocks   Id  System     /dev/sdc1            8192    15124991     7558400    c  W95 FAT32 (LBA)      Why does the disk not show the 32, as I specified when creating the partitions? Is it just displaying 16, but everything is still actually as I specified? Really just want to make sure I'm still correctly aligned.


title: Set up svn for an existing project

text: I have an existing project “abc” with the path `/home/abc`. I want to set up a subversion repository in Ubuntu for this project. I have already installed subversion with the help the article “Setting Up an Ubuntu Subversion Server”. I did not understand the checkout portion and how to connect SVN to my “abc” project.


title: Storing the private key password for auto-mounting SSHFS?

text: I connect to a server via `sshfs` using private/public key pairs. My local key needs a passphrase to use. **NOTE:** The public key has already been copied to the remote server. I'm looking for a method to cache the credentials for this key! I want to auto-mount this share at login (to a MATE session), and need a secure way of storing the password for the key (as opposed to the SSH password, since the server does not accept passwords). Right now the command is:               $ sshfs me@mydomain.com:/ /home/me/MyMountPoint      But I am prompted for a password to unlock the key. I could make the key not require a password, but if it's safer to use a password protected key and store the password somewhere else, I would favour that over a non-password key. What would be the recommended way of doing this? If the password file has permissions of `600`, then only my user could see it. But then again, the key should already be `600` and only my user could get at it in the first place. Is there a best practice for storing the key password for auto-mounting SSHFS?


title: Issue in ubuntu disk size (vitualbox image)

text: I am having an issue while increasing the disk size for `Ubuntu` where I see that pvdisplay doesn't show all the partition, and only show `/dev/sda5`. Also `Ubuntu` disk size is 52.4 GB, but the disk is still showing 11G. Any suggestions?               Disk /dev/sda: 52.4 GB, 52428800000 bytes     255 heads, 63 sectors/track, 6374 cylinders, total 102400000 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes                  Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048      499711      248832   83  Linux     /dev/sda2          499712      501757        1023   8e  Linux LVM     /dev/sda3          501758    23486463    11492353    5  Extended     /dev/sda5          501760    23486463    11492352   8e  Linux LVM      The output of `pvdisplay` command is as below.               root@mubuntu:~# pvdisplay       --- Physical volume ---       PV Name               /dev/sda5       VG Name               mubuntu-vg       PV Size               10.96 GiB / not usable 2.00 MiB       Allocatable           yes (but full)       PE Size               4.00 MiB       Total PE              2805       Free PE               0       Allocated PE          2805       PV UUID               upfW6u-dHEc-0ub9-0FAJ-hmFW-10lK-po2nwS      **EDIT** I created the VM using VirtualBox Image. The output of `df -h` command is as below.               root@mubuntu:~# df -h     Filesystem                    Size  Used Avail Use% Mounted on     /dev/mapper/mubuntu--vg-root   11G  9.8G     0 100% /     none                          4.0K     0  4.0K   0% /sys/fs/cgroup     udev                          991M  4.0K  991M   1% /dev     tmpfs                         201M  1.1M  200M   1% /run     none                          5.0M     0  5.0M   0% /run/lock     none                         1001M     0 1001M   0% /run/shm     none                          100M     0  100M   0% /run/user     /dev/sda1                     236M   66M  158M  30% /boot      Thanks. After using the Gparted, I followed the steps as below, and it worked.               root@mubuntu:~# vgextend mubuntu-vg /dev/sda4       Volume group "mubuntu-vg" successfully extended          root@mubuntu:~# lvextend -l +9632 /dev/mubuntu-vg/root       Extending logical volume root to 48.08 GiB       Logical volume root successfully resized          root@mubuntu:~# resize2fs /dev/mubuntu-vg/root      resize2fs 1.42.9 (4-Feb-2014)     Filesystem at /dev/mubuntu-vg/root is mounted on /; on-line resizing required     old_desc_blocks = 1, new_desc_blocks = 4     The filesystem on /dev/mubuntu-vg/root is now 12604416 blocks long.          root@mubuntu:~# df -h     Filesystem                    Size  Used Avail Use% Mounted on     /dev/mapper/mubuntu--vg-root   48G  9.8G   36G  22% /


title: BitchX Basic Set-UP

text: I hear good things about BitchX and I want to try it. but it seems BitchX is very different from Weechat or IrssI. It doesn't start each channel buffer to its related window; running script is very different on it and last but not least its config file isn't so easy to create.   I searched and found out I have to create windows for each buffer. I have some question?!   1. How could I set BitchX to start every channel in different window?    2. How exactly multi-servers is done in BitchX?   3. What would BitchX config file look like? (a valid updated sample)


title: How to write log before instalation

text: My computer crashes while trying to load the kernel from a LiveCD with the message "unable to handle kernel paging request". I'd like to reproduce the error output on a forum to get some ideas on where to dig, but I can't figure out how to save that trace except by taking a picture with a camera. Is there some option to save the output on a hard drive, or at least allow scrolling to the beginning of the error? I currently have Windows and Ubuntu 9.10 installed, and I'm trying to install Ubuntu 12.04. The same error happens with other Linux distributions (openSUSE 13.1, Linux Mint 16).


title: How to scroll to the bottom or to the beginning of a terminal session in xterm?

text: If I want to move up or down in `xterm` page by page I do it with `<shift> \+ <PgUp>` and `<shift> \+ <PgDn>`. But how can I completely move to the bottom or to the beginning of the terminal session without going one page at a time?


title: How to write a bash script, that logs onto an other machine to do stuff?

text: Is it possible to write a bash script, that   1. would be started from machine A, logs in on a different machine B by ssh (both machines A and B would be Linux-Machines),   2. copys some files on to machine B   3. runs a python script a given python script on these machines.   4. transfers the results back to machine A   5. logs off from machine B. Is this technically doable?


title: Install Arch Linux alongside Ubuntu 12.04

text: I have a windows 8.1 on which I installed Ubuntu 12.04 (dual OS). Now I also want to install Arch Linux alongside windows and ubuntu. Please tell me the how to do this on Ubuntu. I have a gparted Partion Editor. Also I installed the Arch linux which took me 24 minutes. But uploading it is taking forever. Am I on the right track? Please explain what to do next.


title: Solaris equivalent for depth/prune?

text: I am trying to find some files inside a directory. By default, the find `command` is searching the directory which I have specified and it's sub directories. I tried to use `depth/maxdepth` and `prune`, but nothing helped to overcome this. Can somebody point out the right way to use depth/prune in Solaris? My code looks like this:               find file_path -depth 1 -name '*.log'      I am getting the following error:               find: bad option 1     find: [-H | -L] path-list predicate-list


title: How do I make "black&white" the default?

text: When I print something (Firefox 5 but also other apps), the option "color" is always set to "Color (CMYK)". How do I make "monochrome" or "black & white" the default? This is a Kyocera FS-C5100DN with CUPS 1.4.6-5ubuntu1.3. **[EDIT]** Output of `lpstat -d -v`:               system default destination: FS-C5100DN     device for FS-C5100DN: socket://192.168.0.24      So the question is now: Can I change the default somehow on my own computer without changing settings on the server?


title: logrotate doesn't work for munin after last update on OpenSUSE 11.4

text: I'm using munin 1.4.5 on OpenSUSE 11.4. Lately logrotate was updated to fix some permission problems and after that complained with               Mar  3 12:15:05 lucien logrotate: error: "/var/log/munin" has insecure permissions. It must be owned and be writable by root only to avoid security problems. Set the "su" directive in the config file to tell logrotate which user/group should be used for rotation.     Mar  3 12:15:05 lucien logrotate: error: error reading /var/log/munin/munin-html.log: Bad file descriptor     Mar  3 12:15:05 lucien logrotate: error: error reading /var/log/munin/munin-limits.log: Bad file descriptor     Mar  3 12:15:05 lucien logrotate: error: error reading /var/log/munin/munin-update.log: Bad file descriptor     Mar  3 12:15:05 lucien logrotate: error: error reading /var/log/munin/munin-graph.log: Bad file descriptor     Mar  3 12:15:05 lucien logrotate: error: error reading /var/log/munin/munin-node.log: Bad file descriptor      So I addded `su` directives to `/etc/logrotate.d/munin` and `/etc/logrotate.d/munin-node`:               /var/log/munin/munin-html.log     /var/log/munin/munin-nagios.log     /var/log/munin/munin-limits.log     /var/log/munin/munin-update.log {         su munin munin         daily         missingok         rotate 7         compress         copytruncate         notifempty         create 640 munin munin     }     /var/log/munin/munin-graph.log {         su munin www         daily         missingok         rotate 7         compress         copytruncate         notifempty         create 660 munin www     }     /var/log/munin/munin-cgi-graph.log {         su wwwrun munin         daily         missingok         rotate 7         compress         copytruncate         notifempty         create 640 wwwrun www     }          /var/log/munin/munin-node.log {         su munin munin         daily         missingok         rotate 7         compress         copytruncate         notifempty         create 640 munin munin     }      Now logrotate doesn't rotate anymore.               Mar  5 12:15:05 lucien logrotate: error: error reading /var/log/munin/munin-html.log: Bad file descriptor     Mar  5 12:15:05 lucien logrotate: error: error reading /var/log/munin/munin-limits.log: Bad file descriptor     Mar  5 12:15:05 lucien logrotate: error: error reading /var/log/munin/munin-update.log: Bad file descriptor     Mar  5 12:15:05 lucien logrotate: error: error reading /var/log/munin/munin-graph.log: Bad file descriptor     Mar  5 12:15:05 lucien logrotate: error: error setting owner of /var/log/munin/munin-cgi-graph.log-20120305: Operation not permitted     Mar  5 12:15:05 lucien logrotate: error: error opening /var/log/munin/munin-node.log: Permission denied      An `ls -la` of `/var/log/munin/` is here. How do I get logrotate to work again with munin?


title: How do I setup two or more IPv6 address on one NIC in FreeBSD?

text: How can I assign two or more IPv6 address on one NIC. I tried Google but no luck. I've done it with ipv4 but ipv6 can not.


title: Regex : all greek letters with 5 unique letters (meaning that each letter only appears once)

text: Another one I can't seem to solve : all greek letters with 5 unique letters (meaning that each letter only appears once). my solution :               egrep '(.)([^/1])([^/1/2])([^/1/2/3])([^/1/2/3/4])' greek.txt      So What I think I am saying :   * match any first character   * every consecutive character can't be any of the previous patterns But what comes out :               alpha     gamma     delta     epsilon     theta     kappa     lambda     omicron     sigma     upsilon     omega      Alpha, gamma, they have characters that are not unique. Any hints or tips on what I am doing wrong ?


title: pnmtops subprocess hang when called from a scanadf script

text: I have been happily using `scanadf` with the `-S script --script-wait` parameters for a couple of years. My script, called `scan_perpage`, converts the image data to pdf, via a call to `pnmtops`, piped through `ps2pdf`. However recently (I suspect since I updated from Fedora 17 to 19), the called script hangs, and therefore `scanadf` hangs. The script is hung at the `pnmtops` command. The `pnmtops` command itself is waiting for its forked "child" `pnmtops` output filter to complete, and it never does. Running the `scan_perpage` script directly on the raw scanner page output works fine. Running the `pnmtops` command directly also works fine. It is only when run from `scanadf` via `-S` that the script hangs at `pnmtops`. Versions:               # rpm -q --info sane-backends     Name        : sane-backends     Version     : 1.0.23     Release     : 13.fc19          # rpm -q --info sane-frontends     Name        : sane-frontends     Version     : 1.0.14     Release     : 16.fc19          # rpm -q --info netpbm     Name        : netpbm     Version     : 10.61.02     Release     : 5.fc19      Here is the output of my `scan` script, which calls `scanadf -vv`:               $ scan -o output.pdf     Scanning...     scanadf: value for --resolution is: 300     scanadf: scanning image of size 2544x3300 pixels at 1 bits/pixel     scanadf: acquiring gray frame     Started script `/usr/local/bin/scan_perpage' as pid=10902     Scanned document scan-0001     pnmtops: Input maxval is 1.  Postscript raster will have 1 bits per     sample, so maxval = 1     pnmtops: Image will be 610.56 points wide by 792.00 points high, left     edge 0.72 points from left edge of page, bottom edge 0.00 points from     bottom of page; NOT turned to landscape orientation     pnmtops: output filter spawned: pid 10904     pnmtops: Waiting for PID 10904 to exit     Scanned 1 pages     <the script hangs here>      Here is the process tree at the point of the hang:               10897 32072 /bin/sh /usr/local/bin/scan -o output.pdf     10898 10897 scanadf -vvv -d fujitsu -S /usr/local/bin/scan_perpage     --script-wait --resolution 300 --mode Lineart -o scan-%04d     10902 10898 /bin/bash /usr/local/bin/scan_perpage scan-0001     10903 10902 pnmtops -verbose -imagewidth 8.5 -imageheight 11 scan-0001     10904 10903 pnmtops -verbose -imagewidth 8.5 -imageheight 11 scan-0001      Process 10904 (the forked `pnmtops` "output filter") never finishes. An strace indicates it is waiting on a "read". I can't figure out why `pnmtops` hangs when called via `scanadf`, but when called directly on the same file it works perfectly fine. In addition, if the `pnmtops` subprocess is killed manually, everything continues without any problem.


title: cpufreq-set -g performance doesn't work on arch linux

text: `acpi-cpufreq` was already loaded , where the frequency was all 800MHz now , and I can't make it back to full-speed , which is 2500MHz. I tried `cpufreq-set -g performance` , then I check /proc/cpuinfo , it was still 800MHz Is there anything wrong ? **UPDATE** It's a i5 CPU , part of cpu information provided below:               processor   : 3     vendor_id   : GenuineIntel     cpu family  : 6     model       : 42     model name  : Intel(R) Core(TM) i5-2450M CPU @ 2.50GHz     stepping    : 7     microcode   : 0x25     cpu MHz     : 800.000     cache size  : 3072 KB     physical id : 0     siblings    : 4     core id     : 1     cpu cores   : 2     apicid      : 3     initial apicid  : 3     fpu     : yes     fpu_exception   : yes     cpuid level : 13     wp      : yes     flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid     bogomips    : 4986.76     clflush size    : 64     cache_alignment : 64     address sizes   : 36 bits physical, 48 bits virtual     power management:


title: do my advanced filesystem partitions have problems?

text: Recently one of my drive's went bad in my RAID, and I'm replacing with a new drive. I used this answer to mirror the partition on my old drive for resyncing. But I'm concerned about the output. My drives are 4k sectors, did I do something wrong the first time around? or is this warning just some kind of antiquated sillyness?               Checking that no-one is using this disk right now ...     OK     Warning: partition 1 does not end at a cylinder boundary     Warning: partition 2 does not start at a cylinder boundary     Warning: partition 2 does not end at a cylinder boundary     Warning: partition 3 does not start at a cylinder boundary      Warning: partition 3 does not end at a cylinder boundary     Warning: partition 4 does not start at a cylinder boundary          Disk /dev/sda: 121601 cylinders, 255 heads, 63 sectors/track     Old situation:     Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0             Device Boot Start     End   #cyls    #blocks   Id  System     /dev/sda1   *      0+     12-     13-    102400   fd  Linux raid autodetect     /dev/sda2         12+   1318-   1306-  10485760   fd  Linux raid autodetect     /dev/sda3       1318+   2623-   1306-  10485760   fd  Linux raid autodetect     /dev/sda4       2623+ 121600  118978- 955685088+  fd  Linux raid autodetect     New situation:     Units = sectors of 512 bytes, counting from 0             Device Boot    Start       End   #sectors  Id  System     /dev/sda1   *      2048    206847     204800  fd  Linux raid autodetect     /dev/sda2        206848  21178367   20971520  fd  Linux raid autodetect     /dev/sda3      21178368  42149887   20971520  fd  Linux raid autodetect     /dev/sda4      42149888 1953520064 1911370177  fd  Linux raid autodetect     Successfully wrote the new partition table          Re-reading the partition table ...     If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)     to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1     (See fdisk(8).)


title: How to list the actual cronjobs?

text: If I (e.g.: under Fedora) edit the crontab file with vim, then I restart crond:               /etc/init.d/crond restart      then the actual crontab file: "/etc/crontab" is the same as the actual cronjobs in reality. Ok!   But:      Q: How could I list the real-actual cronjobs, if the "/etc/crontab" file gets modified, but the crond not reloaded? Then the real-actual cronjobs aren't the same as the "/etc/crontab" file.   Thank you!


title: What is the best way to synchronize files to a VFAT partition?

text: POSIX filenames may contain all characters except `/`, but some filesystems reserve characters like `?<>\\\:*|"`. Using `pax`, I can copy files while replacing these reserved characters:               $ pax -rw -s '/[?<>\\:*|\"]/_/gp' /source /target      But `pax` lacks an `\--delete` option like `rsync` and `rsync` cannot substitute characters. I'm looking for a simple way to backup my music collection to an external hard drive on a regular basis.


title: Print 2nd and 7th lines to a file using `sed`

text: I have a directory of .txt files. For each, i'd like to grab the 2nd and 7th line, and add those lines to another file, which I've arbitrarily named list.index. I'm not sure how to tell sed about the current filename, within the for loop, so what I have below doesn't work yet.               #!/bin/sh     for i in *.txt     do     sed -n -e '2p' -e '7p' list.index     done


title: Can linux deal with ultra high resolution displays?

text: A few months ago Samsung announced the Ativ Book 9 Plus. A pretty cool ultrabook with a screen resolution of 3200 x 1800 pixels (QHD+). The device ships with Windows 8 until Windows 8.1 will be released and Samsung declared that only Windows 8.1 will be able to deal with this ultra high resolution. Now I ask myself if any linux distribution is able to deal with such a high resolution. Especially font rendering is a point to regard. According to some early reviews of the Ativ Book 9 Plus Windows 8 is not able to render fonts properly so that you can read text without having to put the screen just in front of your nose. That's why they say Windows 8.1 will be able to do better. But what's with linux? Can linux deal better with this ultra high resolution? Maybe anybody has some experience regarding other ultrabooks with comparable resolutions.


title: Emacs shell mode makes $PS1 different

text: I have a custom $PS1 variable that looks like this on my command line: ![enter image description here](http://i.stack.imgur.com/gxJtT.png) And on emacs using `M-x shell` unfortunately looks like this: ![enter image description here](http://i.stack.imgur.com/vlWQd.png) Here is my $PS1 variable `export PS1='\\[\e]0;\u@\h: \w\a\\]\\[\e[0;36m\\]\T \\[\e[1;30m\\]\\[\e[0;34m\\]\u@\H\\[\e[1;30m\\] \\[\e[0;32m\\]\\[\e[1;37m\\]\w\\[\e[0;37m\\] \$ '` How can I make emacs shell-mode look the same with my CLI variable?


title: How to delete the line after a search pattern, globally with vi?

text: Assume I have a big file, ~1k lines, and I need to **delete the line after** some pattern, lets call it: `somePatern`. Conditions:   * cannot be done by hand (no searching -- `/somePattern`, and/or manually moving down one line and deleting).    * preferably a single liner.    * line after the line that contains the pattern has to be gone (no empty line)    * has to be UNIX compatible (I use Debian but need it for UNIX -- great if works on both)  Also if anyone has a link to a site where I can learn this and more regex stuff that be awesome! (But not a beginners type of tut, I have that down, courtesy of `vimtutor` and others.)


title: How to extract annotations from PDF files?

text: Is there a command-line tool to extract annotations (comments added using `evince`) from PDF-files? I search such a solution to send people feedback on their submitted documents. Apart from replying with the annotated PDF as attachment, I want to include a dump of my comments as substitution for a proper changelog in the email's body. In the `man` pages of tools like `pdftotext`, `pdftohtml` or `pdfinfo` I did not find any helpful options.


title: How to emphasize active tab in Tilda?

text: I'm using `Tilda`. It's hard to say which tab is currently active by a glance. Is there way to make it clear which tab is active. For example ,can I emphasize tab by changing it's background color?