title: USB audio only outputs white noise

text: I am running OpenBSD/i386 5.1 on a 5 year old laptop. The speakers and headphone port work, but the headphone port is a little loose so I am trying to install an external USB sound card (Fiio E17 USB DAC). No problems using it on Windows. The device is detected and I created a node for it in `/dev` with `sh /dev/MAKEDEV audio1`, then linked the rest of the devices to point to the new sound card. So far so good, I am able to run `cat /dev/urandom > /dev/audio` and I hear white noise. However, I am not able to run any other audio through it. My `tail /var/log/messages` after plugging the device in:               Aug 30 10:03:55 s96j /bsd: uhidev0 at uhub1     Aug 30 10:03:55 s96j /bsd:  port 1 configuration 1 interface 0 "FiiO FiiO USB DAC-E17" rev 1.10/0.01 addr 2     Aug 30 10:03:55 s96j /bsd: uhidev0: iclass 3/0     Aug 30 10:03:55 s96j /bsd: uhid0 at uhidev0: input=18, output=27, feature=0     Aug 30 10:03:55 s96j /bsd: uaudio0 at uhub1     Aug 30 10:03:55 s96j /bsd:  port 1 configuration 1 interface 1 "FiiO FiiO USB DAC-E17" rev 1.10/0.01 addr 2     Aug 30 10:03:56 s96j /bsd: uaudio0: ignored setting with type 8193 format     Aug 30 10:03:56 s96j /bsd: uaudio0: audio rev 1.00, 2 mixer controls     Aug 30 10:03:56 s96j /bsd: audio1 at uaudio0      My list of relevant devices from `/dev`:               lrwxr-xr-x  1 root  wheel         6 Aug 30 09:44 audio -> audio1     crw-rw-rw-  1 root  wheel   42, 128 Aug 30 10:07 audio0     crw-rw-rw-  1 root  wheel   42, 129 Aug 30 10:15 audio1     crw-rw-rw-  1 root  wheel   42, 130 Aug 30 06:40 audio2     lrwxr-xr-x  1 root  wheel         9 Aug 30 09:44 audioctl -> audioctl1     crw-rw-rw-  1 root  wheel   42, 192 Aug 30 06:40 audioctl0     crw-rw-rw-  1 root  wheel   42, 193 Aug 30 09:44 audioctl1     crw-rw-rw-  1 root  wheel   42, 194 Aug 30 06:40 audioctl2     lrwxr-xr-x  1 root  wheel         6 Aug 30 09:45 mixer -> mixer1     crw-rw-rw-  1 root  wheel   42,  16 Aug 30 06:40 mixer0     crw-rw-rw-  1 root  wheel   42,  17 Aug 30 09:44 mixer1     crw-rw-rw-  1 root  wheel   42,  18 Aug 30 06:40 mixer2     lrwxr-xr-x  1 root  wheel         6 Aug 30 09:45 sound -> sound1     crw-rw-rw-  1 root  wheel   42,   0 Aug 30 06:40 sound0     crw-rw-rw-  1 root  wheel   42,   1 Aug 30 09:44 sound1     crw-rw-rw-  1 root  wheel   42,   2 Aug 30 06:40 sound2      A simple test from the FAQ to determine if data is passing over the device:               # cat > /dev/audio < /dev/zero &     [1] 21098     # audioctl play.{seek,samples,errors}     play.seek=61712     play.samples=1146080     play.errors=0     # audioctl play.{seek,samples,errors}     play.seek=52896     play.samples=1542800     play.errors=0     # audioctl play.{seek,samples,errors}     play.seek=61712     play.samples=1957152     play.errors=0      My `audioctl -a`:               name=USB audio     version=     config=uaudio     encodings=slinear_le:16:2:1,slinear_le:24:3:1     properties=independent     full_duplex=0     fullduplex=0     blocksize=8816     hiwat=7     lowat=1     output_muted=0     monitor_gain=0     mode=     play.rate=44100     play.sample_rate=44100     play.channels=2     play.precision=16     play.bps=2     play.msb=1     play.encoding=slinear_le     play.gain=127     play.balance=32     play.port=0x0     play.avail_ports=0x0     play.seek=8816     play.samples=131988     play.eof=0     play.pause=0     play.error=1     play.waiting=0     play.open=0     play.active=0     play.buffer_size=65536     play.block_size=8816     play.errors=2267     record.rate=44100     record.sample_rate=44100     record.channels=2     record.precision=16     record.bps=2     record.msb=1     record.encoding=slinear_le     record.gain=127     record.balance=32     record.port=0x0     record.avail_ports=0x0     record.seek=0     record.samples=0     record.eof=0     record.pause=0     record.error=0     record.waiting=0     record.open=0     record.active=0     record.buffer_size=65536     record.block_size=8816     record.errors=0      And lastly, my `mixerctl -a`:               outputs.aux.mute=off     outputs.aux=255,255      Again I am able to `cat /dev/urandom > /dev/audio` and get white noise, but nothing else I've tried lets me output other sounds or music. I also tried `cat sample.au > /dev/audio` but that was silent as well. Any suggestions or help would be greatly appreciated! Worst case, hopefully someone can use the steps I outlined here to troubleshoot their own sound devices.


title: Packet analyzer to intercept and filter incoming traffic before any client app

text: I am curious if most Linux distros make it possible to intercept incoming network traffic as soon as it enters the system and filter its content based on some rules before any other client can use it or at least before it gets to a specified client. E.g., let's say I wanted to have a filter that intercepts all HTTP traffic before it gets to a specific client (e.g. Firefox) and, if some pattern is matched, modify the HTML. Or replace all content coming from a certain remote host. I would like to be able to do that before it hits any client, regardless of the client. Does Linux allow for that kind of packet filtering? Additionally, I would also like to know what the workflow of a network packet is once it enters the computer from the port, i.e. if there is a sequence of steps assigned that gets performed before it becomes available to the client app that invoked it.


title: cut / grep and df -h

text: How can I grep or cut the "173G" under "Verf"? I need this for Unix scripting in school.               jonas@jonaspc:~/$ df -h /dev/sda2     Dateisystem    Größe Benutzt Verf. Verw% Eingehängt auf     /dev/sda2       293G    121G  173G   42% /media/Windows


title: random number needed

text: I need a command line script that will generate a random integer between 1 and 6. I'm using Ubuntu with bash.   I was working on this a couple of months ago using 'bc', but never got it to work completely. I've since forgotten where I got to. I'm using this to change a crontab script so that it will not always run every 15 minutes, but at random times (15+-3 minutes). ie. change the crontab to be every 12 minutes, and then in the script sleep for 1-6 minutes before running the script (which is basically a wget to check on the status of a webpage).


title: A problem with mknod when logged in as root

text: I am trying to load a char device driver written by myself. To achieve this I use a modified bash script published on this site: http://www.makelinux.net/ldd3/chp-3-sect-2. Here is my version of the script:               #!/bin/sh          device="ki32"     module="ki32"     mode="664"          if [ $2 = "start" ]; then              /sbin/insmod $1/$module.ko || exit 1              rm -f /dev/${device}         major=`cat /proc/devices | grep "$module" | sed 's/\([0-9]*\)\( [a-zA-Z]*\)/\1/'`         mknod /dev/${device} c $major 0         chmod $mode /dev/${device}     elif [ $2 = "stop" ]; then              /sbin/rmmod $module.ko         rm -f /dev/${device}     fi      However the script fails showing a message similar to this:               # mknod: `/dev/ki32': Invalid argument      The same thing happens when I execute the command outside the script, still logged as root of course. Your help is greatly appreciated.


title: 'yum update' without internet connectioon

text: I have a PC and a laptop. my laptop is always updated, so for updating the PC I don't want to download the packages again for my PC. What I do is copying rpm files from `/var/cache/yum/i386/17/fedora/updates/packages` to the corresponding directory of the PC. Is there a better/faster way to do this? can I say yum connect with ssh to laptop and get updated packages from there?


title: Two EFI disks with Grub2

text: I bought two SSD disks and as usual I though that installing Windows on a completely separate disk would be the easiest solution, but I can't find any tutorials for dual booting with grub2 (efi). All tutorials assume one EFI boot partition. Using just:               menuentry "Windows 7" {             set root=(hd1,1)             chainloader +1     }      Gives me invalid EFI path. What is the correct configuration?


title: Error "parted: invalid token: 1" When Using Parted To Format A Partition?

text: Screenshot: http://imgur.com/DQnhwG2   ![ss of term](http://i.stack.imgur.com/t2ZUL.png) I'm trying to format an existing ext2 partition as ntfs (or any filesystem) using the mkfs command in Parted, but when I specify the partition to format I get:               parted: invalid token: 1      "1" being the partition number I specified. I'm not sure what's wrong. The goal here is to find the correct command. I'm not interested in work-arounds using a different program. I'm just doing this to learn the ins/outs of Parted. I've already read the manuals, and a ton of blog posts. The command I used was:               $ mkfs 1 ntfs      Details:   * Ubuntu 12.04 - Desktop X86-64   * Parted 2.3   * There is no valuable data on the machine. It's just a vm running Ubuntu with 2 virtual hard drives attached. Sda: Ubuntu Sdb: The drive for testing Parted


title: Remove prefixes from filenames

text: I have a bunch of files as follows:               04602635_b0294.DAT20120807164534     04602637_b0297.DAT20120807164713     04602638_b0296.DAT20120807164637     04602639_b0299.DAT20120807164819     04602640_b0298.DAT20120807164748     04602641_b0300.DAT20120807164849     04602650_b0301.DAT20120807164921     04602652_b0302.DAT20120807164956      I need to rename them to exclude the prefix. It needs to look like this..               b0294.DAT20120807164534     b0297.DAT20120807164713     b0296.DAT20120807164637     b0299.DAT20120807164819     b0298.DAT20120807164748     b0300.DAT20120807164849     b0301.DAT20120807164921     b0302.DAT20120807164956      **EDIT** I forgot to add that I am using Solaris.


title: What would it take to add a command to run a script at the completion any given random task?

text: I was playing around with Pushover, and had the thought that it would be cool if I could use it as an argument on any random command, so that it would run a pushover script at the end of the task, regardless of what that task was. I have no idea if it's possible, or how I would go about it, but I'd like to learn. This question on the RasPi Stack Exchange site is what got me thinking about it. But I think there are many things it would be useful for, like letting you know when that compile job is finally finished, and maybe if it was successful. I had the thought that it could look something like:                    $ apt-get -b source packagename -pushover "Compile job complete."      The thought being that the argument '-pushover [enter message text here]' after any command would execute the pushover script, and use their API to notify you via their app. So I guess the question is, is it possible to do in this fashion? If so, where do I start? If not, are there better ways to accomplish the same thing, without being limited by what command you are running? I'm not locked on the idea of using it as a command argument, but I do want a way to run it with any command, without writing a separate script for each one. I am new to Linux, so if it is a non-starter idea, I'll take that answer, too, provided there are logical explanations of why it won't work to go with it.


title: Mount image user-readable with udisks2

