title: How do I set my samba share to allow guest users to view all folders and sub folders, including new and old

text: I currently have a samba share set up on RHEL, that allows any user to write to the root folder. I'm unable to write to the sub folders/files. I have run:               chcon -R -t samba_share_t /path/to/samba/share      This allowed me to write to the "share" folder, but to none of the sub folders (apparently the -R flag didn't work?). My desired outcome is this:   1. Anyone who accesses the samba share to be able to write to all folders/files.    2. If there are any new files/folders I create in my samba share directory, guests are by default able to right in/read from the new files/folders.  So if the answer involves me having to go in and change the permission to each new folder/file, then that doesn't work for me. Here is my `/etc/samba/smb.conf`               [global]          workgroup = MYGROUP     server string = Samba Server Version %v          log file = /var/log/samba/log.%m     max log size = 50          security = share     passdb backend = tdbsam     guest account = nobody          =====Share Definitions====      [homes]               comment = Home Directories              browseable = no              writable = yes          [folder1]          comment = My first folder          browseable = yes          writable = yes          guest ok = yes          path = /my/path/          wins support = yes


title: What's the best way to determine the working directory for UNIX process using 'ps'?

text: I am running a Ruby command line script (`rufus.sh`)which ultimately calls `Thread.new`, which spawns a UNIX process as shown below. I run this script for more than 1 directory as the output of the `ps` command shows below. The last (right most) column below is `COMMAND` (`COMD`) which is essentially the name of the process. The problem is that `COMMAND` doesn't include the working directory (the current directory when the process was launched). What is the best way to figure that out or include it in `COMMAND`? Thanks, Chirag               ps -ef | grep runner     web       7532     1  0 Oct08 ?        00:02:08 /usr/local/bin/ruby ./script/runner ./config/jobs/control.rb critical_alert start     web      21114     1  1 Oct09 ?        02:49:28 /usr/local/bin/ruby ./script/runner ./config/jobs/control.rb task start     web      19028     1  1 10:45 pts/0    00:00:34 /usr/local/bin/ruby ./script/runner ./config/jobs/control.rb task start     web      19029     1  0 10:45 pts/0    00:00:10 /usr/local/bin/ruby ./script/runner ./config/jobs/control.rb critical_alert start


title: bash not reading $TERMINFO on login (over SSH)

text: I have a OpenVZ Fedora 20 VPS that when I SSH into, my termcap file stored in `$XDG_DATA_HOME/terminfo/x/xterm-termite`, isn't being read, despite having `TERMINFO=$XDG_DATA_HOME/terminfo` set. If I execute a subshell bash it works fine. Or if I add `exec bash` to the end of my `.profile` it works fine. I saw this question and suspected it could be the same thing. But I'm logging in with the `/usr/bin` version bash already anyway               $ echo $BASH     /usr/bin/bash     $ which bash     /usr/bin/bash      I also tried Ubuntu 13.10 on the VPS and saw the same problem. Patrick's question did get me thinking though, I know the underlying OS of the VPS is REHL. Could that somehow be affecting it? * * * I source a file called `environment` in my `.profile`, which sets the `$TERMINFO` environment variable if the `terminfo` directory exists in `XDG_DATA_HOME`.               $ echo $TERMINFO     /home/evan/.local/share/terminfo     $ echo $XDG_DATA_HOME     /home/evan/.local/share     $ find $TERMINFO     /home/evan/.local/share/terminfo     /home/evan/.local/share/terminfo/x     /home/evan/.local/share/terminfo/x/xterm-termite     $ echo $TERM     xterm-termite      This works fine on my Linode VPS.


title: Restrict standard users to run a command with a specific argument

text: I know how to restrict standard users to run a command by removing execute permissions for that command. But it's possible restrict standard users to run a command with a specific option/argument? For example a standard user should be able to run the following command:               ls      but not:               ls -l      I think that this can be possible since there are some commands like `chsh` or `passwd` which a standard user can run them, but he get permission denied when he runs `chsh root` or `passwd -a -S`.


title: KVM Desktop Client cannot connect to www server

text: I have a KVM test set up on a workstation. All the instances are using macvtap and a bridge. I can access the web server running on the KVM from a physically separate machine by IP address or DNS but can't from either other instances or from the KVM host? I can ping the server, it pings out. The IP's are assigned via the dhcp server on a 3rd machine, all machines physical and virtual are on same subnet. I've have a `tcpdump` but having trouble making sense of it. workstation is the KVM host www and desktop2 are KVM guests. Details on pastebin


title: how to return to underlying script from tail -f

