title: Mouting a kvm qemu disk image with multiple partitions

text: I am trying to mount a KVM-qemu disk image with this command: `sudo mount -o loop,offset=32256 centos6.img /mnt/centos6`. But it shows this error: `you must specify filesystem type`. As I have more partitions in my disk image I tried this solution. But that too gives same error. Here is the output of `fdisk -ul centos6.img`:               Disk centos6.img: 0 MB, 0 bytes     255 heads, 63 sectors/track, 0 cylinders, total 0 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: 0x0001da69                Device Boot      Start         End      Blocks   Id  System     centos6.img1   *        2048     1026047      512000   83  Linux     Partition 1 does not end on cylinder boundary.     centos6.img2         1026048    20971519     9972736   8e  Linux LVM     Partition 2 has different physical/logical endings:          phys=(1023, 254, 63) logical=(1305, 106, 17)


title: Ubuntu Remap script for UK Logitech Cordless Wave Keyboard

text: I have just bought a Logitech Cordless Wave UK Keyboard and mouse and I'm trying to get the keymapping sorted but not having much luck! The main problem I have is none of the key seem to give me the HASH symbol. Ideally I'm after a remapping script that I can get to run at start up or even a GUI based remapping software so I can get my keys to print what is actually label on each key! I have tried HIDPoint but I'm using VMWare to run Ubuntu 10.04 and it didn't recognise the keyboard or mouse Does anyone know how I can fix this?


title: the lightest way to have a GUI in Linux?

text: I have been using Gnome and KDE for a while, and I am now running Compiz standalone... Regarding system resource, I think the most heavy ones are feature-rich desktop environments (Gnome, KDE), then lightweight environments (XFCE, LXDE), then Compiz standalone without any desktop environments (which I just discovered recently in another question). I wonder if I have come to the end of the list yet? (As the minimum, I want something that can run GUI apps like Firefox. I imagine something with a terminal from which I can start other applications...)


title: what is pts/0 and (:0.0) in linux by type who am i

text: When I type the command:               [root@degeneration Desktop]# who am i      root     pts/0        2013-04-12 15:08 (:0.0)      What is pts/0 and what is meant by (:0.0)?


title: CLI interace to KDE's notifier

text: I think KDE's notifier is pretty sweet. I was thinking... how useful might it be if my system logs were also sent there, so they would pop so I could see them. I think the first step of this is to figure out how to send messages to the notifier via CLI. here's the kde forum discussion on dbus interface. I'm not really sure how to use this interface. If anyone is more familiar with dbus perhaps they can write an answer detailing various ways to access it via dbus.


title: How do I scan for invalid characters on gedit?

text: I am having a dilemma whether to edit a javascript file or not. When I open it with gedit, it shows the following warning: > The file you opened has some invalid characters. If you continue editing > this file you could corrupt this document. You can also choose another > character encoding and try again. The current encoding is UTF-8. As the file has over 100,000 lines of code, is there a quick way to scan for the invalid characters?


title: Should I be worried? Segfaults reported in syslog when merging LVM snapshot (reverting the original back to the snapshot)

text: I was just experimenting with snapshots in LVM on Ubuntu 12.10. I created a snapshot logical volume of 6.5 GiB, and after making some changes to the origin decided to merge the snapshot back in to undo them. All seemed to be going well, but I noticed several LVM-related segfault messages in syslog. Commands entered:               sudo lvcreate -L6.5G -n backup_snapshot -s /dev/mapper/vg0-backup     # made some miscellaneous writes     sudo lvconvert --merge /dev/vg0/backup_snapshot     sudo umount /snapshot/backup     sudo umount /backup     sudo lvchange -an /dev/vg0/backup     sudo lvchange -ay /dev/vg0/backup     sudo mount /backup      From syslog:               Apr 12 04:57:10 bournemouth kernel: [ 5260.813253] EXT4-fs (dm-1): mounted filesystem with ordered data mode. Opts: errors=remount-ro     Apr 12 05:00:11 bournemouth kernel: [ 5441.841401] EXT4-fs (dm-5): mounted filesystem with ordered data mode. Opts: errors=remount-ro     Apr 12 05:02:00 bournemouth kernel: [ 5551.438487] show_signal_msg: 48 callbacks suppressed     Apr 12 05:02:00 bournemouth kernel: [ 5551.438495] lvm[5813]: segfault at 28 ip 000000000047f319 sp 00007fff60873de0 error 4 in lvm[400000+d9000]     Apr 12 05:02:01 bournemouth kernel: [ 5552.458797] lvchange[6449]: segfault at 28 ip 000000000047f319 sp 00007fff935f4380 error 4 in lvm[400000+d9000]      I then unmounted the origin LV, made sure the snapshot no longer existed, and ran `fsck.ext4 -f` on it; it checked out OK that way. But I'm still worried about the segfaults. Is it possible my data got messed up in some way that fsck wouldn't catch? The volume I was experimenting with was a backup one, and all the filesystems I have backed up on it are still in working order, so I could just start over and back them up again. But on the other hand, I'd like to keep my incremental backup history. I'd just like reassurance that I can trust these backups.


title: dpkg and google-chrome don't get along with gnome

text: Install fine. Works fine. Next day the logo and apps menu entry is gone. Doesn't seem to matter what I do. On installation, GDebi refused to install the package, and crashed instead, so I used dpkg -i. As for the logo and apps menu entry, I suppose I'll just have to glue it in place. Sorry Firefox. I install the latest version with dpkg, I use it for a while, it goes into the Internet tab fine. Then I shut down, and the next time I start up it's missing. The program runs fine from a terminal as google-chrome So, my question is, where are the details of this stuff stored? Is it a single text file in /usr? Is it a bunch of stuff that's hard to edit by hand? And where is the logo likely to reside? I know there's probably a GUI way to do this, but it will be more satisfying, and possibly less error-prone, if I simply override whatever's causing Ubuntu/GNOME to lose the icon and applications menu entry.


title: vi hangs when run in /dev/console under LXC

text: I'm running an Arch Linux container from within lxc. The `lxc-start` command connects to the internal `/dev/console`, on which I have `agetty` running using the following command:               /sbin/agetty --noclear -a username -s console 115200,38400,9600      (The -a flag being to log in automatically as user 'username'.) When I run `vi` within this console, it hangs and locks the console. If I kill it from outside, I can get back to the prompt, but the size of the terminal has been reduced to a much smaller window. I can get the original size back by using `reset`. If I run `nano`, it does not lock, but does immediately reduce the terminal size. If I change to using tty1 by altering the getty command as such:               /sbin/agetty --noclear -a username -s tty1 115200,38400,9600      And then connect through `lxc-console -t 1`, vi works quite happily. However, `lxc-start` always connects on `/dev/console`, so I cannot use this technique if I want to run in that. Any ideas what the difference is with `/dev/console` that causes this to happen?


title: Can I safely remove /var/cache?

text: I am running out of disk space and noted that I have a large `/var/cache` directory. Can I safely remove this? (using Arch Linux, BTW).


title: How does one enable different backgrounds for each viewport screen in linux?

text: I was wondering if it was possible to enable different desktop backgrounds in the four different gnome viewport screens using linux mint?


title: Create a temporary file from a stdout redirect or pipe

text: Some commands only output to stdout.   Some tools only work on files.   Is there a command that can glue those together? Contrived simple example: > `diff $(echo 1 | stdout-to-temp-file) $(echo 2 | stdout-to-temp-file)` My actual use case; Current workaround: > `git show HEAD:$1 > /tmp/left && meld /tmp/left $1` My actual use case; Desired: > `meld $(git show HEAD:$1 | stdout-to-temp-file) $1` I'd use this in a few other situations too (i.e. I'm not looking for a git or meld only fix).


title: How to setup transparent firewall using ArchLinux

text: I am trying to setup a Transparent Firewall using ArchLinux. My setup looks like this:               (ISP, IP: 10.90.10.254)     \      \       \ (eth0-> ip: 10.90.10.1 gateway: 10.90.10.254)        +-----------+        |           |        |    PC     |        |(as server)|        +-----------+                     \ (eth1-> ip: 10.90.10.100)                      \                       \          (10.90.10.101)\        | (wireless-> ip-range: 10.90.10.102-)                         +-------+                         |Router |                         +-------+      My router does not have firewalling capacities, therefore I need to drop a firewall between the router and my ISP.


title: Generic RPM that can install on any os - error: RPM is for a different operating system

text: How can I make a rpm from a spec file that can be installed on any host? Currently I have a spec file but when installing the rpm on other hosts I get this:               package my_software-1.0-1dist is for a different operating system The files in the rpm are just perl programs so if the system has perl and some modules which are already spelled out on requires lines I shouldn't need to check the os. I already have BuildArch: noarch in my RPM.


title: How to interleave two files?

text: How do I take two input files and create an output file that interleaves their contents? For example, if one file contains:               3 4 6 9 1     7 3 4 5 6     3 5 7 9 10      And another contains:               a d g e t u     v g j j u r     s f t u 1 g      Then the output should be:               3 4 6 9 1     a d g e t u     7 3 4 5 6     v g j j u r     3 5 7 9 10     s f t u 1 g


title: Linux kernel API changes/additions

text: I'm trying to find a webpage or docs or XYZ that will allow me to see all the API changes/additions/removals between two kernel versions. I found http://kernelnewbies.org/LinuxChanges, but I'm not sure it lists everything as I know that Netlink API changed somewhere between 3.5 and 3.6 but it doesn't appear on that page.


title: Call background process back to stdout

text: Is it possible to "call" a background process output to be shown in the terminal? Example: cron starts apt-get to update the system and I want to see the output of apt-get


title: System hanging when it runs out of memory

text: I've got an eeePC 900a: it has a 8GB flash as disk and only 1GB of RAM. The Linux distribution installed on it is ArchLinux. When the system runs out of memory it becomes **extremely** unresponsive: it takes several seconds/minutes to do things like switching to TTY1 or even moving the mouse pointer. Sometimes it looks like the system just freezes: three ours ago I let it alone and nothing at all is changed so far. I'd rather avoid creating a swap partition/file on this eeePC since the disk is already that small, and also because the many writes on the swap space would shorten a lot the flash card life. Moreover I think that a swap file/partition would just move the problem, rather than definitely fixing it. Isn't the kernel supposed to kill some random applications when it runs out of memory? Why does it fail (or takes ages) at doing that? A few months/years ago I already tried to look further into this, but couldn't find anything that would actually work...


title: How to open a process from terminal without becoming child process?

text: If I execute the following command in `LXTerminal`:               gnome-terminal &      `gnome-terminal` gets opened. But as soon as I close the `LXTerminal`, `gnome- terminal` will be closed as well because it's a child process. Is there any way to open the second process independently?