text: Loop devices, i.e. for mounting raw disk images, can be managed without root privileges using udisks. For testing purposes, an image can be created and formatted like so:               dd if=/dev/urandom of=img.img bs=1M count=16     mkfs.ext4 img.img      And then setup using udisks               udisksctl loop-setup -f img.img      This creates a loop device for the image and mounts it to a new directory under `/run/$USER`, just like any local hard drive managed by udisks. Only the permissions are not what I expected.               # ls -l /run/media/$USER/     drwxr-xr-x 3 root  root   1024 Apr 10 11:19 [some id]     drwx------ 1 auser auser 12288 Oct 30  2012 [a device label]      The first one listed is the loop device, owned by root and not writable by anybody else. The second one is a local hard drive or an USB pen device mounted for comparison, belonging to the user who mounted it. I know that I could fix this with a simple `chmod` executed as root. But why does udisks assign different permissions and owners? Can it be configured to do otherwise?


title: uwsgi install in Debian 6 (Squeeze) wants to upgrade libc6 and initscripts

text: I'd like to install `uwsgi` on my Debian server. This package wants to upgrade some core packages:   * `libc6` from 2.11.3-3 (now, stable) -> 2.13-35   * `initscripts` from 2.88dsf-13.1+squeeze1 (now, stable) -> 2.88dsf-13.3 Can I do this safely, or is there a way to install this package without upgrading libc6? I have the following in the `/etc/apt/preferences` file:               Package: *     Pin: release a=stable     Pin-Priority: 1001          Package: *     Pin: release a=testing     Pin-Priority: 60          Package: *     Pin: release a=unstable     Pin-Priority: 50          Package: fabric     Pin: release a=unstable     Pin-Priority: 2000


title: what does "Read Swap Header failed: Success" mean?

text: I'm trying to install Arch Linux (from the 2014-04-01 snapshot). I've made a swap file and tried to `swapon` it, but I got an error(?) message I don't understand. I've executed               fallocate -l 512M /mnt/sda2/swapfile     chmod 600 /mnt/sda2/swapfile     swapon /mnt/sda2/swapfile      and the output is               swapon: /mnt/sda2/swapfile: read swap header failed: Success      and I have `:(` at the end of my command line. So did it succeed or fail? Is this not how to set up a swap file?


title: Re-enable route cache

text: In my kernel log I found:               lo: 5 rebuilds is over limit, route caching disabled      I know what triggers route cache rebuilds (too long hash bucket chains), but what exactly gets disabled? Which device? How can I check if it is still disabled? How can I re-enable it? After this strange message I started having problems with other network devices like this:               unregister_netdevice: waiting for TUNNEL_03 to become free. Usage count = 2       And routing cache seems to be guilty here


title: What are the numbers after the version in the output of apt-cache policy?

text: This is the output of `apt-cache policy firefox`               firefox:       Installed: 26.0~linuxmint1+lmde       Candidate: 26.0~linuxmint1+lmde       Version table:      *** 26.0~linuxmint1+lmde 0             500 http://packages.linuxmint.com/ debian/import amd64 Packages             100 /var/lib/dpkg/status      The version is shown as `26.0~linuxmint1+lmde`, what is the `0` that comes after it? I have tried with various packages and there is always a `0` after the package version. Presumably, this can also take other values but I haven't seen it. I read through both the `man` and `info` pages of `apt-cache` and could not find anything relevant. The only explanation of `policy` is:                  policy [pkg...]            policy is meant to help debug issues relating to the preferences            file. With no arguments it will print out the priorities of each            source. Otherwise it prints out detailed information about the            priority selection of the named package.


title: Auto mounting other partitions in Arch Linux

text: Im using Arch Linux. Is there a way to automount other NTFS or Ext partitions automatically without writing about them in `/etc/fstab`?


title: Screen stretching on Mint Cinnamon after hard reboot

text: I've been running 64-bit Linux Mint Cinnamon for a couple of years now on my current hardware. I upgraded to Qiana a month ago and hadn't had any problems with it. This morning my machine locked up when I accidentally loaded a huge file via a python script that was apparently too big to fit in memory. I couldn't even get to a tty and had to hard reboot. The machine came back up, but now my desktop and all applications are stretched horizontally maybe 50 pixels, which looks ghastly and will seriously interfere with web development work. The login screen looks fine. Adjusting the horizontal size and position of my ViewSonic monitor display via the monitor itself doesn't affect the application stretching. I have an Intel 4 Series integrated graphics controller with no proprietary drivers. I haven't manually installed or updated any new packages for at least a week, although I do run `unattended- upgrades` for security repos.               $ xdpyinfo | grep dimensions       dimensions:    1600x1200 pixels (423x318 millimeters)      See here for `/var/log/Xorg.0.log`.


title: Trying to get firefox running on CentOS 6 minimal iso - can't open display

text: I've got minimal CentOS 6 running on an Oracle VirtualBox on a Mac. I'm trying to get Firefox up and running so I can download some web files into the VM. I installed Firefox (`yum --enablerepo=remi install firefox`). I also installed Xserver (`yum install xorg-x11-server-Xvfb`) as I wasn't sure if it was included in the minimal OS install. I then `export DISPLAY=10.0.5.52` and then tried to start `firefox` but it said: > Error: can't open display: 10.0.5.52. What do I need to do to get `firefox` to display?


title: Proper escaping of double quotations for curl post data?

text: I'm trying to test out a server, by sending it JSON data and reading the response. I need to `POST` data like `{"item":"value with spaces"}` but when I use `curl` I find that it sends the backslashes as well as the double quotes:               curl -d "{\"item\":\"value with spaces\"}" http://myserver.com/somerubyapp?get=stuff      The server actually receives `"{\"item\":\"value with spaces\"}"` including the double quotes on the ends of the string, the backslashes, and everything. Am I using `curl` incorrectly, or is it an issue with my shell, bash?


title: How to fix icedteanp plugin error?

text: I'm using openSUSE 11.3 with "latest updates". I have installed `vimprobable` and `uzbl`. Whenever I start one of those two browsers, I get the error message: > icedteanp plugin error: Failed to run etc/alternatives/../../bin/java.   >  For more detail rerun "firefox -g" in a terminal window. * * * After some time (about 1 minute), the message disappears by itself (or when I click the "close" button). The browser(s) continue loading and again, this error appears on specific sites. What can I do to fix this problem?


title: Stuck on "grub>" prompt when dual-booting Ubuntu

text: On the dual boot option screen I choose Ubuntu and only get:               grub>      I want to get into Ubuntu and start learning it a bit but am stuck. What would be the best way to fix my problem?


title: How to find Heap memory of a running process?

text: I would like to know how to find the heap memory of a process that is running in the background. Is there any command that allows such?


title: Replacement for TCT's pcat utility

text: I am looking for a utility to dump the memory of a running process that I can then examine for strings. In the past I have used pcat from The Coroner's Toolkit, but I am having a hard time finding a version that will work on RHEL 6.4 64bit. Given that TCT is in its twilight, is there a better utility to do this? Edit: I am looking for a utility. I will use scripts to get what is needed if necessary, but I was hoping for a standalone tool that I could get from the standard repo that will allow an untrained user to grab the process's memory.


title: Ideal Hardware for GNU/Linux Laptop

text: What's the best way to find a laptop with hardware that is amenable to installing and running GNU/Linux? I'm looking for something that will ideally work with GPL'd drivers and/or firmware. I took a quick look at linux-on-laptops.com, but they don't list some of the newer models for Lenovo, for example. Most of the test cases seem to be quite dated. Also, It's not clear where to start looking given so much information. Unfortunately, the FSF website doesn't list many laptop possibilities. LAC, referenced from the FSF website, doesn't mention wireless connectivity as being a feature of their laptops, probably because of firmware issues. I've been looking for a laptop that will accept the ath9k driver because those cards don't require firmware, but getting model type from generic specs pages is not always possible. Searching for lspci dumps online can be can be a roll of the dice. And then there's the issue of what kind of graphics card is ideal from a FSF perspective. From the FSF website: > This page is not an exhaustive list. Also, some video cards may work with > free software, but without 3D acceleration. This information should be > considered very tentative -- we are doing our best to update it. Does anyone know the details of what works and what doesn't? What good combinations are out there? What do you use? Where can I search? Or will I have to bite the bullet and use some proprietary packages? Thanks in advance.


title: How to use 'wine' and AviSynth and Avs2YUV with 'mplayer/mencoder' (or any player/encoder)

text: I have a lot of AviSynth scripts (.avs) which create a montage of text pics and video, but until yesterday I'd had no luck running AviSynth scripts in 'wine'.   I read about a 'Windows' program called Avs2YUV which, according to wineHQ, is _platinum_ and is "intended for use under Wine to interface between Avisynth and Linux-based video tools". I've had _partial_ success with a couple of _very simple_ scripts, but "partial" means I don't know how to use it properly, or the AviSynth-Avs2YUV combo doesn't work properly (or both). Below, are 2 scripts:   The first one outputs and saves video only (as intended), but I'd like to know if it is possible to pipe Avs2YUV's stdout directly into a Linux media player... I've tried a few options, but nothing seems to work. On the other hand, the saved .264 file does play, so AviSynth and Avs2YUV are doing something right here. ( _A quick pre-posting EDIT_ : I've just corrected a typo where I had put .avi instead of .264, and I realized that I really don't know what x264 does (I'm so used to avi encoding, but I have this feeling that it may be video-only encoder???? ... so I'll mention it now, I have no particular interest in x246.. It was in the example I followed.. I just want to produce a playable video+audio .. the wrapper and codecs aren't particularly important to me.. I'm happy with avi.. actually I prefer it because it works well with AviSynth.. Catch-22... The second one behaves very much as the first one, but it produces no audio; which it should. AviSynth scripts are well known, and are directly playable by many players (in Windows), but with this need to use Avs2YUY, I'm somewhat in unknown territory... I'd appreciate some pointers on these two issues, and perhaps there is an entirely different way to use AviSynth in wine, other than in conjunction with Avs2YUV... or is the idea of using AviSynth in Linux just a myth? Here are the scripts:               # Script-1: The saved file plays fine (the source has no audio),     #            but how can I play it directly     #     cd $HOME/.wine/drive_c     echo 'version()' > version.avs     wine  avs2yuv.exe  version.avs - \         | x264 --stdin y4m --output version.264 -     mplayer version.264     #      * * *               # Script-2: The saved file has no audio, but it should.     #        ...and like Script-1, how can I play it directly     cd $HOME/.wine/drive_c     echo 'avisource("video.avi")' > video.avs     wine  avs2yuv.exe  video.avs - \         | x264 --stdin y4m --output video.264 -     mplayer video.264


title: How to write terminal contents into a file

text: Here's my situation: I opened terminal and ran a program which displays live feed in terminal (text) that changes every second. Only "Enter" key can be used while this program is running (it exits that program). So you can't type anything else into the console. I would like to write the terminal contents into a file, like after every second. How can I do it? By opening 2nd console and using some command? Can't get it to work with setterm -dump command.


title: How to find data copies btrfs

text: I have deduplicated my btrfs filesystem with bedup, so now all duplicate files (above a certain size) are "reflink" copies. Is there any way to see, given a filename, what other files are the same reflinks?


title: Where did this copy of my home directory come from?

text: I was working on a project to control my digital camera using Ubuntu and gphoto2. At one point I noticed a new "~" directory in my project folder, /home/greg/project/~. When I enter this new "~" directory, it takes me backwards to my home directory /home/greg/ (as you might expect). I don't know exactly how this happened, but my suspicion is that when I ran gphoto2 on the command line and specified an output file, I typed "~/filename.jpg" expecting the file would show up in my home directory, but instead bash put a new "~" directory in the working directory. I'm wasn't aware something like that could be done (if that's what happened). More important than how it got there is how I should get rid of it. I can't remove the directory, because as far as I can tell it _is_ my home directory. It doesn't appear to be a sym-link, (at least not according to ls -l), but I'm not sure what that would even really mean.