text: I have a `ksh` script, in which I use `tail -f` to view a log file. How can I terminate the `tail` process, and continue executing the underlying script? I am running it on AIX 7.1.   \---------------------------------------------edit-----------------------------------   according to Gilles's answer, I tried this in my script:               trap 'echo "tail process terminated!"' 2     tail -f mylog.log     trap - 2      Now after tail command get executed, then I press CTRL+C, the tail process was killed, and my script continue to run. But the new problem is , when I press CTRL+C again, my script will not exit. Any one can help ?


title: SSH remote backup script

text: I am trying to backup a remote server to my machine. I am trying something like               ssh user@ip "dd if=/dev/sda" | dd of=~/backup.img      But that obviously doesn't work. Other variants that don't work.   * `ssh user@ip "sudo dd if=/dev/sda" | dd of=~/backup.img`   * `ssh user@ip -t "sudo dd if=/dev/sda" | dd of=~/backup.img` I have public key authentication set up. Note that even after compression, the remote machine can not hold its own backup. What do I do? (Note in the long run I want to try and put this in an automatic script, but I just want a backup for now.) Note: I should mention that I don't want to just back up the files (like with rsync) but to have a complete image that I can just drop on a new hard-drive should this one go belly up with little hassle.


title: Requesting user input while reading file line by line

text: For class I need to write a Bash script that will take the output from `ispell` and when I try and request user input inside the while loop it just saves the next line of the file as the user input. How could I go about requesting user input in the while loop?               #!/bin/bash     #Returns the misspelled words     #ispell -l < file          #define vars     ISPELL_OUTPUT_FILE="output.tmp";     INPUT_FILE=$1               ispell -l < $INPUT_FILE > $ISPELL_OUTPUT_FILE;          #echo a new line for give space between command     #and the output generated     echo "";          while read line;     do        echo "'$line' is misspelled. Press "Enter" to keep";        read -p "this spelling, or type a correction here: " USER_INPUT;             if [ $USER_INPUT != "" ]        then           echo "INPUT: $USER_INPUT";        fi                  echo ""; #echo a new line     done < $ISPELL_OUTPUT_FILE;          rm $ISPELL_OUTPUT_FILE;


title: Problems with booting with Kubuntu 13.04 / Windows 7 Dual boot

text: So I've had Kubuntu running on my Lenovo laptop as the only operating system for most of the summer. Earlier this week, I decided to shrink the home partition in order to add a Windows 7 partition. After installing Windows 7, I was then stuck where I could boot into Windows 7, but could not boot into Kubuntu. I ended up using a Kubuntu live USB in order to use the boot-repair tool, which let me regain access to GRUB, which now correctly lists Kubuntu and Windows 7 as the bootable operating systems, but it crashes any time I try to boot into windows. It is able to successfully boot into Kubuntu. I ran the windows startup repair tool several times without success, as well as re-running the boot repair tool. Below is a link to the boot repair summary from the most recent attempt at boot-repair. http://paste.ubuntu.com/6146103/ Any suggestions as to how I could fix this without just wiping the drives and starting over?


title: QEMU for ARM programs with GDB

text: I want to emulate an ARM processor for running the assembly programs using QEMU in RHEL. I have installed QEMU but I still have problems in running the assembly program. I got the assembly program, memory map and the makefile from this link. However, if I run the below command,               qemu-system-arm -S -s -M versatilepb -daemonize -m 128M -d in_asm,cpu,exec -kernel hello_world.bin ; gdb-multiarch --batch --command=hello_world.gdb      I get an error as "hello_world.bin - No such file or directory". I am not sure what is to be done to run the above command. So, I got an ARM image from this link. Instead of hello_world.bin, if I specify the kernel name as " **zImage.Integrator** ", I am getting a QEMU console window. However, I am not able to type or do anything in that window. Can someone please let me know how to run an assembly program using QEMU for ARM?


title: httpd cant write to folder/file because of selinux

