Inserting the command line text before output in stdout (for pipe / redirection)

Consider the following `bash` constructs:               ls /usr/include/asm > list-redir.txt     ls /usr/include/asm | tee list-tee.txt      In this case, `list-redir.txt` and `list-tee.txt` will be identical, and will contain the listing of files as expected; e.g.               $ head -5 list-redir.txt     a.out.h     auxvec.h     bitsperlong.h     boot.h     bootparam.h [...]      My question is - how could I write such a command, and have the command line text inserted as the first thing in the standard output - such that the file eventually starts with the command line as first? As an example, the file `list-redir.txt` would in that case look like:               $ head -5 list-redir.txt     # ls /usr/include/asm     a.out.h     auxvec.h     bitsperlong.h     boot.h [...]      ... which also implies that the character # can be prepended to the inserted command line. Is there anything that I could use for this - but with the minimum of change in typing out in respect to the original command lines (`ls /usr/include/asm > list-redir.txt` ...)?


tmux not respecting disabled control flow

In my shell I have flow control disabled using `stty -ixon`. This works perfectly in the shell and when I launch `tmux` and start programs within `tmux`. However, when starting a new session from the command line and directly launching a command, the flow control setting is not respected and `ctrl-s` freezes the terminal. This works:               tmux new-session -s foo     vim      This does not respect the `stty` flow control setting:               tmux new-session -s foo vim      How can I disable flow control even in the latter case?


Clonezilla Grub

I am trying to restore a disk image with clonezilla. However, after I do so, a grub menu pops up showing the 4 standard options(os, recovery, memtest...). My original image did not have this and I need to skip this so the system auto boots into the OS. I noticed clonezilla switches to using Grub 2 during the install. Is there any way to force clonezilla to use grub 1 instead of grub 2 when restoring an image?


Remove shadows from Metacity windows

My goal is to remove the dropshadow from all metacity windows. I realize there is not a setting to do this and I may need to recompile metacity. If this is so than I'll need some help on where to start. If I can simply do it by editing source files without compiling, an ideas where I can start on that?


Passing a stream to a bash function

I need to create a `bash` function that I can pass a stream to NOT A FILE. Here is the function:               ff() { cat /etc/group | fgrep -f "$1" ;}      When I run it like so:               ff <( echo some_user )      I get an error saying:               fgrep: /dev/fd/63: No such file or directory      instead of:               some_user:x:0:


What is this seemingly base64 data set by setfattr?

I have written a short shell script that simply wraps `setfattr` in a slightly more convenient form for setting the extended attribute that corresponds to a free-text comment:               #!/bin/sh     test "$2" && setfattr -n user.xdg.comment -v "$2" "$1"     getfattr -d -m '^user.xdg.comment$' "$1"      For storing US ASCII comments as xattrs, this works great. However, if I try to set a comment that contains non US ASCII characters, it gives me back what appears to be Base64 encoded data:               $ touch xyz     $ set-comment xyz åäöåä     # file: xyz     user.xdg.comment=0sw6XDpMO2w6XDpA==     $       But it isn't just Base64:               $ printf "0sw6XDpMO2w6XDpA==" | \base64 --decode     ��:\:L;l:\:@base64: invalid input     $       Most of the time, I get _just_ random-looking garbage back. Some times, like this, the Base64 decoder throws "invalid input" back at me. **What is this string?** What is its relationship to the original input value? How do I go from what `getfattr` gives me back to the original input value (such as `åäöåä` in this case)? `setfattr --version` on my system responds with `setfattr 2.4.46`. I'm running the version packaged by Debian Wheezy. In the unlikely event that it matters, I'm running ZFS On Linux 0.6.3 (saw the same behavior with 0.6.2 as well) on the stock Wheezy kernel.


Open a RPM on a Mac?

I am on a MacBook Pro running Apple Leopard (Mac OS X 10.5.8). I would like to unpackage a RPM and view the files contained within the wget-1.11.4-2.el5_4.1.src.rpm . I don't need to install the files to a particular location or run any %postinstall scripts or anything. I just want to unpackage this RPM so that I can view the source files underneath. Is it possible to unpackage a RPM file on a non-RedHat/CentOS system?


Can I limit a process to a certain amount of time / CPU cycles?

We have a script which runs on our web servers, triggered by customer action, which initiates a unix process to generate some cache files. Because this process acts upon files supplied by our customer, it sometimes misbehaves, running so long that the PHP process which spawns it times out or using so much CPU time that a sysadmin will kill it. Is there any command which I could run which would limit the CPU time / runtime of the process? I am looking for a command like `/usr/bin/time`, where I could run that command and pass it the commandline I want it to run and limit.


Debugging ethernet before NFS boot

I'm trying to boot Linux from U-boot on an embedded ARM board using a filesystem on a remote machine served via NFS. It appears that the ethernet connection is not coming up correctly, which results in a failure to mount the NFS share. However, I know that the ethernet hardware works, because U-boot loads the kernel via TFTP. How can I debug this? I can try tweaking the kernel, but that means recompiling the kernel for every iteration, which is slow. Is there a way that I can make the kernel run without being able to mount an external filesystem?