title: My ISO Downloaded as Tar.Gz?

text: I was downloading a Linux-based operating system but instead of ISO, it came as tar.gz (OEM.tar.gz, I think but maybe not). How do I burn this OS to a flash drive?


title: Does the unix calendar program `pal` support line breaks?

text: The unix program `pal` is one of a variety of command-line calendar programs. Based on the `man` page, each line refers to an event, and it does not mention event descriptions that span multiple lines at all. I am trying to insert a multiline event description, and tried with `Line1\nLine2`, as well as `Line1\rLine2`, both of which were printed literally by `pal`. Does anyone know if there's a way to get multi-line event descriptions?


title: How can I start tmux automatically in fish shell while connecting to remote server via ssh

text: I switched from `bash` to `fish` shell. I liked it and decided to use it on my servers also. How can I start `tmux` automatically on `ssh` connection? I followed this instruction for bash but `fish` shell is different and this recipe doesn't work without cardinal rewriting.


title: Error while cross compiling using crosstool-ng. How to debug?

text: This is my build log:               [ERROR]          [ERROR]       [ERROR]  >>     [ERROR]  >>  Build failed in step 'Installing C library headers & start files'     [ERROR]  >>        called in step '(top-level)'     [ERROR]  >>     [ERROR]  >>  Error happened in: CT_DoExecLog[scripts/functions@172]     [ERROR]  >>        called from: do_libc_backend_once[scripts/build/libc/glibc-eglibc.sh-common@347]     [ERROR]  >>        called from: do_libc_backend[scripts/build/libc/glibc-eglibc.sh-common@143]     [ERROR]  >>        called from: do_libc_start_files[scripts/build/libc/glibc-eglibc.sh-common@60]     [ERROR]  >>        called from: main[scripts/crosstool-NG.sh@598]     [ERROR]  >>     [ERROR]  >>  For more info on this error, look at the file: 'build.log'     [ERROR]  >>  There is a list of known issues, some with workarounds, in:     [ERROR]  >>      '/usr/local/powerpc-eabi/share/doc/crosstool-ng/ct-ng.1.15.2/B - Known issues.txt'     [ERROR]       [ERROR]  (elapsed: 29:41.80)      I want to build a kernel after cross compiling that should work on a 32 bit machine. I am working on an amd64 bit and on a 32 bit Ubuntu os. What should my crosstool configuration file be to get this to work?


title: Linux Mint 16 randomly freezing and freezes always after suspend wakeup

text: I've just installed Linux Mint 16 Cinnamon on Dell Latitude E6420. During an hour of use the desktop would become unresponsive and I was unable to access any TTY. It just froze up. The same thing happened again after a forced reboot. I again booted up and it was fine for the whole session, an hour or so. I put the computer to sleep (suspend) and when woken up the next morning it would wake up frozen. I've checked `/var/log/syslog` and found some things I can't understand. See times between 00:06 when computer was put to sleep and 07:57 when computer was woken up. Specifically this line:               Apr 17 07:57:55 NIX-E6420 kernel: [  547.146134] Freezing user space processes ... (elapsed 0.001 seconds) done.      Why would Mint freeze user processes when its woken up?               Apr 16 23:57:47 NIX-E6420 modem-manager[793]: <info>  (ttyS4) closing serial port...     Apr 16 23:57:47 NIX-E6420 modem-manager[793]: <info>  (ttyS4) serial port closed     Apr 16 23:57:47 NIX-E6420 modem-manager[793]: <info>  (ttyS4) opening serial port...     Apr 16 23:57:53 NIX-E6420 NetworkManager[843]: <info> (eth0): IP6 addrconf timed out or failed.     Apr 16 23:57:53 NIX-E6420 NetworkManager[843]: <info> Activation (eth0) Stage 4 of 5 (IPv6 Configure Timeout) scheduled...     Apr 16 23:57:53 NIX-E6420 NetworkManager[843]: <info> Activation (eth0) Stage 4 of 5 (IPv6 Configure Timeout) started...     Apr 16 23:57:53 NIX-E6420 NetworkManager[843]: <info> Activation (eth0) Stage 4 of 5 (IPv6 Configure Timeout) complete.     Apr 16 23:57:59 NIX-E6420 modem-manager[793]: <info>  (ttyS4) closing serial port...     Apr 16 23:57:59 NIX-E6420 modem-manager[793]: <info>  (ttyS4) serial port closed     Apr 16 23:57:59 NIX-E6420 modem-manager[793]: <info>  (ttyS4) opening serial port...     Apr 16 23:58:05 NIX-E6420 modem-manager[793]: <info>  (ttyS4) closing serial port...     Apr 16 23:58:05 NIX-E6420 modem-manager[793]: <info>  (ttyS4) serial port closed     Apr 16 23:59:46 NIX-E6420 dbus[498]: [system] Activating service name='org.freedesktop.timedate1' (using servicehelper)     Apr 16 23:59:46 NIX-E6420 dbus[498]: [system] Successfully activated service 'org.freedesktop.timedate1'     Apr 16 23:59:46 NIX-E6420 dbus[498]: [system] Activating service name='org.freedesktop.systemd1' (using servicehelper)     Apr 16 23:59:46 NIX-E6420 dbus[498]: [system] Successfully activated service 'org.freedesktop.systemd1'     Apr 17 00:02:20 NIX-E6420 kernel: [  295.630421] nouveau W[   PFIFO][0000:01:00.0] INTR 0x01000000: 0x00000005     Apr 17 00:06:31 NIX-E6420 kernel: [  546.940568] PM: Syncing filesystems ... done.     Apr 17 00:06:31 NIX-E6420 kernel: [  546.942332] PM: Preparing system for mem sleep     Apr 17 07:57:55 NIX-E6420 NetworkManager[843]: <info> (eth0): carrier now OFF (device state 100, deferring action for 4 seconds)     Apr 17 07:57:55 NIX-E6420 kernel: [  547.146134] Freezing user space processes ... (elapsed 0.001 seconds) done.     Apr 17 07:57:55 NIX-E6420 kernel: [  547.147354] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.     Apr 17 07:57:55 NIX-E6420 kernel: [  547.148469] PM: Entering mem sleep     Apr 17 07:57:55 NIX-E6420 kernel: [  547.148546] Suspending console(s) (use no_console_suspend to debug)     Apr 17 07:57:55 NIX-E6420 kernel: [  547.169317] sd 1:0:0:0: [sdb] Synchronizing SCSI cache     Apr 17 07:57:55 NIX-E6420 kernel: [  547.169368] sd 1:0:0:0: [sdb] Stopping disk     Apr 17 07:57:55 NIX-E6420 kernel: [  547.169394] sd 0:0:0:0: [sda] Synchronizing SCSI cache     Apr 17 07:57:55 NIX-E6420 kernel: [  547.169651] sd 0:0:0:0: [sda] Stopping disk     Apr 17 07:57:55 NIX-E6420 kernel: [  547.186790] nouveau  [     DRM] suspending fbcon...     Apr 17 07:57:55 NIX-E6420 kernel: [  547.186793] nouveau  [     DRM] suspending display...     Apr 17 07:57:55 NIX-E6420 kernel: [  547.186813] nouveau  [     DRM] unpinning framebuffer(s)...     Apr 17 07:57:55 NIX-E6420 kernel: [  547.186902] nouveau  [     DRM] evicting buffers...     Apr 17 07:57:55 NIX-E6420 kernel: [  547.187841] mei_me 0000:00:16.0: suspend


title: Coloring line numbers in less?

text: Please consider the following example:               $ grep --color=always -n 'Format\|Files' /usr/share/doc-base/doc-base | less -R      Here, `grep` will color also the line numbers of the matches, and `less` will display it. I know I could show the entire file with line numbers in `less` with:               $ less -N /usr/share/doc-base/doc-base       My question is - is there a way, to get `less` to display the entire file with line numbers - but where the line numbers are colored (as in the case with the `grep` output)? Many thanks in advance for any answers,   Cheers!


title: Lots of text files into one big text file