text: Does anyone know which sebool it is to allow httpd write access to /home/user/html? When I disable selinux `echo 0 > /selinux/enforce` I can write, so definitely selinux. Just don't know which one is the right one without opening a big hole and Google isn't being much help.               #[/home]ls -Z     drwxr-x---. user       apache     unconfined_u:object_r:user_home_dir_t:s0 user          #sestatus -b     Policy booleans:     abrt_anon_write                             off     abrt_handle_event                           off     allow_console_login                         on     allow_cvs_read_shadow                       off     allow_daemons_dump_core                     on     allow_daemons_use_tcp_wrapper               off     allow_daemons_use_tty                       on     allow_domain_fd_use                         on     allow_execheap                              off     allow_execmem                               on     allow_execmod                               on     allow_execstack                             on     allow_ftpd_anon_write                       off     allow_ftpd_full_access                      off     allow_ftpd_use_cifs                         off     allow_ftpd_use_nfs                          off     allow_gssd_read_tmp                         on     allow_guest_exec_content                    off     allow_httpd_anon_write                      off     allow_httpd_mod_auth_ntlm_winbind           off     allow_httpd_mod_auth_pam                    off     allow_httpd_sys_script_anon_write           off     allow_java_execstack                        off     allow_kerberos                              on     allow_mount_anyfile                         on     allow_mplayer_execstack                     off     allow_nsplugin_execmem                      on     allow_polyinstantiation                     off     allow_postfix_local_write_mail_spool        on     allow_ptrace                                off     allow_rsync_anon_write                      off     allow_saslauthd_read_shadow                 off     allow_smbd_anon_write                       off     allow_ssh_keysign                           off     allow_staff_exec_content                    on     allow_sysadm_exec_content                   on     allow_unconfined_nsplugin_transition        off     allow_user_exec_content                     on     allow_user_mysql_connect                    off     allow_user_postgresql_connect               off     allow_write_xshm                            off     allow_xguest_exec_content                   off     allow_xserver_execmem                       off     allow_ypbind                                off     allow_zebra_write_config                    on     authlogin_radius                            off     cdrecord_read_content                       off     clamd_use_jit                               off     cobbler_anon_write                          off     cobbler_can_network_connect                 off     cobbler_use_cifs                            off     cobbler_use_nfs                             off     condor_domain_can_network_connect           off     cron_can_relabel                            off     dhcpc_exec_iptables                         off     domain_kernel_load_modules                  off     exim_can_connect_db                         off     exim_manage_user_files                      off     exim_read_user_files                        off     fcron_crond                                 off     fenced_can_network_connect                  off     fenced_can_ssh                              off     ftp_home_dir                                on     ftpd_connect_db                             off     ftpd_use_passive_mode                       off     git_cgit_read_gitosis_content               off     git_session_bind_all_unreserved_ports       off     git_system_enable_homedirs                  off     git_system_use_cifs                         off     git_system_use_nfs                          off     global_ssp                                  off     gpg_agent_env_file                          off     gpg_web_anon_write                          off     httpd_builtin_scripting                     on     httpd_can_check_spam                        off     httpd_can_network_connect                   off     httpd_can_network_connect_cobbler           off     httpd_can_network_connect_db                on     httpd_can_network_memcache                  off     httpd_can_network_relay                     off     httpd_can_sendmail                          on     httpd_dbus_avahi                            on     httpd_enable_cgi                            on     httpd_enable_ftp_server                     off     httpd_enable_homedirs                       on     httpd_execmem                               off     httpd_manage_ipa                            off     httpd_read_user_content                     off     httpd_setrlimit                             off     httpd_ssi_exec                              off     httpd_tmp_exec                              off     httpd_tty_comm                              on     httpd_unified                               on     httpd_use_cifs                              off     httpd_use_gpg                               off     httpd_use_nfs                               off     httpd_use_openstack                         off     icecast_connect_any                         off     init_upstart                                on     irssi_use_full_network                      off     logging_syslogd_can_sendmail                off     mmap_low_allowed                            off     mozilla_read_content                        off     mysql_connect_any                           off     named_write_master_zones                    off     ncftool_read_user_content                   off     nscd_use_shm                                on     nsplugin_can_network                        on     openvpn_enable_homedirs                     on     piranha_lvs_can_network_connect             off     pppd_can_insmod                             off     pppd_for_user                               off     privoxy_connect_any                         on     puppet_manage_all_files                     off     puppetmaster_use_db                         off     qemu_full_network                           on     qemu_use_cifs                               on     qemu_use_comm                               off     qemu_use_nfs                                on     qemu_use_usb                                on     racoon_read_shadow                          off     rgmanager_can_network_connect               off     rsync_client                                off     rsync_export_all_ro                         off     rsync_use_cifs                              off     rsync_use_nfs                               off     samba_create_home_dirs                      off     samba_domain_controller                     off     samba_enable_home_dirs                      off     samba_export_all_ro                         off     samba_export_all_rw                         off     samba_run_unconfined                        off     samba_share_fusefs                          off     samba_share_nfs                             off     sanlock_use_nfs                             off     sanlock_use_samba                           off     secure_mode                                 off     secure_mode_insmod                          off     secure_mode_policyload                      off     sepgsql_enable_users_ddl                    on     sepgsql_unconfined_dbadm                    on     sge_domain_can_network_connect              off     sge_use_nfs                                 off     smartmon_3ware                              off     spamassassin_can_network                    off     spamd_enable_home_dirs                      on     squid_connect_any                           on     squid_use_tproxy                            off     ssh_chroot_rw_homedirs                      off     ssh_sysadm_login                            off     telepathy_tcp_connect_generic_network_ports off     tftp_anon_write                             off     tor_bind_all_unreserved_ports               off     unconfined_login                            on     unconfined_mmap_zero_ignore                 off     unconfined_mozilla_plugin_transition        off     use_fusefs_home_dirs                        off     use_lpd_server                              off     use_nfs_home_dirs                           on     use_samba_home_dirs                         off     user_direct_dri                             on     user_direct_mouse                           off     user_ping                                   on     user_rw_noexattrfile                        on     user_setrlimit                              on     user_tcp_server                             off     user_ttyfile_stat                           off     varnishd_connect_any                        off     vbetool_mmap_zero_ignore                    off     virt_use_comm                               off     virt_use_fusefs                             off     virt_use_nfs                                off     virt_use_samba                              off     virt_use_sanlock                            off     virt_use_sysfs                              on     virt_use_usb                                on     virt_use_xserver                            off     webadm_manage_user_files                    off     webadm_read_user_files                      off     wine_mmap_zero_ignore                       off     xdm_exec_bootloader                         off     xdm_sysadm_login                            off     xen_use_nfs                                 off     xguest_connect_network                      on     xguest_mount_media                          on     xguest_use_bluetooth                        on     xserver_object_manager                      off