Does RHEL execute all cronjob files under /etc/cron.d/*?

This is a RedHat Enterprise Linux 5 system (RHEL). We manage this system using Cfengine. We have several cronjobs which are running twice as often as usual. I checked the cronjobs under `/etc/cron.d/` and this directory contains the actual script called `host-backup`, and also contains a cfengine backup file called `host-backup.cfsaved`, as so:               /etc/cron.d/host-backup     /etc/cron.d/host-backup.cfsaved      Does this operating system execute all files at `/etc/cron.d/*`, or does it only execute files which match a certain pattern. Can I configure this, and where is this defined? I cannot find this answer in the RHEL documentation.


How do I recover an ext4 volume overwritten by an LVM logical volume?

I was running an Ubuntu desktop. The OS was installed on a SSD. I had two additional drives formatted ext4 and mounted on /storage (1TB) and /storage- bak (1.5TB). I installed Centos over Ubuntu on the SSD and the install put a 2.3GB Logical volume on my two "storage" drives. I didn't want this. I guess I missed something during the Centos install. Centos used the LV to mount /home on it. I booted once and logged in. Not much was written to it.   Is there any way to remove the LV and get my drives back to the state they were in.... data intact? I just want a /dev/sdb1 and a /dev/sdc1 so I can mount them as generic EXT4 drives.


screen toggle windows doesn't work with custom command key

I've been using GNU Screen for a while now, but I prefer mapping the command key to something other than `C-a`, as I use that to go to the beginning of a line. For a while now, I've been running screen with:               screen -e^Kk      Which sets the command key to `C-k`. Changing the command key is supposed to also change the command to toggle between screen windows (it should always be the command key, twice), i.e. `C-k C-k`. This used to work, but after a recent reboot, it doesn't anymore. Weirdly, if I use `C-j` as my command key, the toggle works fine. It seems to be a problem with the letter `k`. But only the toggle command fails. I can still use:   * `C-k c` \- create window   * `C-k A` \- rename window   * `C-k n` \- switch to next window   * `C-k p` \- switch to previous window   * `C-k '` \- switch to named/numbered window So the only thing that fails for me is:               screen -e^Kk     C-k C-k  // should switch to most-recently displayed other window      I have no idea why this would happen, or what else I can do to troubleshoot it. I'm running ubuntu, and               screen -v     Screen version 4.00.03jw4 (FAU) 2-May-06


LD_LIBRARY_PATH not found - CentOS

I am trying to run the following two commands... > LD_LIBRARY_PATH =/opt/oracle/instantclient_12_1   >  export LD_LIBRARY_PATH But when I run the first command I get an error               -bash: LD_LIBRARY_PATH: command not found      My OS data is below, >   * OS Version = CentOS release 5.9 (Final) >   * Platform Data = 2.6.18-348.18.1.el5 x86_64 x86_64 GNU/Linux > I've tried as a normal user and as sudo, also get the same error when trying to just set LIBRARY_PATH. This works on ubuntu what I am doing wrong?


shared library not found even with ld.so.conf updated

$ sudo ldconfig -v|grep libOpenNI     355: libOpenNI2.so -> libOpenNI2.so      but when I am executing the program I'm getting               ./SimpleRead: error while loading shared libraries: libOpenNI2.so: cannot open shared object file: No such file or directory      Strange?!!


Problem with wifi in Ubuntu

I'm not able to see (or access) my WiFi in Ubuntu.               tharcisyo@tssd:~$ iwlist scan     eth0      Interface doesn't support scanning.     lo        Interface doesn't support scanning.     wlan0     Failed to read scan data : Network is down.


Broadcom Corporation BCM4313 WLAN does not work on installed Arch

I have a Broadcom Corporation BCM4313 WLAN Controller in my netbook. When I boot the Arch live ISO and set up the network with wpa_supplicant everything works fine. On the installed Arch I get the following Error:               wpa_supplicant -i wlp2s0 -D wext -c ../wpa_supplicant/wpa_supplicant.conf -B          brcmsmac bcma0:0: brcms_ops_bss_info_changed: qos enabled: false (implement)     brcmsmac bcma0:0: brcms_ops_config: change power-safe mode: false (implement)     IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready      I can't figure out why it's not working as the brcmscmac driver is part of the kernel and works flawlessly on the live ISO.               Output of lspci:     02:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01)          Output of ip link show:     1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00     2: enp1s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000     link/ether 04:7d:7b:22:72:6d brd ff:ff:ff:ff:ff:ff     3: wlp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DORMANT qlen 1000     link/ether 7c:e9:d3:20:3d:cf brd ff:ff:ff:ff:ff:ff      Trying to setup wlp2s0 gives the same error:               ip link set up wlp2s0          brcmsmac bcma0:0: brcms_ops_bss_info_changed: qos enabled: false (implement)     brcmsmac bcma0:0: brcms_ops_config: change power-safe mode: false (implement)     IPv6: ADDRCONF(NETDEV_UP): wlp2s0: link is not ready      The module should be loaded (brcmsmac for the pci card):               Output of lsmod | grep "brcmscmac\|bcma\|b43":     brcmsmac              485657  0      cordic                   844  1 brcmsmac     brcmutil                3721  1 brcmsmac     b43                   341637  0      mac80211              389700  2 b43,brcmsmac     cfg80211              336964  3 b43,brcmsmac,mac80211     ssb                    48159  1 b43     pcmcia                 40213  2 b43,ssb     bcma                   30352  3 b43,brcmsmac     mmc_core               86479  3 b43,ssb,rtsx_pci_sdmmc      Thanks in advance for all suggestions.


yaourt curl error: SSL connect error

I'm trying to install some packages form `yaourt`. For example :               yaourt compiz      But it gets me following error:               [hamed@localhost ~]$ yaourt compiz     curl error: SSL connect error      Please tell me what's wrong with `yaourt`?


Linux Live CDs that are able to save configuration on the boot disk?

Puppy Linux has a great feature: as in wikipedia is mentioned > However, it is possible to save files upon shutdown. This feature allows the > user to either save the file to disk (USB, HDD etc.) or even write the file > system to the same CD puppy is booted from if "multisession" was used to > create the booted CD (on CD-Rs as well as CD-RW) where a CD burner is > present. I would be interested in getting to know if there are any other livecds that also offer this feature?


Loading different Linux Distribution each time computer starts automatically?

I have two Linux distributions (OpenSuSE, Ubuntu) installed on two different partitions. Each time i start my machine, GRUB loads up allowing me to select one of the two distributions. I don't want the GRUB to show up so I limit timeout to zero in /boot/grub/menu.lst which will most probably make my machine load OpenSuSE each time i start my PC because it's the first option in the menu.lst. Is it possible that the second time i restart my PC, Ubuntu gets loaded automatically? The third time i restart again, OpenSuSE may get booted while fourth time i restart, Ubuntu may load up and so on? In other words how can i make my machine to boot the next OS in menu.lst, the next time it is restarted?


How to install Mono in AIX?

I don't have root access to an AIX 5.2 machine and want to run Mono programs in it.


Pressing tab after sourcing script file prints script related output

I have a script file in a directory. Its contents are as follows :               #!/bin/bash                                                                                function set {              cur=`pwd`              alias m="cd $cur/app/models"         alias v="cd $cur/app/views"         alias t="cd $cur/app/views/templates"         alias c="cd $cur/app/controllers"         alias cl="cd $cur/app/classes"              alias con="cd $cur/config"         alias p="cd $cur/public"     }          function unset {         unalias m v t c cl con p     }          if [ $1 = 's' ]; then         set      elif [ $1 = 'u' ]; then         unset     fi      When I haven't yet sourced this file, there is no problem. However, once I source this file using the command `. script.sh`, whenever I type a command like `cd` or `vim` and then type something and press the `tab` button, this is what I get :               cd abash: unalias: m: not found     bash: unalias: v: not found     bash: unalias: t: not found     bash: unalias: c: not found     bash: unalias: cl: not found     bash: unalias: con: not found     bash: unalias: p: not found     bash: _upvars: -v: missing argument(s)     bash: unalias: m: not found     bash: unalias: v: not found     bash: unalias: t: not found     bash: unalias: c: not found     bash: unalias: cl: not found     bash: unalias: con: not found     bash: unalias: p: not found     bash: _upvars: -v: missing argument(s)      Any idea what happens and how to stop it?


How to verify that my uImage is good?

I had a zImage file and I used mkimage tool to convert it into a uImage format. When I am booting this file, it is not been found by u-boot:               Wrong Image Format for bootm command     ERROR: can't get kernel image!     U-Boot-PetaLinux>      So I thought of verifying that the uImage generated after conversion with mkimage is a valid image or not. The exact command that I used is:               mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n "Linux kernel" -d zImage uImage      How do I verify this image?


Logging ssh remote commands to `bash_history`

SSH allows a remote user to issue some command without interactively logging in to the server, as the last line of `ssh` usage indicates:               usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]                [-D [bind_address:]port] [-E log_file] [-e escape_char]                [-F configfile] [-I pkcs11] [-i identity_file]                [-L [bind_address:]port:host:hostport] [-Q protocol_feature]                [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]                [-R [bind_address:]port:host:hostport] [-S ctl_path]                [-W host:port] [-w local_tun[:remote_tun]]                [user@]hostname [command]      When ssh is invoked with a remote command, the `.bash_history` file does not get updated (i.e., the remote command is not added to `.bash_history`). I managed to "simulate" this effect by adding the following command to `/etc/ssh/sshd_config`:               ForceCommand if [[ -z $SSH_ORIGINAL_COMMAND ]]; then bash; else printf "$SSH_ORIGINAL_COMMAND\n" >> .bash_history; bash -c "$SSH_ORIGINAL_COMMAND"; fi      The above command checks whether the environment variable `$SSH_ORIGINAL_COMMAND` is empty:   * If so, no remote command is issued, and we simply run `bash`.   * Otherwise, `$SSH_ORIGINAL_COMMAND` is added to `.bash_history`, and the remote command within `$SSH_ORIGINAL_COMMAND` is executed. It works as expected, but I need a bit more: I want the current timestamp to be added to `.bash_history` as well. To this end, I added the following command to `/etc/ssh/sshd_config`:               ForceCommand if [[ -z $SSH_ORIGINAL_COMMAND ]]; then bash; else printf "#`date +%s`\n$SSH_ORIGINAL_COMMAND\n" >> .bash_history; bash -c "$SSH_ORIGINAL_COMMAND"; fi      But when I try to `ssh` to the server, I receive the following error:               bash: -c: line 0: unexpected EOF while looking for matching `"'     bash: -c: line 1: syntax error: unexpected end of file     Connection to 127.0.0.1 closed.      If I remove `#` before `date +%s`, it works correctly. But I need `#` to be printed before the timestamp, as it is the correct format for the `.bash_history` file.


How to fix startx on Arch Linux on Raspberry pi?

I have a problem when trying to use the command startx. It comes back with > `/usr/bin/x error while loading shared libraries: libgcrypt.so.20: cannot > open shared` and then says that it is giving up and can't connect to X servers > `xinit: giving up` > > `xinit: unable to connect to Xserver: Bad file descriptor` > > `xinit: server error` I am relativly new to Linux and to Stackoverflow. I'm sorry if this problem has already been solved somewhere else.


Can we configure different shells for different users on a single Linux/Unix distribution?

Well, this is not something that I want to do but I ask this question to know more about Shell configuration in Unix/Linux systems. So, the situation that I want an answer to is the following -: As we have different shells made available to us by a Unix/Linux system is it possible for us to configure a different shell for every user authorized to access the system. So, let's say that Tom, Dick and Harry are 3 users authorized to use the system "Unix" and I want "Tom" to use the shell **zsh** , Dick to use **tcsh** and Harry to use the **bash** shell. How can I do this and is this even possible?


Development environment for C

Looking for ideas on setting up a convenient and productive development environment for C development. I found C editing with Vim very helpful but I would like to get a wider sampling of suggestions.


The Case of the Conflicting Bootloaders

A server with a 2-disk RAID array (mirrored) is serviced by a 4-port 3Ware controller. Recently it became inaccessible after a restart. At the console it asked for the runlevel. Indeed, the /etc directory had been deleted. How, I have no idea. The old Centos 5 installation would not recover, so I unplugged the array disks, installed a new disk on an unused RAID controller port, and then installed Ubuntu Server 14. All went according to plan. The intent was to return the mirrored drives to service after the new disk install. I took the RAID array out during this process to avoid any chance of overwrite. Now that the RAID array is back, it attempts to boot, despite the presence of my new drive. So there's clearly a conflict with MBR's. Ideally it would be nice to tell my system that it should boot from a certain disk first. Unfortunately the RAID array isn't arranged at that level. It all looks like a single device to BIOS. So I must, I think, remove the bootblock from the RAID array's MBR. Correct? But.. how to do this safely?


Delete non-unique group with group ID as primary group of a user

So say I have two groups with names **testing1** and **testing2**. Both groups have the same group ID of 2000. Then I add a user named _testing-user_ with GID of 2000. Along the way I want to delete group testing2, but I cannot because when I try I get the following response               groupdel: cannot remove the primary group of user 'testing-user'      Here are the methods I have tried around this to success:   * Modified testing1's GID and then deleted testing2, then changed testing1's GID back to 2000   * Modified testing-user's primary GID to a separate group, deleted testing2 then assigned testing-user to testing1 Is there a better method for this that does not involve modifying the users or group id's in question?


How to make RHEL look at access.conf for su -?

I use the file `/etc/security/access.conf` to dictate what users have access to the server:               + : root : LOCAL     + : user1 : ALL     + : user2 : ALL     + : user3 : ALL     - : ALL : ALL      This works fine for new SSH sessions. Only these 3 users have access to the server via SSH. Unfortunately after logging in they can use `su -` to switch to all other users. How can I make `su -` also pay attention to the `/etc/security/access.conf` file so that user1/2/3 are the only users that can actually be used via SSH?


Capture transcript of program with redirected input and output

A typical interaction for a program I've written might look like this:               Enter command: a_command     Completed a command          Enter command: another_command     Completed another command      I typically run my program like `./program < input.txt`, where `input.txt` would contain:               a_command     another_command      I want to be able to capture the entire interaction (not just the output) like above. How can I do this with bash? EDIT: `program` is a binary (specifically, it's in C++), not a bash script. I have access to the source code, but I'd like to do this without having to modify the source code.


How to setup proxychains in VirtualBox Guest Kali Linux

I've been following directions from this book "Kali Linux Cookbook", but I can't get proxychains to work. The OS is Kali Linux and running inside VirtualBox. The guest network is a Bridged Adapter. I got the proxy servers from https://hidemyass.com. Why doesn't my proxychain work? Here is the error:               ~$ sudo /usr/lib/proxychains3/proxyresolv www.targethost.com     |S-chain|-<>-127.0.0.1:9050-<--timeout


Removed USB storage device is still mounted

I'm working on a embedded linux system based on busybox. Sometimes a USB device which is physically removed from the post is still displayed in `mount`, `df` or `/proc/mounts`. If I reattach the device, it is detected as for example `/dev/sdb1` while the `/dev/sda1` device is still mounted. I know that open file handles on removed devices can cause this but is there any other condition which can trigger this bahavior?


How to disable local file writes?

I maintain a shared public computer. Every user has their own directory in `/home`. We don't like to make `/home` a network mount because it takes a long time for new users to login, but we would like to set it so users can't write to their `/home` directories. We have network storage available to users that they should use instead, but we have no way to force them to use it. Ideally I want to prevent them from writing data to the local machine at all, instead directing them to write to the storage server. If that's not possible, I'd at least like to limit their disk quota on the local machine so they can't consume all the space. How can I go about doing that?


Duplicates in history file even after HISTCONTROL specified

I am using cygwin with bash (on Windows 7 pro). I have the following in `.bashrc`:               # Don't put duplicate lines in the history.     export HISTCONTROL="ignoredups"      and the following in `.bash_profile`:               # source the system wide bashrc if it exists     if [ -e /etc/bash.bashrc ] ; then         source /etc/bash.bashrc     fi          # source the users bashrc if it exists     if [ -e "${HOME}/.bashrc" ] ; then         source "${HOME}/.bashrc"     fi      Yet the command history is littered with duplicates.


CentOS ELRepo Kernel installing VMware

Already installed VMware Workstation 9 on my Linux CentOS 6.5 Final with `3.10.40-1.el6.elrepo.x86_64` running kernel. When I open VMware Workstation, it asks me to locate the Kernel Headers 3.10.40-1.el6.elrepo.x86_64. THESE MESSAGE: I get on the internet, my kernel version is different of that message says. Outside, it is all the same. ![message](http://i.stack.imgur.com/tpJeH.png) I've tried to download the ELRepo Headers (lt-kernel- headers-3.10.40-1.el6.elrepo.x86_64.rpm), unzip and put in the way of VMware, however it does not recognize. Apparently I must be doing something wrong. What do I actually download, install and which path should point to the VMware Kernel C Header configuration to work? The official page of the ELRepo, he talks to use the original Kernel conferring with `glibc`, however, already tried using the original kernel as a way to configure the VMware Kernel Headers C and does not work because the name of the kernels do not match indeed. I wonder what it is the Kernel Header?


How should I change root@mydomain when I send from mail() php function?

I've installed sendmail in Ubuntu as below:               apt-get install sendmail      Then I sent an Email to test, I received Email from `root <root@mydomain>`. I checked the content of `/etc/aliases`, but it was empty. I've looked around but couldn't figure out how to change default user for mail sending. What kind of record should I add to `aliases`? What I want to achieve is to change root to something like no-reply.


A problem with ubuntu

I have a Dell Inspiron 1420 with Windows Vista. I wanted to install Ubuntu on it, so I burned the ISO file to a 16GB flash memory and I booted the laptop from it. I tried to install Ubuntu on the hard disk, but an error appeared so I rebooted but it wouldn't boot from the flash again. So I booted from the hard disk and entered Windows and this time I burned the ISO file to the hard disk. I have three partitions:   * `C:` with Windows   * `D:` with files   * `E:` with Ubuntu (installed with universal USB installer) When I restarted the laptop it entered Ubuntu without the booting menu. I tried every thing to enter Windows but I failed. So I browsed the Internet from Ubuntu to find a solution and then closed the lid of the laptop. When I opened it again I saw a black window with the pointer of DOS in the top left of the screen and it doesn't write. I restarted the laptop many times but I always get this screen. What's the problem and what can I do for it?


iptables forwarding between subnets

I want to forward traffic between two subnets, I'm not very familiar with iptables. The forwarding works except when iptables is enabled. There must be something wrong with the rules, though intuitively they seem like they should work. These are the rules I've tried, I've also tried them without destination and source addresses...               Chain INPUT (policy DROP 76 packets, 6424 bytes)      pkts bytes target     prot opt in     out     source               destination                 52  6866 ACCEPT     all  --  lo     any     anywhere             anywhere                  1117 92168 ACCEPT     all  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED          1   152 ACCEPT     tcp  --  any    any     anywhere             anywhere            tcp dpt:ssh           Chain FORWARD (policy DROP 24 packets, 1812 bytes)      pkts bytes target     prot opt in     out     source               destination                  0     0 ACCEPT     all  --  eth0   eth0:0  anywhere             184.107.60.0/24              0     0 ACCEPT     all  --  eth0:0 eth0    184.107.60.0/24      anywhere                      Chain OUTPUT (policy ACCEPT 95 packets, 9660 bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain sshguard (0 references)      pkts bytes target     prot opt in     out     source               destination      Just for good measure here is my ifconfig...               eth0      Link encap:Ethernet  HWaddr 00:25:90:25:61:41                 inet addr:174.142.61.201  Bcast:174.142.61.223  Mask:255.255.255.224               inet6 addr: fe80::225:90ff:fe25:6141/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:205399 errors:0 dropped:0 overruns:0 frame:0               TX packets:105545 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:251555745 (239.9 MiB)  TX bytes:34853743 (33.2 MiB)               Interrupt:16 Memory:d0180000-d01a0000           eth0:0    Link encap:Ethernet  HWaddr 00:25:90:25:61:41                 inet addr:184.107.60.176  Bcast:184.107.60.255  Mask:255.255.255.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               Interrupt:16 Memory:d0180000-d01a0000       I've tried this with different rules that don't specify interfaces and still nothing gets through when iptables is enabled.               Chain INPUT (policy DROP)     target     prot opt source               destination              ACCEPT     all  --  anywhere             anywhere                 ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED      ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh           Chain FORWARD (policy DROP)     target     prot opt source               destination              ACCEPT     all  --  184.107.60.0/24      anywhere                 ACCEPT     all  --  anywhere             184.107.60.0/24               Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination                   Chain sshguard (0 references)     target     prot opt source               destination              DROP       all  --  email.globaltravelerusa.com  anywhere      The rules run on a dedicated server which has its adapter bridged with virtual machines. I need to forward packets between the alias and the main physical interface, because the other IP addresses I am given are on another subnet. The rules currently work if I just have a forward allow policy. Technically that has fixed the problem, but in accepting that solution I learn nothing about what I do with iptables. Obviously IP forwarding is on, and I can access the server from my home computer in another country with iptables configured to allow all forwarding. The problem is simple: what are the right rules to use for forwarding between subnets? The ones shown do not work, for some reason. This is working...               Chain INPUT (policy DROP)     target     prot opt source               destination              ACCEPT     all  --  anywhere             anywhere                 ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED      ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh           Chain FORWARD (policy ACCEPT)     target     prot opt source               destination                   Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination                   Chain sshguard (0 references)     target     prot opt source               destination              DROP       all  --  1.93.29.150          anywhere                 DROP       all  --  42.96.131.14         anywhere                 DROP       all  --  42.62.3.18           anywhere


System image of running Debian system?

Is it possible to backup a running Debian system to some kind of image file, that could simply be written back to another hard disk using dd in case of failures of the original (backed up) Debian system? I am especially looking for a tool directly available in the repositories, as I have Debian Wheezy running on a raspberry pi and therefore, I need support for the ARM architecture, which is given quite reliable for packages of the Debian repositories.


How to install gnome shell 3.6 in debian 7.1

I have installed Debian 7.1 and I realized it has installed gnome shell 3.4.2. How can I upgrade it to version 3.6?


BIND server doesn't recognize my zone properly

I'm pretty new to BIND so I was hoping maybe someone can help me understand why I can't resolve. What is wrong? **named.conf**               options {             listen-on port 53 { localhost; 10.30.0.10; };             listen-on-v6 port 53 { ::1; };             directory       "/var/named";             dump-file       "/var/named/data/cache_dump.db";             statistics-file "/var/named/data/named_stats.txt";             memstatistics-file "/var/named/data/named_mem_stats.txt";             allow-query     { any; };             recursion no;             version "0";                       channel query.log {                     file "/var/log/query.log";                     severity debug 3;                     print-severity yes;                     print-time yes;             };             category queries { query.log; };     };     acl "Tele-Subnet" { 10.100.0.0/16; };     view "Tele" {             match-clients { "Tele-Subnet"; };                  zone "example.net" IN {                     type master;                     file "/var/named/example.net.db";                     allow-update { none; };                     allow-query { any; };                     notify yes;             };          };      **example.net.db**               ORIGIN example.net.     $TTL 86400          example.net.       IN      SOA     10.30.0.10.      admin.example.net. (                             2012081901      ; serial number YYMMDDNN                             28800           ; Refresh                             7200            ; Retry                             864000          ; Expire                             86400           ; Min TTL                             )             IN      A       10.30.0.10                     NS      10.30.0.10.                     NS      10.30.0.10.                                   backup    IN       A      10.10.11.230  ; Engine      So when I query the server, I can only see this in the logs: > 19-Aug-2012 14:45:09.566 info: client 10.100.0.13#5682: view Telenor: query: > backup.example.net IN A + (10.30.0.10)


Copy & Paste over several files with vim?

Vim seems nice for most of the times and outperforms other editors in some categories. But what about Copy&Paste? (It seems to me that even MS DOS' EDIT.COM seems to outperform vim in this category.) Scenario 1: I have a software project, lots of directories and I want to move a function from one file to another. What is the most efficient way to do that? Scenario 2: I activate indentation. It seems in conflict with multi-line copy&paste. I remember seeing on the internet people suggesting to switch indentation off during this process. At the same time I even saw some weird macros. Is there an efficient solution?


Map caps to esc for RHEL 5?

I have an older version of RHEL. In newer versions, there is usually an option to map the caps key to the esc key. How would I do this in an old version? Going to System Preferences -> Keyboard -> Layout Options -> CapsLock Key behavior doesn't have the option to switch caps lock key to escape key.


How small can an embedded Linux file system get?

We have an embedded device running the Angstrom distribution - I'm trying to pare down the root file system to as small as possible. I've started by using Narcissus to generate the file system, but the smallest I am getting so far is about 60Mb. Is this the right strategy, or is it worth it to build one from scratch?


pipe the output of parec to sox

`sox` is probably the one linux program that continues to frustrate me. At the same time, I am awed by what it can do, and I'd like to get close to being fluent in it, if not mastering it. Today, I've spent about 2 hours trying to get `sox` to read bytes from `parec` via a pipe. The `parec` bytes are a `pulseaudio` "sink". In order to get them flowing through the pipe, I used this answer from askubuntu. This is the command I've been using:               $ parec -d telephonControl.monitor | sox -b 16 -e signed -c 2 -r 44100 - -t pulse hmm.ogg silence 1 0.50 0.1% 1 2.0 0.1% :             newfile : restart      and this is the error I get:               sox FAIL formats: can't determine type of  `-'     write() failed: Broken pipe      What's more, oggenc parses them just fine:               parec -d telephonControl.monitor | oggenc -b 192 -o telephonControl.ogg --raw -     Encoding standard input to               "telephonControl.ogg"      at approximate bitrate 192 kbps (VBR encoding enabled)      I have absolutely no idea how to make `sox` digest those bytes.               $ parec -d telephonControl.monitor >> somebytes          $ soxi somebytes     soxi FAIL formats: can't determine type of file `somebytes'      But I do know that they are raw audio, 16 bit signed little endian, 2 channel 44100kHz:               $pacmd     >>> list-sink-inputs     1 sink input(s) available.         index: 17             driver: <protocol-native.c>             flags:              state: RUNNING             sink: 2 <telephonControl>             volume: 0: 100% 1: 100%                     0: 0.00 dB 1: 0.00 dB                     balance 0.00             muted: no             current latency: 92.86 ms             requested latency: 23.20 ms             sample spec: s16le 2ch 44100Hz             channel map: front-left,front-right                          Stereo             resample method: (null)             module: 7             client: 53 <ALSA plug-in>             properties:                     media.name = "ALSA Playback"                     application.name = "ALSA plug-in"                     native-protocol.peer = "UNIX socket client"                     native-protocol.version = "26"                     application.process.id = "3609"                     application.process.user = "alec"                     application.process.host = "ROOROO"                     window.x11.display = ":0"                     application.language = "en_GB.UTF-8"                     application.process.machine_id = "eec7c6ae60f90bb3921ad16d0000302d"                     application.process.session_id = "eec7c6ae60f90bb3921ad16d0000302d-1345384044.64188-1149507345"                     module-stream-restore.id = "sink-input-by-application-name:ALSA plug-in"


Overwrite file and apply file system rights of overwritten files?

I backed up some linux configuration files to a windows machine, so the file system rights were lost. Now I would like to restore my backed up configuration by overwriting the configuration currently present on the linux machine. Is there a command like "overwrite configuration.conf with backup/configuration.conf and apply the file rights of the overwritten configuration.conf to the new configuration.conf" ? Thanks for any hint :-)


Compare two files: lines present in one, not in the other, by one column comparison

I need to compare 2 files. Column 1 is the same in both files. Column 2 is what I want to compare: I want all lines in file 1 that are not in file 2 when comparing column 2. Column 3 is different in both files, even for lines where column 1 and 2 are identical. I cannot remove column 3, because as an output I want the lines from file 1 including this column. Here is an example: **File 1**               21  12340   3     21  12341   7     21  12342   2     21  12343   89     21  12349   7      **File 2**               21  12340   55     21  12341   7     21  12343   89     21  12344   7     21  12346   88     21  12347   3     21  12348   37      My output would be:               21  12342   2     21  12349   7


Enable sqlite FTS Enhanced Query Syntax in python in RHEL6?

SQLite's full text search engine offers a simple query syntax (with `AND` and `OR` operators and `-term` for negation), as well as an enhanced query syntax which also allows parenthesis and `NEAR` — as well as using `NOT` instead of the `-term` syntax. The enhanced query syntax is enabled by setting the SQLITE_ENABLE_FTS3_PARENTHESIS option at compile time, and sqlite as distributed by Red Hat does not have this enabled. I have a python web app where I'd prefer to use the enhanced search syntax. What's the best way to do this? Since the syntax is incompatible, rebuilding the system sqlite might break other things. But I'd prefer not to end up in a whole world of maintaining a parallel python tree. What's the best approach?


PCI-e SSD - Not visible to sysstat's iostat or sar

I am attempting to get basic statistics during test runs on a server with a PCI-e attached SSD that is mounted on /dev/rssda1, however sar and other sysstat either do not log, or in the case of iostat return zeros when querying for statistics. Operating system is RHEL 6.4, any other information available on request. Appreciate any help on this one!


Print lines if given column starts with a capital letter

I have a file like this:               ID  A56     DS  /A56     DS  AGE 56      And I'd like to print the whole line only if the second column starts with a capital letter. Expected output:               ID  A56     DS  AGE 56      What I've tried so far:   `awk '$2 ~ /[A-Z]/ {print $0}' file`   Prints everything: capital letters are found within the second column. `awk '$2 /[A-Z]/' file`   Gets a syntax error.


qemu-kvm savevm very slow

I have up to date gentoo system with kvm images located on 500 gb partition with 200 gb of free space and defragmented, running machine with Windows XP and 2gb ram, I have problem with making snapshot of runing vm. When I try to save state via the `savevm` command using qemu monitor it starts to use 100% of disk IO and writes data very slowly (<1mb/s). It also causing very big fragmentation very fast. Does anyone know a solution to this problem? After ~half hour I have this:               filefrag tmp_sys.img         tmp_sys.img: 25154 extents found      and it's still saving... Completely unusable.


What is the meaning of wget -O -

I am trying to install dropbox onto my Debian machine, and I saw the instruction > cd ~ && wget -O - "some website leading to the download of a tar file" | tar > xzf - But what I did was just typing this > wget -O - "some website leading to the download of a tar file" and I got a lot of rubbish on my terminal. What does > wget -O - means? Does it do any harm to my computer? Thanks! (I think I sound a bit stupid here, but I am just new to using wget!)


Getting the password expire time

Let me preface this with: I do **NOT** have root access available. I recently got locked out of my account because I did not know the password expiration was getting close, then elapsed. I want to add a check to my startup script that checks and displays the time so I know when it is coming near. Is there a command or way of getting the timestamp when my user password will expire?


How can I resolve the "invalid ELF header" warning when trying to SSH and what does it mean?

I'm getting some kind of warning when checking my connection to github. Why is it happening and how can I resolve it?               $ ssh -TI ~/.ssh/id_rsa git@github.com     dlopen /home/ubuntu/.ssh/id_rsa failed: /home/ubuntu/.ssh/id_rsa: invalid ELF header     Hi mediapop/Gnossem-Magazine! You've successfully authenticated, but GitHub does not provide shell access.


Guide on how to install FreeBSD on a laptop

Is there a guide on how to install FreeBSD on a Laptop with some basic GUI elements or a Desktop Manager? Please assist and I know some more people would want to know this.


apt-get failed to fetch package

I want to install curl on my ubuntu:               sudo apt-get install curl      It gave the following error:               Err http://it.archive.ubuntu.com/ubuntu/ maverick/main curl i386 7.21.0-1ubuntu1       404  Not Found [IP: 193.206.140.45 80]     Failed to fetch http://it.archive.ubuntu.com/ubuntu/pool/main/c/curl/curl_7.21.0-1ubuntu1_i386.deb  404  Not Found [IP: 193.206.140.45 80]      Then I did an update and retried install. But this didn't make any difference.               sudo apt-get update      What should I do?


RedHat Linux Space Usage Problem

I recently downloaded something on my Redhat Linux computer, and it told me I was out of space. I checked my disk usage, and it says I've used 100% of my folder, but as you can see I still have almost 900Gb available. How can I reallocate some of that space to my user? Here is a screenshot of my disk usage: http://i.imgur.com/o2CzK.png I know this may be a basic question, but I can't find a way to give myself more space. Also, I have root access. Please let me know if anything else is needed. EDIT: output of df -h               Filesystem            Size  Used Avail Use% Mounted on     /dev/mapper/VolGroup00-LogVol00                           901G  3.5G  852G   1% /     tmpfs                 1.9G  1.2M  1.9G   1% /dev/shm     /dev/sda3             194M   31M  154M  17% /boot     /dev/sda5             4.0G  3.7G  105M  98% /home


Vlook up in gawk or unix

I would like to do a vlookup in unix or `gawk`. I have a file with a column of numbers (file1) I have a file with several columns (file2) I want to look up for the numbers I have in file 1 into column one of file 2 I was using `grep -f file1 file2` but this prints all the lines in file two containing a string as in file 1, not just the lines that have the string in column one of file 2 How can I solve this with `gawk` or other unix tools?


Junk a part of the directory with unzip?

A zipfile `f.zip` contains a bunch of files all with directories.                A/B      A/B/C      A/B/C/D           ..      A/B/C/D/and/some/more/dirs      A/B2      Now I'm only interested in the tree below C/D. I can do `unzip f.zip */D/* -d .` which unzips everything under D - assuming that D is a unique sequence - to the current directory including A/B/C, however I want D to be the root of my unzip action. Of course I can just move D to my current working dir but I consider that cheating. Man pages nor google did reveal a solution, but maybe I'm overlooking and maybe there's a nicer solution than moving.. Oh my platform is mac os x 10.8.prettyup2date


Why is "[ok]" not shown in daemon status message when using GNU Screen?

I have a debian-based system (Voyage Linux 0.9.1 actually, which is based on debian wheezy) and when I do `/etc/init.d/ntp status` it returns (for example)               $ /etc/init.d/ntp status     [ ok ] NTP server is running      However, inside a screen session (version 4.01.00devel 2-May-06) the `[ ok ]` is not shown.               $ screen     $ /etc/init.d/ntp status     NTP server is running      **Why is this the case? And how to show it also in the Screen session?** BTW: On another debian server (which also returns `xterm-256color` when I do `echo $TERM`), I noticed that `/etc/init.d/ntp status` does never show the `[ ok ]`, regardless of whether I am in a screen session or not, so it probably is not really a `screen` issue.


Sorting a file based on one column using Unix and Awk

I need to sort the input file according the 6th column, which is the score. **Input File:**               Sc2/80  20 . A T 86 Pass N=2 F=5;U=4     Sc2/80  20 . A C 80 Pass N=2 F=5;U=4     Sc2/60  55 . G T 90 Pass N=2 F=5;U=4     Sc2/60  55 . G C 99 Pass N=2 F=5;U=4     Sc2/20  39 . C T 97 Pass N=2 F=5;U=4     Sc2/20  39 . C A 99 Pass N=2 F=5;U=4      **Expected Output:**               Sc2/20 39 . C T 97 Pass N=2 F=5;U=4     Sc2/20 39 . C A 99 Pass N=2 F=5;U=4     Sc2/60 55 . G T 90 Pass N=2 F=5;U=4     Sc2/60 55 . G C 99 Pass N=2 F=5;U=4     Sc2/80 20 . A T 86 Pass N=2 F=5;U=4     Sc2/80 20 . A C 80 Pass N=2 F=5;U=4      Logic: All the even lines of the input file should be compared and ranked according to the score (Descending Order) and the corresponding odd line of the file should be printed as well with it. If any of the scores (of the even lines) are equal then we need to look at the score of the corresponding odd line and therefore, the higher score gets priority and is printed first.


Why can't uvcdynctrl see my webcam?

I have added a Creative Labs Live! Optia webcam to my Debian Squeeze machine and can see it using `lsusb`. Unfortunately, when I use `uvcdynctrl -l` I get the message `No Devices Found` I am on Kernel version 2.6.32 which I understand contains the uvc drivers. Any ideas?


Dovecot version upgrade

I am using ubuntu 12.04 and dovecot version is 1.2.9, I want to upgrade my dovecot version from 1.2.9 to **2.1.7**


How to download openSUSE 12.1 throught `wget -c`?

http://software.opensuse.org/121/en Usually I right click and open the download link in a new tab. Copy the url on the command line with `wget -c`. In this case I just can't right click on the download button! ![enter image description here](http://i.stack.imgur.com/SjclQ.png) ![enter image description here](http://i.stack.imgur.com/YV5gE.png)


Switch Fn key state

I have this issue with Lenovo Thinkcentre Edge. Its keyboard has `Fn` key, which acts in my Ubuntu (with Fluxbox) as if it is always "active/pressed". I can't use standard `F1`-`F12` keys unless I hold down this stupid key. You see, I'm a programmer so it's really pain to me. So I decided to remap function keys with `xev` and `xmodmap` I remapped `F1`-`F3` and 'till this point everything is fine, but `F4` does some kind of window minimization. When I run `xev` and hit `F4`, I don't get a reply from the program with a keycode and stuff, instead the window is minimized and when I maximize the window again there is no response from the key. Important info: The function of `Fn` key can't switched in bios. So the question is: Do you have ANY idea how to solve my mystery? EDIT:               # content of .fluxbox/keys     # click on the desktop to get menus     OnDesktop Mouse1 :HideMenus     OnDesktop Mouse2 :WorkspaceMenu     OnDesktop Mouse3 :RootMenu          # scroll on the desktop to change workspaces     OnDesktop Mouse4 :PrevWorkspace     OnDesktop Mouse5 :NextWorkspace          # scroll on the toolbar to change current window     OnToolbar Mouse4 :PrevWindow {static groups} (iconhidden=no)     OnToolbar Mouse5 :NextWindow {static groups} (iconhidden=no)          # alt + left/right click to move/resize a window     OnWindow Mod1 Mouse1 :MacroCmd {Raise} {Focus} {StartMoving}     OnWindowBorder Move1 :StartMoving          OnWindow Mod1 Mouse3 :MacroCmd {Raise} {Focus} {StartResizing NearestCorner}     OnLeftGrip Move1 :StartResizing bottomleft     OnRightGrip Move1 :StartResizing bottomright          # alt + middle click to lower the window     OnWindow Mod1 Mouse2 :Lower          # control-click a window's titlebar and drag to attach windows     OnTitlebar Control Mouse1 :StartTabbing          # double click on the titlebar to shade     OnTitlebar Double Mouse1 :Shade          # left click on the titlebar to move the window     OnTitlebar Mouse1 :MacroCmd {Raise} {Focus} {ActivateTab}     OnTitlebar Move1  :StartMoving          # middle click on the titlebar to lower     OnTitlebar Mouse2 :Lower          # right click on the titlebar for a menu of options     OnTitlebar Mouse3 :WindowMenu          # alt-tab     Mod1 Tab :NextWindow {groups} (workspace=[current])     Mod1 Shift Tab :PrevWindow {groups} (workspace=[current])          # cycle through tabs in the current window     Control Tab :NextTab     Control Shift Tab :PrevTab          # go to a specific tab in the current window     Mod4 1 :Tab 1     Mod4 2 :Tab 2     Mod4 3 :Tab 3     Mod4 4 :Tab 4     Mod4 5 :Tab 5     Mod4 6 :Tab 6     Mod4 7 :Tab 7     Mod4 8 :Tab 8     Mod4 9 :Tab 9          # open a terminal     Mod1 F1 :Exec x-terminal-emulator          # open a dialog to run programs     Mod1 F2 :Exec fbrun          # volume settings, using common keycodes     # if these don't work, use xev to find out your real keycodes     176 :Exec amixer sset Master,0 1+     174 :Exec amixer sset Master,0 1-     160 :Exec amixer sset Master,0 toggle          # current window commands     Mod1 F4 :Close     Mod1 F5 :Kill          # open the window menu     Mod1 space :WindowMenu          # exit fluxbox     Control Mod1 Delete :Exit          # change to previous/next workspace     Control Mod1 Left :PrevWorkspace     Control Mod1 Right :NextWorkspace          # change to a specific workspace     Control F1 :Workspace 1     Control F2 :Workspace 2     Control F3 :Workspace 3     Control F4 :Workspace 4          #osobni     Mod4 d :ShowDesktop     Mod4 m :Maximize     Mod4 f :Exec firefox     Mod4 u :Exec unison-gtk     Mod4 e :Exec eclipse     Mod4 t :Exec thunderbird     Mod4 q :Exec qutim     Mod4 s :Exec skype      Ubuntu is 12.04 LTS, kernel               3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux


access rights of a file in octal format

I wonder if there is command which will give you access rights of any file you provide. There stat related command but it is not accessible in solaris.               stat -c %a /etc/passwd      Is there any equivalent command in solaris ?


Hotspot and Internet access together — why not?

If I try to set up an hotspot in GNOME, I get the following message: > If you have a connection to the Internet other than wireless, you can use it > to share your internet connection with others. > > Switching on the wireless hotspot will disconnect you from `<network name>`. > > It is not possible to access the internet through your wireless while the > hotspot is active. What are the technical reasons why I can't set up an Hotspot and be connected to the Internet at the same time?


Is there a way to cd back multiple times in bash?

I often use `cd -` to go back to where I was. How can I do this multiple times in bash? Or would zsh or some other tool support this?


Fresh Install Scientific Linux No Operating System

I just wiped the hard drive on a desktop computer and used a LiveUSB to install Scientific Linux 6.4, the x86_64 veresion. I went through and simply let the installer use all its default configurations. Once that was done I tried booting up the machine and I got               Error 1962: No operating system found.       I'm currently reinstalling it without grub and am going to load grub on manually, but it baffles me that its not working after the simplest installation. Is this a common problem? I've never had this sort of thing happen before. **Update** I attempted to use a dvd instead to install, but it wouldn't boot from the dvd, I plugged the USB in with the dvd and am able to load it now. I'm guessing it must have been missing certain drivers to boot from the dvd. Anyways, the install didn't work from the live dvd either.


Why is writing SLOW on raw device, and FAST on filesystem (USB key)?

I have a USB key (PQI U822V-Speedy 32G) that I am trying to benchmark quick'n'dirty on Linux. I'm testing write bandwith. ## `dd` on raw partition I created a partition starting at sector 2048, then did a 4 GB sequential write:               dd if=/dev/zero of=/dev/sdb1 bs=1M count=4096      I get ~22 MB/s. I also tried several (4) `dd` running in parallel like the one above but using `count=1024` and the `seek=` option to write to different areas of the drive. Same results. ## `dd` on filesystem However, when I format the `sdb1` partition with either `ext4` or `NTFS`, and copy big files to it (either real or `/dev/zero`), like this:               time dd if=/dev/zero of=/media/USBKEY/file.bin bs=1M count=4096 ; time sync      I do achieve > 66 MB/s as advertised by the manufacturer. Of course, I considered the `sync` duration just after the copy. Why is there such a big performance difference?


Establishing client VNC connection over SSH in one step (e.g., with the -via option)

How do I reduce these two commands to one? I am connecting from my client to an x11vnc server and the two commands below already work. I just wish to do it in one step: first command:               ssh -fNL 5901:localhost:5678 -i ~/.ssh/some_id_rsa rocky@example.com      and second:               vncviewer localhost:5901      From reading the man page, it seems like the -via option might do it. Unfortunately, the man page leaves me very confused. For reference (not that I understand it) here is what my man page says:                  -via gateway               Automatically create encrypted TCP tunnel to the gateway machine before con‐               nection, connect to the host through  that  tunnel  (TightVNC-specific).  By               default,  this  option  invokes SSH local port forwarding, assuming that SSH               client binary can be accessed as /usr/bin/ssh. Note that when using the -via               option,  the  host  machine name should be specified as known to the gateway               machine, e.g.  "localhost"  denotes  the  gateway,  not  the  machine  where               vncviewer  was  launched.  The environment variable VNC_VIA_CMD can override               the            default             tunnel             command             of               /usr/bin/ssh -f -L "$L":"$H":"$R" "$G" sleep 20.  The tunnel command is exe‐               cuted with the environment variables L, H, R, and G taken the values of  the               local  port number, the remote host, the port number on the remote host, and               the gateway machine respectively.


Building zsh without admin priv: No terminal handling library found

I am trying to install Zsh without root privileges on a Linux machine. I downloaded the source tarball and run:               ./configure --prefix=<my_installation_path>      but then I got: > configure: error: "No terminal handling library was found on your system. > This is probably a library called curses or ncurses. You may need to install > a package called 'curses-devel' or 'ncurses-devel' on your system" ## Installing ncurses: Since I am not root on this system, I downloaded `ncurses` and installed it manually (also using `./configure --prefix=<my_installation_path>`), which seems to have gone well. I then updated the following paths:               INSTALLATION_PATH='/path/to/installation'     export PATH=$INSTALLATION_PATH/bin/:$PATH     export LD_LIBRARY_PATH=$INSTALLATION_PATH/lib:$LD_LIBRARY_PATH     export CFLAGS=-I$INSTALLATION_PATH/include      and tried installing Zsh again, but got the same `ncurses` error. As far as I can tell, the path variables above point to the right locations, and I can check this on the shell. Why is Zsh not recognizing `ncurses?`


Running rsh command under the root account

I have two machines running Solaris 9 (192.168.2.9) and Windows XP (192.168.2.5). I need to run the following command on the Windows machine:               rsh 192.168.2.9 -l root pwd      To be able to run this command I've created the `/etc/hosts.equiv` file on the UNIX machine, which contains:               192.168.2.5 xp.user      where `xp.user` is the name of the active XP account, under which the `rsh` command connects. The command gives the following messages:               192.168.2.9: permission denied     rsh: can't establish connection      I tried to change the UNIX user to `notroot`:               rsh 192.168.2.9 -l notroot pwd      The command gave the same result:               192.168.2.9: permission denied     rsh: can't establish connection      But when I created the file `/home/notroot/.rhosts` with the same contents as `/etc/hosts.equiv` the result was OK:               /home/notroot      Both the `hosts.equiv` and `.rhosts` files are identical and were created in the UNIX `vi` editor. The empty lines are added at the end of each file. The properties of the files are: `/etc/hosts.equiv` \- group: root; owner: root; permissions: owner: RW `/home/notroot/.rhosts` \- group: other; owner: notroot; permissions: owner: RW The choice of `rsh` protocol and the root account doesn't depend on me. So, how can I run the `rsh` command under the root account?


SSH from osx to osx and then use agent

I have a mac at home and a mac at work. The work mac is setup for ssh to all work related servers. Sometimes I have to connect from my home mac and access the servers which are setup on my work mac. When I connect to VPN and ssh into my work mac, and try to ssh to any other servers which are set in the config of my work mac it's asking for my passphrase for the user of my work mac, which I don't have any, so I just hit enter and then it asks for the password for the server I want to connect to (keyless ssh setup). The ssh-agent is not running by default when I connect to my work mac via ssh. I have to start it manually. I also have a similar setup on my home mac, sshing into a linux virtualbox and then to an amazon ec2 instance using the ssh-agent from the box and it works fine without any problems. Could you tell me how to fix this issue? Or a workaround?


Loading module 8192cu fails

I 'm running Angstrom Linux (3.0.7) on embedded device BeagleBoard-xM. I want to load a module _(downloaded fromhere)_ and copied into: `/lib/modules/3.0.7/kernel/drivers/net/wireless/rtlwifi/8192cu.ko` on the BeagleBoard-xM SD card file system. However, loading the module fails:               root@beagleboard:/# modprobe 8192cu                                                  FATAL: Module 8192cu not found.      Any ideas?


Replacing string based on line number

I have a situation where i want to replace a particular string in many files Replace a string **AAA** with another string **BBB** but there are lot of strings starting with AAA or ending in AAA ,and i want to replace only one on line 34 and keep others intact. Is it possible to specify by line number,on all files this string is exactly on 34th line.


why isn't rsync copying files to the server

I'm following along with a Railscast that teaches how to set up Chef solo. It uses two interesting terminal commands that I had never seen before, only one of which I can get to work. When I do               scp -r root@198.xxx.xxx.xxx:/var/chef .      It copies the contents of the remote server directory to my local machine. The following command is supposed to sync the files back to the server after I change them on my machine               rsync -r . root@198.XXX.XXX.XXX:/var/chef      However, the changes aren't showing on the remote server, and when I run the chef commands that are supposed to apply the changes, it's not showing any changes that need to be made. Am I using rsync incorrectly? Update Running this command gave the following output. Still no changes are shown on the remote server               rsync -rvv . root@198.XXX.XXX.XXX:/var/chef               `building file list ...      done     delta-transmission enabled     chef/node.json     chef/solo.rb     chef/cache/chef-client-running.pid     chef/cache/chef-stacktrace.out     chef/chef/node.json     chef/chef/solo.rb     chef/chef/cache/chef-client-running.pid     chef/chef/cache/chef-stacktrace.out     chef/chef/cookbooks/main/recipes/default.rb     chef/cookbooks/main/recipes/default.rb     chef/cookbooks/main/templates/default/zshrc.erb     total: matches=17  hash_hits=17  false_alarms=0 data=0     sent 1167 bytes  received 442 bytes  643.60 bytes/sec     total size is 6236  speedup is 3.88`      Update You'll notice from the above update that a `templates` directory should be inside the `main` directory (along with a `recipes` directory), however, this is what's showing               root@Chef3:/var/chef/cookbooks# cd main     root@Chef3:/var/chef/cookbooks/main# ls     recipes


Why should I get linux?

Ok so I am student, about to get my degree in computer science. I have been programming for couple of years now on my Macbook pro on OS X and I havent had any problems. On the other hand, everyone around is telling me to install linux OS because its better, developers use it, programmers use it, etc. But no one told me why is linux better than OS X? What's the big deal about having programming and developing on Linux?


deleting a 'file' under /proc or /dev

I am using a cowdancer/debootstrap setup to generate a chroot. Of course, as I iterate, I generate some chroot configurations that are bad. I have found myself in an awkward situation where I have a slew of files under /proc that are refusing to be deleted. When I `sudo rm -rf z_needs_to_be_deleted`, I get a ton of messages that look analogous to this:               rm: cannot remove 'z_needs_to_be_deleted/var/cache/pbuilder/build/cow.13620/     proc/6352/task/6358/loginuid':  Permission denied      How do I kill off this chroot?


Generate random numbers in specific range

After googling a bit I couldn't find a simple way to generate with a shell command a random number included in a specific range, between a minimum and a maximum. I read about `/dev/random`, `/dev/urandom` and `$RANDOM`, but any of these can do what I need. Is there another useful command, or a way to use the previous data?


Finding the ID of a process and killing it

When ever I need to kill a background process I do `ps -e | grep <process_name>` Which prints something like this `1766 ? 00:00:13 conky` , Then I use the process ID to `kill` it like so `kill 1766` . Is there any way I can simplify this ? Make it quicker ? reduce the amount of typing ?


Aptitude: What is the filter for virtual packages that has been provided?

The `~v` flag will display all virtual packages, but even if they are already provided by installed packages, adding `~i` will make the list empty as virtual packages can never have `i` flag. So how do I find out what virtuals are installed?


How to install windows 7 after fedora 16

I have Fedora 16, but I want to play games, and I´m considering installing Windows 7. I need to be able to dual boot these two OS. Is there something special I´m supposed to do, or it will work like a charm (I put the DVD, install Windows 7 with x/3 disk space and voila, it works)?


Can 'nix handle NTFS ADS data streams?

Two-three years ago, I experimented (in Windows) with NTFS ADS meta-data (Alternate Data Streams). It seemed like an interesting idea, but it is certainly not "portable". Is there an NTFS-ADS aware tool which can read and/or write this ADS data?   Also, do any of the `nix commonly used/preferred file-syystems support similar secondary streams"?


GRUB2 and EFI - File not found?

I'm running Linux on a 8,3 2011 MacBook Pro. It uses EFI/rEFIt to boot. I was able to install GRUB2 EFI support, and it shows up just fine in the rEFIt boot menu. Everything seems to be working there. What I did was this:               apt-get source grub2     sudo apt-get build-dep grub2     cd grub2-1.99     export EFI_ARCH=x86_64     ./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix ""     make      This built everything required. Then, it was time to install the compiled `grub.efi` image:               cd grub-core     ../grub-mkimage -O ${EFI_ARCH}-efi -d . -o grub.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot     sudo mount -t vfat -o rw /dev/sda1 /mnt     sudo mkdir -p /mnt/EFI/grub     sudo cp grub.efi *.mod *.lst /mnt/EFI/grub     sudo touch /mnt/EFI/grub/grub.cfg      It's all looking good so far. When I rebooted into rEFIt, I could see the EFI GRUB menu entry in rEFIt and I was able to start it. Since I hadn't configured anything, I wasn't able to see anything, but I could have entered GRUB commands if I wanted to. I then tried defining my GRUB config file like this:               menuentry "Linux (BIOS)" {         search --file --no-floppy --set=root /vmlinuz         loadbios /boot/vbios.bin /boot/int10.bin         linux /vmlinuz root=/dev/sda4 video=efifb         initrd /initrd.img     }          menuentry "Linux (BIOS + Fix Video)" {         search --file --no-floppy --set=root /vmlinuz         fix_video         loadbios /boot/vbios.bin /boot/int10.bin         linux /vmlinuz root=/dev/sda4 video=efifb         initrd /initrd.img     }          menuentry "Linux (No BIOS)" {         search --file --no-floppy --set=root /vmlinuz         fakebios         linux /vmlinuz root=/dev/sda4 video=efifb         initrd /initrd.img     }      Then, when I booted into GRUB from rEFIt, I could definitely see these menu entries. The problem is that each one yielded a message like this:               error: file not found      I assume that this refers to the fact that it can't find `/vmlinuz`, `/boot/*`, and `/initrd.img`, since they're not present in the EFI partition. Where do I get these files from and how can I copy them to the EFI partition to get booting working? Additionally, how do I specify which kernel to load? Will this GRUB loader just load my main `/dev/sda4` GRUB menu after EFI has booted?


Combine input from multiple files/pipes without clobbering lines or blocking?

Is there a tool that will take input from multiple files or pipes and write it to stdout, without blocking on reads, such that individual input lines come out intact? I basically want to multiplex a bunch of inputs onto one output without clobbering lines.               $ combine file1 <(prog2) ... > nice-output.txt        1. I don't care about the order of the output   2. It should not block as long as some input has data   3. It should be efficient (i.e., I may downvote your Perl one-liner ;)


gvim -p limit of opened tabs?

When I run :               gvim -p *.xyz      I find that not all files are opened in tabs. It feels, like a kind of tab limit? But ! When I try to open unopened with :               :tabnew      it is opened next to previous tabs - it works ! How to make `gvim -p ...` to open all files without need of opening those above limit manually with `:tabnew` ? Btw. Is this limit somewhere written ? Possible to be configured?


FreeBSD: How to install Django with mod_wsgi?

Using FreeBSD 8.2-RELEASE. I want to mess around with Django and I want a working setup on my freebsd system. My understanding is I need to install python, apache, mod_wsgi, and django. The handbook section on Django talks about mod_python not mod_wsgi and I believe mod_wsgi is the recommended method. I have the following installed on my system already from packages:               apache-2.2.17_1      python26-2.6.6       What do I have to do get django working with apache? Any tutorials?


Running 32 bit app on a 64 bit Linux machine

Are there any performance drawbacks (CPU, Memory or IO) when running a 32-bit application on a 64-bit Linux? My main concern is inefficient utilization of pointers and memory blocks.


How to boot Debian into text mode without using GUI?

How can I boot Debian into text mode? My mouse and keyboard are working in GRUB, but when the login screen appears they don't, so I can't do anything.


Bactrack5 + VMWare + GNOME Fail

When I attempt to run any of the preinstalled GUI apps with `startx` it fails to run and terminates with the output `failed to load module "vmwgfx" (module does not exist, 0)"` Followed by `...xterm...` several times. Sorry I do not have the full output handy to copy and paste here. Apparently the GNOME GUI isn't going to run out-of-the-box here, and a VMWare tools installation is needed. So as I'm waiting on the next image to download, in a lengthy process of trial and error, installation, and VMWare tools patches, **can someone suggest whichconfiguration is most likely to succeed in running `gedit` with the least amount of hassle?** I have a Windows 7 64-bit host running Backtrack 5 RX with VMWare Workstation 9. Is there any reason one of either GNOME or KDE might be more compatible than the other with a VMWare + Backtrack?


Binding a particular IP to a port in apache2

In How to set-up a online SVN server on my laptop I asked to give access to my SVN server installed on my laptop to some of my friends siting in another part of country.I set-up a SVN server.I was able to access it locally but my friend wasn't. So i searched on Google and get to conclusion that i have to bind port 80 to my public IP so that when ever any request come to my public IP , it is redirected to port 80 which in turn is used by process apache2.(This is what i understand after search, kindly correct me if i am wrong.) But when I did port binding following a link I got following error when I restart my apache2 server.               service apache2 restart       * Restarting web server apache2                                                                          [Mon May 20 13:44:25 2013] [warn] NameVirtualHost *:80 has no VirtualHosts     [Mon May 20 13:44:25 2013] [warn] NameVirtualHost *:80 has no VirtualHosts     (99)Cannot assign requested address: make_sock: could not bind to address xyz.pqr.ad.ef:8010     no listening sockets available, shutting down     Unable to open logs     Action 'start' failed.     The Apache error log may have more information.      where xyz.pqr.ad.ef is my public IP and I added one more port 8010. Need help to resolve this error and get my SVN repo online for some specific users.


Accessing multiple wifi networks simultaneously from debian wheezy

I have got 2 wireless adapters on my machine (one built-in and the other a purchased USB wireless adapter) is there a way I can utilize different WiFi networks simultaneously? I have in mind something like having 2 workspaces on gnome3 each connected to a separate network or something similar to that.


Configuring Touchpad/Trackball for X

I have just installed my gentoo with X11/Gnome. It works fine with the USB- Mouse, but neither the touchpad nor the trackpoint works. The docs I found seemed to be outdated and were not mentioning the `/etc/X11/xorg.conf.d`. The laptop I am using is an Lenovo Thinkpad Edge E320. `synaptics` is in the `USE` and the driver is installed.


How to build a long command string?

I've a sequence of commands to be used along with lot of pipings, something like this:               awk '{ if ($8 ~ "isad") {print $2, $5, "SE"} else {print $2, $5, "ANT"} }' "/var/log/apache2/other_vhosts_access.log" | grep -v '127.0.0.1' | tr '[' '\0' | tr [:lower:] [:upper:] | sort -t' ' -s -k3      This basically filters the Apache log and prints three cols of info. First col is IP address, second is time, third is a string. The output could be sorted based on any column so, I need to use '-m' with sort for the time field. Sorting order could also be reversed. I want a string to store the arguments to sort, and let the combined strings get executed. Something like this:               $AWK_CMD | $SORT_CMD $SORT_KEY $SORT_REV      where               SORT_CMD="sort -t' '"     SORT_KEY="-k$1"      # $1 from cmd line arg     SORT_REV="$2"        # Either -r or blank      Am able to build such strings; when I echo it, it looks fine. Problem is, how to execute it? I get some errors like:               awk '{ if ($8 ~ "isad") {print $2, $5, "SE"} else {print $2, $5, "ANT"} }' "/var/log/apache2/other_vhosts_access.log" | grep -v '127.0.0.1' | tr '[' '\0' | tr [:lower:] [:upper:] | sort -t' ' -s -k3     Running ...     awk: '{     awk: ^ invalid char ''' in expression      Please ignore if 'sort' doesn't sort properly, that can be fixed. I wish to know how I can build the final command string in steps. The ways I tried to execute this command in the script is by:               $final_cmd     `$final_cmd`      Edit: The script that I'm trying to use               KEY=$1      # Values {1, 2, 3}     REVERSE=$2  # Values {0, 1}           SORT_CMD="sort -t' ' -s"     SORT_KEY="-k$KEY"     if [[ $KEY -eq 2 ]]     then         SORT_KEY="-m -k2"     fi          if [[ $REVERSE -eq 1 ]]     then         SORT_REV="-r"     else         SORT_REV=     fi          final_cmd="awk '{ if (\$8 ~ \"isad\") {print \$2, \$5, \"SE\"} else {print \$2, \$5, \"ANT\"} }' $LOG_FILE '|' grep -v '127.0.0.1' '|' tr '[' '\0' '|' tr [:lower:] [:upper:] '|' $SORT_CMD $SORT_KEY $SORT_REV"          echo $final_cmd     echo "Running ..."     $final_cmd


Edid information

I want to gather the Edid information of the monitor. I can get it from the `xorg.0.log` file when I run `X` with the `-logverbose` option. But the problem is that If I switch the monitor (unplug the current monitor and then plug-in another monitor), then there is no way to get this information. Is there any way to get the EDID dynamically (at runtime)? Or any utility/tool which will inform me as soon as monitor is connected and disconnected? I am using the LFS-6.4.


7z command line add file to a flat directory 7z file

I would like to compress file "./data/x.txt" to path "./data/x.7z". When running               7z a ./data/x.txt.7z ./data/x.txt      The file "./data/x.txt" holds               data/x.txt      as opposed to just (what I want)               x.txt      However, I would like 7z to ignore the path "./data" directory inside of the x.7z file. To clarify, I would like 7z to flatten the directory structure in the 7z file when adding x.txt. Is this possible?


RPMDB broke after a yum update in fedora 19?

A `sudo yum update` operation got interrupted and after a `yum-complete- transaction` was tried again I got this message: > Transaction check error: file /usr/libexec/sssd/sssd_pac from install of > sssd-ipa-1.11.0-1.fc19.x86_64 conflicts with file from package sssd- > ad-1.11.0-0.2.beta2.fc19.x86_64 Does anyone know how to solve this problem?


Create MySQL database name using variable from date

for the variable               dbnya="echo $(date +%Y%m%d%H%M%S)"      When running below code, I will get an error (SQL syntax error)               mysql -u root -pthepass -e "CREATE DATABASE demo$dbnya CHARACTER SET utf8 COLLATE utf8_bin"      The second command will work if I'm using `dbnya=20120423230524` as first command


For each subfolder, sort files by name and rename them to sequential padded numbers (regardless of extension)

I have the following directory structure:               .     ├── event-a     │   ├── album-a     │   │   ├── a.jpg     │   │   └── x.png     │   └── album-b     │       ├── a.jpg     │       ├── x.png     │       └── y.gif     └── event-b         ├── album-x         │   ├── a.jpg         │   └── x.png         └── album-y             ├── a.jpg             ├── x.png             └── y.gif      For each second-level subfolder (named `album-foo` in the example), I want to sort the files by name and rename them to sequential padded numbers, regardless of their extension. The folders may contain JPG, PNG or GIF images, and any file extensions should be preserved. So, in this case, I’d like to get this result:               .     ├── event-a     │   ├── album-a     │   │   ├── 01.jpg     │   │   └── 02.png     │   └── album-b     │       ├── 01.jpg     │       ├── 02.png     │       └── 03.gif     └── event-b         ├── album-x         │   ├── 01.jpg         │   └── 02.png         └── album-y             ├── 01.jpg             ├── 02.png             └── 03.gif      The `rename` utility may be used if that makes anything easier. The main problem is getting figuring out the number each file should get. Do I need to use a nested `for` loop to iterate over the `event-x` and `album-x` subfolders, then for each inner loop, keep track of the number myself, or is there some clever solution that I’m missing?


VirtualBox: two network interfaces (NAT and host-only ones) in a Debian guest on Ubuntu

I created a Debian VM on VirtualBox with two interfaces: a NAT one (for accessing internet) and a host-only one. However, I do not know how to make both interfaces work at the same time. If I the define the host-only as the adapter 1, I can access my VM from the host but not the internet; if I define the NAT one as adapter 1, I can access the internet but cannot reach my guest Debian. So, how could I make both interfaces work together? **Note** : I am still trying to map some port from my host to the SSH port from my guest SO, so there is no need to suggest me to do it :) **EDIT** : This is the output of `ifconfig` when the first adapter is the **host-only** one:               eth0      Link encap:Ethernet  HWaddr 08:00:27:f6:b2:45                 inet addr:192.168.56.101  Bcast:192.168.56.255  Mask:255.255.255.0               inet6 addr: fe80::a00:27ff:fef6:b245/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:495 errors:0 dropped:0 overruns:0 frame:0               TX packets:206 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:48187 (47.0 KiB)  TX bytes:38222 (37.3 KiB)          lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:8 errors:0 dropped:0 overruns:0 frame:0               TX packets:8 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:560 (560.0 B)  TX bytes:560 (560.0 B)      This is the output of `netstat -nr` when the first adapter is the **host- only** one:               Kernel IP routing table     Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     192.168.56.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0      This is the output of `ifconfig` when the first adapter is the **NAT** one:               eth0      Link encap:Ethernet  HWaddr 08:00:27:f6:b2:45                 inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0               inet6 addr: fe80::a00:27ff:fef6:b245/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:53 errors:0 dropped:0 overruns:0 frame:0               TX packets:59 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:6076 (5.9 KiB)  TX bytes:5526 (5.3 KiB)          lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:16 errors:0 dropped:0 overruns:0 frame:0               TX packets:16 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:1664 (1.6 KiB)  TX bytes:1664 (1.6 KiB)      This is the output of `netstat -nr` when the first adapter is the **NAT** one:               Kernel IP routing table     Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface     10.0.2.0        0.0.0.0         255.255.255.0   U         0 0          0 eth0     0.0.0.0         10.0.2.2        0.0.0.0         UG        0 0          0 eth0


How can I autostart GDM on Fedora 15?

I am trying to load Compiz on my _Fedora 15_ desktop. When I finished installing the compiz packages, I restarted. However, it started in text terminal mode and the gui didn't load automatically. I executed following commands externally to load my gui (in root mode):               cd /etc/dconf/db     exec gdm      Though that is working perfectly, I want to load the GUI automatically.


Can't boot truecrypt's rescue.iso on usb using UNetBootin

I tried Unetbootin to put the `truecrypt rescue.iso` file on a USB stick, but the USB stick does not boot properly. It gets into an infinite loop with boot default in 10 seconds over and over again. The default setting is: `/ubnkern initrd=/ubninit`.


Why does the adduser command behave surprisingly?

I see various examples of how to add a user on Ubuntu server I have Ubuntu 10.04.2 LTS I was logged in as root and, when running `adduser`, my SSH command line asked me for both a 'new password' AND then a 'new UNIX password'. I was not quite sure what the difference is and wondering why it ask for two types of password. Why does the `adduser` command behave surprisingly and how do I go about investigating how and why it veers from the default Ubuntu behaviour?               --------     # adduser joe     Adding user `joe' ...     Adding new group `joe' (1007) ...     Adding new user `joe' (1003) with group `joe' ...     Creating home directory `/home/joe' ...     Copying files from `/etc/skel' ...     Enter new password:     Retype new password:     Enter new UNIX password:     ------      **Update:** Since gaining a better understanding of the issue from feedback from mattdm and AlexD, I have modified this question from its original form which was: "What's the difference between 'new UNIX password' and 'new password' on linux, when adding new user?"


How to change login screen size, Linux Mint

So I have been using linux mint for a little bit now. One thing that really bugs me is that the login screen size is always really small. I have used `xrandr --output VGA1 --primary 1600x900` to set to to the right size until the next reboot but is there a better way?


How to start a graphical session in Backtrack Linux

I just started looking at backtrack(i'm on a linux testing streak) and when I start it up I don't see a desktop. Help?


Remove oldest folders + files (50GB) from a folder when share/HD reaches 95% full capacity

I have a big share (~5TB) that is getting full. Now I want to make a script that deletes data from 2 specified folders. But this need to be the oldest files/folders and it need to stop when ~50GB has been removed, so it won't delete all folders. **Edit:** This need to work with Samba shares for my Synology DS-409. The script need to run on the Synology in /etc/crontab. Somewhere else they gave me this code:                   #!/opt/bin/bash     dir=/data/video     min_dirs=3     full=60     logfile=/var/tmp/removed.log          df=`df | grep data | awk '{print $5}' | sed s/%//g`     if [ $df -gt $full ]; then        [[ $(find "$dir" -type d | wc -l) -ge $min_dirs ]] &&        IFS= read -r -d $'\0' line < <(find "$dir" -printf '%T@ %p\0' 2>/dev/null | sort -z -n)        file="${line#* }"        ls -lLd "$file"        #rm -rf "$file"        date=`date`        if [ -f "$file" ]; then           echo "$date $file could not be removed!" >> $logfile        else           echo "$date $file removed" >> $logfile        fi        fi


Cannot connect to my Virtual Box Ubuntu system

I have a VirtualBox running an Ubuntu OS. I'd like to access this Ubuntu machine using `ssh` or `telnet`. In order to do that I've performed the following steps:   1. `sudo apt-get install telnetd`   2. `sudo /etc/init.d/openbsd-inetd restart` Then I tried to access this system using telnet from another machine but unfortunately the connection become timed out:               # telnet 10.125.31.176     Trying 10.125.31.176...     telnet: connect to address 10.125.31.176: Connection timed out     telnet: Unable to connect to remote host: Connection timed out      **Also I'd like to mention that I could easily ping this machine (both ways)** :               # ping 10.125.31.176     PING 10.125.31.176 (10.125.31.176) 56(84) bytes of data.     64 bytes from 10.125.31.176: icmp_seq=1 ttl=57 time=2.34 ms     64 bytes from 10.125.31.176: icmp_seq=2 ttl=57 time=1.81 ms      **EDIT** : I have also performed the open ports scan and it seems ok:               $ sudo nmap -p 20-2550 localhost           Starting Nmap 5.00 ( http://nmap.org ) at 2012-06-11 15:31 IDT     Warning: Hostname localhost resolves to 2 IPs. Using 127.0.0.1.     Interesting ports on localhost (127.0.0.1):     Not shown: 2526 closed ports     PORT    STATE SERVICE     22/tcp  open  ssh     23/tcp  open  telnet     25/tcp  open  smtp     587/tcp open  submission     631/tcp open  ipp          Nmap done: 1 IP address (1 host up) scanned in 1.54 seconds      **EDIT2** : _ifconfig from the VirtualBox Ubuntu_ :               eth0      Link encap:Ethernet  HWaddr 08:00:27:0d:43:7d                 inet addr:10.125.31.176  Bcast:10.125.31.255  Mask:255.255.255.0               inet6 addr: fe80::a00:27ff:fe0d:437d/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:9247631 errors:0 dropped:0 overruns:0 frame:0               TX packets:10147 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:3145994247 (3.1 GB)  TX bytes:727714 (727.7 KB)          lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:30446 errors:0 dropped:0 overruns:0 frame:0               TX packets:30446 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:1280714 (1.2 MB)  TX bytes:1280714 (1.2 MB)      _Windows IP Configuration_               Ethernet adapter Local Area Connection:              Connection-specific DNS Suffix  . : xxx.com         IP Address. . . . . . . . . . . . : 10.125.31.170         Subnet Mask . . . . . . . . . . . : 255.255.255.0         Default Gateway . . . . . . . . . : 10.125.31.1          Ethernet adapter VirtualBox Host-Only Network:              Connection-specific DNS Suffix  . :         IP Address. . . . . . . . . . . . : 192.168.56.1         Subnet Mask . . . . . . . . . . . : 255.255.255.0         Default Gateway . . . . . . . . . :      Any ideas?


Trouble migrating from Yum to apt-get

I recently migrated from using Fedora to Debian. And I'm having some issues with the package manager. I used to be able to search for packages via yum using : `yum search <part_of_package_name_or_description>` Also while installing simple software such as VLC media player. I get the following when I try to run: `sudo apt-get install vlc`               Some packages could not be installed. This may mean that you have     requested an impossible situation or if you are using the unstable     distribution that some required packages have not yet been created     or been moved out of Incoming.     The following information may help to resolve the situation:          The following packages have unmet dependencies:      vlc : Depends: fonts-freefont-ttf but it is not installable            Depends: vlc-nox (= 1:2.0.3-dmo1) but it is not going to be installed            Depends: libavcodec54 (>= 7:0.11.1) but it is not going to be installed            Depends: libavutil51 (>= 7:0.11.1) but it is not going to be installed            Depends: libqtcore4 (>= 4:4.8.0) but it is not going to be installed            Depends: libqtgui4 (>= 4:4.7.0~beta1) but it is not going to be installed            Depends: libstdc++6 (>= 4.6) but 4.4.5-8 is to be installed            Depends: libtar0 but it is not installable            Depends: libva-x11-1 (> 1.0.15~) but it is not going to be installed            Depends: libva1 (> 1.0.15~) but it is not going to be installed            Depends: libxcb-keysyms1 (>= 0.3.9) but it is not going to be installed            Recommends: vlc-plugin-notify (= 1:2.0.3-dmo1) but it is not going to be installed            Recommends: vlc-plugin-pulse (= 1:2.0.3-dmo1) but it is not going to be installed     E: Broken packages           Can someone tell me what I should do to search for packages via command line like yum search? And do I **_really_** have to install the dependencies manully in debian? Or am I missing something here? (Incorrect/incompatible repos perhaps?) I know I sound like a n00b but I don't see any aparent reason why apt-get isn't installing the dependencies on it's own. * * * /etc/apt/sources.list               deb http://http.us.debian.org/debian/ squeeze contrib non-free main     deb-src http://http.us.debian.org/debian/ squeeze main          deb http://security.debian.org/ squeeze/updates main     deb-src http://http.us.debian.org/debian/ squeeze/updates main          # squeeze-updates, previously known as 'volatile'     deb http://mirror.cse.iitk.ac.in/debian/ squeeze-updates main     deb-src http://mirror.cse.iitk.ac.in/debian/ squeeze-updates main     deb http://www.deb-multimedia.org squeeze main non-free     deb http://packages.dotdeb.org squeeze all     deb-src http://packages.dotdeb.org squeeze all     deb ftp://ftp.deb-multimedia.org squeeze main non-free     deb http://www.deb-multimedia.org wheezy main non-free     deb http://www.deb-multimedia.org sid main non-free     deb http://www.deb-multimedia.org squeeze main non-free     # deb http://www.deb-multimedia.org squeeze-backports main     # deb http://www.deb-multimedia.org experimental main           * * * Basic Install requirements right now are   * Firefox (not the IceWeasel derivative)   * VLC   * Gnome3 Desktop environment.   * Improving visuals/graphic display quality. (Gnome 3 should help with that too right?) * * * I migrated from Fedora to Debian simply because Fedora's repositories were causing trouble (outdated software etc.) But if Debian is going to be this challenging throughtout I might as well give up. :(


What is resume= used for in my grub boot settings?

I've always noticed the `resume=/dev/foo` entry in /boot/grub/menu.lst, and that it corresponds to the swap partition, but I've never questioned its use.               title SUSE Linux Enterprise Server 11 SP2 - 3.0.13-0.27 (default)         root (hd0,0)         kernel /boot/vmlinuz-3.0.13-0.27-default root=/dev/sda1 insmod=qla4xxx resume=/dev/sda2 crashkernel=256M-:128M showopts         initrd /boot/initrd-3.0.13-0.27-default      I was rebooting a server this morning and saw a boot message stating `Starting manual resume from disk`. Sounds like some sort of hibernate. So what exactly is resume? I'm trying to Google it, but all I'm seeing is resumes/CVs for Linux Admins :).


Strange behavior automating with "make -f"

I have a set of directories, some of which contain makefiles, and some of the makefiles have `clean` targets. In the parent directory, I have a simple script:               #!/bin/bash          for f in *; do             if [[ -d $f && -f $f/makefile ]]; then                     echo "Making clean in $f..."                     make -f $f/makefile clean             fi     done      This does a weird thing when it hits a directory with a makefile without a (defined) "clean" target. For example, given two directories, `one` and `two`, containing; **one/makefile**               clean:             -rm *.x      **two/makefile**               clean:      In the second case "clean" is present without directives, so if you ran "make clean" in `two` you'd get:               make: Nothing to be done for `clean'.      Versus if there were no "clean":               make: *** No rule to make target `clean'.  Stop.      However, for the problem I'm about to describe, the result is the same whether the target is present but undefined or just not present. Running `clean.sh` from the parent directory;               Making clean in one...     rm *.x     rm: cannot remove `*.x': No such file or directory     make: [clean] Error 1 (ignored)      So `one` did not need cleaning. No big deal, this is as expected. But then:               Making clean in two...     cat clean.sh >clean      chmod a+x clean      Why the `cat clean.sh>clean` etc.? Note I did create a minimal example exactly as shown above -- there are no other files or directories around (just clean.sh, directories one & two, and the very minimal makefiles). But after clean.sh runs, `make` has copied `clean.sh > clean` and made it executable. If I then run clean.sh again:               Making clean in one...     make: `clean' is up to date.     Making clean in two...     make: `clean' is up to date.     Press any key to continue...      Something even weirder, because now it is not using the specified makefiles at all -- it's using some "up to date" mystery target. I've noticed a perhaps related phenomenon: if remove one of the test clauses in clean.sh like this:               #       if [[ -d $f && -f $f/makefile ]]; then             if [[ -d $f ]]; then      And create a directory `three` with no makefile, part of the output includes:               Making clean in three...     make: three/makefile: No such file or directory     make: *** No rule to make target `three/makefile'.  Stop.      That there is no such file or directory I understand, but why does `make` then go on to look for a target with that name? The man page seems pretty straightforward: > -f file, --file=file, --makefile=FILE >   >   >       Use file as a makefile. >


Cloning a bootable USB stick to a different-sized stick

HARDWARE: 2 8GB USB flash drives   DISTRO: Mint 9 Xfce persistent Live Cd One USB flash drive has two partitions:   1) FAT32 700MB Mint 9 partition   2) ext3 7.3GB `casper-rw` partition GOAL:   I want to make a duplicate of that USB flash drive because I don't want to go through the time of installing and configuring from scratch again. EXPERIENCE:   1) I have found that `dd` does not work for this job because if one of my flash drives is even 1MB different in size, which sometimes they are, then the copy gets corrupted. 2) I have found that using `gparted` and preformatting the second drive like the first and then `rsync`'ing each partition individually does not work because for some reason some files do not get copied and the drive remains unbootable. I want to keep my working stick and just make copies of it and configure the sticks for my friends. This way if I goof up another stick I will always have my base stick just sitting around waiting.


_path_files and compadd ignore-files parameter

What is the format for the -F option of `_path_files` and `compadd`? I'm passing several directories to `_path_files`:               _path_files -W "($base_directories)" -/      But some of those directory trees I don't want to complete for this particular command. The documentation I can find for `_path_files` says it accepts a `-F` option-- just like `compadd`, but I can't find the format to pass them in. Twiddling around hasn't been very fruitful either. I've tried, for example,               _path_files -W "($base_directories)" -/ -F shared; # shared still shows up     _path_files -W "($base_directories)" -/ -F "(shared)"; # barfs on that guy