title: trouble with irssi and cifs

text: I'm having trouble getting irssi, the irc client, to write to a mounted cifs share. I have the uid, and gid set to my user as well as setting the permissions on the share to being very permissive. When I tried to download a file in irssi I get an error that the file can't be created, and that the text file is busy. Here is the command I'm mounting the drive with (as root for my generic user)               mount -t cifs -v -o username=user,password=pass,uid=1001,gid=1001,dir_mode=0777 \         //server/myshare /mnt/cloud      Anyone have a clue what might be the issue? I'm running 2.6.34-gentoo.


How can I move to the bottom of a document using the pico editor? `CTRL+V` is next page; is there a similar key for last page?


title: Some keys are invalid on emacs when using German keyboard

text: When I am using emacs 23.3 on KDE, I can not input `^`, `´` and `~` from my German keyboard. If I press these keys, then emacs says that `<dead- circumflex>`, `<dead-acute>` and `<dead-tilde>` are undefined. I can input `^`, `´` and `~` on other applications (e.g. Konsole, Kwrite and firefox), and I can also paste these letters on emacs. I have tried to type C-x ret C-\ latin-1-postfix, but there is no change. Could anyone tell me how to solve this problem?


title: How do I cancel/replace one element of running `cmd1 && cmd2 && cmd3 && ...` chain?

text: $ command1 && command2 && command3     Running command1 ...     Running command2 ...^Z     [1]+  Stopped     $ fg && command4 && wrong_command5 && command6     Running command3     Running command4      How do I cancel the `wrong_command5`, scheduling `right_command5` instead after the termination of currently running `command4`?


title: Installing MySQL 5.6 Validate password plugin

text: So I have installed MySQL 5.6.19 Enterprise Edition and have installed the validate_password.so plugin. My question I have is, Does the MySQL password policy notify the user of what the requirements are to set a password? For instance, I tried to create a user name with 8 characters containing 1 special, 1 capital, and 1 digit. When I fail to meet the requirement all it MySQL puts out is: ERROR 1819 (HY000): Your password does not satisfy the current policy requirements Is there anyway to tell the user what the requirement are? I don't want to be getting tons of calls from across the World, asking me how to create a user all, because the password policy doesn't allow them.


title: How to make a distro be fullscreen on VirtualBox?

text: I'm running Debian as host and I fail to get Debian, Ubuntu, and Fedora guests to be fullscreen. Changing video memory didn't help. **NOTES** :   * I haven't tried any other distro   * I didn't create WinXP guest myself


title: Unable to write to a GPIO pin despite file permissions on /sys/class/gpio/gpio18/value

text: This is on a Raspberry Pi. Here's the output of sudo ls -lL /sys/class/gpio/gpio18:               -rwxrwx--- 1 root     gpio     4096 Mar  8 10:50 active_low     -rwxrwx--- 1 root     gpio     4096 Mar  8 10:52 direction     -rwxrwx--- 1 cameron  cameron  4096 Mar  8 10:50 edge     drwxrwx--- 2 root     gpio        0 Mar  8 10:50 power     drwxrwx--- 2 root     gpio        0 Mar  8 10:50 subsystem     -rwxrwx--- 1 root     gpio     4096 Mar  8 10:50 uevent     -rwxrwx--- 1 cameron  cameron  4096 Mar  8 10:50 value      So looks like I should now have access to value, great. However:               cameron@raspberrypi~ $ echo 1 > /sys/class/gpio/gpio18/value     -bash: /sys/class/gpio/gpio18/value: Permission denied      What's going on? If I chmod 777 everything, then it works, but I shouldn't have to do that when I own the file.


title: How to get someone interested in using Linux

text: What are some ways I could interest my friends, girlfriend, parents, etc. to learn and use Linux? It's usually not feasible for them to let me install Linux on their computers, even for a dual boot. Are there other things to get them hooked?


title: Convert one Fedora spin into another?

text: How do I convert an existing Fedora system into another spin? Example: You have installed from the KDE live image and now want to switch to Xfce. Is something like               # yum group install 'Xfce Desktop'      enough? What about the display manager? What steps are necessary to get the kdm- equivalent of Fedora-Xfce-Spin started?


title: Confusion with Linux kernel

text: I am really confused with the kernel concepts. I came to know that the kernel is between application and hardware, and that the kernel takes input from the applications and it will send the instructions to the hardware to process. In Windows as per my knowledge I don't hear the word called kernel. My doubt is here, what is a kernel actually?


title: top / htop; group process by command

text: I'd like to know how much resource a specific command is using. `top` and `htop` displays information on per process basis but I'd like the information to be shown on per command basis. E.g. I'd like to know how much RAM chrome is using.


title: Searching for terms in a set of files

text: I have two files:               files_to_search.out     terms_to_search.out      I'd like to create a command that identifies terms in `terms_to_search.out` that are not used in any of the files in `files_to_search.out` Is there an easy way to do this?


title: how do I run a cron job with a specific user?

text: My cron and scripting skills are very poor, but I need to run a job every 5 minutes by user 'cpc'. So I created a script and left it at /root. My crontab -e entry about it is: 0-59/5 * * * * /root/bi-kettle.sh And this script (bi-kettle.sh) is:               #!/bin/bash     su cpc     cd /home/cpc/data-integration      /bin/bash kitchen.sh -rep="01" -job="MainLoad" -user="admin" -pass="admin" -level="Basic"`      But it is not called or run at any moment. What am I missing here? Thanks in advance!


title: Printing an array to a file with each element of the array in a new line in bash

text: I am trying the contents of an array into a file with each element of the array in a new line in the file.               IFS=$'\n'        echo "${mtches[@]}" > sample1.txt          The content of mtches is "qwe" and " asd". But the `sample1.txt` file contains `qwe asd` in a single line. Why is it not taking IFS value into the picture?


title: Interactive shell with environment identical to cron

text: I am aware of a lot of pitfalls in the magic world of crontabs, but sometimes it would help troubleshooting a lot when you have some smart way to enter an interactive (bash) shell with exact identical environment as when a shell script is run from a crontab. Now I thought myself of `/bin/openvt -c8 -- /bin/bash --noprofile -l`, but it require root privileges, sets too many variables and a simple `su myusername` sets a lot of extra environment. Anybody know of a way to start a interactive bash shell with identical-to-cron environtment and not requiring root privileges on Kubuntu? Bonus when it works in an ssh session, in the GUI and on one or more of the following OS's too: HP-UX, Solaris and AIX


title: Difference between process in background and daemon

text: What is technically the difference of a process that started in foreground and was manually put into background and a daemon? Do they have different properties?


title: Is there an equivalent to bash's "nocaseglob" in ksh?

text: I would like to do what is mentioned in How to match case insensitive patterns with ls? except for ksh. Is it possible to do it without any pain(regex)?


title: Can I set up linux to accept a dial up connection from my old windows95 laptop?

text: I've got a really old laptop running Windows 95, and I'd like to be able to connect it to my home network. It doesn't have an ethernet jack, nor a usb port. It does have an internal dial up modem though, and I'd like to try connecting to another modern machine running slackware. This other machine also has an internal dial up modem, so it seems like it should be possible. I'd appreciate any advice or pointers to relevant information.


title: How can I translate these OpenVPN client configuration instructions to work with Fedora 20?

text: Here's the link to the full instructions. When I get to step 9, under the heading "9. Setup Client Config Files", it says: > Now we will configure the openVPN to work as client. Remember that we have > already installed the openvpn package in client, and we have “ca.crt”, > “vpnclient1.key”, vpnclient1.crt” in /etc/openvpn/ > > Copy the sample client.conf to /etc/openvpn. > > $ sudo cp /usr/share/doc/openvpn/examples/sample-config-files/client.conf > /etc/openvpn/ > > Edit the /etc/openvpn/client.conf. > > ... > > # Specify that this is openvpn client client > > remote vpnserver 1194 > > ca ca.crt > > cert vpnclient1.crt > > key vpnclient1.key ... > > Now start the OpenVPN in client > > $ /etc/init.d/openvpn start * Starting virtual private network daemon(s)... > * Autostarting VPN 'client' > > $ ifconfig tun0 tun0 Link encap:UNSPEC HWaddr > 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 >   >   >           inet addr:10.8.0.6  P-t-P:10.8.0.5  Mask:255.255.255.255 >   However, when I try to run that last command, I get the following error:               bash: /etc/init.d/openvpn: No such file or directory      I assumed that the script got subsumed by systemctl or something, so I then tried the next few:               # systemctl enable openvpn@.service      # systemctl start openvpn@.service       ...which I stumbled on through tab completion. Can anyone shed any light on how to proceed?


title: Change gid of a specific group

text: I'd like to change group id of a specific group. There are so may solution for changing the gid of a file or directories. But that's not what I want. Is there a way to do that?


title: Full path name of bash? and base process of Linux?

text: I am new to Linux and I recently had a test at school which had the following questions:   * What is the full path name of bash?   * What is the base process of Linux? I couldn't answer these. Does anyone know the answers ?


title: Solution to integer expression expected