title: What is linux peth* and virbr* network interface?

text: Usually when execute `ifconfig` I got the "usual" network interfaces: **wlan0** , **eth0** and **lo**. Those, I suppose to be my PC's wireless adaptor, ethernet adaptor and localhost. I'm using a remote server that has the following interfaces:   * eth0   * eth1   * lo   * peth0   * peth1   * virbr0 What those peth* and virbr mean?


title: Which of HIDS can do this?

text: I'm currently in choosing of HIDS ( Host-based intrusion detection system ). I'm discovery etckeeper on my ubuntu. My question is: Which of HIDS can trace each file on the filesystem? E.g. keep some database of all files on every partition /dev/sda1 (root), etc... with:   1. file path from root   2. modify timestamp   3. file size   4. crc32   5. md5sum   6. sha256sum If file was deleted, keep record until defined period is end. e.g. 30 days. Pretty web interface like e.g. **gitweb**. And monitor disk in background with super low priority, but forever. e.g.               $ iostat -x -d sda sdb 1     Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util     sda               4.54    69.66   28.62   57.08   408.09  1105.88    35.33     5.33   62.24   27.50   79.66   3.07  26.34     sdb               2.56     3.01  120.08    9.62  8776.63  1711.23   161.73     5.21   40.16   32.23  139.01   3.63  47.14      Show **%util** \- 26.34% and 47.14% for sda and sdb. Until disk util more than defined user limit, e.g. 10%, **Host-IDS** will sleep. To prevent what tiger and tripwire does with **_disk load average_**. My request is about not a system files integrity checking, but all of files. Every todays HIDS looks only to specific part of filesystem, /bin/ /sbin/ /usr/bin/. It doesn't look at temporary directory, doesn't try to trace user's home directory. But it is easy to develop Host-IDS, that would monitor every bit on the disk, silently from user, in deep background. Is there something already?


title: RHEL server Booting problem: "fsck.ext3: unable to resolve 'LABEL=/u01'

text: We had an old Linux server in the workplace for last few years, so I decided to turn it on and it's showing this problem during boot up:               No devices found     Setting up Logical Volume Management.                      [  OK  ]     Checking filesystems     /:         clean,  60514 /  5124480 files, 1177926 /  5120710 blocks     /tmp:      clean,     57 /   524288 files,   25421 /   524112 blocks     /var:      clean,   1477 /   524288 files,   57606 /   524112 blocks     /usr:      clean, 184343 /  1312000 files, 1300834 /  1311297 blocks     /archive:  clean,     24 /  8960896 files,  415210 /  8960253 blocks0     /backup:   clean,     17 / 12812288 files,  478934 / 12799788 blocks     fsck.ext3: Unable to resolve `LABEL=/u01`     /boot1:    clean,     33 /   128520 files,   32789 /   514048 blocks                                                                [FAILED]          *** An error occurred during the file system check.     *** Dropping you to a shell; the system will reboot     *** when you leave the shell.     Give root password for maintenance     (or type Control-D to continue): EDAC MC0: UE row 0, channel-a= 0 channel-b= 1     labels "-" (Branch=0 DRAM-Bank=0 RDWR=Read RAS=4812 CAS=0 FATAL Err=0x4      (>Tmid) Thermal event with intelligent throttling disabled))      I tried to use `fsck` to check for errors, but I still cannot boot into the OS. Why is that? After using `fsck -a` it's showing `fsck.ext3:Unable to resolve 'LABLE=/u01'`. Output of `cat /etc/fstab`:               LABEL=/              /              ext3      defaults          1 1     LABEL=/tmp           /tmp           ext3      defaults          1 2     LABEL=/var           /var           ext3      defaults          1 2     LABEL=/usr           /usr           ext3      defaults          1 2     LABEL=/archive       /archive       ext3      defaults          1 2     LABEL=/backup        /backup        ext3      defaults          1 2     LABEL=/u01           /u01           ext3      defaults          1 2     LABEL=/boot1         /boot          ext3      defaults          1 2     tmpfs                /dev/shm       tmpfs     defaults          0 0     devpts               /dev/pts       devpts    gid=5,mode=620    0 0     sysfs                /sys           sysfs     defaults          0 0     proc                 /proc          proc      defaults          0 0     LABEL=SWAP-sda6      swap           swap      defaults          0 0