text: I want to combine thousands of little text files into one big text file. I have them in directories with the structure: timestamp1/status.txt. For example: 20130430133144/status.txt. So far, I know that               cat */* > bigtextfile.txt      works for small numbers of files. But will it work for higher numbers? I wonder if cat is going to gather the content of all files and then try to save to the bigtextfile. Otherwise, I suppose there must another way to do it, like fetch one file, append it to bigtextfile, then fetch another and so on.


title: Masquerade not working sometimes

text: I have an issue with private network traffic not being masqueraded in very specific circumstances. The network is a group of VMware guests using the `10.1.0.0/18` network. The problematic host is `10.1.4.20 255.255.192.0` and the only gateway it is configured to use is `10.1.63.254`. The gateway server `$vpnGatewayAddress` should be masquerading all outbound traffic and forwarding it through `$outerGatewayAddress`, but for some reason, `10.1.4.20` ends up occasionally having `$outerGatewayAddress` in its routing cache, as you can see here :               ip -s route show cache 199.16.156.40     199.16.156.40 from 10.1.4.20 via $outerGatewayAddress dev eth0         cache  used 149 age 17sec ipid 0x9e49     199.16.156.40 via $outerGatewayAddress dev eth0  src 10.1.4.20         cache  used 119 age 11sec ipid 0x9e49      The problem occurs only with api.twitter.com After flushing the cache, I am able to ping it again, and the cache looks sane :               ip route flush cache 199.16.156.40          ping api.twitter.com     PING api.twitter.com (199.16.156.40) 56(84) bytes of data.     64 bytes from 199.16.156.40: icmp_req=1 ttl=247 time=93.4 ms          ip -s route show cache 199.16.156.40     199.16.156.40 from 10.1.4.20 via 10.1.63.254 dev eth0         cache  age 3sec     199.16.156.40 via 10.1.63.254 dev eth0  src 10.1.4.20         cache  used 2 age 2sec      Network information for the app server (without lo) :               ip a          eth0      Link encap:Ethernet  HWaddr 00:50:56:a4:48:20               inet addr:10.1.4.20  Bcast:10.1.63.255  Mask:255.255.192.0               inet6 addr: fe80::250:56ff:fea4:4820/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:1523222895 errors:0 dropped:407 overruns:0 frame:0               TX packets:1444207934 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:1524116772058 (1.5 TB)  TX bytes:565691877505 (565.6 GB)      Network information for the VPN gateway (without lo too) :                eth0      Link encap:Ethernet  HWaddr 00:50:56:a4:56:e9                inet addr:$vpnGatewayAddress  Bcast:$broadcastAddress  Mask:255.255.255.192                inet6 addr: fe80::250:56ff:fea4:56e9/64 Scope:Link                UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1                RX packets:7030472688 errors:0 dropped:1802 overruns:0 frame:0                TX packets:6959026084 errors:0 dropped:0 overruns:0 carrier:0                collisions:0 txqueuelen:1000                RX bytes:7777330931859 (7.7 TB)  TX bytes:7482143729162 (7.4 TB)           eth0:0    Link encap:Ethernet  HWaddr 00:50:56:a4:56:e9                inet addr:10.1.63.254  Bcast:10.1.63.255  Mask:255.255.192.0                UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           eth0:1    Link encap:Ethernet  HWaddr 00:50:56:a4:56:e9                inet addr:10.1.127.254  Bcast:10.1.127.255  Mask:255.255.192.0                UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           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.1.1  P-t-P:10.8.1.2  Mask:255.255.255.255                UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1                RX packets:477047415 errors:0 dropped:0 overruns:0 frame:0                TX packets:833650386 errors:0 dropped:101834 overruns:0 carrier:0                collisions:0 txqueuelen:100                RX bytes:89948688258 (89.9 GB)  TX bytes:1050533566879 (1.0 TB)      eth0 leads to the outside world, and tun0 to an openvpn network of VMs on which sits the app server. `ip r` for the VPN gateway :               default via $outerGatewayAddress dev eth0  metric 100     10.1.0.0/18 dev eth0  proto kernel  scope link  src 10.1.63.254     10.1.64.0/18 dev eth0  proto kernel  scope link  src 10.1.127.254     10.8.1.0/24 via 10.8.1.2 dev tun0     10.8.1.2 dev tun0  proto kernel  scope link  src 10.8.1.1     10.9.0.0/28 via 10.8.1.2 dev tun0     $addressEndingWithAZero/26 dev eth0  proto kernel  scope link  src $vpnGatewayAddress      `ip r` on the app server :               default via 10.1.63.254 dev eth0  metric 100     10.1.0.0/18 dev eth0  proto kernel  scope link  src 10.1.4.20      Firewall rules:               Chain PREROUTING (policy ACCEPT 380M packets, 400G bytes)      pkts bytes target prot opt in out source destination           Chain INPUT (policy ACCEPT 127M packets, 9401M bytes)      pkts bytes target prot opt in out source destination           Chain OUTPUT (policy ACCEPT 1876K packets, 137M bytes)      pkts bytes target prot opt in out source destination           Chain POSTROUTING (policy ACCEPT 223M packets, 389G bytes)      pkts bytes target prot opt in out source destination           32M 1921M MASQUERADE all -- * eth0 10.1.0.0/17 0.0.0.0/0      redirect configuration :               sysctl net.ipv4.conf.all.send_redirects     net.ipv4.conf.all.send_redirects = 1     sysctl net.ipv4.conf.eth0.send_redirects     net.ipv4.conf.eth0.send_redirects = 1     sysctl net.ipv4.conf.tun0.send_redirects     net.ipv4.conf.tun0.send_redirects = 1      Why does the masquerade fail sometimes ? How can I prevent that ?


title: How to use a dongle as HotSpot on Linux?

text: I'm running Linux on a virtual machine on MAC OS. Currently, I've written a script to use a dongle to connect to a WiFi network and use web services. Now, I am looking to use my dongle as a WiFi Hotspot. So my wearable device can connect to my dongle and use the internet. Is it possible to do that? If yes then please guide me. Hardware Details are:   1. The dongle is a ZyDAS USB 2.0    2. I'm using VMWare Fusion to run Linux   3. Linux version (Ubuntu 12.04) : **Linux ubuntu 3.8.0-42-generic #62~precise1-Ubuntu**   4. I'm using the following python script to connect from Linux to the Wifi: **/usr/share/checkbox/scriptsss/create_connection**


title: How to manage error_log and access_log of apache?

text: I noticed my `error_log` file grows larger and larger. I tried changing the LogLevel in `httpd.conf` from               LogLevel debug      to               LogLevel emerg      But I still see errors being posted about `favicon.ico` not being found and so on. If I delete `error_log`, I would have to restart `apache`, which causes some downtime for current viewers.   * Is there a way to tell `apache` **NOT** to write any `error_log`?   * OR is there a way to ensure it does not grow beyond 1 mb ( when it is not turned off )? I notice `access_logs` are being "archived", but I rather want them also not to be created at all. Do these archived `access_logs` ever get deleted or do I have to delete them myself?


title: Redirecting output depending on grep regex

text: I am using `gradle run` to start a REST server. The output of the REST server looks like this:               XXX.XXX.XX.XXX - <moreinfo>     randomtext     randomtext     XXX.XXX.XX.XXX - <moreinfo>     XXX.XXX.XX.XXX - <moreinfo>     randomtext     XXX.XXX.XX.XXX - <moreinfo>      `XXX.XXX.XX.XXX` here is an IP address, randomtext are error messages. All output is directed to stdout, sadly. How can I direct all lines starting with an IP address to a file called `err.log` and every other line to `all.log`? Unfortunately, `gradle run` can only be started once and doesn't stop, since it is a REST server. Maybe use a `tee` , `grep` combination?


title: What else can break if I remove export from a variable?

text: My problem is that when I started coding my script I encountered several variable scope issues which resulted in the bad habit of exporting almost all my variables. Now that my code has got quite large I was contemplating cleaning it and part of that is removing a bunch of useless exports. Unfortunately I'm not sure if my knowledge of variable scope is complete. Even after reading a few pages on the subject. What I know (and hopefully is right): 1-Exporting a variable makes it's content available to subshell processes:               export myvar="content"      2-Stuff done in parenthesis like this will be affected by removing exports (from what I understand this is the only way to declare / use a subshell):               $(grep "content" <<< $myvar)      3-Variables declared without setting their scope are global:               myvar="content"      4-Since I dont declare any local variables I dont have to worry about causing issues within my functions:               local myvar="i dont use this"      Questions: 1- Is there any point in proceeding with removing the useless exports beside my code not reeking of obvious noobishness? 2- If I do proceed with it, is there anything else I should be aware of that may be affected and break my code? or is there any of my knowledge wrong/incomplete? 3- If you know of a well written (and complete) variable scope reference please share the link. Thanks in advance for your help.


title: Share (masquerade) Internet connection from Debian desktop to a bunch of computers

text: I need to share the Internet connection of my Debian desktop to some other devices (a Mac Laptop, and an Android tablet). The Debian desktop is connected to the local network via `eth0`, and the rest of the devices are connected through a wireless network which, for some reason, doesn't allow internet connections. Of course, the desktop is connected to the internet. The laptop and the tablet _can_ "see" the Debian desktop (they can connect themselves through `ssh` and see the desktop files using `smb`). I've been googling around, and I've found how to share (masquerade) the connection and make it available to any machine in the network... I would like to limit the access only to my devices (or a limited list of devices). Is there a way to do that? If there is, can you point me in the right direction?


title: What's using all of the memory in my VM? It's not the disk cache

text: I have an issue where when I try to build a really large project, my machine starts swapping (several GB) even though there's plenty of memory (14 GB in fact). When I run `free`, it shows that it's not the disk cache:               $ free -m                  total       used       free     shared    buffers     cached     Mem:         12900       6350       6549          0          7         77     -/+ buffers/cache:       6266       6633     Swap:         9211        233       8978      So 6.3 GB of memory is actually in use, but if I look at top, sorted by % memory usage, nothing is using any memory:                 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                    38669 blong     20   0 1282m 378m  42m S    2  2.9   0:50.79 firefox                                                     1327 root      20   0  365m 126m 4056 S    4  1.0  40:23.94 Xorg                                                        2540 blong     20   0 1578m  67m  10m S    2  0.5  21:33.35 gnome-shell                                                13943 blong     20   0  579m  12m 5604 S    2  0.1   1:07.01 gnome-terminal                                             30093 blong     20   0  540m 8664 5572 S    0  0.1   0:03.96 icemon                                                      2558 blong     20   0  362m 5964 1808 S    0  0.0   5:17.44 vmtoolsd                                                    2526 blong     20   0  672m 5056 2000 S    0  0.0   0:26.81 gnome-settings-                                             2546 blong     20   0  354m 3484 2244 S    0  0.0   5:08.96 pulseaudio      Am I missing something? Restarting the VM fixes this, but I'd prefer to figure out what's actually happening.


title: Identifying running programs that are using the old version of a library I just replaced

text: After installing updates to address CVE-2014-0160 (the OpenSSL Heartbleed bug), I had to take care to restart anything that might be using libssl -- many services, such as Apache and my VPN software, still had the old vulnerable libssl loaded up, and my package manager made no attempt to rectify this. This got me thinking: After I update a shared library, how can I reliably find out which running programs currently have an old version of the library linked in? I am sure there must be a way to interrogate running processes either at the linker level or at the file descriptors level to determine whether the instance of a given shared library they have loaded is the same as the one currently on disk.


title: extracting specific substrings from string

text: I am trying to write a bash script. In a directory I have 2 fastq files: `A-122-3.BH7WBVADXX.lane_1_ **P1** _I24.hg19.sequence.fastq` `A-122-3.BH7WBVADXX.lane_1_ **P2** _I24.hg19.sequence.fastq` I just want to loop on P1 lets say something like this               for f in *_P1*     do        SOMETHING     done      Now In SOMETHING part I want to define some varables which i would be using later in my code I need to extract these values from my string: `A-122-3.BH7WBVADXX.lane_1_P1_I24.hg19.sequence.fastq` I need `ID = A-122-3-BH7WBVADXX-1` I need `PU = BH7WBVADXX` I need `LB = A-122-3` Then I will solve it further. NOTE : FILENAME ARE NOT OF SAME LENGTH. **A-122-3** PART VARIES FOR DIFFERENT SAMPLES AND ALSO THIS PART **I24** VARIES. Thanks


title: ImageMagick (or other) for UTF-8 text to image

text: I'm trying to create many single-character images using `convert`. The purpose is to provide a plastics specialist with images to print onto keyboard keycaps. The ImageMagick documentation suggests something like this:                printf "\u2318" | convert -size 100x100 label:@- -font unifont-Medium command.png      or                echo ⌘ | convert -size 100x100 label:@- -font unifont-Medium command.png      or                convert -size 100x100 label:'⌘' -font unifont-Medium command.png      which is supposed to print the place of interest symbol, but it instead produces a question mark. I have confirmed (using `charmap`) that the `unifont-Medium` fontset actually includes this glyph. I know that other fonts on my system can also provide this glyph, because I could see it before installing unifont, but I've not been able to work out what their name is. I also tried using LaTeX (e.g. TexLive with all the extras and the `utf8x` package) but none of the special characters are supported. There are a lot of forum questions about printing chinese characters with imagemagick and other special characters... the following does work for me:               convert -background lightblue -fill blue -pointsize 32 \           label:' é è à ù ç Ö ÿ ‘ ’ “ ” ° ² ³ € x ÷ '    label_i8n.gif      but it just doesn't work for the UTF-8 characters that are actually important to me. **How can I convert arbitrary unicode characters to images?** **UPDATE** : I gave up, looks like a bug. Instead, I created a bunch of scripts to generate and render SVG, open sourced here: kinesis-dvorak


Can I select a region for the screenshot via keyboard in import from ImageMagick? If yes, how can I do it? If no, what can I use instead of import?


title: shell script to find the combination of the array elements