text: So I when I run this code on my mac there are no errors, and it provides me the perfect output. But when I run it on Ubuntu or CentOS i get the following error `integer expression expected`                #!/bin/bash     if [ -f $1 ] ;     then         sum=0         echo "#Name Surname City Amount"         while read -r LINE || [[ -n $LINE ]]; do             firstName=$( echo $LINE | cut -d " " -f1)             lastName=$( echo $LINE | cut -d " " -f2)             city=$( echo $LINE | cut -d " " -f3)             amount=$( echo $LINE | cut -d " " -f9)             check=$( echo $amount | grep -c "[0-9]")             if [ $check -gt 0 ]; then                 if [ $amount -gt 999 ] ; then                     state=$(echo $LINE | cut -d " " -f5)                     correctState=$(echo $state | grep -c "^N[YCEJ]")                     if [ $correctState -gt 0 ] ; then                         echo "$firstName $lastName $state $city $amount"                         sum=`expr $sum + $amount`                     fi                      fi             fi         done < $1         echo ""         echo "The sum is all printed amounts is $sum"         echo ""     else         echo "No file found"     fi      Input File:               #Name Surname City Company State Probability Units Price Amount     Tony Passaquale Edenvale "Sams_Groceries_Inc. NJ 90 800 4.78 3824     Nigel Shanford Atlanta Fulton_Hotels_Inc. GA 40 400 9.99 3996     Selma Cooper Eugene Cooper_Inns OR 40 1000 9.99 9990     Allen James San_Jose City_Center_Lodge CA 40 1000 9.99 9990     Bruce Calaway Irvine Penny_Tree_Foods CA 80 1000 4.99 4990     Gloria Lenares Chicago Cordoba_Coffee_Shops IL 60 200 9.99 1998     Wendy Leach New_York Gourmet_Imports NY 100 100 10 1000     Craig Flanders Omaha Fly_n_Buy NE 40 1200 9.49 11388     Montgomery Weissenborn Chicago Shariott_Suites_Hotels IL 60 400 7.98 3192     Shirley Brightwell San_Francisco Pacific_Cafe_Company CA 80 2900 1.75 5075     Roger Vittorio Cleveland National_Associa OH 40 1000 9.99 9990     Tony Passaquale Edenvale Sams_Groceries NJ 90 1000 2.29 2290     Montgomery Weissenborn Los_Angeles Shariott_Suites_Hotels CA 90 5000 1.49 7450     Michael Wiggum Los_Angeles Trader_Depot CA 70 800 2.5 2000     Edna Brock Raleigh Elliott's_Department_Stores NC 70 14400 1.78 25632     Gloria Lenares Chicago Cordoba_Coffee_Shops IL 90 600 8.99 5394     Montgomery Weissenborn Seattle Shariott_Suites_Hotels WA 90 400 8.99 3596     Beth Munin Seattle Little_Corner_Sweets WA 100 400 1.39 556     Tim Kelly New_York Nuts_and_Things NY 60 100 9.99 999     Bart Perryman San_Francisco Kwik-e-mart CA 90 40000 0.69 27600     Stacey Gordon Irvine Penny_Tree_Foods CA 70 200 12.96 2592     Heather Willis Atlanta Big_Chuck_Diners GA 80 400 4.99 1996     Tim Kelly New_York Nuts_and_Things NY 70 600 1.49 894     Ralph Khan New_York Gigamart NY 30 600 9.99 5994     Joshua Newsom New_York Trader_Depot NY 90 800 7.99 6392     Edna Brock Raleigh Elliott's_Department_Stores NC 90 9200 1.88 17296     Edna Brock Raleigh Elliott's_Department_Stores NC 100 4400 1.98 8712     Michael Wiggum Los_Angeles Trader_Depot CA 100 600 2.5 1500     Joshua Newsom New_York Trader_Depot NY 90 600 2.5 1500     Edna Brock Raleigh Elliott's_Department_Stores NC 100 8800 1.68 14784     Heather Willis Atlanta Big_Chuck_Diners GA 100 200 4.99 998     Beth Munin Seattle Little_Corner_Sweets WA 100 200 2.49 498     Shirley Brightwell San_Francisco Pacific_Cafe_Company CA 100 1200 1.89 2268     Tim Kelly New_York Nuts_and_Things NY 90 14000 2.29 32060      Output( expected) this works only on Mac               #Name Surname City Amount     Tony Passaquale NJ Edenvale 3824     Wendy Leach NY New_York 1000     Craig Flanders NE Omaha 11388     Tony Passaquale NJ Edenvale 2290     Edna Brock NC Raleigh 25632     Ralph Khan NY New_York 5994     Joshua Newsom NY New_York 6392     Edna Brock NC Raleigh 17296     Edna Brock NC Raleigh 8712     Joshua Newsom NY New_York 1500     Edna Brock NC Raleigh 14784     Tim Kelly NY New_York 32060          The sum is all printed amounts is 130872      Output( on Ubuntu or CentOSX)                  #Name Surname City Amount     : integer expression expected     : integer expression expected     : integer expression expected     ./script.sh: line 13: [: 9.99: integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected     : integer expression expected          The sum is all printed amounts is 0


title: Recursively search folder but exclude svn subfolder

text: I want to find all occurences of `foo` in a large file system maintained by SVN but I don't want to match anything contained in any `.svn` directory. I get immediate matches when I do `grep -l -e 'foo' *` but when I try and exclude the svn directories with `grep -l -e 'foo' --exclude-dir=".svn"` the command just hangs. What am I doing wrong?


title: Having difficulties mounting a rootfs for an embedded Linux

text: I want my Kernel to start a squashfs rootfs for an embedded Linux. The squashfs file is on a sdcard, therefor i put these parameters on it's command line: > console=ttyS0,115200 root=/dev/sdb1 rw rootfstype=squashfs Unfortunately a kernel panic occured: > VFS: Cannot open root device "sb1" or unkonw-block(0,0) Please append a > correct "root=" boot option; here are the available partitions: not syncing: > VFS: Unable to mount root fs on unknown-block(0,0) what am i doing wrong? **EDIT** : I tried with root=/dev/mmcblk0 but the results are the same. Do i have to mount these devices first, and if so how is this done ?


title: What is a distro-agnostic way determine the OS install date?

text: I am on a CrunchBang machine and trying to write a script that needs to have the OS install date as a reference. I searched and found this command:               ls -lct /etc | tail -1 | awk '{print $6, $7, $8}'      It prints               Mar 31 21:24      I did not understand the `tail -1` part, but was able figure out that $6 $7 $8 are the 6th 7th 8th occurrences of the last line that the command is referencing. However, I realized that the year cannot be included as the year was not displayed in the `ls -ltc` command. Some people suggested finding the date `/etc` was created and some checking the `/var/log/syslog` etc. I thought these might be a little specific to the distro. What is your recommendation for a truly distro-agnostic way to find the OS install date?


title: Instaling Linux on a machine with Asrock Z87 Extreme 6

text: I am not able to install Linux in my newly built machine. I think it can be related with my MB (Asrock Z87 Extreme6). I already have Windows 8.1 installed without UEFI. When I boot (linux) from the BluRay Drive, if I use legacy boot it won't boot at all. If I choose to use UEFI, sometimes it boots, but it fails to install. I have tried several distros (Ubuntu, Debian, Slackware), but with no success. Any idea what's the problem? I have even tried OpenBSD, but no luck there as well. Machine configuration:   * Kingston HyperX blu Memory 16GB    * Seagate 1TB SATA600    * Asrock Z87 Extreme6    * Intel Core i5 4570, 3.2GHz   * Asus BW 16D1HT   * _Using onboard GPU_


title: Setting GTK2 theme for root

text: When using `sudo`, applications do not follow the GTK2 theme and font. How can I set identical settings for use when an application is run from root, but while inside a desktop from a user?


title: do not allow a directory to be deleted but make new files in it?

text: The question in my assignment says this: > create a directory temp with all permissions for everybody, that cannot be > deleted > > and copy hello.sh in this directory giving execution rights for everybody, > but hello.sh will be executed as the owner. So I created a directory called temp and gave permissions like this:               chmod 555 temp      but when I try to cp hello.sh to temp I get an error as temp has the permissions 555. What does the professor exactly meant to ask here? How do I not allow a directory to be deleted but copy files into it?


title: Volume manager tries to mount device while reformatting in gparted

text: When reformatting a USB drive with `gparted`, my volume manager attempts to mount the device. This results in some error messages telling me the device could not be mounted. The only way I know to turn these messages off, is to temporarily disable the auto-mount options in "Removable drives and media" settings for XFce4. Changing these settings constantly gets to be troublesome. Is there a better solution?


title: Deleting viruses from USB

text: When I use my USB drive on Windows computers, then return to my Linux computer, I find many extra files are added to the drive, often `exe` files and various folders.   * Is it sufficient to delete the new files? Will some viruses be placed inside my files?   * Is there some software to help identify and delete these, from Linux?


title: Verbose shutdown messages

text: I am using BSD at the moment and think I have an X compatibility problem where my computer doesn't shut down. It can cause problems because I have to turn off the power manually while there is no display (so I don't know what stage the system shutdown is at.) Does anyone know how to enable messages after log out, shutdown?


title: How can I fix the issue where Add/Remove Software never asks for my password?