title: Check multiple files with string

text: i.e. for each .csv file, do the following:   * Check if the file contains the string “HEADER” in the first line. If its missing, do the following:     1. Display, “ERROR: Missing HEADER record for ”     2. Rename the file from .csv to .head     3. Proceed to process the next file


title: Bash tabcomplete file names for environmental variable values

text: After I upgraded my Ubuntu from 12.04 to 14.04, bash would no longer let me tabcomplete file names when setting the value of an environmental variable, e.g.               FILE=/home/_      `_` is where I would press `TAB`. How can I get tabcompleting of filenames in env variables back? My bash version is 4.3.11.


title: Email using shell script

text: Is there a possibility to add multiple e-mails to a single variable so that when the shell script is run, it sends a mail to all the specified emails?


title: Can the string "abcedf" be matched to string "bafcde" in a single line command?

text: I am planning to implement an indexing structure in my program. For example, if I have _100 rows_ in the table, I will number these rows from 1 to 100 in another column by appending an `_` to the end of the number.(`1_,2_,3_ etc` so that each number can be identified uniquely). After processing the rows, I am storing the output into a file. For example, I insert the line `1_,2_,4_,5_` into a file. if I get a value as `5_,2_,1_,4_` or `2_,5_,1_,4_`, I should not insert those values. An implementation that comes to my mind is, to sort the numbers and then compare them. However, if the total rows becomes 100,000 it won't be a good solution. Is it possible as a single line command in `perl` script or `awk` or `sed`? **EDIT** : To be more precise and short, for a set of unique and distinct values, how can I find all the combinations without repetitions? **Example** : If I have 3 unique keys `1,2 and 3`, how can I find all combinations without the same combination repeated twice? So for the above example, we can find a combination as,               123      Now, when I search for `213` or `321` it should give me a match as I already have the combination `123` obtained.


title: How do i run a process in a specific directory?

text: In an init.d file i wrote the below. Now i need to make the bin run in a specific directory. How do i tell it which directory to use?               mono --debug /path/bin &


title: bash: /dev/stderr: Permission denied

text: After upgrading to a new release version, my `bash` scripts start spitting errors:               bash: /dev/stderr: Permission denied      in previous versions Bash would _internally recognize_ those file names (which is why this question is not a duplicate of this one) and _do the right thing (tm)_ , however, this has stopped working now. What can I do to be able to run my scripts again successfully? I have tried adding the user running the script to the group `tty`, but this makes no difference (even after logging out and back in). I can reproduce this on the command line without problem:               $ echo test > /dev/stdout     bash: /dev/stdout: Permission denied     $ echo test > /dev/stderr     bash: /dev/stderr: Permission denied     $ ls -l /dev/stdout /dev/stderr     lrwxrwxrwx 1 root root 15 May 13 02:04 /dev/stderr -> /proc/self/fd/2     lrwxrwxrwx 1 root root 15 May 13 02:04 /dev/stdout -> /proc/self/fd/1     $ ls -lL /dev/stdout /dev/stderr     crw--w---- 1 username tty 136, 1 May 13 05:01 /dev/stderr     crw--w---- 1 username tty 136, 1 May 13 05:01 /dev/stdout     $ echo $BASH_VERSION     4.2.24(1)-release      On an older system (Ubuntu 10.04):               $ echo $BASH_VERSION     4.1.5(1)-release


title: Is there a way to tell logrotate to ignore open files?

text: I've searched a bit and can't find anything. I don't want `logrotate`to touch files that are currently open. I was thinking of doing something with `lsof` but I didn't see a way to get any of the scripts to abort an operation. Any ideas?


title: Install CUDA 6.0 on Debian 7 via package manager