text: I have a shell script in which I have defined an array. The array contains more than 2 elements. I need to find the combination of all the elements in my array. Suppose, if my array has the elements, _`{12345, 56789, 98765}`_ , I am trying to get the output as,               12345, 56789     12345, 98765     56789, 98765      I tried the php code from here.               <?php     function pc_permute($items, $perms = array( )) {         if (empty($items)) {             print join(' ', $perms) . "\n";         }  else {             for ($i = count($items) - 1; $i >= 0; --$i) {                  $newitems = $items;                  $newperms = $perms;                  list($foo) = array_splice($newitems, $i, 1);                  array_unshift($newperms, $foo);                  pc_permute($newitems, $newperms);              }         }     }     pc_permute(split(' ', '12345 56789 98765'));     ?>      I get the output as,               12345 56789 98765     56789 12345 98765     12345 98765 56789     98765 12345 56789     56789 98765 12345     98765 56789 12345      Is it possible to get the combination in 2 elements sized output? I am not concerned with the order and so if _`A B`_ is got as a combination, I do not need the reverse ( _`B A`_ ).


title: Apache, Group Permissions and User Uploads

text: I have a folder named "digitalgoods" with the following ownership -- apache:apache residing outside of the htdocs folder and is therefore not accessible to the public. However I need the same folder to be accessible by a set group of users (Jack, John, James) -- we'll call them all "uploaders". I want the "uploaders" to be able to each upload files as easily as possible to the "digitalgoods" folder, where apache can then access to serve via purchase. My question is what is the best way to set this up?? I am currently using SSH to access the server, but would it make more sense to install an ftp server for the users to gain access; and if so, what should I do from there in regards to accounts and permissions? Or should I set each user's home directory to "digitalgoods" and in some manner modify the permissions appropriately for access via SSH? I am attempting to make uploading files as painless as possible for the client. Any help in this regard is appreciated.


title: Starting my own application at the startup

text: I am working on zc702 board having ARM Cortex A 9 processor. I have a binary that I got after cross-compilation for ARM (LED blinking). Now I want that this file should execute as soon as the the kernel (petalinux) boots. I am having initramfs as my root file system. How do I proceed to do it? What files I have to modify? Please note that this is a volatile system, so I cannot make required changes in a running system. I have to instead put my binary in some folder in file system (rootfs.cpio). But where ?


title: Merge two audio sources with x11grab, possible?

text: Currently I'm running with the following setup.               ffmpeg \      -i http://pub1.di.fm:80/di_vocaltrance \      -f x11grab -s 1920x1080 -r 25 -i :0.0 \      -c:v libx264 -preset fast -pix_fmt yuv420p -s 1280x800 \      -c:a libmp3lame -ab 96k -ar 22050 \      -threads 0 \      -f flv "rtmp://...."      What I want to bake in:                -f alsa -ac 2 -i hw:0 -acodec pcm_s32le -aq 1 -ab 128k\      Is this possible? And perhaps even mix in "what I hear" (aka playback) so to speak? I've tried something along the lines of (but not fully understanding -map)                -i http://pub1.di.fm:80/di_vocaltrance -map 0:1 \      -f x11grab -s 1920x1080 -r 25 -i :0.0 -map 0:0 \      But that didn't really go so well. I'm so close now, this gives me sound channels, but everything sounds like I'm inside a small tin-can of sorts..               #!/bin/bash     KEY=`cat key.db`          ffmpeg \      -i http://pub1.di.fm:80/di_vocaltrance \      -f alsa -ac 2 -i hw:0 -acodec mp3 -aq 1 -ab 128k \      -f x11grab -s 1920x1080 -r 25 -i :0.0 \      -c:v libx264 -preset fast -pix_fmt yuv420p -s 1280x800 \      -c:a mp3 -ab 96k -ar 22050 \      -threads 0 \      -map 0:0 -map 1:0 -map 2:0 \      -f flv "rtmp://live.twitch.tv/app/$KEY"      It only appears when i mix the two sounds togeather.. Trying to get JACK in here as well but without any actual results (thought i'd pass everything via a mixer board to unload ffmpeg from the mixing) Running with:                -f alsa -ac 2 -i jack \      ....      Gives this however: > [alsa @ 0x1399280] cannot set sample format 0x10000 2 (Invalid argument) > jack: Input/output error


title: Standard unix util to split "foo.bar.baz" into "foo.bar" + ".baz"?

text: I want to split a string `$basename`, containing the output in two parts, `$stem` and `$ext`, such that:   1. the string `"${stem}${ext}"` is identical to the original string `$basename`;   2. either `$stem` or `$ext` may be empty (depending on the string in `$basename`);   3. if `$ext` is not empty, it must start with `.`, and contain no more `.`'s thereafter. It's not difficult to write a shell function to do this, but before doing so I'd like to know if there's a standard Unix command that does this. EDIT: FWIW, the way I'd code this in a (`zsh`) script would be               stem=${basename%.*}     ext=${basename#"$stem"}      EDIT: fixed typo (`${base#...` -> `${basename#...`), and incorporated Stephane Chazelas' suggestion (`...#$stem` -> `...#"$stem"`).


title: Lost files copied to a USB ZIP drive on Ubuntu

text: I have a problem regarding copying of files using Ubuntu's copy feature. The problems goes on like this: I copy a specific folder to my ZIP drive by creating a new folder each day (Backup). Now copy process starts and completes. No when I disconnect the drive from the system and re-plug, I find that all those files are now lost. Only the folder which I created manually, exists. Also, if I use the terminal to copy and create the directories, windows XP detects a corrupt file system in the drive and I again have to scan and fix the drive. The files, though are recovered, still I am thinking why this is happening. Might be due to the different way these OSes create and maintain the table. FAT32 is the file system in the ZIP (4 GB) drive. On XP (SP3) system it is NTFS and on Ubuntu (10.04) it is ext3. There are however no other problems while copying data from the drive. Even copying a single file to the drive works fine. Only copying inside a folder gives the problem. Also, once copy attempt is done, nothing further can be added to the folder. It gives error that the folder is not accessible or so. What could be the problem? Any workaround?


title: What is centos /root/core.* files? they eat my hard disk till it is full

text: I have a vps server with 130GB hard disk. Recently, the server is crash down, I access ssh and use `dh -h`,               Filesystem            Size  Used Avail Use% Mounted on     /dev/vzfs             130G  130G   0  99% /     none                  2.0G  4.0K  2.0G   1% /dev      Then use `du -sh /*` I find `root fold` with 59GB. then `du -sh /root/*`, a long list with some file like               ...     43M     /root/core.7856     59M     /root/core.7859     59M     /root/core.7862     43M     /root/core.7883     43M     /root/core.7885     43M     /root/core.7889     59M     /root/core.7892     59M     /root/core.7904     43M     /root/core.7906     59M     /root/core.7913     43M     /root/core.7915     59M     /root/core.7940     59M     /root/core.7942     43M     /root/core.7947     43M     /root/core.7951     ...      I access my server with `fileZilla`, 1204 core.* files create in recent 3 days. So what is centos /root/core.* files? How are they created? Could I delete them without damage my server? And how to avoid them to be created again? Waiting for some one help me urgently, thanks and regards. **FIX THE PROBLEM** The problem caused by linux mail system. I changed `/etc/mail/trusted-users` permission in `etc/mail/submit.cf` line 552. then, no `/root/core.* files` be created again.


title: Redirect stdout over ssh

