SDcard support in Linux for ENE Flash UB6250 card reader (found on Acer Aspire One 522)

I have an Acer Aspire One 522 netbook for which I want to get the SDcard reader working, but I'm having trouble getting it to recognize the SDcard after it is inserted. I use Slackware and always compile my own kernels, so I have already enabled the `Device Drivers->MMC/SD/SDIO card support` option and respective kernel modules, compiled and properly installed the kernel and its modules (kernel version is 3.5.3). The card reader seems to get connected to the USB bus as soon as a SDcard is inserted, since `lsusb` only shows the reader after this event:               Bus 002 Device 005: ID 0cf2:6250 ENE Technology, Inc. SD card reader (UB6250)      I would normally expect to see a block device like `/dev/mmcblk0` and the card partitions (`/dev/mmcblk0p1`, `/dev/mmcblk0p2` and so on) after the card is inserted, but nothing shows up. Monitoring /var/log/messages while the card is inserted shows this:               Sep  8 14:43:41 aspire kernel: usb 2-2: USB disconnect, device number 5     Sep  8 14:43:44 aspire kernel: usb 2-2: new high-speed USB device number 6 using ehci_hcd     Sep  8 14:43:44 aspire kernel: usb 2-2: New USB device found, idVendor=0cf2, idProduct=6250     Sep  8 14:43:44 aspire kernel: usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=4     Sep  8 14:43:44 aspire kernel: usb 2-2: Product: UB6250            Sep  8 14:43:44 aspire kernel: usb 2-2: Manufacturer: ENE Flash       Sep  8 14:43:44 aspire kernel: usb 2-2: SerialNumber: 606569746801     Sep  8 14:43:44 aspire mtp-probe: checking bus 2, device 6: "/sys/devices/pci0000:00/0000:00:13.2/usb2/2-2"      Sep  8 14:43:44 aspire mtp-probe: bus: 2, device: 6 was not an MTP device      showing the reader being connected to the USB bus but with no block device being detected. Does anyone have any hints about this? Did I miss something or support for this reader is not completely functional yet? Thanks!


Can't install inkscape on Ubuntu?

I tried to install inkscape in my Ubuntu 14, but it doesn't exist. And when I install my ubuntu says that is already install, but when I put in the terminal $ inkscape it says that is necessary to install. It is confusion. See file below How can I fix this problem? ![enter image description here](http://i.stack.imgur.com/EqLXr.png)


Use convert or ghostscript to grab the odd-numbered pages of a PDF

I have a PDF that consists of several hundred pages of bilingual text. Since I need to use OCR on each language separately, I want to grab the even and odd pages and make two separate PDFs, using `convert` or `ghostscript`. The language I want to do first is on the odd-numbered pages. What `convert` or `ghostscript` command can I use to grab these and write them to a new file?


How to name network adapters created with virt-install?

In order to test preseeded installation, I want to create a virtual machine as close as possible to an actual server I use in production. The server has two network adapters: `p1p1` and `p2p1`. When creating a virtual machine with:               virt-install \         --connect=qemu:///system \         ...         --network=bridge:br0 \         --network=bridge:br0 \         ...      the network adapters are called `eth0` and `eth1`. Is there a way to name them `p1p1` and `p2p1` before installing an OS?


How to scp from server to server with different public keys?

What arguments would I use for the `scp` command on a server to server copy if the two servers need different ssh keys? I know how to scp files from a server to a server without having data flow on the PC (the one from which I issued the `scp` command). Based on this tutorial, my starting command looks something like this:               scp -r miguel@10.1.2.2:/home/miguel/ miguel@10.1.2.3:/home/miguel/


Are dropped packages in traffic control really dropped?