text: I am following the official installation guide for Ubuntu. I first installed the cuda-repo package (`cuda-repo-ubuntu1304_6.0-37_amd64.deb`), which adds the NVIDIA repository to `apt`. Then it gives when installing that:               $ uname -a     Linux debian 3.14-1-amd64 #1 SMP Debian 3.14.10-1 (2014-07-07) x86_64 GNU/Linux          $ dpkg -i cuda-repo-ubuntu1304_6.0-37_amd64.deb     $ aptitude update     $ aptitude install cuda          The following packages have unmet dependencies:      nvidia-settings : Depends: screen-resolution-extra (>= 0.12) which is a virtual package.      nvidia-331 : Depends: xorg-video-abi-11 which is a virtual package. or                            xorg-video-abi-12 which is a virtual package. or                            xorg-video-abi-13 which is a virtual package. or                            xorg-video-abi-14 which is a virtual package.      I cannot find any package named `screen-resolution-extra` via `aptitude search`. And there is only a `xorg-video-abi-15` in the repository which cannot be installed. How can I solve this if I want to install CUDA via package manager?


title: Does the kernel have a main() function?

text: I am learning device drivers and Kernel programming. According to Jonathan Corbet's book, there is no `main()` function in device drivers. So I two questions:   * Why don't we need a `main()` function in device drivers?   * Does the kernel itself have a `main()` function? Can someone explain this to me?


title: Transfer a TCP connection from one Linux box to another behind NAT?

text: While experiencing an extremely slow download rate on one of my HTTP connections, I thought it'd be nice if I could just transfer the connection from my PC to an energy-saving home server that shares the same external IP address. The way I imagine it, I'd like to run a command that would take over the connection from a specific IP and a port, letting me pipe all incoming data that flows through it to a file without letting the original owner of the connection to close it. Are there already any tools for that?


title: Installation from USB fails

text: I have a pretty old **Ubuntu 8.04** machine. The machine doesn't have a **DVD reader/writer** in it. **Challenge** : Now, the challenge I am facing is to install RHEL6 in this machine. _Obstacle 1_ : I needed to make a boot image from **USB disk** so that I can use it to install the **RHEL6** in this machine. I was able to overcome the _obstacle 1_ successfully by following the below approach. I used the `iso2usb` software and used an existing image of **RHEL6** to have a **bootable USB disk** for installation. It worked perfectly fine in another machine when I tried booting from USB and installing. _Obstacle 2_ : Now, when I use this same **USB** in the server machine, it gives me the first screen where I can select to install the **RHEL6**. After selecting to install the **RHEL6** , it gives me an error as, > Unable to find any devices of the type needed for this installation type. > Would you like to manually select your driver or use a driver disk? I am stumped at this obstacle and tried various options to overcome this. I tried using an **USB** drive with lesser storage (4 GB) since I guessed using larger **USB** storage (earlier I used 16 GB ) sometimes might not work well with the ancient hardware. I also tried the option specified here. When the bootloader screen appears, I added,               linux all-generic-ide irqpoll pci=nommconf      I also tried using various **USB** ports. The **USB** is getting recognized but again gives the same error as above. Now the only option left to try is to hook up a **DVD** drive to this machine and try the installation. However, I just want to know if am missing out any other option. Also, is it possible that the installation is failing because of the hardware in the machine? I am not sure if the driver update for the **USB** drives might fix the problem.


title: Timeout does not work in expect script

text: I created the following expect script in order to automate logging into a VPN:                #!/usr/bin/expect           set PASS [lindex $argv 0]           set timeout 10      spawn  vpnc      expect    :            {send $PASS\r}      expect eof      However, when I give wrong password argument, the expected 10 second does not occur. Why does this 10 second timeout not occur?


title: Editing margins and sharpening of movies

text: I copied some cartoons from a VCD to my hard drive, to be able to manage the content more easily. However, probably because of the VCD outdated technology, there are two issues with these clips:   1. There are massive black margins at the top and bottom of the clips. It seems that these margins make a widescreen film fit an old style 4:3 screen, but it is not really relevant in my case. How can I get rid of these margins?   2. The quality is rather horrible. The image is a bit blurred and because this is a cartoon it looks more horrible than it would look for a normal film. Can I sharpen the image somehow? I am running Debian Testing.


title: Add another IP address to a Bonding Interface

text: I have a Linux network Bonding interface for two Ethernet interfaces (eth0 and eth1)               $ cat /etc/sysconfig/network-scripts/ifcfg-bond0        DEVICE=bond0       BOOTPROTO=static       ONBOOT=yes       IPADDR=XX.XX.XX.XX       NETMASK=255.255.255.0       GATEWAY=XX.XX.XX.XXX        How i can add another IPADDR to this bonding Interface ?


title: xfce4 loses title bars on all windows

text: I'm running `Debian Wheezy` using `gdm3` as window manager and `xfce4` as desktop environment. Every so often, when I login, the desktop environment starts OK, but all windows are missing the title bar and are positioned at location (0,0). Usually logging out and back in, or restarting `gdm3` and logging in, fixes it, but today it didn't. I switched to 'GNOME classic' which works fine, indicating it's probably a setting in `xfce4` that's got corrupted. Short of just zapping every file in `.config/` and `.cache/` which refers to `xfce`, is there a simple fix/edit?