text: I would like to run               something > file      on a remote system through ssh, but if I run               ssh host something > file      the redirection is executed locally as `ssh etc > file` I've tried it with `'` or `''` or `dd` or with a pipe `|` instead, but I can't get it to work. How can this be done?


title: Tmux key-bind like to use the windows/super for my meta key in Tmux Without X

text: I have RaspberryPI with no GUI==(no x.org) I like to bind the useless window/super key to be my prefix. Using Arch for ARM runs great. If think this is going to take more then simple mod in the tmux.conf file. After some Googling found post with a command: dumpkeys | grep -E "keycode *125|126" That command give me a blank line.


title: sudo environment: "g++: command not found"

text: I have a relatively fresh RHEL 6.5 install, on to which I have installed from source GCCC 4.9. After I installed GCC 4.9, I uninstalled the distro-provided older GCC version via:               sudo yum remove gcc      GCC _appears_ to be correctly installed and visible to both users and `root`, but when I try to issue a `sudo` command which needs the compiler, it cannot be found. It seems to me that `PATH` doesn't point to `g++` during `sudo`, but I don't understand why. `g++` is installed in:               [john@haley boost_1_55_0]$ which g++     /usr/local/bin/g++      And getting the version as a user and as `root` succeeds:               [john@haley boost_1_55_0]$ g++ --version     g++ (GCC) 4.9.0     Copyright (C) 2014 Free Software Foundation, Inc.     This is free software; see the source for copying conditions.  There is NO     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.          [john@haley boost_1_55_0]$ sudo su -     root@haley /root # g++ --version     g++ (GCC) 4.9.0     Copyright (C) 2014 Free Software Foundation, Inc.     This is free software; see the source for copying conditions.  There is NO     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.      But `sudo g++ --version` fails:               john@haley boost_1_55_0]$ sudo g++ --version     [sudo] password for john:      sudo: g++: command not found     [john@haley boost_1_55_0]$       Checking the `PATH` as `sudo`:               [john@haley boost_1_55_0]$ sudo echo $PATH     /usr/lib64/qt-3.3/bin:/usr/local/:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/home/john/bin:/usr/local/bin                                                                                ^^^^^^^^^      ... seems to indicate that the location of `g++` is actually in the path. Why is this failing, and what can I do to fix it? Answering questions in comments: yes, I can execute it using explicit paths under `sudo`:               [john@haley boost_1_55_0]$ sudo /usr/local/bin/g++ --version     [sudo] password for john:      g++ (GCC) 4.9.0     Copyright (C) 2014 Free Software Foundation, Inc.     This is free software; see the source for copying conditions.  There is NO     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.          [john@haley boost_1_55_0]$       It was observed that I was doing-it-wrong when checking the `sudo PATH`. Doing it the right way reveals that in fact `/usr/local/bin` is _not_ in `sudo`'s `PATH`:               [john@haley boost_1_55_0]$ sudo env | grep PATH     13:PATH=/sbin:/bin:/usr/sbin:/usr/bin     [john@haley boost_1_55_0]$


title: differences between echo""> and > command

text: I am new to Linux. There is something that is unclear to me. What is the difference between `echo "" > logfile` and `> logfile` ? When I run the first one, the logfile size doesn't become zero and same name file will be created with 1 byte size. For the second one, logfile size will become zero and same name file will be created with 0 byte size. In what situations should the commands be used differently? For me, I use it when I want to free up the log files.


title: Linux equivalent of "Trusted Root Certification Authorities" on Windows?

text: Where I live we have a corporate firewall which is configured to need a certificate installed on the computers in the house for it to be able to scan for vulnerabilities in secure connections. Without it, a few things won't work as the firewall behaves as a man in the middle, and of course a few websites will deny access to prevent any harm as it looks dangerous. On Windows, I'd just need to double click the certificate (.p12 extension), insert the password and specify it to be put in "Trusted Root Certification Authorities" and be done with it. On Linux, I haven't had much luck in doing that. I'm running Arch.


title: Change working directory of 2 terminals at once

text: I've typically have gnome-terminal open with ~8 tabs, using 2 consecutive tabs for the same task (one has emacs, the other is used to do git checkins and unittest runs and so). When changing tasks, I need to move to a new directory - in both tabs. How can I change the work directory of the second tab to the one of the first tab, with as few steps as possible? Preferably keyboard only.


title: switch window manager when logging in in text mode

text: Suppose I don't start the display manager on boot and login through the terminal. How would I switch my window manager? With gdm or gdm3, you use a scroll box to select it.


title: Command-line web browser with Kerberos authentication?

text: **QUESTION:** Is there a Kerberos-friendly web browser usable via an SSH console? I have tried links but it does not seem to work with Kerberos (the webapp asks me for login/password even though I have a valid Kerberos ticket (which I got with `kinit`). **CONTEXT** : From my laptop I have command-line access to a server, and need to browse an intranet webapp hosted on that server, using Kerberos authentication. The server can not ping the laptop, so I can not run Firefox on the server and redirect the DISPLAY to my laptop


title: linux shell: find -exec in find -exec

text: I want to execute `chmod 555` on all files and directories I get with the following command (it returns the directory test and all files and directories in it):               find ~/.config/google-chrome -type d -name test -exec find {} \;


title: How to link Requires to BuildRequires in rpm spec?

text: Let's say I have such `Requires` entries:               Requires: a     Requires: b     Requires: c      and now I would like to state, that:               BuildRequires: <<Requires>>      meaning, that for build I require everything that is required for install. So, if I remove or add something in the first section, I won't have to edit the second any more, because it will be "linked". **The question is** -- how to express such dependency? _I know that such scheme is not good for public packages, but I am asking for home use -- I prepare quick packages for me and my family only, they are not distributed._


title: PHP Bash error suppresion

text: I'm using a PHP script from cli, the script calls `exec()` a few times. There are some minor errors sometimes, which are handled by the PHP script. I'm suppressing the errors by appending `2>/dev/null` to the end of each command... Is there any way to achieve that without adding the aforementioned?


title: How to do a regex search in a UTF-16LE file while in a UTF-8 locale?

text: EDIT: Due to a comment _Warren Young_ made, it made me realize that I was not clear on one quite relevant point. My search string is already in UTF-16LE order (not in Unicode Codepoint order, which is UTF-16BE), so perhaps the Unicode issue is somewhat moot, Perhaps my issue is a question of how do I grep for bytes (not chars) in groups of _2-bytes_ , ie. so that UTF-16LE `\x09\x0A` is not treated as TAB,newline, but just as 2 bytes which happen to be UTF-16LE `ऊ`? ... Note: I do not need to be concerned about UTF-16 surrogate pairs, so 2-byte blocks is fine. Here is sample pattern for this 3-character string `ऊपर`:   * `\x09\x0A\x09\x2A\x09\x30` but it returns nothing, though the string is in the file. _(here is the original post)_   When searching a UTF-16LE file with a pattern in `\x00\x01\x...etc` format, I have encountered problems for some values. I've been using `sed` (and experimented with `grep`), but being in the UTF-8 locale they recognize some UTF-16LE values as ASCII characters. I'm locked-in to using UTF-16, so recoding to UTF-8 is not an option. eg. In this text `ऊ` (UNICODE 090A), though it is a single character, `ऊ` is perceived as two ASCII chars `\x09` and `\x0A`. `grep` has a `-P` (perl) option which can search for `\x00\x...` patterns, but I'm getting the same ASCII interpretation. Is there some way to use `grep -P` to search in a UTF-16 mode, or perhaps better, how can this be done is perl or some other script. `grep` seems to be the most appealing because of its compactness, but whatever gets the job done will overrride that preference. PS; My `ऊ` example uses a literal string, but my actual usage needs a regex style search. So this perl example is not quite what I'm after, though it does process the file as UTF-16... I'd prefer to not have to open and close the file... I think `perl` has more compact ways for basic things like a regex search. I'm after something with that type of compact syntax.


title: View a remote Ubuntu desktop from Windows 7

text: I tried TightVNC and VNC Viewer (realvnc), and they both show checkboard screens (no screen only checkboard). Also, I tried RDP, same result: checkboard screen. I tried FreeNX, but I would like **stronger/better compression** since I have very fast CPUs on both client and server (though the RAM on the server is only 512MB burstable to 1GB). So, I have the processing power, and I want to take advantage of that to make the connection seamless.


title: Network issue in vsat

text: In my server-client architecture, I **multicast** 100 MB files to many clients from server via satellite link. Network traversal is through 5 hops. I have the 10Mbps ( i.e. 1250 Kilo Byte per second ) bandwidth link. When I multicast the first file to many client, first hop get the incoming speed is of ~9.0 mbps but the receiver end get the speed of only ~4.2 mbps. All clients are 10mb half duplex. I can see, there is low network usage; But I don't know where exactly. If server is sending at the speed of ~9.0 mbps, then client should got the same speed. I am using the reliable UDP for multicasting. Is there any way to find out, what is the incoming and outgoing bandwidth usage of each hop (for a particular port.) ? Is there exist any tool/utility/application who can serve the purpose. All the hops are at remote location, so that going over there is not possible.


title: how do I enable fluxbox instead of Gnome by default in Ubuntu

text: I'm working on a VPS which I can control with PuTTY and FreeNX. I don't have enough RAM for Gnome, so I want fluxbox to start by default instead of Gnome. how do I do that?


title: Assuming sshd allows only public key authentication, how do I log the fingerprints?

text: With OpenSSH, how can I log the fingerprints of the keys used for authentication? I would like to log it in production, so it would be best if this wasn't just some debug setting or similar.


title: In my Dell R310 server, i would like to install CentOS, but for RAID1 what special care i need?

text: I have my Dell R310 server to install CentOS latest version, it has 2 hot plug disk drive, about 250GB of each. - But i need to install RAID1 on it. My question is for RAID1 installation with CentOS is there any special ISO? Or i can use the regular one? Anyone can recommend some working document/screenshot/video links, for RAID1 installation only (i do not want to go with RAID0 or RAID5 etc tutorial, makes more confuse, i decided to only use RAID1 and learn from it)?


title: Copy/Move whole folder but with certain extentions

text: I have a backup copy of my site located in /tmp/backup and want to copy it to /home/mysite/public_html But my aim is to copy only the .php files (with nested folders) and replace. If I don't have nested folders i simply do `cp /tmp/backup/*.php /home/mysite/public_html` But how i can do it for the whole site with many folders?


title: aspell installs too many languages

text: I have installed `aspell-en` and `aspell-de`. I have expected this will give me the choice between `en` and `de` languages. However, the package has installed many versions of `en` and `de` languages and now when I want to select my spell language, I get too many to choose from.   * Is it possible to configure somewhere, which languages are offered/displayed?   * Can I limit the list to, lets say only `en_US` and `de_CH` ? I am sure I will never need `de_LI` and besides, I don't see any reason why `de_LI` should be a separate language anyway. I am using Debian Wheezy. ![Available languages](http://i.stack.imgur.com/CWKYq.jpg)


title: find numbers in parentheses and round them

text: Say I have a file called tables.tex (lots of tables formatted for tex, including a preamble) with lines like this:               some words (xyz, abc) & 0.00071 (0.07846) & 0.00411 (-0.13542) \\     some more words (1) & 0.00341 (-0.59991) & 0.00001 (0.99453) \\      I need to find all the numbers in parentheses that are not before the first '&' in a line that ends with a double backslash and replace them with a rounded version, rounded to 3 digits. So my output at the two lines above would look like this:               some words (xyz, abc) & 0.00071 (0.078) & 0.00411 (-0.135) \\     some more words (1) & 0.00341 (-0.600) & 0.00001 (0.995) \\      What is the most efficient way to do this? I have found answers on this site that describe how to do certain pieces of this operation in various ways (round numbers, print numbers in parentheses, awk, perl, etc), but I'm having trouble putting it all together in good (actually working) style.


title: How to Partition the FvwmButtons

text: I've read some _.fvwm2rc_ but I still want to know how we partition the `FvwmButtons` in Fvwm. How can we assign a specific slice to `Swallow` specific application?


title: remove duplicate files in 2 directories

text: I have two folders (w/ subfolders) containing files that both contain essentially the same content. Example:   * `/folder/files/data/new`   * `/folder/files/data/old` Is there way to delete all files in /new that are already in /old by _strictly filename_ (NOT date modified) to prevent me from re-reading duplicate files.


title: Multiple USB wireless devices?

text: I have a broadcom wireless card in my laptop and as far as I know, it acts as an USB device. I also have one USB stick wireless device (TL-WN422G - uses ath9k_htc driver) which I want to use at the same time as the first (Broadcom) device. The problem is, after I load ath9k_htc - iwconfig does not show the new USB device (the TL-WN422G - wlan1 / ath0 / whatever), but only the old one (wlan0 - Broadcom, checked by MAC). I tried this USB device (TL-WN422G) on my other computer that has PCI wireless card in it, and they both worked just fine together after I pluged it in... I get wlan0 (Ralink) and wlan1 (TL-WN422G). Is it some kind of a problem for the laptop that both devices are recognized as USB? How do I make wlan1 appear on my laptop? also, my system is fully up to date 2.6.35 kernel (Arch) **edit:** I've already downloaded the needed ar9271.fw from linuxwireless.org and I put it into /lib/firmware - something wrong in that? dmesg gives me this on laptop:               usb 1-5: new high speed USB device using ehci_hcd and address 9     usb 1-5: ath9k_htc: Firmware - ar9271.fw not found     ath9k_hif_usb: probe of 1-5:1.0 failed with error -22      and this on the computer that does work:               usb 1-5: new high speed USB device using ehci_hcd and address 4     usb 1-5: ath9k_htc: Transferred FW: ar9271.fw, size: 51280     ath: EEPROM regdomain: 0x809c     ath: EEPROM indicates we should expect a country code     ath: doing EEPROM country->regdmn map search     ath: country maps to regdmn code: 0x52     ath: Country alpha2 being used: CN     ath: Regpair used: 0x52     cfg80211: Calling CRDA for country: CN     Registered led device: ath9k-phy1::radio     Registered led device: ath9k-phy1::assoc     Registered led device: ath9k-phy1::tx     Registered led device: ath9k-phy1::rx     usb 1-5: ath9k_htc: USB layer initialized     usbcore: registered new interface driver ath9k_hif_usb


title: Help with a find command

text: I have a bunch of directories. Inside these directories is a cover letter and a zip archive of work. I wanted to run a quick and easy query to open up all the cover letters so I can decide if it's worth looking at the work folder.               find . | grep cover\.pdf | xargs open    #OS X has open linked to "open" the file      This doesn't work. I've also muddied around with various `print0`, `xargs -0` variations with little success. What's the proper way to do this?


title: Good website to link to for generic linux advocacy

text: I would like to have a link on website, both advertising the fact that I use (GNU/)linux, and pointing the curious reader to a source to learn more information. But I'm having trouble finding the right place to link. Desiderata:   * **Not distribution specific.** (It would seem inappropriate to link to anything but the distro I actually use, but Arch Linux is not really right for beginners.)   * **Beginner friendly.** Says in very simple terms what linux is for those who don't already have any idea. Links to download and beginner resources.   * **Not overly preachy.** Doesn't shame or scold people for being bad, naughty Windows/Apple/non-free-software users.   * **Professional looking and up to date.**   * **Presents linux in a positive light.** But I'm having trouble finding a destination that matches all these criteria. Here are some of the things I've considered, but don't seem right for one reason or another:   * Linux online! Provides decent summary, but the page is extremely unprofessional looking (IMHO); straight out of the mid-1990s.   * Linux.com or the Linux foundation: To me, these seem more aimed at those who already know what linux is, and want to learn more about the foundation, or recent linux-related news, rather than beginners; but the first link may be a possibility; some the pages buried deeper down are more promising.   * Switching to Linux page on Grokdoc; a very good source of information, but is just information only, no pizzazz. Thoughts?


title: is the behaviour of .* to include . and .. defined in LSB or POSIX or some other specification?

text: as title: is the behaviour of `.*` to include `.` and `..` defined in LSB or POSIX or some other specification?


title: Lock some accounts during some time periods

text: Is it possible to lock some accounts in order to be accessible only during specific time periods? For instance the account joe should only be accessible during office hours.


title: Will DVD+RW work on my laptop drive marked RW?

text: I purchase today moserbaer DVD that is: DVD+RW. Now I want to know whether my drive supports this DVD (i.e. the DVD can be burned)! On my drive its written RW & ReWritable. Also please see the below command output if it may help.               ravbholua@ravbholua-Aspire-5315:~$ sudo lshw | grep DVD     [sudo] password for ravbholua:                   description: DVD-RAM writer                  product: DVD-RW DVRKD08RS     ravbholua@ravbholua-Aspire-5315:~$       > EDIT I tried burning the DVD with my Ubuntu 13.10 iso but failed. Then I tried burning only 1 video file on the same DVD but that also got failed. I give the details below: I tried burning Ubuntu 13.10 iso as below: 1st I tried via command line but failed:               ravbholua@ravbholua-Aspire-5315:~/Documents/Other/special$ ls     ubuntu-13.10-desktop-i386.iso     ravbholua@ravbholua-Aspire-5315:~/Documents/Other/special$ sudo wodim -eject gracetime=30 ./ubuntu-13.10-desktop-i386.iso     wodim: No write mode specified.     wodim: Assuming -tao mode.     wodim: Future versions of wodim may have different drive dependent defaults.     Device was not specified. Trying to find an appropriate drive...     Looking for a DVD-R drive to store 895.00 MiB...     Detected DVD-R drive: /dev/dvdrw     Using /dev/cdrom of unknown capabilities     Device type    : Removable CD-ROM     Version        : 5     Response Format: 2     Capabilities   :      Vendor_info    : 'PIONEER '     Identification : 'DVD-RW DVRKD08RS'     Revision       : '1.02'     Device seems to be: Generic mmc2 DVD-R/DVD-RW.     Using generic SCSI-3/mmc DVD-R(W) driver (mmc_mdvd).     Driver flags   : SWABAUDIO BURNFREE      Supported modes: PACKET SAO     Speed set to 5540 KB/s     Starting to write CD/DVD at speed   4.0 in real unknown mode for single session.     Last chance to quit, starting real write in    0 seconds. Operation starts.     Errno: 5 (Input/output error), send opc scsi sendcmd: no error     CDB:  54 01 00 00 00 00 00 00 00 00     status: 0x2 (CHECK CONDITION)     Sense Bytes: 72 0B 00 00 00 00 00 0E 09 0C 00 00 00 02 00 08     Sense Key: 0x0 No Additional Sense, Segment 11     Sense Code: 0x00 Qual 0x02 (end-of-partition/medium detected) Fru 0x0     Sense flags: Blk 0 (not valid)      cmd finished after 79.878s timeout 60s     wodim: OPC failed.      Then I used Brasero (GUI) for that but that also couldn't burn the Ubuntu iso. The error log is below:               Checking session consistency (brasero_burn_check_session_consistency brasero-burn.c:1739)     BraseroBurnURI called brasero_job_get_action     BraseroBurnURI called brasero_job_get_action     BraseroBurnURI called brasero_job_set_output_size_for_current_track     BraseroBurnURI stopping     BraseroBurnURI called brasero_job_get_action     BraseroBurnURI called brasero_job_get_session_output_size     BraseroBurnURI output set (IMAGE) image = /tmp/brasero_tmp_EM0F9W.bin toc = none     BraseroBurnURI called brasero_job_get_session_output_size     BraseroBurnURI called brasero_job_get_action     BraseroBurnURI called brasero_job_get_current_track     BraseroBurnURI no burn:// URI found     BraseroBurnURI stopping     BraseroLocalTrack called brasero_job_get_action     BraseroLocalTrack called brasero_job_get_action     BraseroLocalTrack called brasero_job_set_output_size_for_current_track     BraseroLocalTrack stopping     BraseroLocalTrack called brasero_job_get_action     BraseroLocalTrack called brasero_job_get_session_output_size     BraseroLocalTrack output set (IMAGE) image = /tmp/brasero_tmp_EUZF9W.bin toc = none     BraseroLocalTrack called brasero_job_get_session_output_size     BraseroLocalTrack called brasero_job_get_action     BraseroLocalTrack called brasero_job_get_current_track     BraseroLocalTrack no remote URIs     BraseroLocalTrack stopping     BraseroChecksumImage called brasero_job_get_current_track     BraseroChecksumImage called brasero_job_get_action     BraseroChecksumImage called brasero_job_get_flags     BraseroChecksumImage called brasero_job_get_action     BraseroChecksumImage called brasero_job_get_action     BraseroChecksumImage called brasero_job_get_fd_in     BraseroChecksumImage called brasero_job_set_output_size_for_current_track     BraseroChecksumImage stopping     BraseroChecksumImage called brasero_job_get_current_track     BraseroChecksumImage called brasero_job_get_action     BraseroChecksumImage called brasero_job_get_flags     BraseroChecksumImage called brasero_job_get_action     BraseroChecksumImage called brasero_job_get_session_output_size     BraseroChecksumImage output set (IMAGE) image = /tmp/brasero_tmp_ZJFG9W.bin toc = none     BraseroChecksumImage called brasero_job_get_session_output_size     BraseroChecksumImage called brasero_job_get_action     BraseroChecksumImage called brasero_job_get_action     BraseroChecksumImage called brasero_job_get_current_track     BraseroChecksumImage called brasero_job_get_input_type     BraseroChecksumImage called brasero_job_set_current_action     BraseroChecksumImage called brasero_job_get_fd_in     BraseroChecksumImage called brasero_job_get_current_track     BraseroChecksumImage called brasero_job_get_current_track     BraseroChecksumImage Starting checksuming file /home/ravbholua/Documents/Other/special/ubuntu-13.10-desktop-i386.iso (size = 938475520)     BraseroChecksumImage called brasero_job_get_fd_out     BraseroChecksumImage called brasero_job_get_current_track     BraseroChecksumImage Setting new checksum (type = 2) d0508f909c2c71d96aeac5efb0329b33 ((null) before)     BraseroChecksumImage Finished track successfully     BraseroChecksumImage stopping     BraseroLibburn called brasero_job_get_action     BraseroLibburn called brasero_job_get_action     BraseroLibburn unsupported operation     BraseroLibburn deactivating     BraseroLibburn called brasero_job_get_action     BraseroLibburn called brasero_job_get_action     BraseroLibburn called brasero_job_get_device     BraseroLibburn Drive (/dev/sr0) init result = 1     BraseroLibburn called brasero_job_get_flags     BraseroLibburn called brasero_job_get_media     BraseroLibburn called brasero_job_get_fd_in     BraseroLibburn called brasero_job_get_tracks     BraseroLibburn Setting burnproof 0     BraseroLibburn Setting dummy 0     BraseroLibburn called brasero_job_get_session_output_size     BraseroLibburn called brasero_job_set_current_action     BraseroLibburn burn_drive_convert_fs_adr( /dev/sr0 )     BraseroLibburn Blanking/Formatting     BraseroLibburn called brasero_job_set_dangerous     BraseroLibburn called brasero_job_set_current_action     BraseroLibburn burn_drive_is_enumerable_adr( /dev/sr0 ) is true     BraseroLibburn Async START UNIT succeeded after 0.1 seconds     BraseroLibburn mmc_set_streaming: end_lba=2295103 ,  r=5540 ,  w=5540     BraseroLibburn Allocating buffer via mmap()     BraseroLibburn Format type 26h "DVD+RW (fs=0,rs=0)", blocks = 4294967295     BraseroLibburn CDB: 04 11 00 00 00 00      BraseroLibburn Format list: 00 02 00 08 FF FF FF FF 98 00 00 00           BraseroLibburn syncing cache     BraseroLibburn Async SYNCHRONIZE CACHE succeeded after 0.1 seconds     BraseroLibburn Writing     BraseroLibburn called brasero_job_set_dangerous     BraseroLibburn called brasero_job_set_current_action     BraseroLibburn called brasero_job_set_current_action     BraseroLibburn dvd/bd Profile= 1Ah , obs= 32768 , obs_pad= 0     BraseroLibburn Something went wrong     BraseroLibburn called brasero_job_error     BraseroLibburn finished with an error     BraseroLibburn asked to stop because of an error         error       = 15         message = "An error occurred while writing to disc"     BraseroLibburn stopping     Session error : An error occurred while writing to disc (brasero_burn_record brasero-burn.c:2856)      Then I tried burning the DVD with a video file but now also it failed. What's the issue please? Why I'm failing to do!!!


title: Network manager behaving strange on a laptop?

text: I use Debain stable with Gnome3. The network manager has this unpractical behaviour:   When the laptop in powser-safe mode (lid shut), the wireless network is off. Good.   When I open the lid and log in, at first I have no connection. The network manager shows to be searching for a connection, when I right click on it it shows my home network as the selected one. After (usually) **several minutes** , I get prompted for the password for my home w-lan (that is allready entered into the prompt), then my computer actually connects to the w-lan and I'm good. I'd like to get rid of the waiting period. There's another, connected thing that's bothering me: When I login and do nothing for a while, my laptop is supposed to lock the screen (and does so most of the time). But the prompt for the w-lan password prevents locking the screen until the password is entered. How can I change the behaviour upon login, meaning to get the network manager to prompt me for my password and find a new connection at once?


title: Compressing all files that contain a particular string

text: How can you compress all files in a directory that contain the word “compress” anywhere within its contents?


title: Any other way to define an environment variable?

text: I'm quite new to Linux. Debian Wheezy is now running on my Laptop (64 bits). I recently installed Oracle 11g R2 database for evaluation purpose, and defined environment variables (such as `ORACLE_SID`) through a script `/etc/profile.d/oracle.sh`. This works fine, but for the "oracle" user. I change user by `su - oracle`.   The value of `ORACLE_SI`D is different from the one specified in the `/etc/profile.d/oracle.sh` file. As the oracle user has no file (such as `.bash_profile`, `.profile` etc.) in its home directory, where can this value come from? What is the overloading sequence of environment variables?


title: Search for all messages containing a sring only in those files which is mentioned in a text file

text: You are in a directory with a large number of FIX logs that are over 1GB in size. You have a text file containing the names of 10 of those files. How can you search for all messages containing “50=MSFT”, only in those ten files?


title: "Jagged" rectangle text in emacs

text: Suppose I have something like               this     is     text      I want to change it to be               "this"     "is"     "text"      The first quote I can insert simply by making a rectangle and doing `C-x r t`, but the trailing quote I can't add because they aren't all at the same alignment. Is there any way to add something to the end of all selected lines?


title: what is the command to display .eps files?

text: I'm have a file called `t-0.8.eps`. How can I open this file in the shell? I am using Mac and when I click `.eps` files the preview (the name of the software to read PDFs) says failed.


title: 'ps' command hangs

text: A coworker ran into this issue twice and I don't know what's wrong. His `ps` command hangs, taking about 25% of the CPU.                  in_progress=1        sleep 10             while [ "$in_progress" -eq 1 ]; do           num_isp=`ps -e | grep isputility | grep -v grep | wc -l`           if [ "$num_isp" -eq 0 ]; then              in_progress=0           fi           sleep 10        done      Below is the output of the `ps` command that hung.                      F S   UID        PID       PPID  C PRI  NI ADDR    SZ WCHAN STIME TTY          TIME CMD     00100000 -     0   35672094    1204253  -  10   0    -  844K -     Apr16 ?        00:00:00 /bin/sh /home/customProgram     00100000 -     0   43548705   42545184  -  10   0    -  648K -     11:51 ?        00:00:00 ps –elf     00100000 -     0   41926696   35672094  -  10   0    -  648K -     Apr16 ?        03:53:01 ps -e     00100000 -     0   41926702   35672094  -  10   0    -  672K -     Apr16 ?        00:00:00 grep isputility     00100000 -     0   41926704   35672094  -  10   0    -  672K -     Apr16 ?        00:00:00 grep -v grep     00100000 -     0   41926706   35672094  -  10   0    -  640K -     Apr16 ?        00:00:00 wc -l      Running QNX `hogs` command (similar to `top`) shows `ps` is using ~25% of the CPU.               hogs -% 1 -n     PID             NAME  MSEC  PIDS SYSTEM     1            procnto  2116   71%    70%     41926696           ps   763   25%    25%      Can anyone point us in the right direction to figure out why `ps` hung and what we can do about it?


title: console vim in screen session: remap Ctrl-Shift-Left, Ctrl-Shift-Right to not delete lines

text: I have my gvim setup so that I can select word-wise with Ctrl-Shift-Right, Ctrl-Shift-Left etc. (yes, I know it's a bad habit, but it works for me..). Unfortunately, these key combinations delete text when used in console vim inside a screen session. I believe this is because the two key combinations produce the codes `<Esc>[1;6D` and `<Esc>[1;6C` on the terminal, which are interpreted as "delete next 6 lines" or "change next lines", respectively. Is there some way to stop screen or console vim from interpreting these key combinations? **UPDATE** : Content of my .screenrc:               sessionname daku     startup_message off     hardstatus on     hardstatus alwayslastline     hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "


title: SSH X11 forwarding put on a different monitor

text: Is there a way to use ssh and X11 forwarding with multiple monitors, such that one screen gets the remote session and one keeps the current session? Note: In case I didn't clarify, I meant forwarding an entire session with `gnome-session` or `start-x` or similar. I knew that ssh could be used for single windows.


title: How does one determine the amount of space allocated to their command line?

text: How would one go about determining the amount of space allocated to their system for command lines. Is there anything else I need to be concerned with?


title: How to start first command from the list printed by command 'history | grep something'

text: For example, I have the following output from command:               loom@loom:$ history | grep MAKE       219  ../build.sh -DCMAKE_BUILD_TYPE=Debug ..       909  history | grep MAKE      How to write a command, that start the first command from the list? Also, I'd like to know how to start n-th command from output of `history | grep something`?


title: What does xargs do if it's used without any parameter?

text: [user@notebook ~] echo -e '1\n2\n3\n4'     1     2     3     4     [user@notebook ~] echo -e '1\n2\n3\n4' | xargs     1 2 3 4     [user@notebook ~]       **My question:** So xargs removes the newlines if it's used without parameters?


title: What is the utility of piping to `/dev/null`?

text: Seeing that `/dev/null`'s utility isn't immediately obvious to me, what is the use of `/dev/null` piping?


title: Slackware 14 can't find DVD after booting from it

text: I am installing Slackware 14 from a DVD onto a gigabyte 990fxa-ud3 motherboard. The DVD boots fine but when I run setup and choose CDROM as the source, it says that it can't find the CDROM drive. The DVD reader is a HP DVD1170 with a USB interface. Trying the modprob stuff here does not help. Edit: Trying some of the stuff here does not work either (setting IOMMU to enabled).


title: How to get volume level from the command line?

text: I have a text status bar on a tiling window manager and I am using tcl to feed information to it. At the moment I need a command line that output the volume level 0% to 100%. I am using Arch Linux.


title: Problem with sed

text: root@ROUTER:~# cat maccheck.txt      logread | egrep ': STA |DHCPACK' | awk '{print $1" "$2" "$3" "$9}' | sed -e 's/\( [0-9] \)/0\1/' | sed "s/.\{15\}/&:/; s/: /:/g" | cut -d : -f 1,2,4,5,6,7,8,9 | sed "s/.\{13\}/&X/;" | sed 's/:X/ /g' | sed 's/XX:XX:XX:XX:XX:XX/AAAA/g' | sort -u -r      it OK when it's here:               root@ROUTER:~# logread | egrep ': STA |DHCPACK' | awk '{print $1" "$2" "$3" "$9}' | head -1     Sep 2 03:03:25 XX:XX:XX:XX:XX:XX      but it's bad if I use the script that has further things in it:               root@ROUTER:~# sh maccheck.txt |head -1     Sep0 4 13:13 AAAA      so the "Sep0" is bad.. how to modify it to be "Sep"?               root@ROUTER:~# logread | egrep ': STA |DHCPACK' | awk '{print $1" "$2" "$3" "$9}' | sed -e 's/\( [0-9] \)/0\1/' | head -1     Sep0 2 03:03:25 AAAA      So the problem is with:               sed -e 's/\( [0-9] \)/0\1/'      **Q:** I need the same output, but without the "0" in "Sep", how to do it?


title: IPTables dropping UDP packet stream

text: I have a configuration where UDP packets containing encapsulated DNS data are sent to a KVM instance for processing. The KVM instance sits behind an IPtables firewall which is also doing NAT. The stream is coming in on average at about 25Mb per second. The stream comes in and works as expected with one exception. If I terminate the KVM instance and remove the IPtables rules, the stream no longer gets forwarded through the IPtables box. I expect this behavior. If I bring up another KVM instance with the same IP address, and add the same rules back into iptables, the stream does not get forwarded until I stop the stream on the sending side and leave it off for at least 30 seconds. If I start the stream after waiting 30 seconds, the traffic is again passed to the KVM instance. I'm thinking there is some kernel parameter related to UDP timeouts that I'm unaware of. Has anyone seen behavior like this? The IPtables box is running CentOS 6.4. The KVM instance is running Ubuntu 10.04.


title: executing any program in mc ends putty session if not logged in with root

text: Maybe there is a simple-obvious solution for this but I dont know how to make mc to be able to execute programs when I press enter/double click on it and I am not logged in as root... the executable has executable rights for all. I get this whenever I try to execute anything by hiting enter or double clicking or trying to call a program from the command line. When I run the program to be executed with sudo it opens it up nicely, but I like the pressing enter method and would not like to type always the file name. Or how could I setup only some executables to execute from mc? Here is my `/etc/mc` folder:               drwxr-xr-x. 121 root root 12288 Nov 14 10:59 ..     -rw-r--r--.  1 root root 12278 Aug 22  2010 cedit.menu     -rw-r--r--.  1 root root  788 Aug 22  2010 edit.indent.rc     -rw-r--r--.  1 root root  247 Aug 22  2010 edit.spell.rc     drwxr-xr-x.  2 root root  4096 Oct 15 10:50 extfs     -rw-r--r--.  1 root root  1024 Aug 22  2010 filehighlight.ini     -rw-r--r--.  1 root root  226 Aug 22  2010 mc.charsets     -rw-r--r--.  1 root root 17353 Aug 22  2010 mc.ext     -rw-r--r--.  1 root root  7936 Aug 22  2010 mc.keymap     -rw-r--r--.  1 root root  7936 Aug 22  2010 mc.keymap.default     -rw-r--r--.  1 root root  7913 Aug 22  2010 mc.keymap.emacs     -rw-r--r--.  1 root root  1979 Aug 22  2010 mc.lib     -rw-r--r--.  1 root root  9556 Aug 22  2010 mc.menu     -rw-r--r--.  1 root root 10126 Aug 22  2010 mc.menu.sr     -rw-r--r--.  1 root root  6259 Aug 22  2010 Syntax      The mc from `/user/bin`               -rwxr-xr-x.  1 root root      988432 Aug 22  2010 mc      For example, here is a file I would like to execute through mc with normal user:               -rwxrwxr-x  1 root hUSERS  205780 Jun 11 16:03 DBU3L      These are the putty log's last lines:               [44m*DBU3L[23;3H[1;1H[39m[49m[K     [K     [K     [K     [K     [K     [K     [K     [K     [K     [K     [K     [K     [K     [K     [K     [K     [K     [K     [K     [K     [K     [K     [K[1;80H[?1002l[?1001r[?1l>[24;1H(B[m[39;49m     [K     [?1049l>[?47l8[m$ ./DBU3L      `mv -v` output:               GNU Midnight Commander 4.7.0.2     Virtual File System: tarfs, extfs, cpiofs, ftpfs, fish, mcfs, smbfs     With builtin Editor     Using system-installed S-Lang library with terminfo database     With subshell support as default     With support for background operations     With mouse support on xterm and Linux console     With internationalization support     With multiple codepages support     Data types: char 8 int 32 long 64 void * 64 off_t 64 ecs_char 8      I saw in a forum a program called `sam` that could be used to solve the problem, but would not like to reinvent the wheel if this could be fixed by changing some rights or mc parameters.


title: Python: Move lines backward in a textfile

text: Imagine a text file which contains random text and two unique markers               01 text text text     02 text text text     03 __DELETE_THIS_FIRST__     04 text text text     05 text text text     06 text text text     07 text text text     08 __DELETE_THIS_LINE_SECOND__     09 a few     10 interesting     11 lines follow     12 __DELETE_THIS_LINE_THIRD__     13 text text text     14 text text text     15 text text text     16 text text text     17 __DELETE_THIS_LINE_FIRST__     18 text text text     19 text text text     20 text text text     21 text text text     22 __DELETE_THIS_LINE_SECOND__     23 even     24 more     25 interesting lines     26 __DELETE_THIS_LINE_THIRD__      I want a Python expression that moves the interesting lines between the END marker and thr THIRD marker to the position of the **PREVIOUS** BEGIN marker and also deletes all three markers. Which should result in:               01 text text text     02 text text text     09 a few     10 interesting     11 lines follow     04 text text text     05 text text text     06 text text text     07 text text text     13 text text text     14 text text text     15 text text text     16 text text text     23 even     24 more     25 interesting lines     18 text text text     19 text text text     20 text text text     21 text text text      The three markers are always a triple and occur multiple times in the file. FIRST marker always occurs before SECOND marker, which always occurs before THIRD marker Any ideas? Related: 126325


title: Start the script with sudo not working

text: I am trying to start the virtual machine (ORACLE VIRTUALBOX) using this script (script name: `start_vm001.sh`).               START_VM=`/usr/bin/VBoxHeadless --startvm testvm001`     EXECUTE_VM=`exec /sbin/start-stop-daemon --start --chuid 1001 \     --exec "$START_VM" -- $START_VM`     echo $EXECUTE_VM                    $ ./start_vm001.sh, # it worked     $ sudo ./start_vm001.sh # it not worked          ERROR OUTPUT: sbin/start-stop-daemon: unable to stat Oracle VM VirtualBox      Headless Interface 4.1.12_Ubuntu (C) 2008-2013 Oracle Corporation All rights      reserved. Invalid machine name or UUID! (No such file or directory)      How to run the script using sudo?