While having a slight timeout problem in my network (the router needed some rest, so that's solved) I found myself trying to decipher `tc -s` output, after noticing that the "dropped" values represented an important proportion of packages, of at least 10%:               qdisc cbq 1: root refcnt 2 rate 10Mbit (bounded,isolated) prio no-transmit      Sent 392050166 bytes **727491 pkt (dropped 27505** , overlimits 1201372 requeues 1)       backlog 0b 0p requeues 1        borrowed 0 overactions 0 avgidle 12500 undertime 0     qdisc sfq 10: parent 1:10 limit 127p quantum 1514b depth 127 divisor 1024 perturb 10sec       Sent 16125105 bytes 265435 pkt (dropped 0, overlimits 0 requeues 0)       backlog 0b 0p requeues 0      qdisc sfq 20: parent 1:20 limit 127p quantum 1514b depth 127 divisor 1024 perturb 10sec       Sent 375890855 bytes **461738 pkt (dropped 27505** , overlimits 0 requeues 0)       backlog 0b 0p requeues 0      qdisc sfq 30: parent 1:30 limit 127p quantum 1514b depth 127 divisor 1024 perturb 10sec       Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)       backlog 0b 0p requeues 0      qdisc ingress ffff: parent ffff:fff1 ----------------       Sent 342713979 bytes 716041 pkt (dropped 1308, overlimits 0 requeues 0)       backlog 0b 0p requeues 0 So, these counters represent really dropped package, _a la_ iptables? Or it's just a representation of something else? What represent this number? The manual says something about dropping, but it left me with the same doubt: > DESCRIPTION > > Tc is used to configure Traffic Control in the Linux kernel. Traffic Control > consists of the following: > > [...] > > DROPPING > > Traffic exceeding a set bandwidth may also be dropped forthwith, both on > ingress and on egress.


Formatting a floating point variable in a SED statement

As part of a makefile recipe, I want to repeatedly adjust a few lines in some text file `txt.in`. In particular, I want to update, among others, the third line which contains simply two numbers separated by a space. They should be formatted as `0.00 0.00`. As such, I've included the code below in my makefile to test whether I can do this.               # Makefile to test for-loop     SHELL=/bin/zsh          for:         for k in 1 2 3; do \             let n="$$k*0.25"; \             let m="$$n+0.25"; \             sed -i "3s/.*/$$n $$m/" txt.in; \         done      This yields `0.7500000000 1.0000000000` as the end result. There may be more efficient ways to do this and I'd be happy to find out about those, but the thing I'd really like to find out is if there's a way to get the format right.


How do I get just the user-manual for Vim

To get the vim user-manual I am doing               vi test      and then, once the file is opened, I do :help user-manual This opens up a split window, which makes reading manual inconvenient to read. How do I only open the user-manual in the full window ?


I changed my hostname, why is my bash PS1 prompt unchanged

I changed my hostname by editing /etc/hostname and can see the new hostname using the `hostname` and `hostname -F` commands. But the shell prompt is still showing the old hostname. This is Ubuntu 11.0.4 by the way. The prompt is set in my `.bashrc` which I have not edited. Logging out and even rebooting has no effect. Relevant section of the standard Ubuntu `.bashrc`:               if [ "$color_prompt" = yes ]; then         PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '     else         PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '     fi      ($debian_chroot is unset as I login...) I guess the hostname is picked up by the special character \h. Here's the PS1 setting as reported in the shell:               PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '      And here is what PS1 shows:               username@oldhostname:~$       I repeated the process using the exact command in Warren's answer. It turns out that the hostname works until reboot but then it is lost, even though `/etc/hostname` contains the new hostname.


local shutdown scripts (do's and don't's)

At work, I'm running linux, and use vagrant on a daily basis. What I find annoying is that the system often hangs when I reboot/shut down, if I forgot to `vagrant halt` any virtual boxes I may have fired up.   To counter this, I'd like to write a shutdown script, along the lines of:               #! /bin/sh     cd ~/vagrants/vagrant_1     vagrant halt     cd ../vagrant_2     vagrant halt     exit 0      However, for I'm not too sure if `~` will still be available to me, and even if it is, if the _home_ dir in question will always be the right one, and if the script will have access too it. So I thought I'd do:               #! /bin/sh     VAGRANT_HOME="~/vagrants/"    #or "/home/my_user/vagrants"     if [ -d "$VAGRANT_HOME" ]; then         cd $VAGRANT_HOMEvagrant_1         vagrant halt         cd $VAGRANT_HOMEvagrant_2         vagrant halt     fi      But even so, I can't help finding this silly, since I have added a couple of aliasses to my `.profile` file, including:               alias vagranthalt="cd ~/vagrants/vagrant_1 && vagrant halt && cd - && cd ~/vagrants/vagrant_2 && vagrant halt && cd -"      Which I'd like to use, but I'm not sure if these aliasses will still be available when my script is executed. I think I'll only need it @ runlevel 6, but might also need to symlink the script to run on runlevel 0, too. Basically, what I'd like to know is this:   * will existing aliasses be available to me, or not?   * Is there a _user_ executing this script (and will I therefore be able to use `~` for home?   * should I make sure I have, at least, read-rights on the vagrant dirs in the script   * Is there another way to ensure the vagrant boxes are shutdown, that is perhaps slightly easier?


listen a power-button event in Python (no ACPI)

I am using a Debian machine which does not include the acpid package. Is there a way that I can reboot the machine using Python language when the power- button is pressed, without installing that (or any other) package on the machine? Currently nothing is happening when the button is pressed.


How can I move files from my host system to Whonix-Workstation?

I'm not sure if using the guest additions is safe, but it seems to be the only way to transfer files. I cannot even get copy/paste to work between host and workstation.


Merging two different files with conditions

I have two different files as shown below. Content of `a.txt`:               HDR|1||||||||||                    DTL|@|||||||||||                  TLR|||||||||||||                   HDR|1||||||||||||                 DTL|||||||||||||                   TLR|||||||||||||           Content of `b.txt`:               HDR|2||||||||||       DTL|||||||||||||     TLR|||||||||||||     HDR|2||||||||||||      DTL|last||||||||||||     TLR|||||||||||||      Here I have to take out all the lines till 1st "TLR" in a.txt and b.txt and merge into 1.txt ,same way take out all the lines After 1st "TLR" in a.txt and b.txt and merge into 2.txt output should be: Content of `1.txt`:               HDR|1||||||||||      DTL|@|||||||||||      TLR|||||||||||||     HDR|2||||||||||      DTL||||||||||||      TLR|||||||||||||        Content of `2.txt`:               HDR|1||||||||||      DTL||||||||||||      TLR|||||||||||||     HDR|2||||||||||      DTL|last|||||||||||      TLR|||||||||||||        How can we accomplish this using UNIX Script?


Gedit Click Config plugin won't open

I'm using Gedit 3.4.2 with Click Config plugin 1.4.0. When I go to Edit->Click Config->Configure the window doesn't open, basically rendering this plugin useless. I've tried reinstalling the plugin. I've found a similar issue but I don't quite understand the fix: http://code.google.com/p/gedit-click- config/issues/detail?id=4


I want to find duplicates in a file and add a character to the end of the line on the 1st match

I am trying to find duplicates in a file and once a match is found mark the 1st match with a character or word on the end of the line. eg my file (test.html) contains the following entries               host= alpha-sfserver1     host= alphacrest3     host= alphacrest4     host= alphactn1      host= alphactn2     host= alphactn3      host= alphactn4     down alphacrest4      I can find the duplicate using the following:- (I use $2 as the duplicate will always be in column 2)               awk '{if (++dup[$2] == 1) print $0;}' test.html      It removed the last entry (down alphacrest4) but what I want is to also mark the duplicate entry with a word or character such as:-               host= alphacrest4 acked      Any help is most welcome.


How to let GDM shares monitor configure with GNOME?

I'm using gnome under Arch Linux in my laptop with a 1920*1080 monitor on the left of it, I set the monitor as my primary display in GNOME and everything works fine after I log in. However, GDM displays my log-in dialogue on my lap- top screen every time, and I noticed that my monitor was set defaultly on the right side of my laptop. I searched and found someone said mouse's position may have effect, which did not work on me. Can anybody help?


multithread handling in AM1808 using embedded Linux

I am using AM1808 ARM9 based board using GCC compiler (UBUNTU 10.04) . I am using Sqlite3 database management. I have some requirement regarding handling threads in background having access on database more then 3 or 4 times simultaneously. I found that I need to Cross compile the Sqlite3 with the Multithreading option(THREADSAFE = 1) enabled. I am not getting that How i can Cross Compile the Sqlite3.7.15 with the Serialized or Mutithread option enabled ? I stuck here and due to this i am getting uncertain errors. and my system gets stuck on Thread. I have already cross compiled my sqlite3.7.15 using following command. > sudo ./configure --exec- > prefix=/media/8CCC8E9BCC8E7F68/SQLIte3/sqliteinstall/ --host=arm > --target=arm CC=/opt/arm-2011.03/bin/arm-none-linux-gnueabi-gcc > AR=/opt/arm-2011.03/bin/arm-none-linux-gnueabi-ar > STRIP=/opt/arm-2011.03/bin/arm-none-linux-gnueabi-strip > RANLIB=/opt/arm-2011.03/bin/arm-none-linux-gnueabi-ranlib CFLAGS="-Os"


Configuring DNS resolver failover timeout

We have all of our systems set up to do internal DNS to a local name server and a secondary name server so that in the event the local DNS server is down they should go over the WAN to the secondary that is up in a remote location. During a recent maintenance window the primary name server locally was taken offline and our UNIX/Linux systems with Veritas Cluster (VCS) and Red hat cluster both experienced issues with cluster resources. Trying to determine how long resolution should be delayed when the servers have to go to the secondary (i.e. how long is the timeout to the primary) as it seems to hang for a while if the primary server is there but hung up? Is the length of time it waits before moving to the seconday tunable? This is for Solaris 10 and RHEL 6.


Using bzgrep recursively

I wanted to use `bzgrep` to find to text in bzip2 files. I expected `bzgrep` to work as `grep`, but on bz2 files. So I tried `bzgrep -r "mypattern" .` to find text in my bz2 files. Instead of the expected result I get the same result as `grep` : It found the text only in `.txt` files. Any idea how to use `bzgrep` recursively ? I am using `grep (GNU grep) 2.18`


What are the requierements to sniff UDP packets in a Wireless Ad-Hoc network?

In a wireless Ad-Hoc network, I have two computers which communicates in UDP together from 192.168.1.3 to 192.168.1.5 I have a third computer (192.168.1.6) which wants to listen to the packets which are not addressed to it. I can see the packets with `tcpdump` (which sets the wireless card in promiscuous mode). To redirect the packets, I am using :               iptables -t nat -I PREROUTING -s 192.168.1.3 -j DNAT --to-destination 192.168.1.5      Is it the only rule I need to use? Why isn't it working? Did I miss other requirements?


xsel not deleting selected text

I have been trying to get `xsel --delete` to work to ultimately implement a script to **move** selected material from one editor to another. According to the description:               Delete the contents of the selection     ------------------------------------                  xsel --delete          Will cause the program in which text is selected to delete that text. This     really works, you can try it on xedit to remotely delete text in the editor     window.      But this does not seem to work (`emacs`, `gedit` and also tried `xedit`). According to the man page:               -d, --delete            Request that the current selection be  deleted.  This  not  only            clears  the selection, but also requests to the program in which            the selection resides that the  selected  contents  be  deleted.            Overrides all input options.      But selected text is not even cleared. Clearing with `\--clear` worked in `gedit`, but not in `emacs`. In all cases I checked if the selected text was "known" with `xsel -p -o` first. How can I get `xsel --delete` to work? Does this depend on the application listening to `xsel`?


Passing multiple scripts to shell over ssh

I have a somewhat lengthy script which sources other scripts to include the functions there. I'd like to execute this script remotely via ssh. Now I thought to make one script file of it (without sourcing it) and then let it execute remotely via ssh. For example the idea was something like this, unfortunately it does not work:               $ ssh user@host < $(cat dep1.sh dep2.sh main.sh)      whereas when it is a single file (I merged it before) does work:               $ ssh user@host < complete_main_script.sh      Any ideas how I would overcome the issue, i.e. make one script file of the three above and send it as a whole via `ssh`?


How to upgrade mono on openSuse

I have a virtual machine running of openSuse 11.2 that has mono 2.6.4, I use this VM as a test server to test asp.net applications under Apache mod_mono. I wanted to upgrade (in the same virtual machine) to mono 2.8.2. I downloaded several rpm files from http://ftp.novell.com/pub/mono/download- stable/openSUSE_11.2/i586/ but I'm in a dependency "loop", don't know which package to install in the correct order... (Did I mention that I know very little of suse?) Edit: Is it possible to find a way to upgrade it without network connectivity? Thanks!


vim/emacs plugin to view recursive grep search search results?

Suppose I have a file formatted like this:               file1:123     file2:4444     some/other/file:2233      This represents the search results from a grep (i.e. file:line-number). I'd like to have a vim plugin which would allow me quickly browse through those hits. It would display a two-pane window (split horizontally) with the top pane showing the hits and the bottom pane showing currently selected hit. Changing the selection in the top pane displays the specified file at the indicated line number in the bottom pane. Anyone run across something like this? I'd even consider a non-vim solution (emacs/dedicated program, ...).


General Setup on remote programming

I have the following 3 units   * A laptop that runs both MAC/Ubuntu    * A home-based server with Ubuntu desktop version   * A wireless router which I got from the provider that does not have that much technical documentation (just general setup stuff). Also the router is connected with wire to the server. Ideally I want to use the terminal on my laptop and connect to the home server. What are the options? I just need to setup an SSH connection between these two machines?


Converting colored output into html

There are tools providing coloured output:               dwdiff -c File1 File2 # word level diff     grep --color=always # we all know this guy     ...      The question is: **How to convert their colored output of arbitrary program into coloured html file?** Other output formats might be suitable as well (LaTeX would be great). I think html is good starting point, as it's easy to convert it to other formats. (For curious how to keep terminal colour codes, please follow answer: http://unix.stackexchange.com/a/10832/9689 `... | unbuffer command_with_colours arg1 arg2 | ...` - tool unbuffer is part of expect )


How can I remove all symbolic links with a special target?

With the command:               ls -la *      I can list all my symbolic links. How can I remove all symbolic links which are linked to a special folder? For example: In my directory `usr/local/bin` I have the following entries:               lrwxrwxrwx 1 root root 50 Apr 22 14:52 allneeded -> /usr/local/texlive/2011/bin/x86_64-linux/allneeded     lrwxrwxrwx 1 root root 47 Apr 22 14:52 amstex -> /usr/local/texlive/2011/bin/x86_64-linux/amstex     lrwxrwxrwx 1 root root 24 Apr 23 19:09 arara -> /home/marco/.arara/arara      Now I want to remove all links with the path `/usr/local/texlive/`


libpangocairo-1.0.so.0: undefined symbol: cairo_has_show_text_glyphs error

I am using Debian Squeeze and I wanted to install Gimp 2.8. I installed a lot of packages dependencies for Gimp but I could not successfully complete the install of the Gimp package When installing the Gimp dependent packages, I think I broke a necessary package because now I am getting the following error when I try to start `thunar`, `gedit` and more.               symbol lookup error: /usr/local/lib/libpangocairo-1.0.so.0: undefined symbol: cairo_has_show_text_glyphs      How can I resolve this error?


How to tell the "last" command to read from STDIN?

SERVER:~ # zcat /var/log/wtmp-20130827.gz | last -f -     last: -: No such file or directory     SERVER:~ #       Without uncompressing the wtmp file, how can I see the output of if it with the last command?


Prevent wpa_supplicant from joining hidden networks

Is there any way to prevent wpa_supplicant from trying to join hidden networks? If SSID Foo is out of range, wpa_supplicant seems to broadcast "Is Foo available?"-queries. This is not particularly privacy-friendly, consdering lists of SSIDs can be uniquely identifiable.


What is sourcing my shell script?

I have a `.zshrc` and a `.zshenv` in my home directory. I added a new command to my `.zshenv` that I discovered was being run at least 3 times. I realized that I was accidentally `source`ing it from the `.zshrc`, so I removed that line, but it's still being run twice. I've tried echoing `$0` and `$_` in the script, and I get `(~/.zshenv) (~/.zshenv)` for the first pass, and `(30) (zsh)` for the second. What could that mean? Is there a better way to get a "stack trace" showing my caller?


Editing files in debian before installation

I am having problems installing debian on virtualbox. The installation step fails when trying to configure packet manager. The guy in the following post had them solved by editing a certain file during one of the installation phases. http://askubuntu.com/questions/146574/configuring-the-package-manage-failed- installation-on-11-10?newreg=3029c47198d34bb7be96025ffe0b3e32 I am completely new to Linux, command lines in general and have no idea how to: "Edit /usr/lib/apt-setup/generators/50mirror.ubuntu and comment out the two lines with db_metaget and db_subst statements after the comment "Text is variable for Debian"." could someone show some basic commands that would do it? :) I've already navigated to /usr/lib/apt-setup/generators/ and found the 50mirror file. How should I proceed? How do I close the shell and return to the installation afterwards? UPDATE: for anyone, trying to install linux on VirtualBox, install VirtualBox using administrator privileges. Then launch it with them as well. Worked for me :)


Copying files from one machine to another without asking for password

I am currently using this command. I am on another machine (ip1)               scp file.txt root@ip2:/home/praveen/test.c /home/praveen      The command will prompt for password. I use it in some shell scripts, and am calling these scripts from some crontab files. So, I can not enter the password every time. Is there any way to disable password asking or some another way to input password from somewhere, so that I don't need to enter it again. And I cannot use `ssh-keygen`, because I have to do the actions for these scripts only. When I use `ssh-keygen`, it will never prompt me for password again. I don't want this. Rest of the things should work as usual.


Courier-MTA not listening, how to increase debugging information?

i Follow tutorial from https://wiki.archlinux.org/index.php/Courier_MTA based on systemctl status command, the server is working fine               # systemctl status courier     courier.service - Courier Daemon        Loaded: loaded (/usr/lib/systemd/system/courier.service; disabled)        Active: active (running) since Tue 2013-08-27 15:40:16 WIT; 35s ago       Process: 509 ExecStop=/usr/sbin/courier stop (code=exited, status=0/SUCCESS)       Process: 511 ExecStart=/usr/sbin/courier start (code=exited, status=0/SUCCESS)      Main PID: 516 (courierd)        CGroup: name=systemd:/system/courier.service                ├─516 /usr/lib/courier/courierd                ├─517 /usr/lib/courier/courierd                ├─518 ./courieruucp                ├─519 ./courierlocal                ├─520 ./courierfax                ├─521 ./courieresmtp                └─522 ./courierdsn          Aug 27 15:40:16 gravity courierd[517]: Started ./courieruucp, pid=518, maxdels=4, maxhost=4, maxrcpt=16     Aug 27 15:40:16 gravity courierd[517]: Started ./courierlocal, pid=519, maxdels=10, maxhost=4, maxrcpt=1     Aug 27 15:40:16 gravity courierd[517]: Started ./courierfax, pid=520, maxdels=1, maxhost=1, maxrcpt=1     Aug 27 15:40:16 gravity courierd[517]: Started ./courieresmtp, pid=521, maxdels=40, maxhost=4, maxrcpt=100     Aug 27 15:40:16 gravity courierd[517]: Started ./courierdsn, pid=522, maxdels=4, maxhost=1, maxrcpt=1     Aug 27 15:40:16 gravity courierd[517]: queuelo=200, queuehi=400     Aug 27 15:40:16 gravity courierd[517]: Purging /var/spool/courier/msgq     Aug 27 15:40:16 gravity courierd[517]: Purging /var/spool/courier/msgs     Aug 27 15:40:16 gravity courierd[517]: Waiting.  shutdown time=Tue Aug 27 16:40:16 2013, wakeup time=Tue Aug 27 15:50:44 2013, queuedeliverin...rogress=0     Aug 27 15:40:16 gravity courieruucp[518]: ERROR: no uucp user found, outbound UUCP is DISABLED!      but the server was not listening at all               $ sudo netstat -ant | grep :25     $ sudo netstat -ant | grep :143      the start configuration               # grep START= /etc/courier/*     /etc/courier/esmtpd:ESMTPDSTART=YES     /etc/courier/esmtpd-msa:ESMTPDSTART=YES     /etc/courier/esmtpd-ssl:ESMTPDSSLSTART=NO     /etc/courier/imapd:IMAPDSTART=YES     /etc/courier/imapd-ssl:IMAPDSSLSTART=NO     /etc/courier/pop3d:POP3DSTART=YES     /etc/courier/pop3d-ssl:POP3DSSLSTART=NO      the log:               Aug 27 15:40:16 gravity courierd: Loading STATIC transport module libraries.     Aug 27 15:40:16 gravity courierd: Courier 0.71 Copyright 1999-2012 Double Precision, Inc.     Aug 27 15:40:16 gravity courierd: Installing [0/0]     Aug 27 15:40:16 gravity courierd: Installing uucp     Aug 27 15:40:16 gravity courierd: Installed: module.uucp - Courier 0.71 Copyright 1999-2012 Double Precision, Inc.     Aug 27 15:40:16 gravity courierd: Installing local     Aug 27 15:40:16 gravity courierd: Installed: module.local - Courier 0.71 Copyright 1999-2012 Double Precision, Inc.     Aug 27 15:40:16 gravity courierd: Installing fax     Aug 27 15:40:16 gravity courierd: Installed: module.fax - Courier 0.71 Copyright 1999-2012 Double Precision, Inc.     Aug 27 15:40:16 gravity courierd: Installing esmtp     Aug 27 15:40:16 gravity courierd: Installed: module.esmtp - Courier 0.71 Copyright 1999-2012 Double Precision, Inc.     Aug 27 15:40:16 gravity courierd: Installing dsn     Aug 27 15:40:16 gravity courierd: Installed: module.dsn - Courier 0.71 Copyright 1999-2012 Double Precision, Inc.     Aug 27 15:40:16 gravity courierd: Initializing uucp     Aug 27 15:40:16 gravity courierd: Initializing local     Aug 27 15:40:16 gravity courierd: Initializing fax     Aug 27 15:40:16 gravity courierd: Initializing esmtp     Aug 27 15:40:16 gravity courierd: Initializing dsn     Aug 27 15:40:16 gravity courierd: Started ./courieruucp, pid=518, maxdels=4, maxhost=4, maxrcpt=16     Aug 27 15:40:16 gravity courierd: Started ./courierlocal, pid=519, maxdels=10, maxhost=4, maxrcpt=1     Aug 27 15:40:16 gravity courierd: Started ./courierfax, pid=520, maxdels=1, maxhost=1, maxrcpt=1     Aug 27 15:40:16 gravity courierd: Started ./courieresmtp, pid=521, maxdels=40, maxhost=4, maxrcpt=100     Aug 27 15:40:16 gravity courierd: Started ./courierdsn, pid=522, maxdels=4, maxhost=1, maxrcpt=1     Aug 27 15:40:16 gravity courierd: queuelo=200, queuehi=400     Aug 27 15:40:16 gravity courierd: Purging /var/spool/courier/msgq     Aug 27 15:40:16 gravity courierd: Purging /var/spool/courier/msgs     Aug 27 15:40:16 gravity courierd: Waiting.  shutdown time=Tue Aug 27 16:40:16 2013, wakeup time=Tue Aug 27 15:50:44 2013, queuedelivering=1, inprogress=0     Aug 27 15:40:16 gravity courieruucp: ERROR: no uucp user found, outbound UUCP is DISABLED!      how to increase debugging information?


KVM can't access iso o raw images outside /var/lib/libvirt/images

I'm using Linux Mint Debian Edition (Up. 8) when tryng to start a virtual machine from libvirt (either from commandline or using virt-manager to local qemu-kvm) I get this error when I use an image that is not loaded in the default datastore: if I copy the same image (in this example an .iso file) to the /var/lib/libvirt/images folder it works. I've tried to chown and chmod it to every possible owner and mode but it just won't work. SELinux is not in place in this distro so I don't know where's the point, in logs I can see just permission denied and I'm quite stuck.               Impossibile completare l'installazione: 'internal error: process exited while connecting to monitor: qemu-system-x86_64: -drive file=/home/penzo/Scaricati/elementaryos-stable-amd64.20130810.iso,if=none,id=drive-ide0-1-0,readonly=on,format=raw: could not open disk image /home/penzo/Scaricati/elementaryos-stable-amd64.20130810.iso: Could not open '/home/penzo/Scaricati/elementaryos-stable-amd64.20130810.iso': Permission denied     '          Traceback (most recent call last):       File "/usr/share/virt-manager/virtManager/asyncjob.py", line 96, in cb_wrapper         callback(asyncjob, *args, **kwargs)       File "/usr/share/virt-manager/virtManager/create.py", line 1949, in do_install         guest.start_install(False, meter=meter)       File "/usr/lib/pymodules/python2.7/virtinst/Guest.py", line 1249, in start_install         noboot)       File "/usr/lib/pymodules/python2.7/virtinst/Guest.py", line 1317, in _create_guest         dom = self.conn.createLinux(start_xml or final_xml, 0)       File "/usr/lib/python2.7/dist-packages/libvirt.py", line 2897, in createLinux         if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)     libvirtError: internal error: process exited while connecting to monitor: qemu-system-x86_64: -drive file=/home/penzo/Scaricati/elementaryos-stable-amd64.20130810.iso,if=none,id=drive-ide0-1-0,readonly=on,format=raw: could not open disk image /home/penzo/Scaricati/elementaryos-stable-amd64.20130810.iso: Could not open '/home/penzo/Scaricati/elementaryos-stable-amd64.20130810.iso': Permission denied      any clues?


Due to a broken monitor, I need to setup only the right half of my screen

The left side of my full hd monitor is broken, in order to use only the good part the resolution needs to be `1274x1080`, aligned to the right. A simple `xrandr -s 1274x1080` will get the right resolution, but centered. Using `\--transform 1,0,-323,0,1,0,0,0,1` will move the screen but will not occupy the right side. I already tried to play with `modeline`, using the link given in this answer, but it does not move the screen no matter what I change.


Built new kernel, LVM won't mount from initrd

I need to upgrade my kernel on a RHEL 5 system to build with some experimental drivers. I have configured the kernel with module loading for LVM (`dm_*` modules). Once the initrd runs the `/init` script, the LVM mounting procedure is failing. The drives are configured with LVM (including the root device) so during init, it mounts them and performs `switchroot`. What can I do to understand why `lvmscan` is failing?


Incrontab does not execute command

When I use incrontab out of the box, I mean no changes, I get no result, as if the command was not executed. my incron line is : `/crrae IN_CREATE,IN_CLOSE_WRITE,IN_MOVED_TO /usr/bin/unix2dos $#` the log give information as if everything was ok but no actually the strace generated is: `incrontab_trace_0.txt`                0.000000 poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=8, events=POLLIN}], 3, -1) = 1 ([{fd=8, revents=POLLIN}])     17.616276 read(8, "\1\0\0\0\0\1\0\0\0\0\0\0000\0\0\0ExportSageJDE_CO"..., 32768) = 64      0.000145 stat64("/crrae", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0      0.000147 time(NULL)                = 1399228077      0.000056 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=156, ...}) = 0      0.000089 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=156, ...}) = 0      0.000082 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=156, ...}) = 0      0.000096 send(3, "<78>May  4 18:27:57 incrond[3183"..., 108, MSG_NOSIGNAL) = 108      0.000104 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7f60718) = 31838      0.000816 poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=8, events=POLLIN}], 3, -1) = -1 EINTR (Interrupted system call)      0.000834 --- SIGCHLD (Child exited) @ 0 (0) ---      0.000033 read(4, 0x8069c40, 32)    = -1 EAGAIN (Resource temporarily unavailable)      0.000057 write(5, "X", 1)          = 1      0.000056 sigreturn()               = ? (mask now [])      0.000072 poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=8, events=POLLIN}], 3, -1) = 1 ([{fd=4, revents=POLLIN}])      0.000068 read(4, "X", 1)           = 1      0.000054 read(4, 0xbfd22dd9, 1)    = -1 EAGAIN (Resource temporarily unavailable)      0.000057 waitpid(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], WNOHANG) = 31838      0.000060 waitpid(-1, 0xbfd22dd4, WNOHANG) = -1 ECHILD (No child processes)      0.000051 poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=8, events=POLLIN}], 3, -1) = 1 ([{fd=8, revents=POLLIN}])      0.009198 read(8, "\1\0\0\0\10\0\0\0\0\0\0\0000\0\0\0ExportSageJDE_CO"..., 32768) = 64      0.000074 stat64("/crrae", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0      0.000118 time(NULL)                = 1399228077      0.000057 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=156, ...}) = 0      0.000084 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=156, ...}) = 0      0.000082 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=156, ...}) = 0      0.000090 send(3, "<78>May  4 18:27:57 incrond[3183"..., 108, MSG_NOSIGNAL) = 108      0.000065 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7f60718) = 31839      0.000614 poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=8, events=POLLIN}], 3, -1) = -1 EINTR (Interrupted system call)      0.000832 --- SIGCHLD (Child exited) @ 0 (0) ---      0.000026 read(4, 0x8069c40, 32)    = -1 EAGAIN (Resource temporarily unavailable)      0.000055 write(5, "X", 1)          = 1      0.000054 sigreturn()               = ? (mask now [])      0.000071 poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=8, events=POLLIN}], 3, -1) = 1 ([{fd=4, revents=POLLIN}])      0.000067 read(4, "X", 1)           = 1      0.000053 read(4, 0xbfd22dd9, 1)    = -1 EAGAIN (Resource temporarily unavailable)      0.000051 waitpid(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], WNOHANG) = 31839      0.000058 waitpid(-1, 0xbfd22dd4, WNOHANG) = -1 ECHILD (No child processes)      0.000050 poll([{fd=4, events=POLLIN}, {fd=6, events=POLLIN}, {fd=8, events=POLLIN}], 3, -1 <unfinished ...>      When I change my incron to:               /crrae IN_CREATE,IN_CLOSE_WRITE,IN_MOVED_TO /usr/bin/unix2dos /crrae/$#       or               /crrae IN_CREATE,IN_CLOSE_WRITE,IN_MOVED_TO /usr/bin/unix2dos $@/$#      the log gives me this:               May  4 18:15:10 srvovs incrond[20859]: (root) CMD (/usr/bin/unix2dos /crrae/u2dtmpPbqoFd)     May  4 18:15:10 srvovs incrond[20859]: (root) CMD (/usr/bin/unix2dos /crrae/u2dtmpN2Odxf)     May  4 18:15:10 srvovs incrond[20859]: (root) CMD (/usr/bin/unix2dos /crrae/u2dtmpN2Odxf)      multiple times, the `incron.conf` has not been modified. Any ideas?


Where does bash store the time commands were executed?

Enabling `history` to display time via `export HISTTIMEFORMAT='%F %T '` shows the times of the commands but `.bash_history` doesn't contain any times. Where does `bash` store the times the commands were executed? Are they always stored automatically?


rename hundreds of file by removing last few characters

I have hundreds of file andI want to remove last 7 characters from the filename but keeping its extension. Old name:               abc_xyz12_4567.txt          abcde_xyz12_4567.txt      New name:               abc_xyz.txt          abcde_xyz.txt


AWK: Nested Conditional Subset of Rows without Headers

I have a pretty specific question, and have been able to find lots on conditional subsetting using awk but none that lends enough explicit code for me to generalize to my situation. I have a file 'keys' and a file 'features' both **without headers**. The 'keys' table contains two variables, KEY and GROUP (1st and second columns, respectively), toy example below.                   1          GROUP0         2          GROUP0         3          GROUP1         4          GROUP1         5          GROUP2         6          GROUP2        The file 'features' contains a list of features of widgets like so (ID, FEATURE, VALUE 1st, 2nd and 3rd columns, respectively).                   A           num_user     10         A           KEY          4         B           num_user     2         B           KEY          2         B           battery      Large         C           num_user     10         C           KEY          15         D           num_user     2         D           KEY          2         D           battery      Small         E           num_user     2         E           KEY          7         E           battery      Small      I am trying to select all rows for an ID which has a value of 'KEY' that is in the 'KEY' column of 'keys' for a hardcoded list of 'GROUP' values. The desired result is                   A           num_user     10         A           KEY          4         B           num_user     2         B           KEY          2         B           battery      Large         D           num_user     2         D           KEY          2         D           battery      Small      Any ideas?


How to turn verbose mode on and off using a case statement in UNIX

I'm trying to create a shell script file that uses getopts. The purpose of the program is to remove files that are in the project and place them in the deleted directory aka recycling bin. I have already been able to successfully complete this. I have also been able to use the getopt command -i (interactive) to pass into a case statement and then trigger off a question for the user asking if they are sure they would like to remove a file. This has been done by creating a variable "ision" and setting it to true when the case statement is activated. I have inserted my code down below. I've tried it out a couple of times and everything seems to be fine but I would like to add the verbose activity/mode. Is there anyone who could help me out?               #!/bin/bash          while getopts ":i:v" option ;     do     case "$option" in     i) echo "interactive mode set"     ision=true;     break;;     v) echo "verbose mode"     vison=true;     break;;     esac     done     echo "this is the proof we need"          echo $@          shift $(($OPTIND-2))          echo $@          echo "this is working too"          if [ ! -e ~/deleted ]     then     mkdir ~/deleted     fi          echo "the echo file was made or just created"          if [ $# -eq 0 ]     then     echo "safe_rm missing operand"     exit     fi          echo "all workking on the western front"          for i in $@     do          if [ "$ision" == "true" ]     then     echo "do you want to remobve the file"     echo "variable test $i"     echo "yes or no"     read -p "Enter " answer     if [ "$answer" == "no" ]     then     continue;     fi     fi          if [ ! -f $i ]     then     echo "no such file or directory"     exit     fi             if [ $i == safe_rm ]             then                  echo "cant remove safe_rm"             continue             fi                  if [ $i == safe_rm_restore ]             then             continue             echo "cant remove safe_rm_restore"                  fi          inode=$(ls -i $i | cut -c -6 )     echo "the inode is $inode "     pathname=$(dirname $i)     if [ $pathname == "." ]     then     pathname=$(pwd)     echo $pathname     fi     basename=$(basename $i)     path=$basename"_"$inode":"$pathname"/"$basename          echo $path          if [ ! -f .restoreinfo ]     then     touch .restoreinfo     fi               echo $path >> .restoreinfo     mv $i ~/deleted/          done


vmlinuz file for Ubuntu

How do I look for the `vmlinuz` file for Ubuntu from SUSE. I try: `mount /dev/sda5 /mnt` then `cd /boot`, but I don't see the `vmlinuz` file for Ubuntu. Where is it? The `/boot` directory is empty.


RS232 chat. Simplest way?

I'm working in a project in which I will have to deal with serial communications. For testing, I want make to 2 computers speak to each other (with my interaction) via RS232. Will the next thing work? in computer A:               # cat /dev/ttyS0      in computer B:               # echo <something> >> /dev/ttyS0      Will computer A, receive data from B, or not? If I'm wrong, what would be the easiest way to send something to the other computer? Ideas are welcome!


Help with PKGBUILD

As I would expect, there are a lot of Arch Linux users in here, and I think one of you can help me before upload my first PKGBUILD. The package I want to build is from a git repo. I've read the wiki guidelines but the CVS page is not very complete... When I makepkg, the procces seem to go straight, but in some point, it gets stuck. I don't know how to proceed. Could you help me?               # Maintainer: Tomas Sironi <sironitomas at gmail dot com>          pkgname=mutter-meego-git     pkgver=20101015     pkgrel=1     pkgdesc=""     arch=('i686' 'x86_64')     url="http://http://git.gitorious.org/meego-netbook-ux/mutter-meego/"     license=('GPL')     groups=()     depends=()     makedepends=('git')     optdepends=()     provides=('mutter-meego')     conflicts=('mutter-meego')          _gitroot="git://gitorious.org/meego-netbook-ux/mutter-meego.git"     _gitname="mutter-meego-git"          replaces=()     backup=()     options=()     install=     #~ source=($pkgname-$pkgver.tar.gz)     noextract=()     md5sums=() #generate with 'makepkg -g'          build() {         export INCLUDE="/usr/include"              msg "Connecting to the GIT server..."         if [ -d ${_gitname}/.git ]; then             cd ${_gitname}             git pull         else             git clone ${_gitroot} ${_gitname}             cd ${_gitname}         fi              ./configure.ac -prefix /usr \                     -libdir /usr/lib         make || return 1         make INSTALL_ROOT=$pkgdir install || return 1     }          package() {       cd $srcdir/$pkgname-$pkgver       make DESTDIR=$pkgdir install     }


File protection in Unix

Is there a way to protect a file in such a way that even `root` cannot delete it or rewrite it after creating it? I have a file which is created by `root` under `/var/log/` and I want to restrict all users (including `root`) so that they can just read this particular file after it has been created.


Error when I try to init gentoo, Loading init ramdisk

I installed the gento acoording to the hanbook, but when I reboot my system I've a mistake, Just I can see the following               Loading init ramdisk...      and no more. I believe that my trouble is in the setup of my `/etc/fstab`, because I diden't one partition to /home , /boot I put all in the same partition, then I try to setup my `/etc/fstab` like:               /dev/sda6       /           ext4        noatime     0 1     /dev/SWAP       none        swap        sw          0 0     /dev/cdrom      /mnt/cdrom  auto        noauto,ro   0 0     /dev/sda5       /mnt/disco5 auto        noatime     0 0      **Update:** This is the setup of my grub2, `/boot/grub/grub.cfg`               menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-72d88d2d-9090-4aee-b18d-a02e09514a4d' {         load_video         set gfxpayload=keep         insmod gzio         insmod part_msdos         insmod ext2         set root='hd0,msdos6'         if [ x$feature_platform_search_hint = xy ]; then           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6  72d88d2d-9090-4aee-b18d-a02e09514a4d         else           search --no-floppy --fs-uuid --set=root 72d88d2d-9090-4aee-b18d-a02e09514a4d         fi         echo    'Loading Linux 3.14.14-gentoo ...'         linux   /boot/vmlinuz-3.14.14-gentoo root=UUID=72d88d2d-9090-4aee-b18d-a02e09514a4d ro           echo    'Loading initial ramdisk ...'         initrd  /boot/initramfs-genkernel-x86_64-3.14.14-gentoo     }     submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-72d88d2d-9090-4aee-b18d-a02e09514a4d' {         menuentry 'Gentoo GNU/Linux, with Linux 3.14.14-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.14.14-gentoo-advanced-72d88d2d-9090-4aee-b18d-a02e09514a4d' {             load_video             set gfxpayload=keep             insmod gzio             insmod part_msdos             insmod ext2             set root='hd0,msdos6'             if [ x$feature_platform_search_hint = xy ]; then               search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6  72d88d2d-9090-4aee-b18d-a02e09514a4d             else               search --no-floppy --fs-uuid --set=root 72d88d2d-9090-4aee-b18d-a02e09514a4d             fi             echo    'Loading Linux 3.14.14-gentoo ...'             linux   /boot/vmlinuz-3.14.14-gentoo root=UUID=72d88d2d-9090-4aee-b18d-a02e09514a4d ro               echo    'Loading initial ramdisk ...'             initrd  /boot/initramfs-genkernel-x86_64-3.14.14-gentoo         }         menuentry 'Gentoo GNU/Linux, with Linux 3.14.14-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.14.14-gentoo-recovery-72d88d2d-9090-4aee-b18d-a02e09514a4d' {             load_video             set gfxpayload=keep             insmod gzio             insmod part_msdos             insmod ext2             set root='hd0,msdos6'             if [ x$feature_platform_search_hint = xy ]; then               search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6  72d88d2d-9090-4aee-b18d-a02e09514a4d             else               search --no-floppy --fs-uuid --set=root 72d88d2d-9090-4aee-b18d-a02e09514a4d             fi             echo    'Loading Linux 3.14.14-gentoo ...'             linux   /boot/vmlinuz-3.14.14-gentoo root=UUID=72d88d2d-9090-4aee-b18d-a02e09514a4d ro single              echo    'Loading initial ramdisk ...'             initrd  /boot/initramfs-genkernel-x86_64-3.14.14-gentoo         }     }      So someone could tell me how to fix the problem to load the system and if my setup fstab is good?


bash: colorize second column of output

let's say, I have following output from ls:               $ ls -lAhF /bin     -rwxr-xr-x 1 root root 905K Apr 10  2010 bash*     -rwxr-xr-x 3 root root  31K Dec 26  2011 bunzip2*     -rwxr-xr-x 1 root root 505K Nov 15  2010 busybox*     -rwxr-xr-x 3 root root  31K Dec 26  2011 bzcat*     lrwxrwxrwx 1 root root    6 Jun 24  2012 bzcmp -> bzdiff*     ...      I am looking for a way, how I could colorize the second column. I know how to use sed to colorize any pattern, but I don't know how to colorize specific column. Basically, I need to insert `'\033[0;31m'` after the first space and `'\033[0m'` infront of the the second space. Or perhaps there is much more elegant way ?


Dual boot Windows 7 and Arch Linux

I have a Vaio notebook with Windows 7 64 bit. I want to dual boot it with Arch Linux. I have three primary partitions: Recovery, System reserved (Active and Boot) and the Windows `C:` drive. I have resized the large partition with the the Windows `C:` drive. Now I have an empty space where I could create the Linux partition, but I am lost as concerns the boot loader. According to Arch documentation, using Windows 7/8 boot loader restricts me to a Fat32 Linux partition, really a no go. So I can use GRUB or SysLinux. As for Syslinux, I have read that using `chain.c32` can prevent Windows 7 hibernation. As for GRUB, the new version is very complex, do I really need it for such a simple task? Secondly, Arch Docs say that a post-MBR gap of about 1 to 2 MiB is recommended to provide sufficient room for embedding GRUB's `core.img`. How do I check if I have it and what to do if I don't have it? Before choosing and studying any strategy I'd like to hear from your expert advice.


Jailkit not working properly when connecting remotely from iPad via SFTP app

I used jailkit to add users and restrict them to a jail directory. It works for Linux and PC clients connecting to the ssh server but when I connect with iPad it gives them access to everything. I am using my iPad to connect to the SSH server on my linux PC using an SFTP app. I'm logging in with a username. When I log in using the username from a PC it works, restricting me to the jail root folder. But from my iPad it lets me access the entire file system. I used this tutorial: http://syiron.wordpress.com/2011/06/25/simple-jailkit-howto/


How to bind v4l2 USB cameras to the same device names even after reboot?

I have 3 USB cameras on single PC, one camera will be unused and can be ignored. I need to force two identical cameras to be mapped to constant device names (like `/dev/video1` and `/dev/video2` ). The cameras should not change their order (say camera 1 mounted as `video1` and camera 2 as `video2` after disconnect they should be in same order not camera1 --> `/dev/video2`, camera2 --> `/dev/video1`. How to make this setup work? I will feed camera output to _Gstreamer_. Cameras are using _v4l2_ and _uvc_ driver interface. Linux distro in question is _Archlinux_ , cameras - some Logitech webcams.


Alsaequal volume gain, Pre-Amp like

I use alsaequal for equalize my audio, hitherto ok, but all know that after equalizer the volume is low, some equalizers have a control called "Pre-AMP" that solve this problem, but in Alsaequal haven't this control. I've tried using ALSA's softvol plugin but this plugin cause distortion, that isn't acceptable for me! So, someone have a solution for me ?


Change default file manager in Arch Linux with E17 to Dolphin

I am using Arch Linux with E17 as my DE. However, I am not happy with the file manager that E17 comes with, so I researched a bit and decided to go with the Dolphin file manager (the one KDE comes with). So I need the following info from the experts:   * What's the best place to get it from? Official packages? AUR? If yes, which, if no, where and how?   * And, of course, how to make it the default file manager so that it gets launched instead of E17's file manager.


Encrypting loopback images without using a loopback device

I'm trying to design a firmware update system for an embedded Linux system. My plan is to send an image that can be mounted on the target system, so I don't need to unpack the entire file. I also want to encrypt the image, and optionally compress it as well. Since the build system for creating this image is going to be deployed on several computers I also want the build system to require minimal amount of setup, i.e., avoid avoid requiring root privileges. I've created a working model where I mount an image file using `losetup` as such:               dd if=/dev/zero of=image_file bs=1M count=10     losetup -e aes loop0 image_file     mkfs.ext2 /dev/loop0     losetup -d loop0     mount -t ext2 -o loop,encryption=aes image_file some_working_folder/     # Add files to some_working_folder     umount some_working_folder     # Send encrypted image to the target system      Now, since this is a bit cumbersome to set up on some machines, and I want to avoid creating fixed sized images. So I want to replace the `losetup` commands with something else. I found the command `virt-make-fs`, which can create a mountable image with the `ext2` filesystem. So now I only need to encrypt the image file in a way that is decryptable by the linux kernel. I've tried to use OpenSSL, but I haven't been able to find the correct algorithm, or maybe I'm missing something. Does anybody know how to do this? Basically I want something like the script below.               tar -cf archive.tar some files     virt-make-fs archive.tar image.ext2     # the below command need to be fixed/replaced     openssl enc -aes192 -in image.ext2 -out image.ext2.aes      On the target system I want be able to use the following command, or at least something similar.               # The next command should be done on the target     mount -t ext2 -o loop,encryption=aes image.ext2.aes /mnt/upgrade     # work with files in /mnt/upgrade      So, just to clarify: How can I create an encrypted mountable image file without being root? Feel free to comment if I'm trying to reinvent the wheel, or if there is some other well established solution for this problem. Even though there are better solutions, I'm still interested in the command to solve the encryption problem. * * * Edit: As been pointed out cryptoloop is unsecure, see http://lwn.net/Articles/67216/. So I will probably look around for another solution as well. I've found to util `aespipe`, which I might be able to use. * * * Edit 2: I've dug into the source code in the AES module of the Linux kernel, and I've concluded that it is probably the hashing of the password that is causing the problem. Both `aespipe` and the AES module are using an AES-256-CBC encryption. As far as I can see the linux kernel uses the given password as key, and `aespipe` hashes the incoming password. Since the "no root" part is very important to me I've started looking for other solutions, and my current plan is to use something like the following on the development computer:               tar -cf - file0 file1 ... | gzip -c | aespipe -e aes256 > arhive_file      And then on the target system run               rm -rf /tmp/update ; mkdir -p /tmp/update     aespipe -d -e aes256 < archive.mbl | gzip -cd | tar -C /tmp/update -xf -


How to install Java Runtime Environment 7 update 5 for x64 arquitecture on Debian OS?

**The History:** Hey guys I want to install JRE7u5 and not OpenJRE7u5 because, while doing a research on the web I discovery that Minecraft runs better on JRE, than with OpenJRE. **The Failure:** But the here (instructions for Linux x64) and here (instructions for Linux x64 RPM) are not helpful, I already tried to download both and I used `alien` and `rpm` to try install the RPM package, but everything goes wrong. **The question:** Knowing that I would like to request a tutorial teaching me how to install JRE7u5 (Java Runtime Environment 7 update 5) for x64 architecture, and just for inclusion, I'm using Debian 6.


What does .??* mean in a shell command?

The following command will `tar` all "dot" files and folders:               tar -zcvf dotfiles.tar.gz .??*      I am familiar with regular expressions, but I don't understand how to interpret `.??*`. I executed `ls .??*` and `tree .??*` and looked at the files which were listed. Why does this regular expression include all files within folders starting with `.` for example?


How to allow a particular user to access the FTP?

Anonymous / FTP users are allowed to access the FTP. Suppose if there is a user named as JOE then how can I allow him to access the FTP?


How to log all my DNS queries?

How can I create logs of every DNS query that my computer makes along with the responses it gets?


How to list all styles in zsh

How an I list all of the styles defined in a zsh session using the `zstyle` command? I would like to know this so I know what configuration options are available to me.


If I SSH into a remote machine and my connection gets dropped, then is there a chance that the run I made will continue on?

Or will the run halt along with everything (though maybe partial progress could be made if I use a ">" to print progress so far to a file)


Testing if a process is running via if and -z

I'm have a process on my system which is notorious for crashing, and is kind of mission critical, my network manager. In any case, I need to write a loop which tests if it's running and starts it if it isn't. This is what I've come up with thus far:               #!/bin/bash          while [ true ]; do          if [ -z $(ps aux | grep "[n]m-applet") ]; then             echo "Bugger died, resurrecting..."             nm-applet >/dev/null 2>/dev/null &             disown $!         fi              sleep 3     done       Unfortunately, this isn't quite doing the trick, as it seems to be starting the process even when not necessary, and after the first run, I get the following error output:               line 4: [: too many arguments      What am I doing wrong here?


downloading files using wget

I am trying to download an http link from here. The URL is http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file When I use               wget http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file       I get only `index.html?acc=GSE48191` which is some kind of binary format. How can I download the files under this http link?


Motion command images are jibberish

It seems my motion command config will not take complete pictures. It used to take a few tiny ok images, and a garbled image, now after adjusting it to full resolution it takes a large image of garbled blocks: ![garbled image](http://i.stack.imgur.com/7Qg36.jpg) It used to give a message about the wrong pallette type in its log, but I adjusted that to 15 (YUYV) and it doesn't complain about that:               ------------------------     cap.driver: "uvcvideo"     cap.card: "UVC Camera (046d:0825)"     cap.bus_info: "usb-ehci-platform-1.1"     cap.capabilities=0x04000001     ------------------------     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_get_capability: - VIDEO_CAPTURE     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_get_capability: - STREAMING     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_select_input: name = "Camera 1", type 0x00000002, status 00000000     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_select_input: - CAMERA     [1] [WRN] [VID] [Sep 11 22:24:03] v4l2_select_input: Device doesn't support VIDIOC_G_STD     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_do_set_pix_format: Testing palette YUYV (1280x720)     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_do_set_pix_format: Using palette YUYV (1280x720) bytesperlines 2560 sizeimage 1843200 colorspace 00000008     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls: found control 0x00980900, "Brightness", range 0,255      [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls:   "Brightness", default 128, current 128     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls: found control 0x00980901, "Contrast", range 0,255      [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls:   "Contrast", default 32, current 32     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls: found control 0x00980902, "Saturation", range 0,255      [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls:   "Saturation", default 32, current 32     [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls: found control 0x00980913, "Gain", range 0,255      [1] [NTC] [VID] [Sep 11 22:24:03] v4l2_scan_controls:   "Gain", default 64, current 64     [1] [NTC] [VID] [Sep 11 22:24:03] vid_v4lx_start: Using V4L2     [1] [NTC] [ALL] [Sep 11 22:24:03] image_ring_resize: Resizing pre_capture buffer to 1 items     [1] [NTC] [EVT] [Sep 11 22:24:32] event_new_video FPS 2     [1] [NTC] [ALL] [Sep 11 22:24:32] motion_detected: Motion detected - starting event 1     [1] [NTC] [EVT] [Sep 11 22:24:33] event_newfile: File of type 1 saved to: /mnt/sd/arduino/www/motion/01-20140911222431-01.jpg      Looking up that error, it seems there are two types of standards, VIDIOC_G_STD or VIDIOC_S_STD. Is there a way to switch it though?


To list out duplicate filenames in a listing?

bash-3.00$ cat f.txt     -rw-r--r--   1 mukesh   other        102 Nov  5 18:32 f1.txt     -rw-r--r--   1 mukesh   other         19 Nov  5 18:32 f2.txt     -rw-r--r--   1 mukesh   other        204 Nov  5 18:32 f3.txt //DUPLICATE     -rw-r--r--   1 mukesh   other        204 Nov  6 18:32 f3.txt  //DUPLICATE     -rw-r--r--   1 mukesh   other        204 Nov  6 18:32 f100.txt      Lets say i have the above file-names listed in a file called f.txt. I want to list out all the file-names which have a duplicate( **only file-name** ), display the duplicate file name and number of duplicates. Eg : In the above list f3.txt has a duplicate and there are a total of 2 f3.txt filenames found.


How do I remove all sub-directories from within a directory?

This question is kind of a phase II to the first question I posted at here I have a directory that contains a bunch of sub-directories, .zip files, and other random files not contained within a sub-directory. I'd like a command line script to remove all sub-directories from within the parent directory, but keep all zip files and loose files that don't belong to any sub-directories. All of the sub-directories have content, so I believe I'd need to force their deletion with the -f command. So basically, a command that looks inside the parent directory (or the current directory), deletes all folders from within it, but keeps all other content and files that are not a folder or contained within a folder. I understand that deleting items from the command line requires special care, but I have already taken all necessary precautions to back up remotely.


How to get "apt-get -y upgrade" within a PHP script to function as expected?

Yes, I'm aware of unattended-upgrade, but I don't like that package's limitations. I've got a PHP script that makes the following calls:               ...     system("/usr/bin/apt-get update");     system("/usr/bin/apt-get -y upgrade 2>&1 > /tmp/apt_get.txt");     system("/usr/bin/apt-get autoremove");     system("/usr/bin/apt-get autoclean");     ...      The script is set up via cron to run automatically on a schedule. It appears to execute all of the commands correctly as root. However, 'apt-get -y upgrade' doesn't actually perform the upgrade as evidenced here in the output of /tmp/apt_get.txt:               Reading package lists...     Building dependency tree...     Reading state information...     The following packages will be upgraded:       iproute     1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     Need to get 444 kB of archives.     After this operation, 1,024 B of additional disk space will be used.     Get:1 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main iproute amd64 20111117-1ubuntu2.3 [444 kB] Fetched 444 kB in 1s (374 kB/s)      Manually running 'apt-get upgrade' shows that the package was downloaded but not installed:               Reading package lists... Done     Building dependency tree     Reading state information... Done     The following packages will be upgraded:       iproute     1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.     Need to get 0 B/444 kB of archives.     After this operation, 1,024 B of additional disk space will be used.     Do you want to continue [Y/n]? n     Abort.      So apt-get successfully downloads the package but doesn't actually perform the upgrade. What do I need to change to get this script to work as expected? It almost seems like a bug in "apt-get -y upgrade" itself. (Running Ubuntu 12.04.4 LTS here.)


What should every expert know?

What things should any self-professed UNIX expert have under their belt? I'm looking to fill any gaps in my knowledge. Some things I can think of off the bat:   * Shell (interactive and scripting)   * Common utilities (grep, ls, etc.)   * vi (possibly Emacs too)   * Some mix of sed / awk / Perl (preferably all)   * Knowledge of networking standards   * Ability to set up common programs: A mail server, file server and so on Probably forgetting a lot, obvious and not-so-obvious. What else?


How do I skip special buffers when killing the current buffer?

I have some code in my `.emacs` that prevents it from showing some pre-defined special buffers when I'm using `previous-buffer` and `next-buffer`:               (defadvice next-buffer (after avoid-messages-buffer-in-next-buffer)       (when (string= "*Messages*" (buffer-name)) (next-buffer))       (when (string= "*Completions*" (buffer-name)) (next-buffer))       (when (string-match "\*tramp.*\*" (buffer-name)) (previous-buffer))        ... and so on)      This works great, but I'd like to have the same functionality for `C-x` `k`. So far, I've tried writing the same kind of function `(defadvice (after kill- buffer) ...)`, but that doesn't seem to work. How do I go about doing this?


Why the inconsistency with using cat vs. echo piped to this sed command?

Inspired by this question: sed: N command does not read single line I wanted to understand why there appears to be an inconsistency between the following 2 commands: ### #1. echo This command produces no output               $ echo -en 'abc\n' | sed -n 'N;p'     $      A hex dump of the output from `echo`: _od - octal dump_               $ echo -en 'abc\n' | od -tx1     0000000 61 62 63 0a     0000004      _hexdump_               $ echo -en 'abc\n' | hexdump -C     00000000  61 62 63 0a                                       |abc.|     00000004      ### #2. cat If I put the string 'abc\n' in a file such as this:               1: abc     2:      That's a line with the string `abc` on it followed by a linefeed (`\n` aka. `0x0A`). Then pipe it to `sed` as before, I get this:               $ cat abc.txt | sed -n 'N;p'     abc          $      That's output that includes the string `abc` followed by 2 linefeeds. _od - octal dump_               $ cat abc.txt | od -tx1     0000000 61 62 63 0a 0a     0000005      _hexdump_               $ cat abc.txt | hexdump -C     00000000  61 62 63 0a 0a                                    |abc..|     00000005      I'm a little perplexed as to what's going on? ### UPDATE OK so my issue was with how I was creating the file `abc.txt` as @choroba pointed out. I was creating the file in `vim` and not realizing that it was adding 2 linefeeds. When I enabled visibility of special characters it became a little more obvious:               :set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<,     :set list      Now in `vim` file `abc.txt` looked like this:               abc$     $      If I created the file as @choroba suggested then the file `abc.txt` showed up as expected:               $ cat abc.txt | od -tx1     0000000 61 62 63 0a     0000004      And it behaved identical to the original `echo` example:               $ cat abc.txt | sed -n 'N;p'     $       ### Original issue My original issue with why `sed -n 'N;p'` wasn't displaying anything was answered thanks to @enzotib's answer. The bit from the POSIX standard is what I wasn't picking up on: > If no next line of input is available, the N command verb shall branch to > the end of the script and quit without starting a new cycle or copying the > pattern space to standard output


How to autostart a background program by a non-root user?

As a non-root user, I want to run a background job when the system boots. It's sort of a service which doesn't require root privilege. Is there a way to do it? One way is to put `sudo -u user command` in `rc.local`, but editing `rc.local` requires root privilege. Another way is to launch it from `cron` every minute and check for any running instance, but firstly it wakes up the system unnecessarily and secondly, there can be race condition in checking running instances. A third way is to run it in `~/.bash_profile`, but I want to start it without user login.


Under Mint 12 on an HP Pavillion DV7, my wireless stopped working

My wireless worked when I first installed. I needed to turn it off for a while, so I clicked "off" in the pulldown dialog. I used the wired network for awhile, but when I went to turn my wireless back on, it started connecting for half a second then dropping the connection. I can use the wired interface but my office doesnt have a wire so I have to go out into a common room to work. Very irritating. Can anyone help me? Note that this isn't the same problem as this, as he never had wireless afaict. Maybe it is and I don't understand something. UPDATE: The device is a Atheros AR5B91, and dmesg is reporting the following:               [  314.769728] wlan0: authenticate with 00:22:3f:80:10:fc     [  314.787528] wlan0: send auth to 00:22:3f:80:10:fc (try 1/3)     [  314.789526] wlan0: authenticated     [  314.804098] wlan0: associate with 00:22:3f:80:10:fc (try 1/3)     [  314.806466] wlan0: RX AssocResp from 00:22:3f:80:10:fc (capab=0x421 status=0 aid=3)     [  314.806470] wlan0: associated     [  316.024238] wlan0: deauthenticating from 00:22:3f:80:10:fc by local choice (reason=3)


How can I test the RAM for data corruption on an ARM-based system?

I have an embedded device. It is ARM based, with Linux 2.6.31 and has 256 MB RAM. I wanted to get some ideas/tips on what is the most effective way to test the device RAM for data corruptions. Is there a test/software that someone can suggest? Note: I have memtester now. I got it after suggestion from Ulrich Dangel (below). I also have `mtest` set up from the uboot now. Any other tests / approaches I could use?


Need to delete a directory with name '~' created accidentally

I don't remember exactly how this directory got created. It's name is `~`, the alternative we all use for `home diretory`. I also see a sticky bit attached with this directory. How shall I delete it? I fear running a normal rmdir would delete all the files from the home directory recursively. Here are the details :               mtk4@laptop:~/temp$ ls -l     total 4     drwxrwxr-t 2 mtk4 mtk4 4096 Oct 17 2011 ~      How shall I proceed? Another question : What does the `total` number specify on the first line of output of `ls -l` ? '4' in this case. There is just 1 directory as shown(other than `.` and `..`). I am using ubuntu 12.04. Also asked same question on askubuntu, as it seems to be relavant on both sites.


Please help diagnose very slow Remmina session for VirtualBox VM

I'm using Remmina 0.9.99.1 with CrunchBang VMs on a remote server (VirtualBox 4.3.4 on Debian 7.2.0 x64). I'm using RDP with TLS security, and connect through a UDP-mode VPN. With freshly-installed CrunchBang VMs, Remmina sessions are unusable, with high latency and retransmission artifacts. The VPN becomes saturated, and ping increases from 200-300 ms to 2-4 seconds. However, Remmina sessions become usable after setting "xset r off" in OpenBox autostart to disable keyboard repeat. What might be causing this? In addressing questions about similar problems, some have recommended the disabling of receive window auto-tuning. But I see nothing relevant in documentation for either VirtualBox or Remmina. Given that I'm using a UDP- mode OpenVPN connection, I don't believe that this is a classic TCP-via-TCP retransmission storm.


New to using serial console and trying to log into embedded system

I have two PC Engines Alix 2d2 which I've been given and I'm trying to install an (BSD or Linux based) OS on. Currently one has a version of openWRT (the other had openWRT until I formatted the CF card and put on a version of FreeDOS (I don't know if this works because no console)). Both boards were in working order before I began, allbeit working as openWRT systems. I did not test either of their serial ports before I started (although i have changed nothing about the second system so...) In addition to the alix boards I have:   1. a Windows desktop without a built in serial port   2. a USB to serial adapter which I have been using with the Windows desktop   3. a Linux box which has a serial port on the motherboard   4. one serial cable (Startech branded, described as straight through) I have connected each alix board to both computers 1 at a time trying to get, well, anything to come though the serial connection. I've read several articles and how-tos on the internet about the alix boards noting that the speeds mentioned either seem to be 9600 or 38400 so I've tried both. On Windows I was using PuTTY's serial mode to connect (I double checked which com port I was using) and on Linux I was using minicom with the `-D 9600/38400 -p /dev/ttyS0` (I also have ttyS1-3 but minicom would not connect to them). So far I've had nothing from the boards, the how-tos describe a brief memory check when they boot, but I've not seen a single character. Never having used a console over serial before I'm at a loss as to what I should try next so any suggestions (or reading material) would be very welcome.


Linux mint update error

I just got some updates for my **linux mint** and when I try to install them a message like this appears:               Failed to fetch cdrom://Linux Mint 16 _petra_ - Release amd64 20131126/dists/saucy/contrib/binary-amd64/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs     Failed to fetch cdrom://Linux Mint 16 _petra_ - Release amd64 20131126/dists/saucy/main/binary-amd64/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs     Failed to fetch cdrom://Linux Mint 16 _petra_ - Release amd64 20131126/dists/saucy/non-free/binary-amd64/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs     Failed to fetch cdrom://Linux Mint 16 _petra_ - Release amd64 20131126/dists/saucy/contrib/binary-i386/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs     Failed to fetch cdrom://Linux Mint 16 _petra_ - Release amd64 20131126/dists/saucy/main/binary-i386/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs     Failed to fetch cdrom://Linux Mint 16 _petra_ - Release amd64 20131126/dists/saucy/non-free/binary-i386/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs     Some index files failed to download. They have been ignored, or old ones used instead.      Can somebody help me?


How can I check how much space I am allowed to use on a linux server?

I have some giant files I'd like to back up by putting them on a server I am allowed to use for such things. However, I am uncertain about how much space I am allowed to use. Is there any way of checking this after I have sshed to said server?


Why does LUKS need to generate hash values?

If you create a new LUKS device, you can specify the option `-hash` and `-iter-time`. For example like this:                sudo cryptsetup luksFormat --cipher aes-cbc-essiv:sha256 --key-size 256 --iter-time 2100 --hash sha512 /dev/loop0      From the manpage of cryptsetup: > --hash, -h > > For create action specifies hash to use for password hashing. > > For luksFormat action specifies hash used in LUKS key setup scheme and > volume key digest. Because of the first sentence I naively assumed that the hash is used in a similar way as in a standard linux system, where a hash value is created by a specified algorithm (for example `sha512`). To make it harder for an attacker which has the hash and wants to try a dictionary attack, the has is salted and the algorithm is iterated n-times to make computation time longer. In this case the has value is stored in `/etc/shadow`. If a user logs in, the hash is computed and compared to the value in the `/etc/shadows` file. If they are equal, the user is accepted to login. In a similar way an attacker which owns the file `/etc/shadow` (from where he also knows the salt value) can compute hashes from words in a dictionary and compare it to the value in the `/etc/shadow` file until some string matches. If the hash in LUKS were used in a similar way, I assumed it must be stored somewhere (for example in the partition header) and if the attacker had access to the partition header (or the file where it is stored) for some reasons, he could proceed in a similar way as above to find out the password. This lead me to the question about how to get the hash: How can I extract the hash value of a LUKS device? Thinking about how the LUKS system may work, I guess that it is not used in this way. Instead I think, that the password is just used to encrypt the key (and no hash is stored anywhere), which is stored encrypted in the header. But in the LUKS man-page I didn't find any hint, which encryption algorithm is used for key encryption and how to change it. (The options `\--cipher aes-cbc- essiv:sha256 --key-size 256` refer to the actual algorithm which is used to encrypt the partition but not the key). This indicates for me that this understanding my be also incorrect. So, how does this all really works and what is the role of the hash described above? Would be great if someone could clarify my misconceptions above (perhaps with some references).


How to keep ftp connection alive

Some ftp websites have a small time out value. When you do some other jobs, ftp connection dies and you should log in again. How can I keep my connection alive? **Edit:** It will be appreciated if somebody provide a method for `ftp` command as it is light and easy.


what is a Kernel?

I'm learning Unix from the Unix Architecture book by Maurice J Bach. So if my question seems too stupid, please do bear with it. I read a few related questions but I would like a more simple explanation, with an example. My confusion is with the concept of kernel. What is a kernel? I understand it's the operating system and it is a process. But when my teacher teaches he says a system call(), results in a process going from user mode to kernel mode. What actually happens in a system call? Does the user process go to sleep and the operating system execute it on behalf of user process and returns the value to the user process or does the user process execute in kernel mode? If the latter is correct, what does it mean?


udev does not see drm subsystem changes on laptop resume

I am using udev to manage setting up monitors on my ThinkPad T400. I use a docking station, and the desired behavior is that when I dock the laptop, the LVDS output is turned off, and the DVI-0 output is enabled. Likewise, when I remove the laptop from the dock, DVI-0 is turned off and LVDS is turned back on. This all works fine, _as long as the laptop is not suspended_. However, the way I normally work is to use the laptop during my commute, suspend it, dock it and _then_ switch it on. If I do things in this order, udev never observes changes to the drm subsystem. Which is weird, because a call to `xrandr` does indeed show that DVI-0 now exists. Does anyone have any ideas on why this might be occuring, and what I can to debug/solve this problem?


Efficiently remove file(s) from large .tgz

Assume i have an gzip compressed tar-ball compressedArchive.tgz (+100 files, totaling +5gb). What would be the fastest way to remove all entries matching a given filename pattern for example prefix*.jpg and then store the remains in a gzip:ed tar- ball again? Replacing the old archive or creating a new one is not important, whichever is fastest.


What is the difference between Halt and Shutdown commands?

What is the difference between the `halt` and `shutdown` commands?


photorec couldn't recover last saved file

Yesterday I deleted by mistake the content of current directory which had many c programs. Later I successfully recovered all the files **(using command photorec)** with one issue. The issue is: for 1 file I saw that the last saved matter wasn't recovered. I explain what I mean: I wrote a file, saved then edited again saved and edited.... For that file I see that many files are present in the recovered files. In 1 recovered file 5 lines of code (for that file) is present and in other 30 lines. But the matter that was present in the file when I last saved it couldn't be recovered. So what I mean is that intermediate matters are recovered of that file but the last saved one wasn't present in the recovered files. Does one has any idea why so!! Because it seems if previous matters are recovered then last saved should obviously be present in the recovered files. This Q is a result of this post.


Arg list too long error while using find

I have the `find` command as follows:               find /jobs/logs/* -prune -name '*.log' -type f -mtime +1 |         while read LOGFILE         do             echo $LOGFILE         done      This is failing due to the following error:               /usr/bin/find: arg list too long      Can anyone suggest a way to fix this? (This is a continuation of my previous question.)


Changing HFSPlus UUID from PartedMagic

I needed to make a clone of my hard drive recently (bad blocks FTW). I was using Clonezilla at the time. However, Clonezilla refused to copy the HFS+ partition, so I did it manually. The problem is that the UUIDs are out of sync. What is the command to set a specific UUID for HFS+?


Linux stack for a home network firewall/proxy?

I've got a generic home 'network' where my ISP supplied modem acts as router with a software firewall built-in. My PCs connect directly to this router to access the Internet. I want to place a box in between my home computers and the broadband modem. This would act as proxy passing all traffic back and forth, together with a firewall and intrusion detection system/packet sniffer.   * Is there a prebuilt Linux flavour that would do this out of the box so to speak?    * What software on top of the OS is required?    * Would installing a software packet sniffer here be a big performance hit? Would the proxy be a big performance hit? E.g. with multiple boxes active simultaneously, would the proxy need to be multi-core?    * Can I just use any average desktop PC for hardware just so long as there's two network adapters or are there any specific specs for this task?    * Also what is a known working linux/wireless card combo when the wifi adapter is operating in master mode i.e. a WiFi hotspot?


Can't ssh anywhere

I've tried about 4 hosts, everyone gives me the same result with `ssh -vvv`               OpenSSH_6.0p1, OpenSSL 1.0.1c 10 May 2012     debug1: Reading configuration data ~/.ssh/config     debug1: ~/.ssh/config line 6: Applying options for xmpp     debug1: Reading configuration data /etc/ssh/ssh_config     debug2: ssh_connect: needpriv 0     debug1: Connecting to ... [...] port 22.     debug1: Connection established.      and then it hangs, even to machines in the local network.               ssh -V: OpenSSH_6.0p1, OpenSSL 1.0.1c 10 May 2012      also tried with 5.9, no change. `localhost` fails as well:               OpenSSH_6.0p1, OpenSSL 1.0.1c 10 May 2012     debug1: Reading configuration data ~/.ssh/config     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: Connecting to localhost [::1] port 22.     debug1: Connection established.


USB audio only outputs white noise

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.


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

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.


cut / grep and df -h

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


random number needed

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).


A problem with mknod when logged in as root

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.


'yum update' without internet connectioon

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?


Two EFI disks with Grub2

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?


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

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


Remove prefixes from filenames

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.


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

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.


Mount image user-readable with udisks2

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?


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

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


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

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?


Re-enable route cache

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