title: Cannot enable network after CentOS 6.3 fresh install

text: I am trying to perform a fresh CentOS 6.3 installation then run various `yum` commands such as `yum install httpd`. The installation runs fine, however I cannot run any network based commands like `yum` I am aware the default installation has networking disabled. I have amended the `/etc/sysconfig/network-scripts/ifcfg-eth0` file in accordance with this guide, but keep receiving the error > Could not retrieve mirrorlist > http://mirrorlist.centos.org?release=6arch=i1386&repo=os error was > > 14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'" > > Error: Cannot find a valid baseurl for repo: base I have since amended the `/etc/resolv.conf` file to include Google's nameserver 8.8.8.8 but this hasn't changed anything. I have amended `/etc/sysconfig/network` changing the `hostname` from `localhost.localdomain` to `local.igoo.net` (a made up but fully qualified domain?). I did have it working yesterday then tried to install WHM/cPanel which went fine. I then decided I didn't need WHM/cPanel so fresh insatlled CentOS and now cannot recreate the steps I took to get networking working. When I run `/etc/init.d/network restart` the error message: > Bringing up interface eth0: > > Determining IP information for eth0... failed; no link present. Check cable? (The cable is not unplugged) I'm not sure what to try next! Can anyone suggest what I've missed out?


title: SIOCSIFADDR: File exists after upgrading kernel

text: Since upgrading my (Gentoo) kernel from 2.6.38 to 3.3.8 (via oldconfig), I can't get the network on eth0 up anymore. It reports "SIOCSIFADDR: File exists" with a number of other SIOCSIF* errors that seem related. I have the CONFIG_BNX2=y configuration for the Broadcom NetXtreme II NIC that the machine has (which we have been using for years) enabled in the new kernel. Any hints?


title: Detailed Per-Process Profiling

text: I am looking for a way to profile a single process including time spent for CPU, I/O, memory usage over time and optionally system calls. I already know `callgrind` offering some basic profiling features but only with debugging information and lacking most of the other mentioned information. I know `strace -c` providing a summary about all system calls and their required CPU time. I know several IO-related tools like `(io)top`, `iostat`, `vmstat` but all of them are lacking detailed statistics about a single process. There is also `/proc/$PID/io` providing some IO statistics about a single process, but I would have to read it at fixed intervals in order to gather IO information over time. I know `pidstat` providing CPU load, IO statistics and memory utilization but no system calls, only at a high granularity and not over time. One could of course combine several of the described tools to gather those information over time, but lacking a high granularity and thus missing important information. What I am looking for is a single tool providing all (or at least most) of the mentioned information, ideally over time. Does such a tool exist?


title: Why do I need to escape regex characters in sed to be interpreted as regex characters?

text: It seems e.g.   `cat sed_data.txt | sed 's/\b[0-9]\{3\}\b/NUMBER/g'`   that I _must_ escape characters to form a regular expression. In this case I had to escape braces in order to be interpreted as a number of times.   Why? I was expecting that everything would be a regex character unless escaped. I.e. the opposite.


title: Arch Linux in Qemu : Failed to access perfctr msr error