text: Using CentOS Release 6.4 x86 when I go to **System > Administration > Add/Remove Software*8 and try to add software or refresh the package list, I immediately get the following error: ![Authorization Failed](http://i.stack.imgur.com/wgjBY.png) > **Authorization Failed** > > You have failed to provide correct authentication. Please check any > passwords or account settings. > > Failed to obtain authentication However the reason I failed to provide authentication is because _I was never asked for a password at all_. I'm running as a normal user who is a member of the `wheel` group and can run commands via `sudo`. I also can `su` to root. I am able to install software via `yum`. How can I fix the issue where **Add/Remove Software** never asks for a password? * * * **UPDATE:** The issue appears to be with PolicyKit. Specifically, I have no authentication agent running and trying to start it results in the error > Unable to determine the session we are in: Remote Exception invoking > org.freedesktop.ConsoleKit.Manager.GetSessionForUnixProcess() Some terminal output:               [jnet@dogYears Desktop]$ pkexec echo "test"     Error executing command as another user: No authentication agent was found.          [jnet@dogYears Desktop]$ ps awwwx|grep polkit              2059 ?        S      0:00 /usr/libexec/polkit-1/polkitd     28688 pts/3    S+     0:00 grep polkit          [jnet@dogYears Desktop]$ /usr/libexec/polkit-gnome-authentication-agent-1     (polkit-gnome-authentication-agent-1:28725): polkit-gnome-1-WARNING **: Unable to determine the session we are in: Remote Exception invoking org.freedesktop.ConsoleKit.Manager.GetSessionForUnixProcess() on /org/freedesktop/ConsoleKit/Manager at name org.freedesktop.ConsoleKit: org.freedesktop.ConsoleKit.Manager.GeneralError: Unable to lookup session information for process '28725' org.freedesktop.ConsoleKit.Manager.GeneralError Unable%20to%20lookup%20session%20information%20for%20process%20%2728725%27


title: Installing Android-x86 on a USB (not creating a Live USB)?

text: I want to carry around an Android OS install on a USB so I can have a Google Authenticator with me everywhere I go since I don't own any mobile devices. The idea being that I can run Android through VirtualBox on the computers I use. So I first partitioned my 8 GB USB drive using `gparted` into a `fat32` file system for portability. Then I created a VirtualBox disk connected associated with the `fat32` partition on the USB drive at `/dev/sdd1`:               $ sudo su -     root@ckleinlx:~/.VirtualBox/HardDisks# VBoxManage internalcommands createrawvmdk -filename /root/.VirtualBox/HardDisks/usbdisk.vmdk -rawdisk /dev/sdd1     RAW host disk access VMDK file /root/.VirtualBox/HardDisks/usbdisk.vmdk created successfully.      Then I downloaded the android-x86 iso, and attached the iso and newly created `usbdisk.vmdk` as storage on a new VM in VirtualBox. ![enter image description here](http://i.stack.imgur.com/2bih6.png) Then I boot up the VM and start the installer. ![enter image description here](http://i.stack.imgur.com/oCSST.png) I formatted the partition again as `fat32` and marked it `Bootable`, then started the install. When asked if I want to install `GRUB` I confirm, installation completes, and I select "Reboot", then shut down the VM. At this point I remove the Android install disk from the VM, leaving only `usbdisk.vmdk`, which has Android installed on it now. However, when I boot, I just get this: ![enter image description here](http://i.stack.imgur.com/IwOXJ.png) Android and grub are both clearly installed on the usb:               root@ckleinlx:~/.VirtualBox/HardDisks# mount /dev/sdd1 /media/usb     root@ckleinlx:~/.VirtualBox/HardDisks# ls /media/usb     android-4.3-test  grub      And here's what the USB stick looks like in `gparted` ![enter image description here](http://i.stack.imgur.com/Ib1ny.png) Why can't Android be booted from this USB? Everything seems to be installed correctly, but virtualbox complains that it can't read the boot medium.


title: sed how to do "or"

text: I have the following two lines that work ok:               /\.to <\=/ s/<\=/be <\=/     /\.to_not <\=/ s/<\=/be <\=/      I would like to combine them and I tried:               /\.to( |_not )<\=/ s/<\=/be <\=/      but it doesn't match. What should I change? I also tried `/\\.to(\s|_not )<\=/ s/<\=/be <\=/ `


title: vim: Execute BundleInstall without showing the vim interface

text: I have a installation script that I use to initalize my vim plugins when I'm on a new machine               #!/bin/bash          # Clone vundle into the directory if it's not already     if [[ ! -e bundle/vundle/.git ]]     then         mkdir -p bundle         rm -rf bundle/vundle         git clone https://github.com/gmarik/vundle.git bundle/vundle     fi          vim +BundleInstall +qall      However, this brings up vim. I was curious if there was a way to have vim hide its interface but still execute the BundleInstall script? In other words the script would hang until the BundleInstall command finished.


title: Why would running a directory path as a command return "permission denied" and not "command not found"?

text: I am an a redhat box and I noticed that if I accidentally type in a `dir` path without `cd` in front of it, I get a `/path/to/dir/: Permission denied.`; however, I would expect it to say `/path/to/dir/: Command not found`. Just as if I typed in nonsense like:               $ sldkfjsd     sldkfjsd: Command not found.      What purpose does this have and what would happen if I was to run a `dir` as a command as a super user (I don't have `sudo` access)?


title: Replace specific text only in specific fields using nawk

text: My input data file abc.txt has this               "20131008","0004","0568","98"      I ran this command to replace the text               nawk -F, -vOFS=',' '{gsub("0568","0808",$3); print }' abc.txt      In the output the delimiter "," is replaced with a space. The output looks like this.                "20131008" "0004" "0568" "98".      Can someone please help with this? I tried to replace the `-vOFS` but doesn't work.


title: NFS Mounting over WAN which ports

text: I have a NAS box setup at a different location than our company. The idea was to use it as offsite backup. When the NAS box was on our LAN we had no issues mounting the NFS shares. Once we moved it to the offsite location we are unable to talk to it. So far I have forwarded ports (tcp and upd): 2049, 111, 1110, 4045 Every command such as rpcbind, showmount and mount itself all report connection timed out. It has become increasingly hard to determine where I am being firewalled. Can anyone point out some tips. What ports do I need to open at the offsite location and which ports need to be forwarded at our main location?


title: Linux Kernel: uid and gid vs /etc/passwd

text: **How does the Linux kernel deal with UIDs and GIDs?** When I want to add a user to a system, does the kernel require some type of "registration" for this user (syscall?)? Does the kernel even care about which users are available in /etc/passwd or does it simply know about and deal with numeric values independently of that file's content?


title: Where did 47gigabytes of space go?

text: Clean installation od Debian squeeze 6.0.6 x64 on intel atom 230, with 3 HDDs, with 3x500GB. `df -h` shows :               datastore              size used  free   %   mounted     /dev/md0              917G  909M  870G   1% /     tmpfs                1001M     0 1001M   0% /lib/init/rw     udev                  996M  188K  996M   1% /dev     tmpfs                1001M     0 1001M   0% /dev/shm      `df -i` shows :               datastore              size used  free   %   mounted     /dev/md0             61054976   27582 61027394    1% /     tmpfs                 256087       7  256080    1% /lib/init/rw     udev                  254831     692  254139    1% /dev     tmpfs                 256087       1  256086    1% /dev/shm      It is ext3. Please tell me, where did my 47 gigabytes go? It is a clean installation as you can see. `du -sh` shows: 709M


title: Running several times the same command with several aguments after a pipe

text: I have a key (of random binary data) that gets generated by `get_key`. And with this key, I can do several things with my encrypted files. For example, I can decrypt them. `get_key | tee >(decrypt file1) >(decrypt file2)` I would like to know how I could generalize that to `n` files where the files are given as `FILES=file1 file2 file3 file4 file5`. At the moment, I can see two solutions: 1) Compute a string and `eval` it 2) replace decrypt by a recursive function `f` that calls decrypt does `tee >(decrypt A[0]) | f ("${A[@]:1}")` (it decrypts the first element and calls itself recursively) if the array is not empty and nothing if it is. I wanted to know if you had a nicer way to doing that (note that I do not want the key to be written to a file or a variable, so loops aren't an option). * * * Edit: I'll use it in https://github.com/xavierm02/combine-keys


title: Google Chrome on Ubuntu 12.04 Freezes My Laptop After Fifteen Minutes of Use

text: I will have about five tabs open and it is fast. However, after about fifteen minutes to thirty, my Chrome will completely freeze my laptop and I'll have to hold the power button to shut-down and restart my computer. Both Chromium and Google Chrome do this, but Firefox (my preferred browser) doesn't do this at all. Why use Chrome, then? I use Google Chrome mainly for it's stability in certain webpages I use. So is there a way to fix this freezing?


title: Using BASH versus ASH on Synology

text: The majority of my photo files have the following naming convention / format `IMG_20131204_120000.JPG`, showing date and time the photo was taken (iPhone/Apple naming convention). However, not all my photos follow this naming convention. With the help of this forum we evolved the script as follows:               for x in *.JPG *.jpg *.TIF *.tif *.PNG *.png *.BMP *.bmp *.GIF *.gif *.IMG *.img *.JPEG *.jpeg *.TIFF *.tiff; do       d=$(date -r "$x" +%Y%m%d)" - Family Photos"       if [[ "$x" =~ ^[iI][mM][gG][_-][1-2][09][0-9][0-9][0-1][0-9][0-3][0-9][_-][0-2][0-9][0-6][0-9][0-6][0-9][.][a-zA-Z]*$ ]]; then         d=$(expr substr "$x" 5 8)" - Family Photos"       fi       mkdir -p "$d" >/dev/null 2>&1       mv -- "$x" "$d/" >/dev/null 2>&1     done     rmdir ' - Family Photos' >/dev/null 2>&1      I use the `if` statement to take the date from the File name itself if the filename is in the format `IMG_20131204_120000.JPG` as this date most accurately reflects the date the photo was actually taken, but if the file doesn't follow this naming convention I take the operating system date of when the file was last modified/created. I plan to run this script every night to categorize the photos uploaded during the previous 24 hours. My problem is I now find out that my Synology system only supports ASH not BASH shell and therefore the regular expression `=~` in the `if` statement doesn't work. I can use IPKG to install a BASH package. Is there an easy way to have just this script use BASH while the rest of the system is untouched and uses ASH? Or alternatively is there a way to do the same thing in the `if` statement using the ASH shell?


title: Problem installing ArchLinux on LVM on a LUKS setup via archboot

text: I've used archlinux before, and I've decided to have it enccrypted. I use BIOS. I used the latest vesion of archboot. I made an LUKS setup, then made lvm volume group and two ext4 partition in it for / and /boot. Then I made a ext4 boot partition and let the setup to save the password in my root partition and use kernel path for fstab. After the installation I corrected my fstab and mkintcpio and once installed syslinux and the other time grub. But no matter what the bootloader is it couldn't load the OS or the and goes to rootfs without asking the password to my luks setup. How should I fix it, How much more information is my question lacking to be answered, where am I doing it wrong? I also played with the crypttab however it resulted in no good.


title: iostat: await vs. svctm

text: In the `iostat` manpage I have found these two similar columns:               await         The average time (in milliseconds) for I/O requests issued to the device to be  served.  This         includes the time spent by the requests in queue and the time spent servicing them.          svctm         The  average  service time (in milliseconds) for I/O requests that were issued to the device.         Warning! Do not trust this field any more.  This field will be removed in  a  future  sysstat         version.      Are these columns meant to represent the same thing? I seem that sometimes they agree, but sometimes not:               avg-cpu:  %user   %nice %system %iowait  %steal   %idle                4.44    0.02    1.00    0.36    0.00   94.19          Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util     sda               0.07     0.96    0.28    1.28     8.98    47.45    72.13     0.02   11.36   11.49   11.34   5.71   0.89          avg-cpu:  %user   %nice %system %iowait  %steal   %idle                8.00    0.00    2.50    2.50    0.00   87.00          Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util     sda               0.00     9.00    2.00    6.00    12.00    68.00    20.00     0.05    6.00    2.00    7.33   6.00   4.80          avg-cpu:  %user   %nice %system %iowait  %steal   %idle                4.57    0.00    0.51    0.00    0.00   94.92          Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util     sda               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00          avg-cpu:  %user   %nice %system %iowait  %steal   %idle               13.93    0.00    1.99    1.49    0.00   82.59          Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util     sda               0.00    29.00    0.00    4.00     0.00   132.00    66.00     0.03    7.00    0.00    7.00   7.00   2.80      Other than the obvious warning that `svctm` is depreciated, **what is the difference between these two columns**?


title: NetworkManager no longer auto-connects on login

text: I've configured `nm-applet` to run during X login, and I've connected to my home Wi-Fi network many times. Recently it no longer tries to connect to the network after logging in. In the connection's "General" tab "Automatically connect to this network when it is available" is checked: ![enter image description here](http://i.stack.imgur.com/hxuua.png) The wired network connection is also configured to connect automatically, but it's not been connected for weeks. It and the Wi-Fi are the only configured connections. NM _does_ try to reconnect if I disable and re-enable Wi-Fi after connecting, so at some level I guess it still knows about the auto-connect (or maybe it's just trying to get to the previous state). When I re-enabled Wi-Fi just a few minutes ago it created a _new_ connection with the same name as the existing Wi-Fi connection with a "-1" at the end. After deleting that connection I can no longer reproduce this behaviour. The SSID is not hidden. I just booted, NM auto-connected after login and created another copy of the connection:               $ nmcli c     NAME                      UUID                                   TYPE              TIMESTAMP-REAL                         Wired connection 1        6c870845-d2c0-465a-9f74-ae53ecd6ac0c   802-3-ethernet    Mon 21 Apr 2014 08:23:52 AM BST        BTHub4-GRK6               77cfadf5-e580-411a-978b-3c1d44265373   802-11-wireless   Mon 21 Apr 2014 08:28:52 AM BST        BTHub4-GRK6 1             858e53cc-000b-461f-b2c1-7ce3e761a833   802-11-wireless   never                                   NetworkManager is already running:               $ systemctl status NetworkManager     ● NetworkManager.service - Network Manager        Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled)        Active: active (running) since Thu 2014-05-22 08:13:30 BST; 12h ago      Main PID: 340 (NetworkManager)        CGroup: /system.slice/NetworkManager.service                ├─340 /usr/bin/NetworkManager --no-daemon                └─875 /usr/bin/dhcpcd -B -K -L -G -c /usr/lib/networkmanager/nm-dhcp-client.action wl...


title: Compiling wine application, how do i link to windows.h

text: Please forgive me if i'm asking in the wrong SA. Note: This is **NOT** about compiling wine itself! I am trying to figure out how to compile windows application with wine's windows.h. I have installed wine-dev package and i can see that windows.h was placed in /usr/include/wine/windows/windows.h, but when i try to compile it cannot find it. I have attempted to run               pkg-config --libs wine      But that returns the error:               Package wine was not found in the pkg-config search path.     Perhaps you should add the directory containing `wine.pc'     to the PKG_CONFIG_PATH environment variable     No package 'wine' found      Replacing `wine` with `wine1.6`, `wine-dev`, or `wine1.6-dev` does not resolve the issue.


title: How do I change currently selected keyboard layout from command line?

text: I have my keyboard layouts (two of them) and switching between them configured via the following command:               setxkbmap -layout us,ru -option -option "grp:lctrl_lshift_toggle,ctrl:nocaps"      Now I want to switch to `us` layout, using some command line command. Is that possible?


title: AWS XML response error signature does not match

text: I have a bash script that should return the XML response for AWS EC2 regions but I am getting an XML error response as: > "SignatureDoesNotMatch" The request signature we calculated does not match > the signature you provided. Check your AWS Secret Access Key and signing > method. Consult the service documentation for details. Is the method for generating the signature for EC2 web query correct? Here's the code:               #!/bin/bash          dt=$(date +%FT%TZ | sed 's/:/%3A/g')     echo "$dt"          q="GET     ec2.amazonaws.com     /     Action=DescribeRegions&AWSAccessKeyId=<aws access key>&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=$dt&Version=2013-02-01"          sig=$(echo -en "$q" | openssl dgst -sha256 -hmac "<aws secret key>" -binary | openssl enc -base64)     echo "the signature is $sig"          curl --get --data-urlencode DATA "https://ec2.amazonaws.com/?Action=DescribeRegions&AWSAccessKeyId=<aws access key>&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=$dt&Version=2013-02-01&Signature=$sig"     echo -e "\n\n finished "      P.S: the AWS access key and AWS secret key are removed for security reason, they work very well.


title: Deleting users with nologin shell

text: On a security audit performed on our production Linux servers , we were asked to remove nobody user if no application are using it. I checked and could see that there are no files owned by 'nobody' user.               find / -path /proc -prune -o -user nobody -ls      'nobody' user does not have a login shell, similarly any user who does not have a login, Can it pose any security threat? Is it advisable to delete these users without a login shell?               # grep nobody /etc/passwd     nobody:x:99:99:Nobody:/:/sbin/nologin      Please give your thoughts.


title: Is there a way to bypass .zshrc on login?

text: I'm enjoying learning ZSH, but one thing's bugging me. If I put something in my .zshrc that renders the shell useless (I'm playing with something that affects the way the keyboard is interpreted), then I could end up not being able to fix it unless I can bypass my zshrc on login. Is there a way?


title: Debian install halts

text: I'm running Debian squeeze on my Lenovo laptop. Recently I tried to install Debian Jessie on a different partition. The installation process goes smoothly, but at some point (around 99% completion) my computer just halts. I can boot the system but it is unusable, the window manager won't start and some essential files are missing, for example my user is not even created. Clearly the install crashed. I tried the install again, same thing happens. Did anyone experience something similar? I found nothing useful under `/var/log`, are there any install logs available, if yes where are they located?


title: Prevent root password change in ldap - debian

text: After setting up ldap authentication with pam in debian, evertything works fine. Using the passwd command change the ldap password of the current user. The problem is my ldap has been set up with an "admin" account and a "root" account with admin rights. For historical reasons I cannot change this. How can I make passwd change only the local password for root, and not the ldap one ? Here is the pam config:               account sufficient pam_ldap.so     account sufficient pam_unix.so try_first_pass     account [success=2 new_authtok_reqd=done default=ignore]        pam_unix.so     account [success=1 default=ignore]      pam_ldap.so     account requisite                       pam_deny.so     account required                        pam_permit.so     auth sufficient pam_ldap.so     auth required pam_unix.so nullok_secure try_first_pass          auth    [success=2 default=ignore]      pam_unix.so nullok_secure     auth    [success=1 default=ignore]      pam_ldap.so use_first_pass     auth    requisite                       pam_deny.so     auth    required                        pam_permit.so     password sufficient pam_ldap.so     password required pam_unix.so nullok obscure min=4 max=8 md5 try_first_pass     password        [success=2 default=ignore]      pam_unix.so obscure sha512     password        [success=1 user_unknown=ignore default=die]     pam_ldap.so use_authtok try_first_pass     password        requisite                       pam_deny.so     password        required                        pam_permit.so          session [default=1]                     pam_permit.so     session requisite                       pam_deny.so     session required                        pam_permit.so     session required        pam_unix.so     session optional                        pam_ldap.so     session optional                        pam_ck_connector.so nox11     session required pam_mkhomedir.so skel=/etc/skel/ umask=0022          session [default=1]                     pam_permit.so     session requisite                       pam_deny.so     session required                        pam_permit.so     session required        pam_unix.so     session optional                        pam_ldap.so


I'm installing Arch Linux on a UEFI-GPT computer, dual boot with Windows 8.1. GRUB is installed correctly, but when I inserted the command (on chroot)               grub-mkconfig -o /boot/grub/grub.cfg      I reported various errors on LVM and Windows, including: > NTFS-fs warning (device sdaX): load_system_files(): Windows is hibernated. > Will not be able to remount read-write. Run chkdsk. What happened and could I resolve this? I have disabled fast boot and fast startup on Windows before I install Arch Linux.


title: Replace \n by a newline in sed portably

text: I'm so confused with GNU `sed`, POSIX `sed`, and BSD `sed`'s myriad of options. How do I replace literal `\n` with the newline character using these three `sed` types?


title: Ubuntu filesystem buffers/cache always empty

text: I have a virtual server with ubuntu 10.04.4 LTS and plesk (preinstalled by hosting company).   Now i have seen that the buffers/cache are always empty. Current uptime is 22 days. free and htop shows the same values.               root@server:/root# free -m                  total       used       free     shared    buffers     cached     Mem:          4096        540       3555          0          0          0     -/+ buffers/cache:        540       3555     Swap:         4096          0       4096      mount info:               root@server:/root# mount     /dev/vzfs on / type reiserfs (rw,usrquota,grpquota)     proc on /proc type proc (rw,relatime)     sysfs on /sys type sysfs (rw,relatime)     none on /dev/pts type devpts (rw,relatime)      I have searched stackexchange/google but found nothing. How can I enable filecache or is this not possible cause of vzfs and all is good?!


title: Debian based Raspberry – samba invisible unless I restart

text: I have a Raspberry Pi running Raspbian along with other computers on the same network. I installed, configured and started `samba` to share files from my home folder of the Raspberry Pi to my other computers. It works really well, however I have a problem: Sometimes when I check the network to find my Raspberry Pi samba server, I don't see it. It appears as soon as I restart `samba` on the _RPI_.   1. Is there a way to launch a _"discovery"_ of samba servers?   2. When I restart samba, does it send a broadcast signal to the network to say it is available?


title: Resize a very tiny xcf image without blurring or dithering it

text: I have some drawings I made with an Intuos tablet. All of these drawings are 25x35 or so. The color of each pixel was very carefully selected. They're kind of like 'miniatures.' I need to resize these. But I ran into problems. The images get dithered, and if I make them huge, blurred. Here is the image at normal size. It happens to be dithered, but this is not visible. ![enter image description here](http://i.stack.imgur.com/Wg6ey.jpg) I used the following two imagemagic commands, but they both produced blurring:               convert -resize 400% image.xcf image-2.jpg     convert -adaptive-resize 400% image.xcf image-2.jpg      ![enter image description here](http://i.stack.imgur.com/Bd1a5.jpg)


title: Fork vs. thread system time

text: I got the following logs: **Program 1** : Taken from a program executed 64 `fork` calls:               real 0m0.023s     user 0m0.068s     sys  0m0.008s      **Program 2** : Taken from a program executed 64 `thread` calls:               real 0m0.613s     user 0m0.370s     sys  0m2.027s      I don't understand the difference between the system times. Shouldn't Program 1 System time be **higher** then for Program 2 because of the context switching between the process?


title: Installing Minor Software Updates

text: On an existing `Red Hat Enterprise Linux` server, I need to perform software upgrades on `Java`, `Apache` and `Samba`. I need to install minor updates for each of the above software. How can I figure out how they were installed? How would I go about upgrading the software? **EDIT** I'd like to maintain the `current configuration` of the already mentioned software. Are there any precautions that I need to take when installing the `minor` patches?


title: Opening session via XDMCP to GDM

text: I have a RHEL6 server which we connect via XDMCP. If I start xdm (`xdm &`) it works but the login screen is the old xdm simple login and not gdm. Our RHEL5 servers connect to gdm just fine. The problem is that GDM isn't running. When I try to launch GDM (`gdm &`) it gives me the following message:               ** (gdm-binary:3229): WARNING **: Couldn't connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory      I've also tried using (gdm-binary &) and get the same message.               cat /etc/gdm/custom.conf     # GDM configuration storage     [daemon]     [security]     DisallowTCP=false     AllowRemoteRoot=true     [xdmcp]     Enable=true     [greeter]     IncludeAll=true     [chooser]     [debug]      In /etc/X11/xdm/Xaccess I have the following uncommented: `* #any host can get a login window` In /etc/X11/xdm/xdm-config I have tried commenting and uncommenting the following: `DisplayManager.requestPort: 0` I've referenced several tutorials such as: http://www.yolinux.com/TUTORIALS/GDM_XDMCP.html http://kosala-linux.blogspot.com/2013/02/x-manager-configurations-for- rheloel.html


title: Convert a typescript file to a list of commands (history)

text: I wanted to record a linux session so I could use it as documentation for a "how to install" guide. I found something on the internet that suggested that the script command would be good for this, and so I started it and ran through my installation. Of course, I didn't read closely enough to realize that the script command actually records _keystrokes_ , so when I go to create my documentation it's full of lines that look like this:               $ make test[K[K[K[Kinstall[1@s[1@u[1@d[1@o[1@      I know that I can use script replay to play the script back, but what I really want to do is run something like scriptreplay but pipe the list of commands that would get executed to a file (I don't want to actually run them). Is this possible? I know about the history command, which I probably should have used instead, but I don't have access to the session's history anymore.


title: Running commands after event based outputs

text: there are commands like > iwevent or > tcpdump -n src host x.x.x.x that send to the stdout some lines when something happens. Is there any form of running some command inmmediatly after a line is printed. Ex:               iwevent | echo "Wireless event happened"


title: Emacs Hexl to read device files?

text: I have to manually edit a FAT 16 partition. After trying few hex editors, I decided to try Emacs Hexl.               sudo emacs -> M-x hexl-find-file -> /dev/sdb      The commands open device file but its empty, although others hex editors (including 'sudo cat /dev/sdb') show its content. Why so? Thank you.


title: Why does 'for anytext; do' loop four times?

text: Is this a bug or a feature?   It seems to happen for _unquoted_ alphanumerics. Running GNU bash, version 4.1.5               for alpha01234; do echo $((++i)); done      output:               1     2     3     4


title: How do I create a local copy of a complete website section from OSX using curl?

text: I'm trying to download Mathematics of the Discrete Fourier Transform so that I can read through it off-line on my iPad (which doesn't have an Internet connection) I have used `wget` in Linux. It seems that the OSX alternative is `curl`, but I cannot find how to download recursively anywhere in the mammoth manual page.   Is this even the right tool for the job? If so, how to use it?


title: Cannot open: Input/output error with tar command in a shell script

text: I am trying to create a tar ball in a shell script (I have enabled `set -x`), but I get an error:               + cd /home5/mysite/public_html     + TAR_DUMP=gypo_2012-02-18-03:51:15.tar.gz     + echo 'Tar name: gypo_2012-02-18-03:51:15.tar.gz'     Tar name: gypo_2012-02-18-03:51:15.tar.gz     + tar -cvzf gypo_2012-02-18-03:51:15.tar.gz gypo     ...     tar: gypo_2012-02-18-03\:44\:04.tar.gz: Cannot open: Input/output error     tar: Error is not recoverable: exiting now     ...      The script is the following:               NOW=$(date +"%Y-%m-%d-%T")          # TAR          cd $HOME/public_html     TAR_DUMP="gypo_$NOW.tar.gz"     echo "Tar name: $TAR_DUMP"     tar -cvzf $TAR_DUMP gypo     # mv -t $DEST $TAR_DUMP      Why is tar generating this error and how can I solve it? Thanks.


title: How to have CoreAudio from Mac to Linux/Unix?

text: After using Alsa and PulseAudio for a while, I feel they are not yet strong enough for Audio capture and audio playback. When I test with loud-speaker and microphone, there is self feedback-loop.   When I test with some internal PCI-Express card, Linux audio creates static white noise. It seems that a lot of problems exist, without any permanent solution. I followed many suggestion like using external sound card to resolve such issues. But it turns out that there is something wrong with the Linux audio system, with either Alsa or PulseAudio. The same hardware turns out to be very solid for audio capture and playback by when using Windows 7/8 or Mac OS X. My concern is that Alsa and PulseAudio are not equal to CoreAudio from Mac. And Microsoft Windows also has their own audio platform. What else can I use for Linux? Is it possible to get CoreAudio or another audio platform without using Alsa or PulseAudio? **My setup: (i have tried several)** The main goal is to send PC1 audio to PC2. But for the moment all the audio testing is done in local PC1. Case 1) My PC1 is capturing the audio from its own mother-board sound card. Which creates static white noise, i can not kill this noise, its always there while using mother-board sound card speaker out and mic-in or without mic even there is a static noise. Case 2) My PC1 is capturing the audio from external USB microphone, and My PC1 is also using an external USB creative sound blaster card. In his case, i have less noise now. But there is a problem i can hear myself louder while having the loud speaker volume higher and microphone volume to normal level. This case also get resolve while using Ear phone, instead of using Loud speaker Case 3) My PC1 is capturing its mother-board sound card using general microphone. And speaker out is using external speaker box. I have static noise white noise, not removable. All those case does not happen when i use he same PC1 with Windows XP/ 7/8 or Mac OS X. Only this happening while using Alsa or Pulse audio. For the moment i am using External USB microphone and External USB sound card to avoid the noise. Still without having any solution to remove the self feedback loop.


title: Getting the combined count of all occurences of a string under multiple directories?

text: I have a (hopefully) interesting problem that I could use some advice on. I have a system that's essentially used for storing logs. It has a directory structure like: YYYY/MM/DD/hostname/ There are a number of hostnames, and under each one are a bunch of gzipped hourly logs (access, error, etc). What I'm interested in is the total count of a given string in the access logs broken down by day and hostname. What's the best way to do this? Is this possible with a find and grep combination, or is it too complicated for that and instead need a script? Thanks!


title: Search for values in 2 columns from CSV

text: I have a csv files with say 20 odd columns. I need to get the 14th and 15th column values where value in 14th column is say `"VALUE1"` and value in 15th column is `"VALUE2"`. My condition gets satisfied only when 14th column has `VALUE1` and 15th column has `VALUE2`. I need to get the aggregate count. I think `wc -l` could give me the count list and `cut -d "," -f14,15` gives me the 14th and 15th column values. But how to check whether 14th has `VALUE1` and 15th has `VALUE2`? **UPD** : I think the one below works               grep -r "" * | cut -d " " -f14,15 | grep "Value1" | grep "Value2"      but still I dont think this is the perfect way to do do it.


title: Vim: copy, then paste more than once

text: I use the highlight mode in vim to copy a few characters. I then want to paste more than once. My current technique does not work well. Sample text: `Linux Solaris Irix HP-UX` Suppose I want to copy the word `Linux`, then paste over `Solaris` and `Irix`.   1. Place cursor at `L` in `Linux`   2. Command `v` (for visual hilite), then `e` (for end-of-word), then `y` (for yank/copy)   3. Now `Linux` is on my "vim clipboard"   4. Move cursor to `S` in `Solaris` (first instance)   5. Command `v` (for visual hilite), then `e` (for end-of-word), then `p` (for paste)   6. Text is now: `Linux Linux Irix HP-UX`, but now `Solaris` is on my "vim clipboard"   7. Move cursor to `I` in `Irix` (second instance)   8. Command `v` (for visual hilite), then `e` (for end-of-word), then `p` (for paste)   9. Text is now: `Linux Linux Solaris HP-UX` which is not what I expected. I resort to using highlite/paste with the mouse (via X Terminal). Surely, I can do this better. How?


title: How to change position of unity launcher in Ubuntu?

text: How can I change the position of unity launcher?


title: Is i386 multiarch support broken on amd64 Debian Sid?

text: I am currently experiencing issues with Debian Sid. My architecture is amd64 (x86-64). If I want to install a i386 package and run the following commands:               # dpkg -add-architecture i386     # sudo apt-get update      ... the i386 packages are retrieved correctly (i386 can be seen in the `apt- get update` output), but if I try to install a i386 package it will not work:               $ sudo apt-get install libc6:i386     Reading package lists... Done     Building dependency tree            Reading state information... Done     Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:      libc6:i386 : Depends: libgcc1:i386 but it is not going to be installed     E: Unable to correct problems, you have held broken packages.      If I try to break the circular dependency by specifying that I want to install both libc6 and libgcc1 at the same time, then it gets worse:               $ sudo apt-get install libc6:i386 libgcc1:i386     [insert here the list of all my packages that will be removed]     0 upgraded, 5 newly installed, 2428 to remove and 0 not upgraded.     Need to get 5538 kB of archives.     After this operation, 6787 MB disk space will be freed.     You are about to do something potentially harmful.     To continue type in the phrase 'Yes, do as I say!'      ?]      It seems that it wants to remove all my amd64 packages and replace them by i386 ones despite that both of these packages are co-installable (Multi-Arch is set to same in the Debian control file). Notes:   1. I am up-to-date and this is not a glitch due to some package update as I can reproduce the bug for several days after several repositories update.   2. I am using Debian Sid on purpose and I am aware of its intrinsic instable nature. I still would like to understand what is causing this problem.


title: Ignore files when building debian package

text: When I build `myproject` with the command:               dpkg-deb -z8 -Zgzip --build myproject      It packs all files inside the package. Is there a way to ignore some folders from being packed inside the deb-file? If I could ignore the folder `.git` then I could use the git-repository folder directly for generating the debian package.


title: Where do drafts go when mutt crashes?

text: Sometimes a message doesn't get sent for whatever reason (e.g. a crash or shutdown). I can't find the message in the `Drafts` maildir (`/new`, `/tmp`, or `/cur`). Surely mutt must save the message somewhere that doesn't get wiped in case of an unclean shutdown?


title: Language variable missing after the update

text: It appears that language variable is missing after our recent update to our Linux servers. We are running Redhat 5 on them. Is there anyway update can remove variables? The env output shows nothing set for the language although root was not affected by this.


title: Adding "random number entropy" for GPG keys?

text: In the following video: _Linux HOWTO: Secure Your Data with PGP, Part 2_, you are shown how to create a key pair with `gpg`. At about `1:50`, the instructor says the following: > While the key is being generated, it is a good idea to **move your mouse > around** a little bit to give it a bit more random number entropy for the > creation of the keypair. This seems to me like a myth, especially since command-line tools shouldn't usually be affected by the cursor. On the other hand, I have no clue how Linux's random number generator works, whether it is shared by the GUI or independent from it. Is there any stock in what he claims, or this an example of cargo cult programming?


title: Getting Source as Flatfile and to remove the Carriage returns and \n ...special charaters?

text: I have an issue where I am getting a flatfile source with a huge number of records with PIPE delimiters and one of the fields is getting carriage returns (in multiple lines) and starts with a newline (`\n`). So how can I remove the `\n` character in the file? Example:               -000123456|1654321|6/12/2002 8:49:20 AM|     tt Cynthia L Eggleston E456585 remove move the funds adv account in fcle flagged on 710091 pmt due 12-16- 15|      Can anyone suggest how to proceed?


title: What kind of notification is Firefox sending when a download has finished?

text: I'm using the dynamic window manager of suckless (dwm). I noticed that `firefox` is able to send nice notifications when a download has finished. See the two figures ![no notification](http://i.stack.imgur.com/lOnK0.png) When I'm on a different tag, I get this kind of notification (inverted `1` tag) upon a finished download. ![notification](http://i.stack.imgur.com/AbAvT.png) I'd like to use this kind of notification for my other `uxterms`. E.g. in case a long job has finished it should light up like above. At best, this would also work inside the `GNU screen` sessions that I'm using. I'm not sure if this is a `Xorg` or a `dwm` feature. Any ideas? **EDIT:** The answer of @scai is very much to the point, but lacks the full compatibility with `GNU screen`. In case anybody can still improve this, it'd be very much appreciated.


title: Does a return from a shell command guarantee that output files have been written?

text: I'm building an OSX app and use the screencapture command to grab a screenshot and write it to disk:               screencapture -mT0 ~/screenshot.png      Can I, if I'm not running a UNIX commands in the background, expect the file to be completely output when the command has been executed and I have received an exit status?


title: Possible missing firmware

text: I've just installed Backtrack 5 r3 (Gnome, 64bits) on my new machine but I am kind of facing a problem. I tried installing ATI driver, gparted, and libc for 32-bit support and I always seem to be getting a common error line with all of them: > W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168f-2.fw for module > r8169   > W: Possible missing firmware /lib/firmware/rtl_nic/rtl8168f-1.fw for module > r8169 What is this problem, and how can it be fixed? If you want more information, please make a comment EDIT:   The error message I get when trying to install > linux-firmware   > > > Error! Bad return status for module build on kernel: 3.2.6 (x86_64)   >  Consult the make.log in the build directory   >  /var/lib/dkms/fglrx/8.723.1/build/ for more information. dpkg: error   >  processing fglrx (--configure): subprocess installed   >  post-installation script returned error exit status 10 dpkg:   >  dependency problems prevent configuration of fglrx-amdcccle:   >  fglrx-amdcccle depends on fglrx; however: Package fglrx is not   >  configured yet. dpkg: error processing fglrx-amdcccle (--configure):   >  dependency problems - leaving unconfigured No apport report written   >  because the error message indicates its a followup error from a   >  previous failure.   >  Processing triggers for python-gmenu ... Rebuilding   >  /usr/share/applications/desktop.en_US.utf8.cache...   >  Processing triggers for initramfs-tools ... update-initramfs:   >  Generating /boot/initrd.img-3.2.6 Processing triggers for   >  python-support ... Errors were encountered while processing: fglrx   >  fglrx-amdcccle E: Sub-process /usr/bin/dpkg returned an error code (1)   > EDIT2:   The contents of make.log file in /var/lib/dkms/fglrx/8.723.1/build/                 doing Makefile based build for kernel 2.6.x and higher     rm -rf *.c *.h *.o *.ko *.GCC* .??* *.symvers     make -C /lib/modules/3.2.6/build SUBDIRS=/var/lib/dkms/fglrx/8.723.1/build/2.6.x modules     make[1]: Entering directory `/usr/src/linux-source-3.2.6'            WARNING: Symbol version dump /usr/src/linux-source-3.2.6/Module.symvers                is missing; modules will have no dependencies and modversions.            CC [M]  /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.o     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c:113:28: error: linux/smp_lock.h: No such file or directory     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c:402: error: unknown field ‘ioctl’ specified in initializer     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c:402: warning: initialization from incompatible pointer type     In file included from /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c:443:     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/drm_proc.h: In function ‘FGLDRM__vma_info’:     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/drm_proc.h:497: warning: format ‘%08lx’ expects type ‘long unsigned int’, but argument 5 has type ‘phys_addr_t’     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c: In function ‘fglrx_pci_suspend’:     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c:833: error: implicit declaration of function ‘acquire_console_sem’     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c:855: error: implicit declaration of function ‘release_console_sem’     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c: In function ‘firegl_init_module’:     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c:1028: error: ‘SPIN_LOCK_UNLOCKED’ undeclared (first use in this function)     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c:1028: error: (Each undeclared identifier is reported only once     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c:1028: error: for each function it appears in.)     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c: In function ‘KCL_SetPageCache_Array’:     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c:1316: warning: passing argument 1 of ‘KCL_ConvertPageToKernelAddress’ makes pointer from integer without a cast     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.h:325: note: expected ‘void *’ but argument is of type ‘long unsigned int’     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c: In function ‘__ke__cmpxchg’:     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c:1473: error: variable or field ‘__ret’ declared void     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c:1473: error: variable or field ‘__old’ declared void     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c:1473: error: variable or field ‘__new’ declared void     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c: In function ‘KCL_GlobalKernelLock’:     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c:1866: error: implicit declaration of function ‘lock_kernel’     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c: In function ‘KCL_GlobalKernelUnlock’:     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c:1872: error: implicit declaration of function ‘unlock_kernel’     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c: In function ‘KAS_Mutex_Initialize’:     /var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.c:5051: error: implicit declaration of function ‘init_MUTEX’     make[2]: *** [/var/lib/dkms/fglrx/8.723.1/build/2.6.x/firegl_public.o] Error 1     make[1]: *** [_module_/var/lib/dkms/fglrx/8.723.1/build/2.6.x] Error 2     make[1]: Leaving directory `/usr/src/linux-source-3.2.6'     make: *** [kmod_build] Error 2     build failed with return value 2


title: SQUASHFS 3 vs 4

text: I'm trying to modify a firmware file by unsquashing it, editing my files and squash it again. But I got problems with the device which does not accept the file because of different squashfs types (as I suppose). Here's the output on my dev box: **original file:**               user@ubuntuVM:~$ unsquashfs -s main-fs.5_0      Reading a different endian SQUASHFS filesystem on main-fs.5_0     Found a valid big endian SQUASHFS 3:0 superblock on main-fs.5_0.     Creation or last append time Thu Aug 21 20:56:15 2008     Filesystem size 9653.75 Kbytes (9.43 Mbytes)     Block size 65536     Filesystem is not exportable via NFS     Inodes are compressed     Data is compressed     Fragments are compressed     Always_use_fragments option is not specified     Check data is not present in the filesystem     Duplicates are removed     Number of fragments 105     Number of inodes 1667     Number of uids 2     Number of gids 1      **modified file:** (used `mksquashfs squashfs-root main-fs.test -b 64K -no- exports -no-xattrs -no-sparse -force-gid 0 -force-uid 0` as root)               user@ubuntuVM:~$ unsquashfs -s main-fs.mod     Found a valid SQUASHFS 4:0 superblock on main-fs.mod.     Creation or last append time Mon Dec  3 14:46:07 2012     Filesystem size 9654.48 Kbytes (9.43 Mbytes)     Compression gzip     Block size 65536     Filesystem is not exportable via NFS     Inodes are compressed     Data is compressed     Fragments are compressed     Always_use_fragments option is not specified     Xattrs are not stored     Duplicates are removed     Number of fragments 105     Number of inodes 1667     Number of ids 1      I think the problem is the superblock and/or SQUASHFS version. I found that it was possible to us `mksquashfs -2.0` for some time, but this argument got removed and would not be so helpful because I need version 3. So my question exactly is: How can I achieve to repack my modified files exactly as they were before? Additionally my modificated file states `compression: gzip` but the original states nothing about it's compression. Maybe here is a problem too, but I don't know how to get more info than the above. :-(


title: In emacs (or other editor) how to display the byte offset of the cursor?

text: The question indicates my preference to use emacs, but the overriding issue is that I want to be able to do a normal text search and somehow see/copy-paste the _byte-offset_ of the matched text. To be clear, by _byte-offset_ , I do not mean emac's _point_ value, which shows the number of _characters_ from the start of the buffer, eg. in UTF-16LE, _point_ considers `\x0d\x00\x0a\x00` as 1 character, whereas I'm interested in it as 4 bytes. Any other editor (or viewer) which presents this basic information while displaying the text in a "normally" readable and searchable fashion is worthwile. Even a hex view with a synchronized _normal-text_ view would be okay, but a typical Hex-dump viewer/editor is not what I'm after, as they (typically) only display ASCII chars, and I haven't found a FOSS Hex-dump viewer/editor which can perform a simple text-mode search for non ASCII UTF-8 or for any UTF-16 strings. I'm primarily concerned with legibility and search-ability of the text, so a "normal" Hex dump program is only a fallback (which I'm already using).


title: How to visualize directory tree structures?

text: I know I can use `tree` to show the nested content of a directory. Alas, its output is hardly beautiful as I want to include it in a documentation. So eye- candy is a requirement. So I was wondering if there is an easy way to generate a more beautiful representation of a directory's tree structure. I wouldn't mind a solution that generates awesome images with fancy configurable colors.


title: How to install wine-1.4 in the sid repo?

text: I want to install the latest version of Wine in my Debian box. There is `wine_1.4-0.1_i386.deb` in the `pool/w/wine/` directory in the Debian mirrors. I have added `testing`, `sid` repos in the `sources.list` file. However, the latest wine I can install is always `1.2.3-0.3`. Run `apt-cache policy wine` shows:               wine:       Installed: (none)       Candidate: 1.2.3-0.3       Version table:          1.2.3-0.3 0             500 http://mirrors.xxx.com/debian/ testing/main i386 Packages             500 http://mirrors.xxx.com/debian/ sid/main i386 Packages          1.0.1-3.1 0             500 http://mirrors.xxx.com/debian/ squeeze/main i386 Packages             100 /var/lib/dpkg/status      The existed version `1.4-0.1` doesn't show in any sources. I have also tried:               sudo apt-get install wine=1.4-0.1      to install the explicit version 1.4-0.1, but still no success. How to install wine-1.4 by force? Should I download the `.deb` packages manually and run `sudo dpkg -i ...`?


title: Port forwarding using iptables on Linux

text: I want to forward a local port to a remote port (8041) to a port (8042) on a remote machine (10.0.0.42). I can do this via               ssh -L 10.0.0.41:8041:10.0.0.42:8042 user@localhost      where `10.0.0.41` is bound to `eth0`. Now I want to do this without all the userland and encryption overhead. My guess would be               iptables -t nat -A PREROUTING -i eth0 -p tcp -d 10.0.0.41 --dport 8041 -j DNAT --to 10.0.0.42:8042      and enable ip-forward - but it does not work.


title: FreeRadius/Samba/Winbind "reading winbind reply failed" error

text: I'm trying to set up FreeRadius (on debian 7, samba 3.6.6) to authenticate with AD, and I've successfully joined the the radius machine to the domain (server 08 r2). I can successfully run   * `wbinfo -u & -g`   * `ntlm_auth --request-nt-key --domain=MYDOMAIN --username=user --password=password`   * `kinit user@DOMAIN.COM` so all seems good. However when I run               radtest -t mschap user password localhost 0 testing123      I get               Access-Reject ....[snip]...MS-CHAP-Error = "\000E=691 R=1"      The debug output shows this:               Exec-Program output: Reading winbind reply failed! (0xc0000001) ..[snip]..     MS-CHAP-Response is incorrect      I am seeing the appropriate `\--nt-response={longstring}` so I don't believe this is an issue with auth to AD (as I do when I run `ntlm_auth` in terminal). My reading says that this may be a permissions issue. However I have added the freeradius process (`freerad`) to `/etc/group` (`winbindd_priv:x:119:freerad`), and I still see the error. I've searched and found nothing else to try... Any ideas?


title: ImageMagick convert script is failing to generate thumbnails

text: Product Information: ImageMagick Vers : ImageMagick-6.8.6 Operating System : RHEL 6.4. We are using ImageMagick in our CMS application to convert eps files to png files. But the script is not able generate thumbnails while converting. Our application is running on a Linux system. When we run the `identify` command on one such file, we get the following:               # identify tmp/ADVAIR_DISKUS_250.eps     identify: no decode delegate for this image format `tmp/ADVAIR_DISKUS_250.eps' @ error/constitute.c/ReadImage/552      Can some one suggest how to address this issue?


title: Clearing/modifying previous libnotify notifications?

text: I have written a script which generates notifications like this:               notify-send -i audio-card "Transferring audio playback to speakers." \         "Audio playback has been transferred to the analog output speaker system."      Is there any way to clear or to replace these notifications from the command line or from Python? Essentially, I have a script which toggles between two PulseAudio sinks and I'd like to clear previous notifications of this type to replace them with the updated text if the user toggles quickly.


title: nm-applet runs fine from the command line but not at startup

text: If I run nm-applet from the command line, it works fine, and an icon appears in my notification area. But, I have `nm-applet` in my list of startup applications, and it fails to load when I log in. How do I get it to start when I log in? I'm using MATE in Linux Mint 16 Petra.


title: Can I get vim-stlye (hjkl) navigation for GNU info?

text: The layout of my netbook's keyboard means that using the arrow keys for navigation is slightly uncomfortable. Is there a way to make GNU Info pages use vim-style `hjkl` navigation? I know I can               info printf | less      ...and use j and k to scroll up and down, which is good enough as I use info pages for reading so navigating to specific characters isn't vital; but it would be nice if I could do this within `info`, rather than resorting to a pipe.


title: Running Ubuntu of a USB stick. Can't install wireless driver

text: I've installed Ubuntu 12.04 on my 8 gb USB stick, and got it running. It seems like I don't have the full Ubuntu OS on the stick though, and that was my intention. Anyway, I can run a "demo" version it seems, and it looks like the normal installation of Ubuntu but with a installer package on the desktop. The issue surfaces when i try to download the driver for my wireless card, it downloads it for a bit, then throws some error, and if I press anything after that my screen basically looks like a graphic card meltdown. ( lines in different colors all over the screen ). All I want to do is have the USB being able to use the computers wireless card. It does not even have to be Ubuntu, just a basic OS i can access the internet with, and save files to the local hard drive. (A basic text editor aswell) Does anyone have any idea? EDIT: This is how it happens   1. I choose "Try Ubuntu" in the UNetBootin bootloader   2. It loads Ubuntu (without the files i made last time i tried this)   3. It tells me I'm missing a driver, in this case Broadcom Wireless driver.   4. I press install and about 2/3 in i get this error: BUG: Unable to handle kernel NULL pointer dereference at (null) and log of the call stack, but i didn't manage to write it down before the screen are unreadable Note: One of my attempts it installed the driver just fine and asked me to restart. I did, and noticed the Wireless button was blue (on my laptop). However, just before i added my home network, it froze and i had to restart. Driver was gone, and i was back to scratch.


title: How to set a variable equal to the output from a command in GRUB2?

text: I want to customize a little my GRUB 2 bootloader, so I'm asking how can I set a variable equal to the output from a command in GRUB2? I am interested to pass the output of `date` command to a variable. Moreover, how can I retain only the time or hour in that variable?


title: XFS: rm does not terminate, xfs_repair not possible

text: I have a 500 GByte disk with a single XFS file system on it (EDIT: the OS is on another disk). On this disk I have backup data in the form of multiple hard-linked copies of the original data. After each new backup I delete the directory containing the data of the oldest backup. The corresponding `rm` process sometimes does not terminate (and consumes a lot of CPU). Killing it (-9) does not help, only rebooting the system does. I tried running `xfs_repair` on that volume. However, it seems I do not have enough RAM for that (the machine has 4 GByte RAM and only supports 32bit). The location of the machine makes it very hard for me to physically touch the hard disk. How can I repair my file system and/or make `rm` terminate? EDIT: I ran `xfs_repair -v -t 1 /dev/disk/xxx` with `xfs_repair version 3.1.7`. EDIT: Output:               Phase 6 - check inode connectivity...             - resetting contents of realtime bitmap and summary inodes             - traversing filesystem ...             - agno = 0     failed to create prefetch thread: Resource temporarily unavailable             - agno = 1     failed to create prefetch thread: Resource temporarily unavailable             - agno = 2     failed to create prefetch thread: Resource temporarily unavailable             - agno = 3     failed to create prefetch thread: Resource temporarily unavailable             - agno = 4     failed to create prefetch thread: Resource temporarily unavailable             - agno = 5     failed to create prefetch thread: Resource temporarily unavailable             - agno = 6     failed to create prefetch thread: Resource temporarily unavailable             - agno = 7          fatal error -- calloc failed in dir_hash_init


title: how to keep file owner same for newly created files

text: This question is regarding samba file access. I have created a folder A, and under folder A created two folders B and C. And also created three users A, B and C. User A has access to all three folders but User B has only access to folder B and User C has only access to folder C. Permission of B & C folders are:               drwxrwxr-x 3 a b 4096 May 10 16:22 b     drwxrwxr-x 3 a c 4096 May 10 16:43 c      Problem: When user B creates any new file under folder B, it's permission becomes               drwxr-x--- 2 b b 4096 May 10 16:21 New Folder      whereas I want it to keep the owner, group and permission same as folder B for any newly created files.


title: curl --resolve appears to do nothing

text: The `\--help` output for curl lists a `\--resolve` option, which states               --resolve <host:port:address> Force resolve of HOST:PORT to ADDRESS      I'm not having any luck getting it to work though. The basic command I'm trying to run is               curl --resolve foo.example.com:443:localhost https://foo.example.com:443/      and I keep getting the response `Couldn't resolve host 'foo.example.com'`. I want do do this because I'm testing a certificate for foo.example.com, but I'm not testing it on the actual server. Instead, I'm testing it on a dummy machine. I know that I can edit `/etc/hosts` so that foo.example.com resolves to localhost, but this curl approach seems like it would be the "correct" way to go, if I could make it work. Does anybody see what I'm doing wrong here?


title: du reports surprising total size for same data

text: Don't worry, this isn't typical "du vs. df" question. :-) I mounted a squashfs image (via loop) and used du to reported the size: `du --apparent-size -lsh image1/` which reported 215M. Then I used rsync ("rsync -aS") to copy all files to a real partition (ext4). To my surprise du reports for this directory now: 302M. Where do the additional 87MB come from? Without --apparent-size the values are 242M and 676M, respectively.


title: Where can I find some good documentation for bash printf?

text: `man printf`, `info printf` and `printf --help` are all pretty useless to me; I want an explanation of the `FORMAT` options. For example, I could use:               printf '%s\n' foo bar      and get output:               foo     bar      From general reading online I surmise that `%s` means something like 'separator', so with it `printf` prints every argument provided to it, separated by newlines. I've also seen references here and there to `%d` and a number of others (I think it's something to do with digits?). Could someone please provide an overview of these formatting options?


title: How to make tightvnc listen for incoming connections on port 5900?

text: I'm running tightvnc on a raspberry pi and looking at the log               /root/.vnc/hostname:5900.log      I see this line:               30/04/14 09:23:18 Listening for VNC connections on TCP port 11800      How can I change this so it listens on port 5900?


title: Hotmail Folders

text: Is there a linux mail client I can use that will let me see my folders in Hotmail and persist the changes back to the server? Kind of like the Hotmail connector for Outlook, or Windows Live Mail? I'm using openSuse and KDE desktop, with Gnome application support.


title: Direct i2c hardware access

text: I have a custom hardware, i.mx6q based board, running a custom stripped version of Debian, the usual Linux tools to make life easy are not available. Can I read and write to i2c directly with root access to `/sys/bus/i2c/devices/[device]` using standard tools such as `echo`, etc?


title: What was superuser password set?

text: > **Possible Duplicate:**   >  Is there a root password on OS X and Ubuntu? After I installed Ubuntu, I noticed that I'm not sure what was superuser password set, If I set it at all. I know that I created a user via which I'm logging in. But when I write `su` command the password for the user I created does not work. Does it mean that superuser is the one user I created and I can use `sudo xralf` to gain superuser privileges? Is there some material on this topic. I'm still little confused how this works in Linux.


title: How to Cygwin Xwin -query an Ubuntu 11.10 Xserver?

text: I am running **Cygwin 1.7** on **Win7 Pro x64** , and I can query my **Ubuntu 10.04 LTS** server just fine.               XWin.exe -clipboard -once -rootless -nodecoration -notrayicon -query $IP_ADDRESS      I recently installed Ubuntu 11.10 with XFCE desktop on another machine, and I cannot connect to this one. Of course, I enabled TCP and XDMCP in LightDM using **/etc/lightdm/lightdm.conf**               [SeatDefaults]     # ...     xserver-allow-tcp=true          [XDMCPServer]     enabled=true      and I think the fact that I can connect using my **Xubuntu 11.10** laptop proves that it works.               X -query $IP_ADDRESS :1      **Xwin** fails to connect, while logging something like:               [333305.324] XDMCP fatal error: Session failed Failed to connect to display :0     [333305.324]      [333305.324] Server terminated with error (1). Closing log file.      Today I updated Cygwin.               CYGWIN_NT-6.1-WOW64 1.7.9(0.237/5/3) 2011-03-29 10:10      Still doesn't work. Does anyone have a clue as to what 'feature' the new and improved LightDM or Xserver has that I forgot to take into account? Oh and did I mention the exact same **Cygwin/Xwin** connects to **Ubuntu 10.04** just fine, using the same command line (different IP of course)?