text: I got the Arch Linux (march build) iso file through bittorrent lately. I tried to run it in VM, but it only gets up to the main screen (The screen where you select what you want to do) shown below: ![enter image description here](http://i.stack.imgur.com/dzhCi.png) But when I select first option, it shows a black screen which goes nowhere. The Hardware Information option seems to work, but it's out of my intellectual capacity so I ignored it. I then tried `qemu` with a simple `qemu-system-x86_64 ./location to file` command. It shows a slightly different image: ![enter image description here](http://i.stack.imgur.com/MSdaX.png) On selecting `x64-86` I get errors: ![enter image description here](http://i.stack.imgur.com/gR5iv.png) I am a Ubuntu user, so I don't get anything of this, but the first error seems to be:               failed to access perctr msr(msr coo1ooo4 is 0)


title: Listing and specifying packages in debootstrap

text: Is there a way to list the packages that debootstrap is going to download? Also, is there a way to tell debootstrap to download a user-specified list of packages?


title: Fedora Core yum update keeps hanging

text: When I run `yum update` it hangs at the end with no error message. If I run `sudo yum install httpd` it hangs with no error. I read that using `strace` should give more info, but when I try that it says `no such command strace`. I have `fedora` core running on VirtualBox, `Win 7` is the host computer, just trying to install `apache / php / mysql` on it.


title: Why ssh-agent group ownership is not root

text: Trying to understand why ssh-agent has sgid bit and found this post ssh-agent has sgid I have another question, why the group ownership of ssh-agent is nobody not root? What is the reason behind it? Will it still work if group ownership is root?


title: btrfs and the discard mount option on an ssd

text: I can't seem to find an answer to this so I thought I would ask here: In `/etc/fstab` and when using the mount command in ext4 you would add the option `discard` to activate TRIM on an SSD. Similarly the `discard` option activates TRIM on btrfs volumes as confirmed at btrfs.wiki.kernel.org. Btrfs is supposed to enable copy on write by nature and if this is the case does the discard option effectively disable copy on write? I'm imagining TRIM erasing all of the blocks that would have contained previous versions of files. If copy on write still functions doesn't that reduce the performance of an SSD long term, if eventually none of the blocks are zeroed out?


title: How can we compare two same directories in linux and list different files

text: Suppose I have same version of linux kernel but I changed some driver lines. Is there any way to compare these kernels and list the results. The result would be helpful to go back if I changed a lot in original drivers.


title: Ramdisks in OpenSuse 13.1

text: I've just installed OpenSuse 13.1, and noticed 5 **tmpfs** ramdisks in the partitioner, mapped to `/dev/shm`, `/run`, `/sys/fs/cgroup`, `/var/lock` and `/var/run`. I don't remember seeing these ramdisks in the past when I've used OpenSuse, though I did recently upgrade to a new SSD. I was wondering if anybody knew what they were for or whether it was good to get rid of them?


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

text: 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` ...)?


title: tmux not respecting disabled control flow

text: 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?


title: Clonezilla Grub

text: 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?


title: Remove shadows from Metacity windows

text: 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?


title: Passing a stream to a bash function

text: 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:


title: What is this seemingly base64 data set by setfattr?

text: 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.


title: Open a RPM on a Mac?

text: 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?


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

text: 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.


title: Debugging ethernet before NFS boot

text: 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?


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

text: 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.


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

text: 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.


title: screen toggle windows doesn't work with custom command key

text: 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


title: LD_LIBRARY_PATH not found - CentOS

text: 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?


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

text: $ 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?!!


title: Problem with wifi in Ubuntu

text: 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.


title: Broadcom Corporation BCM4313 WLAN does not work on installed Arch

text: 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.


title: yaourt curl error: SSL connect error

text: 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`?


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

text: 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?


title: Loading different Linux Distribution each time computer starts automatically?

text: 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?


title: How to install Mono in AIX?

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


title: Pressing tab after sourcing script file prints script related output

text: 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?


title: How to verify that my uImage is good?

text: 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?


title: Logging ssh remote commands to `bash_history`

text: 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.


title: How to fix startx on Arch Linux on Raspberry pi?

text: 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.


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

text: 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?


title: Development environment for C

text: 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.


title: The Case of the Conflicting Bootloaders

text: 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?


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

text: 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?


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

text: 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?


title: Capture transcript of program with redirected input and output

text: 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.


title: How to setup proxychains in VirtualBox Guest Kali Linux

text: 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


title: Removed USB storage device is still mounted

text: 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?


title: How to disable local file writes?

text: 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?


title: Duplicates in history file even after HISTCONTROL specified

text: 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.


title: CentOS ELRepo Kernel installing VMware

text: 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?


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

text: 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.


title: A problem with ubuntu

text: 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?


title: iptables forwarding between subnets

text: 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


title: System image of running Debian system?

text: 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.


title: How to install gnome shell 3.6 in debian 7.1

text: 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?


title: BIND server doesn't recognize my zone properly

text: 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)


title: Copy & Paste over several files with vim?

text: 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?


title: Map caps to esc for RHEL 5?

text: 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.


title: How small can an embedded Linux file system get?

text: 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?


title: pipe the output of parec to sox

text: `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"


title: Overwrite file and apply file system rights of overwritten files?

text: 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 :-)


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

text: 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


title: Enable sqlite FTS Enhanced Query Syntax in python in RHEL6?

text: 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?


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

text: 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!


title: Print lines if given column starts with a capital letter

text: 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.


title: qemu-kvm savevm very slow

text: 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.


title: What is the meaning of wget -O -

text: 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!)


title: Getting the password expire time

text: 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?


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

text: 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.


title: Guide on how to install FreeBSD on a laptop

text: 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.


title: apt-get failed to fetch package

text: 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?


title: RedHat Linux Space Usage Problem

text: 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


title: Vlook up in gawk or unix

text: 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?


title: Junk a part of the directory with unzip?

text: 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


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

text: 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.


title: Sorting a file based on one column using Unix and Awk

text: 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.


title: Why can't uvcdynctrl see my webcam?

text: 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?


title: Dovecot version upgrade

text: 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**


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

text: 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)


title: Switch Fn key state

text: 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


title: access rights of a file in octal format

text: 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 ?


title: Hotspot and Internet access together — why not?

text: 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?


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

text: 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?


title: Fresh Install Scientific Linux No Operating System

text: 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.


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

text: 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?