title: what could cause large pagefault latencies in linux?

text: I'm running a Linux netbook with an SSD. Since the SSD is slow (and I don't want to wear it out) I've been running without swap. So far this has been great, but I recently put a new kernel on (2.6.37) and noticed some slowdown. During this the disk drive light on my netbook stays on. LatencyTOP is only partially helpful in this, while one 3s (that's _seconds_ not ms) delay is for 'disk write (synchronous),' one is 2s for 'page fault.' I don't understand why there would be much of a penalty for a page fault at all since I'm not using swap to begin with (and seem to have a lot of free/cached memory). What could be the cause of this, and is there a way to resolve it? Is such a high latency for page faults even harmful or is the problem elsewhere?


title: bash adds extra single quotes

text: I have a problem executing my script.   When executing it in debug mode (bash -x), I can see that bash is adding extra quotes. Therefor my script is failing. Here this is within my script:               testvar="\"sudo /home/pi/shared/blink.sh 27 off\""     ssh -n -q -q -o BatchMode=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=5 $1 ${testvar}      This is the output:               ssh -n -q -q -o BatchMode=yes -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=5 192.168.42.105 '"sudo' /home/pi/shared/blink.sh 27 'off"'


title: Some people told me FreeBSD is NOT Unix, is that right? Confused

text: Some people told me FreeBSD is NOT Unix, is that right? I'm confused. I checked some articles, but the expressions are pretty vague, and I need some clarification.


title: Volume up/down function keys limited to gnome-volume-control "Unamplified 100%" level

text: Using GUI `gnome-volume-control`:                                            Sound Preferences     ----------------------------------------------------------------------------          Output Volume: [--------------+      ]                                  ||                       Unamplified 100%      the volume can be adjusted at will. When using the keyboard volume-up and volume-down function keys the volume may be lowered at will but raising the volume is limited to the "Unamplified 100%" level. Is there a way around this limitation? > Linux road 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 21:21:01 UTC 2011 > i686 GNU/Linux


title: How to pass lines from a file to a bash script, so that each line remains undivided, even if there are spaces?

text: Given:               $ cat lines.txt     a/b     'c/d e/f'          $ cat 1.sh     #!/bin/sh     ./2.sh `cat lines.txt`          $ cat 2.sh     #!/bin/sh     echo p1=$1     echo p2=$2     echo p3=$3          $ ./1.sh     p1=a/b     p2='c/d     p3=e/f'      How do I change `lines.txt` or `1.sh`, so that `2.sh` receives only two arguments:   * **`a/b`**   * **`c/d e/f`** ?


title: binary compare two files, failing only if first never matches any part of the second

text: I have a file (call it _A_ , for reference) that may be a fragment of some other extant file on my system. I can't use `cmp` because I don't know how many bytes may be missing from the start of _A_ (or, at least, I can't use it without brute forcing through the -i flag). Is there a way for me to discover whether _A_ is already existent on my system (using GNU tools, or any other linux program)? Or will I have to botch together a c++ program to do the job? Note: efficiency is desirable since the files that _A_ has to be compared with may be numerous.


title: Splitting the Home dir two different partitions

text: I run a Ubuntu desktop environment with two harddisks. A small SSD and a large regular disk. Currently i run a setup where my home drive is located on `/home/name`, but some folders e.g. `Downloads` are linked to a folder on the regular harddrive. This setup has several issues as it tends to get difficult to maintain and remember which folder belongs to where and so on. Is there a more simple and elegant way to manage this kind of setup? Edit: SSD is 128GB


title: Trying to print up down arrow keys

text: I have this: I read down arrow key               abc@abc-ubuntu:~/bashpratice$ read -n 3 key     ^[[Babc@abc-ubuntu:~/bashpratice$       I am able to grep for it               abc@abc-ubuntu:~/bashpratice$ echo $key | grep '\['     [B     abc@abc-ubuntu:~/bashpratice$ echo $key | grep '\[B'     [B      But echoing the key just prints spaces               abc@abc-ubuntu:~/bashpratice$ echo $key          abc@abc-ubuntu:~/bashpratice$       Why does echoing the key just give spaces?


title: .zshrc and the configuration function

text: I called `zsh` from Bash for the first time in my machine after installing it. Then I followed the instructions in the menu from the configuration function and saved the changes. So far so good, I can now use `zsh`. However I would like to start making manual changes to `.zshrc`, but I would like to know if adding manual entries to `.zshrc` will prevent me from running the configuration function again in the future. Is there a syntax that I could try to stick to to make sure I can run this configuration function again? Is there any value in this?


title: ZSH: search history on up and down keys?

text: Currently, I have the following in my .zshrc:               bindkey '^[[A' up-line-or-search     bindkey '^[[B' down-line-or-search      However, this only seems to match the content of my current input before a space character occurs. For example, `sudo ls /` will match every line in my history that begins with `sudo`, while I would like it to only match lines that match my entire input. (i.e. `sudo ls /etc` would match, but not `sudo cat /var/log/messages`) What do I need to change in order to gain the desired behavior? Here is my entire .zshrc in case it is relevant: https://gist.github.com/919566


title: c++ programming on a Real-time linux OS

text: Is there any gotcha's programming RealTime C++ applications (user space and linux drivers) on RT linux kernel compare to a std linux kernel? The Linux RT patch applies changes to kernel scheduler, semaphores, muteces, etc, and I'm wondering if these changes are transparent to the developer? or would one need to take special care in writing such application?


title: grepping a variable and adding 1 to it

text: I have a variable containing a leading zeroes number, and I want to grep this variable and that same variable plus one. I made several attempts but ran into errors. Here's what I want to do:               read var     newvar=$(($var +1))     grep '$var' /some/dir     grep '$newvar' /some/dir      I really think there's something wrong with my code. I also tried some test like this:               #!/bin/bash     echo "enter number"     read number     newnumber=$(($number + 1))     echo "$newnumber"      That gives me an error: `value too great for base (error token is`. If i do it like this:                #!/bin/bash     echo "enter number"     read number     number=""     newnumber=$(($number + 1))     echo "$newnumber"      This will output 1 all the time. What's wrong with my attempts, and how can I do what I want?


title: What reasons would prevent a machine restart from proceeding?

text: I am in the process of testing a fanless, atom based PC for use in an embedded application. I am running Voyage Linux version 0.7.5 on the machine. This distribution is derived from Debian Lenny. Everything works great except I can't get the shut down command to perform a reboot. This is important in this application because it provides us a way to perform a remote reset should that be needed. Looking at the terminal, the last two messages on the screen show the following:               [ 219.974475] ehci_hcd 0000:00:1d.7: PCI INT D disabled     [ 219.974657] Restarting system.     [ 219.974754] machine restart      At this point, the machine sticks and will not reboot until I cut the power or perform a hardware reset. I recall seeing this sort of thing (at least with a shutdown) when running the OS under VirtualBox. I really know very little about the interaction with the kernel and the machine at this point so I am asking if anyone knows if there are potential kernel configurations that cam cause this kind of problem. Edit: Having been asked if the system supports ACPI, I took a closer look at the boot log. I found the following message:               [   3.99748] ACPI: resource (null) [io 0x0480-0x04bf] conflicts with ACPI region PHO_ [io 0x4bc-0x4bc]


title: curl unable to find cslistener

text: **netstat** shows some connection from my linux box to remote host on their **cslistener** port. But trying to access that port using **curl** is giving error :               $ curl -v https://myapp.domain.com:cslistener      * getaddrinfo(3) failed for myapp.domain.com:cslistener:443      * Couldn't resolve host 'myapp.domain.com:cslistener'      * Closing connection #0       curl: (6) Couldn't resolve host ‘myapp.domain.com:cslistener'      Please guide as to what I am missing here.


title: e- and f- versions of commands

text: I noticed that some commands also come in with e- and f- versions, e.g. grep, egrep, fgrep and a few others. Is there some pattern or a naming convention if a particular command should have e- or f-version?


title: Run Windows program on Linux in a secure way

text: I am trying to find a way to achieve a secure execution of Windows programs inside a Linux installation. I suppose that a Windows malware should not do any damage (infect the machine), if executed through a low privileged Wine instance; but I am afraid that it could mess up configurations and files of my user. So, I thought to use a combination of Qemu and Wine (because I have read that Qemu could be more light than an entire VM), but I am not sure about the pros and cons. Is there a real gain using that combination instead of simply the Virtual Box? I appreciated Virtual Box in the past years, but I am tired of launching an entire OS when I need a simple program. Are Qemu + Wine more easy to run? Can this combination provide the same security guarantees as the Virtual Box does?


title: timestamp before an echo

text: Exists a nicer way to create timestamp in front of an `echo`? Currently I do it this way:               #!/bin/sh          if mount | grep -q /mnt/usb; then             echo `date +%R\ ` "usb device already mounted"     else             echo `date +%R\ ` "mounting usb device..."             mount -t msdosfs /dev/da0s1 /mnt/usb                  if mount | grep -q /mnt/usb; then                     echo `date +%R\ ` "usb device successfully mounted"             fi     fi      The output should look something like that:               10:36 usb device already mounted


title: How does ps know to hide passwords?

text: Witness:               $ ps f       PID TTY      STAT   TIME COMMAND     31509 pts/3    Ss     0:01 -bash     27266 pts/3    S+     0:00  \_ mysql -uroot -p     25210 pts/10   Ss+    0:00 /bin/bash     24444 pts/4    Ss     0:00 -bash     29111 pts/4    S+     0:00  \_ tmux attach      4833 pts/5    Ss+    0:00 -bash      9046 pts/6    Ss     0:00 -bash     17749 pts/6    R+     0:00  \_ ps f      4748 pts/0    Ss     0:00 -bash     14635 pts/0    T      0:02  \_ mysql -uroot -px xxxxxxxxxxxxxxxx     16210 pts/0    S+     0:01  \_ mysql -uroot -px xxxxxxxxxxxxxxxx      How did ps know to hide the `mysql` passwords? Can I incorporate this into my own scripts to hide particular CLI attributes?


title: How to make traceroute trace beyond 30 hops?

text: Some of the servers I use `traceroute` on, are more than 30 hops away. How do I make `traceroute` trace beyond 30 hops?


title: OpenVPN - Socket bind failed on local address [AF_INET] IP:1194: Cannot assign requested address

text: How get it resolved? I am trying to start the openVPN server so that i can login remotely using username: demo and password: demo, but openVPN server is failing to start. What am i doing wrong, how can i fix it please?               $ cat /etc/openvpn/server.conf     proto tcp     port 1194     dev tap     #do-mtu 1492     #fragment 1300     dev-node tap     keepalive 10 120      max-clients 10          # Annoying files      ca /etc/openvpn/keys/ca.crt     cert /etc/openvpn/keys/server.crt     key /etc/openvpn/keys/server.key     dh /etc/openvpn/keys/dh1024.pem          # Owner     user nobody     group nogroup     server 10.44.77.0 255.255.255.0          persist-key     persist-tun     status openvpn-status.log     verb 6          # Router     client-to-client     push "dhcp-option DOMAIN xxxxx" # Server public IP or domain name     push "dhcp-option DNS 208.67.222.222" # Primary dns server (opendns shown)     push "dhcp-option DNS 208.67.220.220" # Secondary dns server (opendns shown)     push "redirect-gateway" # Directs all traffic through your VPN     #log-append /var/log/openvpn     comp-lzo          # Username/password     auth-user-pass-verify /etc/openvpn/auth.sh via-env     client-cert-not-required     username-as-common-name     management-client-auth     management 8.8.8.8 1194 pass.txt          $ cat auth.sh     #/bin/sh     Allowed_user = "demo"     ALLOWED_PASS = "demo"          if ["$username" == "$Allowed_user"] && ["$password" == "$ALLOWED_PASS"]      then exit 0     fi          exit 1          $ cat pass.txt  #chmod 600 pass.txt else it gives warning     demo demo;       **Output:**               $ openvpn /etc/openvpn/server.conf      Thu Aug 29 12:02:46 2013 us=863944 Current Parameter Settings:     Thu Aug 29 12:02:46 2013 us=864047   config = '/etc/openvpn/server.conf'     Thu Aug 29 12:02:46 2013 us=864075   mode = 1     Thu Aug 29 12:02:46 2013 us=864097   persist_config = DISABLED     Thu Aug 29 12:02:46 2013 us=864119   persist_mode = 1     Thu Aug 29 12:02:46 2013 us=864164   show_ciphers = DISABLED     Thu Aug 29 12:02:46 2013 us=864185   show_digests = DISABLED     Thu Aug 29 12:02:46 2013 us=864216   show_engines = DISABLED     Thu Aug 29 12:02:46 2013 us=864237   genkey = DISABLED     Thu Aug 29 12:02:46 2013 us=864259   key_pass_file = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=864290   show_tls_ciphers = DISABLED     Thu Aug 29 12:02:46 2013 us=864323 Connection profiles [default]:     Thu Aug 29 12:02:46 2013 us=864346   proto = tcp-server     Thu Aug 29 12:02:46 2013 us=864366   local = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=864398   local_port = 1194     Thu Aug 29 12:02:46 2013 us=864419   remote = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=864451   remote_port = 1194     Thu Aug 29 12:02:46 2013 us=864471   remote_float = DISABLED     Thu Aug 29 12:02:46 2013 us=864492   bind_defined = DISABLED     Thu Aug 29 12:02:46 2013 us=864512   bind_local = ENABLED     Thu Aug 29 12:02:46 2013 us=864537   connect_retry_seconds = 5     Thu Aug 29 12:02:46 2013 us=864557   connect_timeout = 10     Thu Aug 29 12:02:46 2013 us=864581   connect_retry_max = 0     Thu Aug 29 12:02:46 2013 us=864604   socks_proxy_server = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=864624   socks_proxy_port = 0     Thu Aug 29 12:02:46 2013 us=864647   socks_proxy_retry = DISABLED     Thu Aug 29 12:02:46 2013 us=864670 Connection profiles END     Thu Aug 29 12:02:46 2013 us=864695   remote_random = DISABLED     Thu Aug 29 12:02:46 2013 us=864719   ipchange = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=864742   dev = 'tap'     Thu Aug 29 12:02:46 2013 us=864762   dev_type = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=864785   dev_node = 'tap'     Thu Aug 29 12:02:46 2013 us=864809   lladdr = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=864829   topology = 1     Thu Aug 29 12:02:46 2013 us=864850   tun_ipv6 = DISABLED     Thu Aug 29 12:02:46 2013 us=864878   ifconfig_local = '10.44.77.1'     Thu Aug 29 12:02:46 2013 us=864902   ifconfig_remote_netmask = '255.255.255.0'     Thu Aug 29 12:02:46 2013 us=864925   ifconfig_noexec = DISABLED     Thu Aug 29 12:02:46 2013 us=864946   ifconfig_nowarn = DISABLED     Thu Aug 29 12:02:46 2013 us=864966   ifconfig_ipv6_local = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=864990   ifconfig_ipv6_netbits = 0     Thu Aug 29 12:02:46 2013 us=865013   ifconfig_ipv6_remote = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=865036   shaper = 0     Thu Aug 29 12:02:46 2013 us=865057   tun_mtu = 1500     Thu Aug 29 12:02:46 2013 us=865077   tun_mtu_defined = ENABLED     Thu Aug 29 12:02:46 2013 us=865106   link_mtu = 1500     Thu Aug 29 12:02:46 2013 us=865129   link_mtu_defined = DISABLED     Thu Aug 29 12:02:46 2013 us=865152   tun_mtu_extra = 32     Thu Aug 29 12:02:46 2013 us=865172   tun_mtu_extra_defined = ENABLED     Thu Aug 29 12:02:46 2013 us=865193   fragment = 0     Thu Aug 29 12:02:46 2013 us=865221   mtu_discover_type = -1     Thu Aug 29 12:02:46 2013 us=865244   mtu_test = 0     Thu Aug 29 12:02:46 2013 us=865266   mlock = DISABLED     Thu Aug 29 12:02:46 2013 us=865289   keepalive_ping = 10     Thu Aug 29 12:02:46 2013 us=865309   keepalive_timeout = 120     Thu Aug 29 12:02:46 2013 us=865330   inactivity_timeout = 0     Thu Aug 29 12:02:46 2013 us=865350   ping_send_timeout = 10     Thu Aug 29 12:02:46 2013 us=865378   ping_rec_timeout = 240     Thu Aug 29 12:02:46 2013 us=865401   ping_rec_timeout_action = 2     Thu Aug 29 12:02:46 2013 us=865422   ping_timer_remote = DISABLED     Thu Aug 29 12:02:46 2013 us=865442   remap_sigusr1 = 0     Thu Aug 29 12:02:46 2013 us=865470   explicit_exit_notification = 0     Thu Aug 29 12:02:46 2013 us=865493   persist_tun = ENABLED     Thu Aug 29 12:02:46 2013 us=865513   persist_local_ip = DISABLED     Thu Aug 29 12:02:46 2013 us=865535   persist_remote_ip = DISABLED     Thu Aug 29 12:02:46 2013 us=865558   persist_key = ENABLED     Thu Aug 29 12:02:46 2013 us=865584   mssfix = 1450     Thu Aug 29 12:02:46 2013 us=865609   passtos = DISABLED     Thu Aug 29 12:02:46 2013 us=865632   resolve_retry_seconds = 1000000000     Thu Aug 29 12:02:46 2013 us=865653   username = 'nobody'     Thu Aug 29 12:02:46 2013 us=865673   groupname = 'nogroup'     Thu Aug 29 12:02:46 2013 us=865692   chroot_dir = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=865711   cd_dir = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=865731   writepid = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=865750   up_script = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=865770   down_script = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=865789   down_pre = DISABLED     Thu Aug 29 12:02:46 2013 us=865809   up_restart = DISABLED     Thu Aug 29 12:02:46 2013 us=865828   up_delay = DISABLED     Thu Aug 29 12:02:46 2013 us=865848   daemon = DISABLED     Thu Aug 29 12:02:46 2013 us=865867   inetd = 0     Thu Aug 29 12:02:46 2013 us=865887   log = DISABLED     Thu Aug 29 12:02:46 2013 us=865906   suppress_timestamps = DISABLED     Thu Aug 29 12:02:46 2013 us=865926   nice = 0     Thu Aug 29 12:02:46 2013 us=865946   verbosity = 6     Thu Aug 29 12:02:46 2013 us=865965   mute = 0     Thu Aug 29 12:02:46 2013 us=865985   gremlin = 0     Thu Aug 29 12:02:46 2013 us=866004   status_file = 'openvpn-status.log'     Thu Aug 29 12:02:46 2013 us=866024   status_file_version = 1     Thu Aug 29 12:02:46 2013 us=866044   status_file_update_freq = 60     Thu Aug 29 12:02:46 2013 us=866064   occ = ENABLED     Thu Aug 29 12:02:46 2013 us=866083   rcvbuf = 65536     Thu Aug 29 12:02:46 2013 us=866103   sndbuf = 65536     Thu Aug 29 12:02:46 2013 us=866122   sockflags = 0     Thu Aug 29 12:02:46 2013 us=866142   fast_io = DISABLED     Thu Aug 29 12:02:46 2013 us=866161   lzo = 7     Thu Aug 29 12:02:46 2013 us=866181   route_script = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=866201   route_default_gateway = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=866221   route_default_metric = 0     Thu Aug 29 12:02:46 2013 us=866241   route_noexec = DISABLED     Thu Aug 29 12:02:46 2013 us=866261   route_delay = 0     Thu Aug 29 12:02:46 2013 us=866282   route_delay_window = 30     Thu Aug 29 12:02:46 2013 us=866302   route_delay_defined = DISABLED     Thu Aug 29 12:02:46 2013 us=866323   route_nopull = DISABLED     Thu Aug 29 12:02:46 2013 us=866343   route_gateway_via_dhcp = DISABLED     Thu Aug 29 12:02:46 2013 us=866364   max_routes = 100     Thu Aug 29 12:02:46 2013 us=866383   allow_pull_fqdn = DISABLED     Thu Aug 29 12:02:46 2013 us=866404   management_addr = 'xxxxxxxxx'     Thu Aug 29 12:02:46 2013 us=866424   management_port = 1194     Thu Aug 29 12:02:46 2013 us=866444   management_user_pass = 'pass.txt'     Thu Aug 29 12:02:46 2013 us=866464   management_log_history_cache = 250     Thu Aug 29 12:02:46 2013 us=866483   management_echo_buffer_size = 100     Thu Aug 29 12:02:46 2013 us=866504   management_write_peer_info_file = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=866524   management_client_user = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=866544   management_client_group = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=866564   management_flags = 64     Thu Aug 29 12:02:46 2013 us=866583   shared_secret_file = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=866603   key_direction = 0     Thu Aug 29 12:02:46 2013 us=866623   ciphername_defined = ENABLED     Thu Aug 29 12:02:46 2013 us=866643   ciphername = 'BF-CBC'     Thu Aug 29 12:02:46 2013 us=866663   authname_defined = ENABLED     Thu Aug 29 12:02:46 2013 us=866683   authname = 'SHA1'     Thu Aug 29 12:02:46 2013 us=866702   prng_hash = 'SHA1'     Thu Aug 29 12:02:46 2013 us=866722   prng_nonce_secret_len = 16     Thu Aug 29 12:02:46 2013 us=866742   keysize = 0     Thu Aug 29 12:02:46 2013 us=866761   engine = DISABLED     Thu Aug 29 12:02:46 2013 us=866790   replay = ENABLED     Thu Aug 29 12:02:46 2013 us=866810   mute_replay_warnings = DISABLED     Thu Aug 29 12:02:46 2013 us=866830   replay_window = 64     Thu Aug 29 12:02:46 2013 us=866850   replay_time = 15     Thu Aug 29 12:02:46 2013 us=866869   packet_id_file = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=866899   use_iv = ENABLED     Thu Aug 29 12:02:46 2013 us=866919   test_crypto = DISABLED     Thu Aug 29 12:02:46 2013 us=866939   tls_server = ENABLED     Thu Aug 29 12:02:46 2013 us=866973   tls_client = DISABLED     Thu Aug 29 12:02:46 2013 us=867007   key_method = 2     Thu Aug 29 12:02:46 2013 us=867047   ca_file = '/etc/openvpn/keys/ca.crt'     Thu Aug 29 12:02:46 2013 us=867068   ca_path = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=867088   dh_file = '/etc/openvpn/keys/dh1024.pem'     Thu Aug 29 12:02:46 2013 us=867108   cert_file = '/etc/openvpn/keys/server.crt'     Thu Aug 29 12:02:46 2013 us=867129   priv_key_file = '/etc/openvpn/keys/server.key'     Thu Aug 29 12:02:46 2013 us=867149   pkcs12_file = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=867168   cipher_list = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=867188   tls_verify = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=867207   tls_export_cert = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=867227   tls_remote = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=867246   crl_file = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=867266   ns_cert_type = 0     Thu Aug 29 12:02:46 2013 us=867285   remote_cert_ku[i] = 0     Thu Aug 29 12:02:46 2013 us=867304   remote_cert_ku[i] = 0     Thu Aug 29 12:02:46 2013 us=867323   remote_cert_ku[i] = 0     Thu Aug 29 12:02:46 2013 us=867342   remote_cert_ku[i] = 0     Thu Aug 29 12:02:46 2013 us=867361   remote_cert_ku[i] = 0     Thu Aug 29 12:02:46 2013 us=867380   remote_cert_ku[i] = 0     Thu Aug 29 12:02:46 2013 us=867398   remote_cert_ku[i] = 0     Thu Aug 29 12:02:46 2013 us=867417   remote_cert_ku[i] = 0     Thu Aug 29 12:02:46 2013 us=867436   remote_cert_ku[i] = 0     Thu Aug 29 12:02:46 2013 us=867455   remote_cert_ku[i] = 0     Thu Aug 29 12:02:46 2013 us=867473   remote_cert_ku[i] = 0     Thu Aug 29 12:02:46 2013 us=867492   remote_cert_ku[i] = 0     Thu Aug 29 12:02:46 2013 us=867511   remote_cert_ku[i] = 0     Thu Aug 29 12:02:46 2013 us=867529   remote_cert_ku[i] = 0     Thu Aug 29 12:02:46 2013 us=867548   remote_cert_ku[i] = 0     Thu Aug 29 12:02:46 2013 us=867567   remote_cert_ku[i] = 0     Thu Aug 29 12:02:46 2013 us=867587   remote_cert_eku = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=867606   tls_timeout = 2     Thu Aug 29 12:02:46 2013 us=867625   renegotiate_bytes = 0     Thu Aug 29 12:02:46 2013 us=867644   renegotiate_packets = 0     Thu Aug 29 12:02:46 2013 us=867663   renegotiate_seconds = 3600     Thu Aug 29 12:02:46 2013 us=867681   handshake_window = 60     Thu Aug 29 12:02:46 2013 us=867701   transition_window = 3600     Thu Aug 29 12:02:46 2013 us=867720   single_session = DISABLED     Thu Aug 29 12:02:46 2013 us=867743   push_peer_info = DISABLED     Thu Aug 29 12:02:46 2013 us=867764   tls_exit = DISABLED     Thu Aug 29 12:02:46 2013 us=867784   tls_auth_file = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=867803   pkcs11_protected_authentication = DISABLED     Thu Aug 29 12:02:46 2013 us=867823   pkcs11_protected_authentication = DISABLED     Thu Aug 29 12:02:46 2013 us=867843   pkcs11_protected_authentication = DISABLED     Thu Aug 29 12:02:46 2013 us=867862   pkcs11_protected_authentication = DISABLED     Thu Aug 29 12:02:46 2013 us=867882   pkcs11_protected_authentication = DISABLED     Thu Aug 29 12:02:46 2013 us=867902   pkcs11_protected_authentication = DISABLED     Thu Aug 29 12:02:46 2013 us=867922   pkcs11_protected_authentication = DISABLED     Thu Aug 29 12:02:46 2013 us=867941   pkcs11_protected_authentication = DISABLED     Thu Aug 29 12:02:46 2013 us=867960   pkcs11_protected_authentication = DISABLED     Thu Aug 29 12:02:46 2013 us=867980   pkcs11_protected_authentication = DISABLED     Thu Aug 29 12:02:46 2013 us=867999   pkcs11_protected_authentication = DISABLED     Thu Aug 29 12:02:46 2013 us=868019   pkcs11_protected_authentication = DISABLED     Thu Aug 29 12:02:46 2013 us=868038   pkcs11_protected_authentication = DISABLED     Thu Aug 29 12:02:46 2013 us=868057   pkcs11_protected_authentication = DISABLED     Thu Aug 29 12:02:46 2013 us=868077   pkcs11_protected_authentication = DISABLED     Thu Aug 29 12:02:46 2013 us=868097   pkcs11_protected_authentication = DISABLED     Thu Aug 29 12:02:46 2013 us=868117   pkcs11_private_mode = 00000000     Thu Aug 29 12:02:46 2013 us=868137   pkcs11_private_mode = 00000000     Thu Aug 29 12:02:46 2013 us=868157   pkcs11_private_mode = 00000000     Thu Aug 29 12:02:46 2013 us=868177   pkcs11_private_mode = 00000000     Thu Aug 29 12:02:46 2013 us=868196   pkcs11_private_mode = 00000000     Thu Aug 29 12:02:46 2013 us=868215   pkcs11_private_mode = 00000000     Thu Aug 29 12:02:46 2013 us=868234   pkcs11_private_mode = 00000000     Thu Aug 29 12:02:46 2013 us=868254   pkcs11_private_mode = 00000000     Thu Aug 29 12:02:46 2013 us=868273   pkcs11_private_mode = 00000000     Thu Aug 29 12:02:46 2013 us=868292   pkcs11_private_mode = 00000000     Thu Aug 29 12:02:46 2013 us=868311   pkcs11_private_mode = 00000000     Thu Aug 29 12:02:46 2013 us=868330   pkcs11_private_mode = 00000000     Thu Aug 29 12:02:46 2013 us=868350   pkcs11_private_mode = 00000000     Thu Aug 29 12:02:46 2013 us=868369   pkcs11_private_mode = 00000000     Thu Aug 29 12:02:46 2013 us=868388   pkcs11_private_mode = 00000000     Thu Aug 29 12:02:46 2013 us=868408   pkcs11_private_mode = 00000000     Thu Aug 29 12:02:46 2013 us=868427   pkcs11_cert_private = DISABLED     Thu Aug 29 12:02:46 2013 us=868446   pkcs11_cert_private = DISABLED     Thu Aug 29 12:02:46 2013 us=868465   pkcs11_cert_private = DISABLED     Thu Aug 29 12:02:46 2013 us=868484   pkcs11_cert_private = DISABLED     Thu Aug 29 12:02:46 2013 us=868504   pkcs11_cert_private = DISABLED     Thu Aug 29 12:02:46 2013 us=868522   pkcs11_cert_private = DISABLED     Thu Aug 29 12:02:46 2013 us=868541   pkcs11_cert_private = DISABLED     Thu Aug 29 12:02:46 2013 us=868561   pkcs11_cert_private = DISABLED     Thu Aug 29 12:02:46 2013 us=868580   pkcs11_cert_private = DISABLED     Thu Aug 29 12:02:46 2013 us=868599   pkcs11_cert_private = DISABLED     Thu Aug 29 12:02:46 2013 us=868618   pkcs11_cert_private = DISABLED     Thu Aug 29 12:02:46 2013 us=868637   pkcs11_cert_private = DISABLED     Thu Aug 29 12:02:46 2013 us=868656   pkcs11_cert_private = DISABLED     Thu Aug 29 12:02:46 2013 us=868675   pkcs11_cert_private = DISABLED     Thu Aug 29 12:02:46 2013 us=868694   pkcs11_cert_private = DISABLED     Thu Aug 29 12:02:46 2013 us=868713   pkcs11_cert_private = DISABLED     Thu Aug 29 12:02:46 2013 us=868733   pkcs11_pin_cache_period = -1     Thu Aug 29 12:02:46 2013 us=868746   pkcs11_id = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=868767   pkcs11_id_management = DISABLED     Thu Aug 29 12:02:46 2013 us=868789   server_network = 10.44.77.0     Thu Aug 29 12:02:46 2013 us=868810   server_netmask = 255.255.255.0     Thu Aug 29 12:02:46 2013 us=868839   server_network_ipv6 = ::     Thu Aug 29 12:02:46 2013 us=868859   server_netbits_ipv6 = 0     Thu Aug 29 12:02:46 2013 us=868880   server_bridge_ip = 0.0.0.0     Thu Aug 29 12:02:46 2013 us=868901   server_bridge_netmask = 0.0.0.0     Thu Aug 29 12:02:46 2013 us=868922   server_bridge_pool_start = 0.0.0.0     Thu Aug 29 12:02:46 2013 us=868943   server_bridge_pool_end = 0.0.0.0     Thu Aug 29 12:02:46 2013 us=868963   push_entry = 'dhcp-option DOMAIN xxxxxxxxxxx'     Thu Aug 29 12:02:46 2013 us=868983   push_entry = 'dhcp-option DNS 208.67.222.222'     Thu Aug 29 12:02:46 2013 us=869003   push_entry = 'dhcp-option DNS 208.67.220.220'     Thu Aug 29 12:02:46 2013 us=869023   push_entry = 'redirect-gateway'     Thu Aug 29 12:02:46 2013 us=869043   push_entry = 'route-gateway 10.44.77.1'     Thu Aug 29 12:02:46 2013 us=869062   push_entry = 'ping 10'     Thu Aug 29 12:02:46 2013 us=869082   push_entry = 'ping-restart 120'     Thu Aug 29 12:02:46 2013 us=869101   ifconfig_pool_defined = ENABLED     Thu Aug 29 12:02:46 2013 us=869123   ifconfig_pool_start = 10.44.77.2     Thu Aug 29 12:02:46 2013 us=869144   ifconfig_pool_end = 10.44.77.254     Thu Aug 29 12:02:46 2013 us=869165   ifconfig_pool_netmask = 255.255.255.0     Thu Aug 29 12:02:46 2013 us=869185   ifconfig_pool_persist_filename = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=869205   ifconfig_pool_persist_refresh_freq = 600     Thu Aug 29 12:02:46 2013 us=869224   ifconfig_ipv6_pool_defined = DISABLED     Thu Aug 29 12:02:46 2013 us=869245   ifconfig_ipv6_pool_base = ::     Thu Aug 29 12:02:46 2013 us=869264   ifconfig_ipv6_pool_netbits = 0     Thu Aug 29 12:02:46 2013 us=869284   n_bcast_buf = 256     Thu Aug 29 12:02:46 2013 us=869303   tcp_queue_limit = 64     Thu Aug 29 12:02:46 2013 us=869322   real_hash_size = 256     Thu Aug 29 12:02:46 2013 us=869342   virtual_hash_size = 256     Thu Aug 29 12:02:46 2013 us=869361   client_connect_script = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=869380   learn_address_script = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=869400   client_disconnect_script = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=869420   client_config_dir = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=869439   ccd_exclusive = DISABLED     Thu Aug 29 12:02:46 2013 us=869458   tmp_dir = '/tmp'     Thu Aug 29 12:02:46 2013 us=869478   push_ifconfig_defined = DISABLED     Thu Aug 29 12:02:46 2013 us=869499   push_ifconfig_local = 0.0.0.0     Thu Aug 29 12:02:46 2013 us=869519   push_ifconfig_remote_netmask = 0.0.0.0     Thu Aug 29 12:02:46 2013 us=869539   push_ifconfig_ipv6_defined = DISABLED     Thu Aug 29 12:02:46 2013 us=869560   push_ifconfig_ipv6_local = ::/0     Thu Aug 29 12:02:46 2013 us=869580   push_ifconfig_ipv6_remote = ::     Thu Aug 29 12:02:46 2013 us=869599   enable_c2c = ENABLED     Thu Aug 29 12:02:46 2013 us=869619   duplicate_cn = DISABLED     Thu Aug 29 12:02:46 2013 us=869638   cf_max = 0     Thu Aug 29 12:02:46 2013 us=869657   cf_per = 0     Thu Aug 29 12:02:46 2013 us=869676   max_clients = 10     Thu Aug 29 12:02:46 2013 us=869696   max_routes_per_client = 256     Thu Aug 29 12:02:46 2013 us=869715   auth_user_pass_verify_script = '/etc/openvpn/auth.sh'     Thu Aug 29 12:02:46 2013 us=869735   auth_user_pass_verify_script_via_file = DISABLED     Thu Aug 29 12:02:46 2013 us=869754   ssl_flags = 3     Thu Aug 29 12:02:46 2013 us=869773   port_share_host = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=869793   port_share_port = 0     Thu Aug 29 12:02:46 2013 us=869812   client = DISABLED     Thu Aug 29 12:02:46 2013 us=869831   pull = DISABLED     Thu Aug 29 12:02:46 2013 us=869850   auth_user_pass_file = '[UNDEF]'     Thu Aug 29 12:02:46 2013 us=869877 OpenVPN 2.2.1 x86_64-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [eurephia] [MH] [PF_INET6] [IPv6 payload 20110424-2 (2.2RC2)] built on Feb 27 2013     Thu Aug 29 12:02:46 2013 us=870025 MANAGEMENT: Socket bind failed on local address [AF_INET]xxxxx:1194: Cannot assign requested address     Thu Aug 29 12:02:46 2013 us=870058 Exiting


title: Yum can find a package, but can not install it

text: How is it possible?               [root@server1 ~]# yum search diy     Loaded plugins: product-id, rhnplugin, security, subscription-manager     This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.     This system is receiving updates from RHN Classic or RHN Satellite.     ======================================= N/S Matched: diy =======================================     openshift-origin-cartridge-diy-0.1.noarch : Provides diy support            Name and summary matches only, use "search all" for everything.     [root@server1 ~]# yum install openshift-origin-cartridge-diy     Loaded plugins: product-id, rhnplugin, security, subscription-manager     This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.     This system is receiving updates from RHN Classic or RHN Satellite.     Setting up Install Process     No package openshift-origin-cartridge-diy available.     Error: Nothing to do     [root@server1 ~]#


title: Why does pam_mount ask for password?

text: I used the `pam-auth-update` tool in order to enable some pam configuration profiles:                PAM configuration       PAM profiles to enable:         [*] encfs encrypted home directories                    [*] Unix authentication                                      [*] Mount volumes for user                                  [*] GNOME Keyring Daemon - Login keyring management           [*] ConsoleKit Session Management      All the features work as expected, but there's one thing -- the `Mount volumes for user` option seems to affect the `su` command. I added the following line to `/etc/security/pam_mount.conf.xml` file:               <volume user="morfik" fstype="fuse" path="encfs#/media/Server/Dropbox.encfs/Dropbox/encrypted" mountpoint="/media/Server/Dropbox" />      and when I type in a terminal `su morfik` (as root), there's shouldn't be any password prompt, but instead I see this:               # su morfik     reenter password for pam_mount:      If I unchecked the `Mount volumes for user` option in the menu above, everything seems to be file and the `reenter password` disappears. I tried to play with `/etc/pam.d/` files, but I don't have any experience with PAM, and I wasn't able to make it work. Does anyone know what has to be changed in these files? **UPDATE#1** This is the content of `/etc/pam.d` directory:               # ls -al /etc/pam.d/     total 104K     drwxr-xr-x   2 root root 4.0K Mar 21 16:21 ./     drwxr-xr-x 153 root root  12K Mar 21 16:11 ../     -rw-r--r--   1 root root  197 Sep  8  2013 atd     -rw-r--r--   1 root root  384 May 25  2012 chfn     -rw-r--r--   1 root root   92 May 25  2012 chpasswd     -rw-r--r--   1 root root  581 May 25  2012 chsh     -rw-r--r--   1 root root 1.2K Mar 20 17:35 common-account     -rw-r--r--   1 root root 1.3K Mar 20 17:35 common-auth     -rw-r--r--   1 root root 1.5K Mar 20 17:35 common-password     -rw-r--r--   1 root root 1.3K Mar 20 17:35 common-session     -rw-r--r--   1 root root 1.2K Mar 20 17:35 common-session-noninteractive     -rw-r--r--   1 root root  527 Jul  3  2012 cron     -rw-r--r--   1 root root   69 Jul 16  2013 cups-daemon     -rw-r--r--   1 root root 4.8K Mar  5 10:18 login     -rw-r--r--   1 root root   92 May 25  2012 newusers     -rw-r--r--   1 root root  520 Jul 22  2008 other     -rw-r--r--   1 root root  147 Feb 13 07:15 passwd     -rw-r--r--   1 root root  255 Oct 15 18:40 polkit-1     -rw-r--r--   1 root root   84 Dec 27 12:40 samba     -rw-r--r--   1 root root 2.1K Feb 15 03:11 sshd     -rw-r--r--   1 root root 2.3K May 25  2012 su     -rw-r--r--   1 root root   95 Jan 15 22:58 sudo     -rw-r--r--   1 root root  108 Oct 19 23:42 xscreensaver      There's no file `/etc/pam.d/system-auth`. I checked what files have `pam_mount` in their content, and I got this:               # egrep -i pam_mount *     common-auth:auth        optional        pam_mount.so     common-session:session  optional        pam_mount.so      The content of the files:               #     # /etc/pam.d/common-auth - authentication settings common to all services     #     # This file is included from other service-specific PAM config files,     # and should contain a list of the authentication modules that define     # the central authentication scheme for use on the system     # (e.g., /etc/shadow, LDAP, Kerberos, etc.).  The default is to use the     # traditional Unix authentication mechanisms.     #     # As of pam 1.0.1-6, this file is managed by pam-auth-update by default.     # To take advantage of this, it is recommended that you configure any     # local modules either before or after the default block, and use     # pam-auth-update to manage selection of other modules.  See     # pam-auth-update(8) for details.          # here are the per-package modules (the "Primary" block)     auth    sufficient              pam_encfs.so      auth    [success=1 default=ignore]  pam_unix.so nullok_secure try_first_pass     # here's the fallback if no module succeeds     auth    requisite           pam_deny.so     # prime the stack with a positive return value if there isn't one already;     # this avoids us returning an error just because nothing sets a success code     # since the modules above will each just jump around     auth    required            pam_permit.so     # and here are more per-package modules (the "Additional" block)     auth    optional    pam_mount.so      # end of pam-auth-update config      and:               #     # /etc/pam.d/common-session - session-related modules common to all services     #     # This file is included from other service-specific PAM config files,     # and should contain a list of modules that define tasks to be performed     # at the start and end of sessions of *any* kind (both interactive and     # non-interactive).     #     # As of pam 1.0.1-6, this file is managed by pam-auth-update by default.     # To take advantage of this, it is recommended that you configure any     # local modules either before or after the default block, and use     # pam-auth-update to manage selection of other modules.  See     # pam-auth-update(8) for details.          # here are the per-package modules (the "Primary" block)     session [default=1]         pam_permit.so     # here's the fallback if no module succeeds     session requisite           pam_deny.so     # prime the stack with a positive return value if there isn't one already;     # this avoids us returning an error just because nothing sets a success code     # since the modules above will each just jump around     session required            pam_permit.so     # and here are more per-package modules (the "Additional" block)     session required    pam_unix.so      session optional    pam_mount.so      session optional            pam_ck_connector.so nox11     # end of pam-auth-update config      **UPDATE#2** I'm using Debian testing. I tried to change the position of `pam_mount`, but it's always the same. I've read some sections of the manual, and there was something like: > >      When "sufficient" is used in the second column, you must make sure that >        pam_mount is added before this entry. Otherwise pam_mount will not > get >        executed  should  a  previous  PAM module succeed. Also be aware of > the >        "include" statements. These make PAM look into the specified  file. > If >        there is a "sufficient" statement, then the pam_mount entry must > either >        be in the included file before the "sufficient" statement or before > the >        "include" statement. >   I even added `pam_mount` to the `/etc/pam.d/su` file to check if this makes any difference, but it doesn't matter. If `pam_mount` if first, like they say, instead of a password prompt, I get `pam_mount password` prompt when I log to my system, and it still asks for password when I try `su morfik` This is the `su.log` from `strace`: http://pastebin.com/bSBsGiy4


title: Debian7, date and time formats to Hungarian

text: how can I change (only) the date and time formats to Hungarian on a Debian7 (but the language I want to keep English)... I've tried to change like this: /etc/defaults/locale               #  File generated by update-locale     LANG="en_US.UTF-8"     LANGUAGE="en_US:en"     LC_TIME="hu_HU" (or "hu_HU.UTF-8" or hu_HU.UTF-8)      ... but the date time format remains...               root@debian:~# date     Fri Mar 21 13:07:48 CET 2014      ... but the charset changed somehow, because if I start mc the border lines looks terrible, and if I remove LC_TIME line from /etc/defaults/locale the lines are fine again... any ideas? root@debian:~# locale               LANG=en_US.UTF-8     LANGUAGE=en_US:en     LC_CTYPE="en_US.UTF-8"     LC_NUMERIC="en_US.UTF-8"     LC_TIME="en_US.UTF-8"     LC_COLLATE="en_US.UTF-8"     LC_MONETARY="en_US.UTF-8"     LC_MESSAGES="en_US.UTF-8"     LC_PAPER="en_US.UTF-8"     LC_NAME="en_US.UTF-8"     LC_ADDRESS="en_US.UTF-8"     LC_TELEPHONE="en_US.UTF-8"     LC_MEASUREMENT="en_US.UTF-8"     LC_IDENTIFICATION="en_US.UTF-8"     LC_ALL=


title: Add directory to path for all shells and users in SLES 11.1

text: I'm using a server running Suse Enterprise 11.1. I need to add some locations to the path for all users and for all the shells. Is there a nice and easy way to do this or do I have to modify the profile file for each shell. Also I don't know if this is the default config for suse or if someone mess the server up, but there isn't a /etc/profile nor a /etc/shellnameprofile.local How can I archive this? Please help.


title: Sending Emails from bash script in Solaris VM

text: I am trying to send emails using the following bash script:               /bin/mail -s "#subject" "$emailto" < "$message"       It works fine on my local machine but does not work on my VM. I looked it up and read that the issue might be related to the `/etc/hosts` file, so here is the contents of that file:               127.0.0.1    localhost loghost     192.168.1.200   root loghost      I am root user on this solaris VM. What do I need to do change get this working? I am getting this msg in log file               From MAILER-DAEMON Thu Feb 14 20:20:06 2013     Return-Path: <>     Received: from unknown (localhost [127.0.0.1])             by unknown (8.14.4+Sun/8.14.4) with ESMTP id r1F1K57F002411             for <root@unknown>; Thu, 14 Feb 2013 20:20:06 -0500 (EST)     Received: from localhost (localhost)             by unknown (8.14.4+Sun/8.14.4/Submit) id r1F1K51c002398;             Thu, 14 Feb 2013 20:20:06 -0500 (EST)     Date: Thu, 14 Feb 2013 20:20:06 -0500 (EST)     From: Mail Delivery Subsystem <MAILER-DAEMON@unknown>     Message-Id: <201302150120.r1F1K51c002398@unknown>     To: root@unknown     MIME-Version: 1.0     Content-Type: multipart/report; report-type=delivery-status;             boundary="r1F1K51c002398.1360891206/unknown"     Subject: Returned mail: see transcript for details     Auto-Submitted: auto-generated (failure)     Content-Length: 1287          This is a MIME-encapsulated message          --r1F1K51c002398.1360891206/unknown


title: How do Firefox and Chrome render JPEG images on Linux?

text: I'm having trouble with Firefox and Chrome for some time now and it's very irritating. Neither of these browsers will render JPEG images. Konqueror and Opera are fine though. What libraries I can try swapping or up/downgrading to get this working again? I'm forced by nVidia to maintain an old driver stack, which could also be contributing to the issue. Can it?


title: Reversing 1-D array

text: I'm trying to reverse a 1-D array which contains a list of files. I followed http://stackoverflow.com/questions/13360091/how-to-reverse-array-in-bash- onliner-for-loop to be the code. But this is not quite working for me.               for (( i=${#FILES_dcn[@]}-1,j=0 ;i>=0;i--,j++ ));     do            dcnarray[j] = ${FILES_dcn[i]}          done      The values are not getting copied when I echo the arrays onto a file. Why is that??


title: AWK remove one line?

text: I need some help with awk. This is my uptime               uptime=`uptime|grep days|awk '{print$3,$4}'`      But it displays now > 23 days, I want to remove `,` How can I accomplish that? cheers and thanks


title: make `find` return with a non-zero exit code if error occured

text: Why am I seeing the following:               $ find  -not -exec bash -c 'foo' \; -quit     bash: foo: command not found     $ echo $?     0      This is a reduced version of the actual script I am using which I post at the end of the question (if you really want to know). So the question is how do I make `find` execute a shell using `exec bash -c` on a bunch of find results and exit at the first one that fails **and** also return a non-zero exit code that I can inspect later in my script? *** actual script ***               #!/usr/bin/env bash     find path-a path-b path-c \       -iname build.xml -not -exec bash -c 'echo -n "building {} ..." && ant -f {} build && echo "success" || (echo "failure" && exit 1)' \; -quit     RESULT=$?     echo "result was $RESULT"


title: What is the proper use of the term 'session'?

text: [I hesitated whether to post this in meta or here. But although this involves terminology, it is of general use, not only on this website.] It looks like at least in Xfce 4.10 (with the session manager "Xfce4-session") this term means a desktop environment in the case in which different DE are installed beside Xfce; selecting between them is presented in the login window as selection between "sessions". ![enter image description here](http://i.stack.imgur.com/TteYh.png) And then what is selected is the DE; selecting a session here is not selecting one among others of the same DE, but the DE itself ![enter image description here](http://i.stack.imgur.com/H1TWn.jpg) (In my case it says Xfce, LXDE, Openbox.) What is selected above is the username and the DE, not a **saved** session. But after making this selection, if in Settings/'Session and Startup'/General the option 'Display chooser on login' is checked, a new selection is possible between a different type of sessions, those that are DE-specific, a sort of sub-sessions, saved by a certain user within a certain DE, with the option under Settings/'Session and Startup'/Session/'Save session'. ![enter image description here](http://i.stack.imgur.com/3v67f.png) Passwords and usernames are related to selecting and entering generic sessions (DE). Is this normal and accepted use, or is it just an accident, maybe limited to Xfce? (I have stumbled into this when searching for this workaround) * * * Edit after comments: What I think it happened is that the proper use of the term 'session' being that of **the set of options and running programs saved by the user in a certain DE** , this meaning was diffused upstream to the initial selection of the user and DE. Both selections may be implicit (automated) if the user does not activate 'login password' and 'chooser'. But while many people want to be asked for password at login/startup, they do not want to select each time between saved sessions. As the first selection (user/DE/password) is the most common, it took the name "session" which now appears in the Xfce login window. The term 'login' must have played a role in this because it suggests that a login must be one into a session. But if so, there must be two types of logins if there are two types of sessions. The term 'login' thus appears in Settings/'Users and Groups' when setting on being asked for password ![enter image description here](http://i.stack.imgur.com/TLcWO.png) but also under 'Session and Startup' regarding choosing (or not) between saved sessions - **after** the first 'login' has been made. ![enter image description here](http://i.stack.imgur.com/6TWrP.png) These are two different types of logins. I was wandering whether behind this there's some consensus or is it just an accident. This may cause confusion especially to new users, whom these GUI settings are supposed to help - and especially when practical problems occur as seen in the linked answer. Trying to solve these problems and looking at the Xfce settings as they are displayed now, v.4.10, the double use of the term makes things worse.


title: Is it possible to search text within text-files using Catfish?

text: I want to find a line in system files - that is I need to scan a lot of files for that. I learned that I can use                grep -r <word> *      replacing with the needed expression. Can Catfish do that kind of search? (I am in Linux Mint 15 Xfce)


title: midnight commander: specify commandline options in global config file

text: I want to start mc always with the `--nomouse` option. Is there a way to put this option into the (global) config file, so that I don't have to type it every time ?


title: Where to set boot sector for dual boot system "Kubuntu - Windows XP"?

text: I've downloaded Kubuntu 13.04 `.iso` from their site. Unfortunately this version doesn't provide auto installation as `Install Kubuntu alongside existing OSes`. They either take all you disk of force you to manually partition your disk (see my question http://askubuntu.com/questions/319389/where-to-find-the-latest- kubuntu-13-04-with-autoinstaller). I choose 'manual' option. And I don't understand where do I need to place boot loader. I have such a picture of my disk as Kubuntu shows. I want to install Kubuntu in a `free space` sector (it is 65 Gb):               /dev/sda       /dev/sda1 ntfs       /dev/sda2 ntfs       /dev/sda5 ntfs       /dev/sda6 fat32       /free space      Three `ntfs` sections (`/dev/sda1`, `/dev/sda2`, `/dev/sda5`) are Windows OSes:               /dev/sda1 is C:/, this one is considered as a main I think and it is Win XP     /dev/sda2 is D:/     /dev/sda5 is F:/      `/dev/sda6` is just an empty shared partition formatted as `FAT32`. So: 1) where do I need to place a `boot loader` to have a dual-boot system? Kubuntu offers me all my those `/dev/sda`s without any help, without any hint. 2) Do I need to install and set up GRUB manually or Kubuntu will do it itself?


title: Debian 7.0 (64bit) Skype crashes when answering call

text: I can make video call using Skype but when I answer Skype crashes and sometimes gdm3 too.               LOG :     ALSA lib conf.c:4687:(snd_config_expand) Unknown parameters CARD=DX     ALSA lib control.c:951:(snd_ctl_open_noupdate) Invalid CTL default:CARD=DX     ALSA lib conf.c:3314:(snd_config_hooks_call) Cannot open shared library libasound_module_conf_pulse.so     ALSA lib control.c:951:(snd_ctl_open_noupdate) Invalid CTL hw:2     skype: hcontrol.c :326 : _snd_hctl_find_elem:  L'assertion « hctl && id » a échoué.     Abandon      My configuration:   * Debian 7 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux   * Skype 4.2.0.11-1 i386 (Multi Arch ok) **The problem was solved** when it became clear that the fglrx driver conflicts with the radeon DRM driver. so I Uninstall libdrm-intel1, libdrm- nouveau1a, libdrm-radeon1. I kept libdrm2. I found the solution here : Wiki de Debian


title: Mate desktop breaks with no panels and tens of caja windows on user switching?

text: I'm using Sabayon GNU/Linux with Mate-Desktop. I have my computer set up for multiple users so my girlfriend and the kids can use it too.                ~ $ uname -a     Linux 3.9.0-sabayon #1 SMP Thu Jun 27 07:53:45 UTC 2013 x86_64 Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz GenuineIntel GNU/Linux      ~ $ equo search mate-desktop     >>      @@ Package: mate-base/mate-desktop-1.6.0 branch: 5, [sabayonlinux.org]      >>         Available:     version: 1.6.0 ~ tag: NoTag ~ revision: 0     >>         Installed:     version: 1.6.0 ~ tag: NoTag ~ revision: 0      Each time i switch user, logging out and logging in as another user I end up in a completly messed up desktop environment.   * The `mate-panel`s are missing.   * Errors pop up that no system tray is available.   * Tens of `caja` instances pop up. The only way to fix this is to switch to TTY and reboot the machine. After reboot everything works as desired. But switching users does not work at all. In addition, both `mate-panel` and `mate-settings-d` use around 100% CPU.                 PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND      8691 afri      20   0 6735900 5.384g  21176 R 100.3 17.2  70:03.75 mate-settings-d      8716 afri      20   0 1789004 1.070g  21744 R  96.4  3.4  64:12.03 mate-panel      Someone on IRC of #mate told me this could be a `dconf` error. The `.xsession- error` log says `dconf` has some issues with permissions:               (mate-panel:8716): dconf-CRITICAL **: unable to create directory '/run/user/1001/dconf': Permission denied.  dconf will not work properly.      Checking out the directory `/run/user/1001/dconf` tells it's owned by another user. It's a mess. How to avoid this permission conflict for the dconf directory? * * * ### Update Finally, this thread suggests to play around with `$XDG_RUNTIME_DIR`:                $ echo $XDG_RUNTIME_DIR     /run/user/1001      Now, the issue is obvious: all users are using the same directory for `dconf` which results in the described permission issues. So I tried to adjust the `$XDG_RUNTIME_DIR`. I added the following line to my `~/.bash_profile` settings:               export XDG_RUNTIME_DIR=/run/user/$(id -u username)      Now, `dconf` should be able to access the custom directory. But this still does not work. I'm still getting the same error as above:               (mate-panel:8716): dconf-CRITICAL **: unable to create directory '/run/user/1001/dconf': Permission denied.  dconf will not work properly.      But I double-checked the settings of the directory:   1. it's existing.   2. permissions are set correctly.   3. environment variables are set correctly. What else can I try to fix this? I'm really lost.


title: How to make and apply (patch) one side diff?

text: I want to make a shell script that updates a config file. The file present on the server has information, like various IP addresses. The new file has more code, from new configs added to the system, I want to be able to add these new configurations to the server file without changing what's already configured there **example:** **server file**               [config]     ip=127.0.0.1     port=22      **new file**               [config]     ip=XXX.XXX.XXX.XXX     port=XX     user=root      I want the resulting file to be               [config]     ip=127.0.0.1     port=22     user=root      How would be a good way to do that? I don't want to rely on line position and such, because the actual config files are quite large and more lines could have been added to the server file. I've tried to make a diff from the files and apply the patch, but it didn't work. Thanks for any help.


title: Listing only the files in a folder and inside its subfolders

text: Is there a linux command for getting only the files in a folder and inside its subfolders? I have used the `find` command, but it is displaying all the files and folders. I am executing this shell command using the php `exec()` function.


title: What is a good alternative to iTunes on Linux?

text: I use iTunes primarily to sync music to my iPod, but other than that I use it to play music as opposed to streaming like Pandora or Spotify. I'm trying to completely convert from Win7 to Fedora and if I was able to have my music in a Linux environment, I'd be one step closer.


title: How to make LXTerminals open maximized in Lubuntu 11.04?

text: I have Lubuntu 11.04, I start my terminal sessions with a shortcut. The annoying thing is that the terminal windows are never maximized when I launch them, so every time I launch a terminal I must resort to using the mouse. How do I set it so that the terminal session windows open maximized when I start them? The Lubuntu terminal is LXTerminal.


title: how to understand list of soundcards; meaning of MID, HDMI, PCH

text: Command `aplay -l` produces a list of "all soundcards and digital audio devices". On my brand-new Fujitsu Esprimo desktop, I get:               **** List of PLAYBACK Hardware Devices ****     card 0: MID [HDA Intel MID], device 3: HDMI 0 [HDMI 0]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 0: MID [HDA Intel MID], device 7: HDMI 1 [HDMI 1]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 0: MID [HDA Intel MID], device 8: HDMI 2 [HDMI 2]       Subdevices: 1/1       Subdevice #0: subdevice #0     card 1: PCH [HDA Intel PCH], device 0: ALC671 Analog [ALC671 Analog]       Subdevices: 1/1       Subdevice #0: subdevice #0      `lspic -v` shows two audio devices:               00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)         Subsystem: Fujitsu Technology Solutions Device 11e7         Flags: bus master, fast devsel, latency 0, IRQ 48         Memory at f7c34000 (64-bit, non-prefetchable) [size=16K]         Capabilities: <access denied>         Kernel driver in use: snd_hda_intel          00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 04)         Subsystem: Fujitsu Technology Solutions Device 11eb         Flags: bus master, fast devsel, latency 0, IRQ 47         Memory at f7c30000 (64-bit, non-prefetchable) [size=16K]         Capabilities: <access denied>         Kernel driver in use: snd_hda_intel      Now my questions: How it comes my office computer has two sound cards? These are both standard on-board cards, right? What's the meaning of MID, PCH, HDMI? Which one is connected to the moss-green standard plug?


title: How do I add a guest account to Linux Mint 13?

text: Is there a way to add a guest login account on welcome screen of Linux Mint 13 MATE-32bits, similar to the one present in Ubuntu 12.04?


title: awk remove the rows based on another column value

text: I have a file like below which I have sorted based on the username field.               UserID score UserName     1234    200   Jack     5678    150   Jill     8543    200   Jill      5678    100   John      I am trying to remove the rows which have the lowest score for the same usernames. So, I want to have the output as,               UserID score UserName     1234    200   Jack     8543    200   Jill      5678    100   John


title: Not allowed to read a file with correct group permissions? ACL?

text: I just set up a basic nginx server on my Debian 7.0 server. The config file `/etc/nginx/nginx.conf` is barely modified, and begings with:               user www-data; # nginx shall run as user `www-data`      I then set up a server configuration (file `/etc/nginx/sites- available/filenamehere`), which includes the following directives:               root /home/diti/www     access_log /home/diti/logs/access.log;      I executed `setfacl` so that nginx can read all data in /home/ directories, and created the file `/home/diti/logs/access.log` as a regular user (username is `diti`). * * *               $ whoami     diti          $ groups diti     diti : diti          $ ls -lh /home/diti/logs/access.log     total 12K     -rw-r-x---+ 1 www-data diti 8.9K Mar 13 16:47 access.log          $ tail /home/diti/logs/access.log     tail: cannot open `access.log' for reading: Permission denied          $ getfacl /home/diti/logs/access.log     getfacl: Removing leading '/' from absolute path names     # file: home/diti/logs/access.log     # owner: www-data     # group: diti     user::rw-     user:www-data:r-x     group::---     mask::r-x     other::---      **How comes I am not able to read the log file** , owned by `www-data:diti`? I should be able to, since I (`diti`) belong to group `diti`, and group permissions for the log file are set to `r-x`. Is it because of ACL? My filesystem is ext4.


title: How can I use gsub with a pattern? And how to tell it which file to awk?

text: I've read here that I can replace the values of all columns containing a particular text using               awk -F'\t' -vOFS='\t' '{ gsub("CC", "C", $1) ; gsub("AA", "A", $1) ; print }'      But where do I tell `awk` the name of the file I want to perform this operation on? And instead of searching for the literal "CC", how can search for a column matching the pattern `A{7}`?


title: find -exec exit 1 \; Doesn't work neither does find -exec sh -c exit 1 \;

text: Using Enterprise Linux 5/6, Bash 4.x I want this type of logic:               # IF temp file exists, exit because we are restarting already          find /tmp/restarting_server -mmin -10 -exec exit 1          lsof -i TCP:1234 || declare Server_is_down=TRUE         if ! [ -z $Server_is_down ]; then restart_server         fi     # Restart Server Function     restart_server() {         touch /tmp/restarting_server          service server restart         rm -f /tmp/restarting_server      }      The problem is find's -exec doesnt like builtins it seems. I know I can do an if then statement to check for the file and exit there, but I want to know how to do this in a find -exec (or I'd settle for a good xargs solution).


title: Gentoo - problem with setting services up (KDE 4.10)

text: I have a problem with Gentoo. I have installed Gentoo in VirtualBox and it works perfectly. I have learned a lot about Gentoo, how to compile everything, how to set Gentoo for my needs. But now I want graphical interface and I decided to use KDE 4.10. It is the latest stable version and it looks great. Guide is here http://wiki.gentoo.org/wiki/KDE First, I have selected profile and after that going to set all services (ConsoleKit, DBus...). According to guide, before ConsoleKit, you must install DBus. Okay, add it in USE variable and update system with command:               root# emerge --ask --changed-use --deep @world      After executing command, Gentoo should install 200-300 packages ... it goes well for few minutes and then screen goes black! And there is the problem--it is not screensaver or something--it just doesn't work anymore. After closing the virtual machine, logging in again and executing command `^^` it will continue until some point. When there is big package that needs to be installed it will stop (because of that black screen). After executing command it will install the same package (because it isn't installed), again and again. What can I do to proceed with installation?


title: disable sudo password prompt for boot script

text: I've got raspbian installed and need to mount a cifs path after boot is completed. In `fstab` I got an entry for this with the `noauto` parameter. When using `auto`, boot hangs. So in raspbian, the file is located in `/etc/rc.local`               # Print the IP address     _IP=$(hostname -I) || true     if [ "$_IP" ]; then       printf "My IP address is %s\n" "$_IP"     fi          #mount media storage via cifs     if grep -qs '/media/Seagate' /proc/mounts; then         echo "Seagate already mounted."     else         echo "Mounting Seagate.."         sudo -n mount /media/Seagate     fi          exit 0      According to the man page the -n parameter will suppress a password prompt for the `sudo` command. This is not the case, however. So I tried editing the `sudoers` file.               # This file MUST be edited with the 'visudo' command as root.     #     # Please consider adding local content in /etc/sudoers.d/ instead of     # directly modifying this file.     #     # See the man page for details on how to write a sudoers file.     #     Defaults    env_reset     Defaults    mail_badpass     Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"          # Host alias specification          # User alias specification          # Cmnd alias specification          # User privilege specification     root    ALL=(ALL:ALL) ALL          # Allow members of group sudo to execute any command     %sudo   ALL=(ALL:ALL) NOPASSWD: ALL          # See sudoers(5) for more information on "#include" directives:          #includedir /etc/sudoers.d     pi ALL=(ALL) NOPASSWD: ALL      Only the %sudo line is changed. I assume root to be in group sudo and since the %sudo line is after the root line, no password should be required. Note that root does not have a password anyways on raspbian, I can fill anything at the password prompt. Any suggestions? Other approaches like crontab may also be suitable EDIT 1 Further info: there is               #!/bin/sh -e      on top of the file; the '-e' parameter apparently makes it not halt on errors. The permissions are               drwxr-xr-x 2 root root 4096 Feb 23 12:09


title: bash script error: source: not found

text: I must be missing a fundamental understanding about sourcing files in bash. I've tried the different approaches that seem like they should work, but I still get this error `source: not found`. In my script I tried to cd to the directory where the file that I want to source is located before sourcing it. That didn't work.               cd /home/user/path/to/     source myfile      Neither did providing the full absolute path to the file to be sourced:               source /home/user/path/to/myfile      The error is "source: not found" with the line number of the above statement. Is there something else, something basic, I could be overlooking? I have checked the paths I'm using and I don't see any errors. This problem is repeatable. I'm running Ubuntu on a Linode server and my scripts all start with:               #!/bin/bash


title: Status of 5GHz support for 802.11 WiFi devs in BSD (2014)

text: To put it simply, 2.4GHz band doesn't work anymore due to the plethora of various Wi-Fi and other devices, whereas 5GHz is still almost entirely empty. Do any of the BSDs -- FreeBSD, OpenBSD, NetBSD, DragonFly -- support wireless networking in the 5GHz band? Any one of 802.11a, 802.11n, 802.11ac, as long as it's on the 5GHz band?


title: What does mv do in case of errors?

text: I've just tried to move a big tree from one disk to another, which was too small. Now, I'm left with something I can't really understand - it looks like some files were indeed moved away from the source tree while others were just copied. This is most probably not true, and I'm just overlooking something, like I did when I check the free place on the target disk. :D The command was simply `mv source-dir destination-dir`, where both dirs reside on different disks. I'm using `mv (GNU coreutils) 7.4`. Nowhere in the man page I found the answers to the following questions:   * may truncated files get created?   * in case of errors, will anything in the source tree get deleted?   * how to recover (in an easy and fast way)?


title: Rip chapters of a DVD to separate files

text: I have a DVD with cartoons for kids and there are a couple of episodes on every one of them. How can I rip them such that every episode is in a separate file? I think every episode is written as a chapter within one title on the DVD.


title: Remote-Accesible Live-Distribution (aka Live CD)

text: I'm looking for a live distribution (Live CD or the likes) which comes - per default - with `sshd` running at startup. I want to check the components of my laptop whose graphics has died (card- replacement did not do the trick). The system seems to boot into Knoppix 6 just right (and in typing commands w/o screen I can get it to shut down regularly) but **what I need** is a live distribution (CD/DVD/USB) which I can fire up and log (`ssh`) into over the network to check whether the CPU & memory is OK and if the new graphics card is ok too. Anybody an idea?


title: Getty instances in init process

text: Init typically will start multiple instances of "getty" which waits for console logins which spawn one's user shell process. Upon shutdown, init controls the sequence and processes for shutdown. The init process is never shut down. It is a user process and not a kernel system process although it does run as root. If the init process are user process and not kernel process, how I can modify the behavior or see the log the the process remotely?


title: Array of string expanded to path?

text: Suppose I have the following initialization of bash array:               my_array=(         "/usr/bin"         "/usr/lib/*.so"     )      If I do iteration using:               for array_item in ${my_array[@]}      do          ...      done       Then the content of the `my_array` is expanded containing path to any files with .so extension in /usr/lib/ directories. but I just wanted the array contain two string which is `"/usr/bin"` and `"/usr/lib/*.so"`. How should I do that?


title: Where can I find sources for

text: 1. Emacs lisp source code for `.elc` files? e.g. `cal-mayan.elc`   2. Files in the `/bin` directory? e.g. `cat`, `split`, and `echo`


title: Enabling Telnet on the NETGEAR N300 Wi-Fi Gigabit Router (D1500) Possible?

text: I've bought this router not long ago and I was looking forward to telnet but I am starting to doubt whether it is possible or I am doing something wrong : Tested telnetEnable.exe on Windows and the compiled version on ubuntu, basically this is where I'm stuck (the beginning)               root@ubuntu:~/telnet# telnet 192.168.1.1     Trying 192.168.1.1...     Connected to 192.168.1.1.     Escape character is '^]'.     Connection closed by foreign host.      Now, I will try to give you guys who are for sure more expert than me all the info you need to help me if possible, please.               root@ubuntu:~/telnet# route -n     Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0     192.168.1.0     0.0.0.0         255.255.255.0   U     1      0        0 eth0      route -n and arping to see MAC and default gateway               root@ubuntu:~/telnet# arping 192.168.1.1 -I eth0     ARPING 192.168.1.1 from 192.168.1.4 eth0     Unicast reply from 192.168.1.1 [XXXXXXXXXXXX]  3.359ms     Unicast reply from 192.168.1.1 [XXXXXXXXXXXX]  0.850ms     ^CSent 2 probes (1 broadcast(s))     Received 2 response(s)      Now, nmap shows port 23 is open but tcpwrapped so i assume it still should work?               root@ubuntu:~/telnet# nmap -A -T4 192.168.1.1     Starting Nmap 6.40 ( http://nmap.org ) at 2014-09-07 20:07 UTC     Nmap scan report for 192.168.1.1     Host is up (0.0012s latency).     Not shown: 995 closed ports     PORT     STATE SERVICE    VERSION     21/tcp   open  ftp     23/tcp   open  tcpwrapped     53/tcp   open  domain     ISC BIND hostmaster     80/tcp   open  tcpwrapped     | http-auth:      | HTTP/1.0 401      |_  Basic realm=NETGEAR D1500     |_http-methods: No Allow or Public header in OPTIONS response (status code 401)     |_http-title: Authorization Failed     5431/tcp open  upnp       MiniUPnP     1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at http://www.insecure.org/cgi-bin/servicefp-submit.cgi :     SF-Port21-TCP:V=6.40%I=7%D=9/7%Time=540CBAFE%P=x86_64-pc-linux-gnu%r(NULL,     SF:25,"220\x20FTP\x20server\x20\(192\.168\.1\.1\)\x20ready\.\r\n")%r(Gener     SF:icLines,3E,"220\x20FTP\x20server\x20\(192\.168\.1\.1\)\x20ready\.\r\n50     SF:0\x20Unknown\x20command:\x20\"\"\r\n")%r(Help,39,"220\x20FTP\x20server\     SF:x20\(192\.168\.1\.1\)\x20ready\.\r\n503\x20USER\x20expected\.\r\n")%r(S     SF:MBProgNeg,3E,"220\x20FTP\x20server\x20\(192\.168\.1\.1\)\x20ready\.\r\n     SF:500\x20Unknown\x20command:\x20\"\"\r\n");     MAC Address: 08:BD:43:68:83:B0 (Netgear,)     Device type: switch     Running: Allied Telesyn embedded, D-Link embedded     OS CPE: cpe:/h:alliedtelesyn:at-gs950 cpe:/h:dlink:des-3226l     OS details: Allied Telesyn AT-GS950 or D-Link DES-3226L switch     Network Distance: 1 hop     TRACEROUTE     HOP RTT     ADDRESS     1   1.21 ms 192.168.1.1     Nmap done: 1 IP address (1 host up) scanned in 54.34 seconds      Now, I've tried to do everything I could but without success. I must either be doing something wrong or it is not possible with this router to access telnet (would like to boost snr). I think this is all the possible information I've gathered so far, let me know what else to try.


title: initramfs image compression other than gzip

text: can the initramfs image be compressed by a method other than gzip, such as lzma?


title: How can I use DD to migrate data from an old drive to a new drive?

text: I am upgrading the internal SATA hard drive on my laptop from a 40G drive to a 160G drive. I have a Linux/Ubuntu desktop which has a SATA card. I would actually like to do the same thing for a couple CentOS & FreeBSD boxes at work, and it seems this would have the same solution. I've heard that I can use DD to mirror the 40G partition to the 160G drive, or that I can save the 40G partition as an image on my local system, and then copy that 40G image to the 160G drive. Can anyone describe how I may do this? Do I need any other utilities, such as gparted


title: Lm_sensors not reading gfx card temperature right

text: I have ran sensors-detect and lm_sensors still returns the following.               radeon-pci-0100     Adapter: PCI adapter     temp1:       +511.0°C  (crit = +120.0°C, hyst = +90.0°C)          coretemp-isa-0000     Adapter: ISA adapter     Physical id 0:  +47.0°C  (high = +87.0°C, crit = +105.0°C)     Core 0:         +46.0°C  (high = +87.0°C, crit = +105.0°C)     Core 1:         +47.0°C  (high = +87.0°C, crit = +105.0°C)


title: Is there a scripting language with C-like syntax?

text: I can neither code Bash nor Python (actually, I am only comfortable with C-like syntax), and, actually, am too busy and lazy to learn them now. But I would like to script some tasks. Is there a scripting language for GNU/Linux, having obvious and comfortable syntax for C/C++/C#/Java developers?


title: Minimizing "idle" writes on a file system

text: Leaving out many details, I need to create a read/write file system on a device with the following main goals:   * Eliminate all writes while data is not being explicitly written.   * Reduce all indirect writes when data _is_ written.   * Run fsck on boot after unclean unmount. Currently I am using ext3, mounted with noatime. I am not familiar with the details of ext3. In particular, is data written to an ext3 system during "idle" time when no programs are explicitly writing data (specifically, I'm thinking of kjournald and the commit= mount option)? If I switch to ext2, will that meet all the above requirements? In particular, do I have to set anything up to force an fsck after a sudden power cut? My options are fat32, ext, ext2, and ext3, plus all of the settings available via mount. Performance is not critical, neither is robustness wrt bad sectors developing over time.


title: Cannot change JAVA_HOME

text: When I run java -version in my terminal I get:               user@ubuntu:~$ java -version     java version "1.7.0_25"     OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.13.04.2)     OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)      I need to change my java to 5. I have downloaded jdk5 which is located here:               /home/user/tools/jdk1.5.0_22      First I have tried to add the following to my ~/.bashrc file:               JAVA_HOME=/home/user/tools/jdk1.5.0_22     export JAVA_HOME     PATH=$PATH:$JAVA_HOME/bin     export PATH       I have then restarted my terminal but I still get:               user@ubuntu:~$ java -version     java version "1.7.0_25"     OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.13.04.2)     OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)      I have then tried to add `JAVA_HOME` to `/etc/environment` :               PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"          JAVA_HOME=/home/user/tools/jdk1.5.0_22      After restarting the terminal (close and open a new one) java still points to jdk 7:               user@ubuntu:~$ java -version     java version "1.7.0_25"     OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.13.04.2)     OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)      But it seems that the JAVA_HOME is set:               user@ubuntu:~$ echo $JAVA_HOME     /home/user/tools/jdk1.5.0_22      How do I change the version of java that I use?


title: bbswitch & bumblebee, card starting one every two call

text: I'm trying to set up bumblebee for using my Nvidia card (GT 750M) for running opengl 4 applications. I installed intel-dri, xf86-video-intel, nvidia, bumblebee and bbswitch. I set up /etc/modprobe.d/bbswitch.conf               options bbswitch load_state=0 unload_state=1      Yet I have a stange issue, at first call my program doesn't start :               $ cat /proc/acpi/bbswitch     0000:02:00.0 OFF     $ optirun glxgears     [ 1500.270330] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) Server terminated successfully (0). Closing log file.     [ 1500.270357] [ERROR]Aborting because fallback start is disabled.     $ cat /proc/acpi/bbswitch     0000:02:00.0 ON     $ optirun glxgears     >> WORKS !!!     $ cat /proc/acpi/bbswitch     0000:02:00.0 OFF      when looking at /var/log/Xorg.8.log I have               [  1491.638] (EE) Failed to load module "mouse" (module does not exist, 0)     [  1491.639] (EE) Failed to load module "kbd" (module does not exist, 0)     [  1500.268] (EE) NVIDIA(GPU-0): Failed to initialize the NVIDIA GPU at PCI:2:0:0.  Please     [  1500.268] (EE) NVIDIA(GPU-0):     check your system's kernel log for additional error     [  1500.268] (EE) NVIDIA(GPU-0):     messages and refer to Chapter 8: Common Problems in the     [  1500.268] (EE) NVIDIA(GPU-0):     README for additional information.      Any idea how to solve this ?


title: What does it mean when something says that UNIX device files are static?

text: I've been reading up on udev. In the "overview" section, Wikipedia states that "unlike traditional Unix systems, where the device nodes in the /dev directory have been a static set of files, the Linux udev device manager dynamically provides only the nodes for the devices actually present on a system". What does it mean when it says "static set of files"? Does it mean that there are always `/dev` files but they don't always point to a real device?


title: How do I accept all Networks with the same ssid with wicd?

text: We have a Mesh network here in my town, where every node creates the same client wlan with the SSID "kiel.freifunk.net". In `wicd` I can connect to those networks, but I have to choose which of them. In network-manager it was more handy: there was shown only one network with that SSID and if I moved through the room with my laptop, it automatically connects to the nearest network with that SSID name (I think that's called "roaming") Is it possible to achieve this with `wicd` also?


title: Yum adds the dir 'Package' to baseurl

text: I'm on a network that doesn't get outside internet. I have the repo file pointing to a http server on the network that has the packages that came with the RHEL install cd. Most of the servers work correctly, but one of them wants to add the directory 'Packages' to the end of the line.               [RHEL63]     name= RHEL 6.3 Repository     baseurl=http://myserver/rpm/RHEL6-3     enabled=1     gpgcheck=0      When I try to install, it finds the dependencies (so apparently it sees them) and asks me if I want to continue. Then I get a bunch of error messages because it's looking for the rpms in the directory 'Packages'.               Downloading Packages:     http://myserver/rpm/RHEL6-3/Packages/389-ds-base-1.2.10.2-15.el6.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404"      I've done a `yum clean all` and similar urls for other RHEL versions work with other servers. **EDIT** I've created a 'Packages' directory and have copied all of the rpms to that location which solved the issue. My main concern is why it has that behavior in the first place.


title: Cheapest linux devices?

text: I'm getting interested in ultra-cheap linux devices lately. So far I've been playing with some no-name "3G/4G router" devices from amazon (such as this $10 job http://www.amazon.com/BrainyTrade-Mobile-Wireless- Hotspot-1800mAh/dp/B0093IPJKQ), which runs OpenWRT and gives me USB and Wifi connectivity, and a battery, which charges off USB. I'm curious what other ultra-cheap linux devices people are playing with? Define ultra-cheap as <30USD.


title: Make xterm transparent

text: I'm going through the process of making xterm transparent, I've followed the steps on this site. I installed `transset-df` and `Xcompmgr` and added this line to my `.bashrc` file `[ -n "$XTERM_VERSION" ] && transset-df -a >/dev/null` I'm using `Awesome WM` and when I open a new window with `Mod4` \+ `Enter` I get an error saying `invalid window paramter` among other things, and it doesn't make the window transparent, but when I create sucesive windows it does makes the previous windows transparen, even it makes previous non `xter` windows transparent, except the most recent one. First I tought it was a software problem but then after looking at `transset-df` help, I realized the `-a` option tells `transset-df` to apply transparency to the actual window. So what it is doing is to apply transparency to the most recent window, thats why the first xterm windows shows the error(it is not created by the time the command is called), and sucesive xterms make previous transparent. I need some way to tell bash to apply the command only after the window has been created. Thanks.


title: Pipe input to another process one line at a time

text: I have a script which can take one file name at a time and I want to run it for many files in a folder. So, I want to pipe the output of:               find . -iname '*.m'       to my script but one line at a time.


title: How to inspect group permissions of a file

text: I would like to inspect group permissions of a file from a bash script. Specifically, I need to check whether a file has the group writeable bit on. That's it. Simple as that. However:   1. I also need this to be portable.   2. `test -w <file` won't tell me whether it's group writeable.   3. The output of `ls -ld` is nice for humans, but not so sure about scripts. Technically I could parse output such as `drwxrwxr-x` to extract the group bits, but this seems brittle.   4. The interface for `stat` is completely incompatible between OS X and other systems.   5. `find <file> -perm ...` can't possibly be the answer?


title: View blocked address from sshguard

text: How can I view all the addresses that sshguard has blocked to iptables?


title: Port Forwarding using iptables on Open-Mesh

text: A quick overview for those who are unfamiliar with Open-Mesh: The system uses small wireless access points that automagically build their own mesh network. As long as one of the access points is connected to the internet through a wired LAN (making that access point the "gateway"), all the access points (and their wireless clients) will have internet access. The access points run a modified version of OpenWRT. Normally, the only way to SSH into any of the wireless access points (nodes) is to first SSH into the gateway, _then_ SSH from there to the node. **What I'm trying to do:** Open/forward a port to SSH into each wireless node directly. For example, my gateway is at `10.45.13.220` on my LAN. The first wireless node is at `5.12.252.248` on the mesh network (i.e. typing `ssh root@5.12.252.248` while logged into the gateway will open a shell to the wireless node). I would like to be able to log into the wireless node like so:               $ ssh -p 11001 root@10.45.13.220      So I tried forwarding that port in `iptables` using the following commands:               $ iptables -t nat -A PREROUTING -p tcp -d 10.45.13.220 --dport 11001 \               -j DNAT --to-destination 5.12.252.248:22          $ iptables -t filter -A FORWARD -p tcp -d 5.12.252.248 --dport 22 -j ACCEPT`      I know this is doing _something_ because when I try to SSH to `10.45.13.220:11001` (from another computer on the network) before entering the above commands, the connection is refused. But once the commands have been entered, **the connection times out.** Any idea what I'm doing wrong? I'm pretty new to `iptables`, but this seems like it should be pretty straightforward. **Note:** IP forwarding is already enabled **EDIT: Logging Results** After setting up logging for both rules suggested by @slm, this is what `dmesg` spits out when I try to connect to 10.45.13.220:11001 from another linux box:               [1015021.850000] IN=br-lan1 OUT= MAC=ac:86:74:0c:fd:00:6c:62:6d:12:85:9d:08:00 \     SRC=10.45.13.246 DST=10.45.13.220 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=16916 DF \     PROTO=TCP SPT=41908 DPT=11001 WINDOW=14600 RES=0x00 SYN URGP=0          [1015021.850000] IN=br-lan1 OUT=br-lan1 MAC=ac:86:74:0c:fd:00:6c:62:6d:12:85:9d:08:00 \     SRC=10.45.13.246 DST=5.12.252.248 LEN=60 TOS=0x00 PREC=0x00 TTL=63 ID=16916 DF \     PROTO=TCP SPT=41908 DPT=22 WINDOW=14600 RES=0x00 SYN URGP=0          [1015022.850000] IN=br-lan1 OUT=br-lan1 MAC=ac:86:74:0c:fd:00:6c:62:6d:12:85:9d:08:00 \     RC=10.45.13.246 DST=5.12.252.248 LEN=60 TOS=0x00 PREC=0x00 TTL=63 ID=16917 DF \     PROTO=TCP SPT=41908 DPT=22 WINDOW=14600 RES=0x00 SYN URGP=0      New iptables rules used (as per @slm's suggestion):               iptables -t nat -A PREROUTING -p tcp --dport 11001 -j LOG --log-level debug     iptables -t nat -A PREROUTING -p tcp --dport 11001 -j DNAT --to 5.12.252.248:22     iptables -A FORWARD -i br-lan1 -p tcp -j LOG --log-level debug     iptables -A FORWARD -i br-lan1 -o bat0.2@bat0 -p tcp -d 5.12.252.248 --dport 22 \         -j ACCEPT


title: Trouble using `make gconfig` in ubuntu linux

text: I am trying to compile vanilla Linux kernel 3.12.14 downloaded from kernel.org. When I try `make gconfig`, it says:               * Unable to find the GTK+ installation. Please make sure that     * the GTK+ 2.0 development package is correctly installed...     * You need gtk+-2.0, glib-2.0 and libglade-2.0.     *     make[1]: *** No rule to make target 'scripts/kconfig/.tmp_gtkcheck', needed by `scripts/kconfig/gconf.o'.  Stop.     make: *** [gconfig] Error 2      Now I checked and found my ubuntu has newest versions of libgtk2.0-0, libgtk2.0-bin, libglib2.0-0, and libglib2.0-bin and are manually installed. Cannot find libglade-2.0 whatsoever. I don't know how to go about that to make gconfig work properly.               >> sudo apt-get install libgtk2.0-dev libglib2.0-dev libglade2-dev     Reading package lists... Done     Building dependency tree            Reading state information... Done     Package libglib2.0-dev is not available, but is referred to by another package.     This may mean that the package is missing, has been obsoleted, or     is only available from another source     However the following packages replace it:       libglib2.0-0 libglib2.0-bin          Package libgtk2.0-dev is not available, but is referred to by another package.     This may mean that the package is missing, has been obsoleted, or     is only available from another source          E: Package 'libgtk2.0-dev' has no installation candidate     E: Package 'libglib2.0-dev' has no installation candidate     E: Unable to locate package libglade2-dev


title: String index processing

text: My input file looks like:               #key    string              pos(string)          key1    AA000AA000000AAA0A  2, 3, 18, 12         key2    00A00AAA000AAAA00A  3, 18                 And I'd like to add a new column at the end of each key line (tab-separated). If an `A` is found in column 2 of the input file, the new column would contain the positions given in column 3 of the input file. If a `0` is found in column 2 of the input file, the position should not be printed in the new column. Basically, this is the wished output:               #key    string              pos(string)     Apos(string)     key1    AA000AA000000AAA0A  2, 3, 18, 12    2, 18     key2    00A00AAA000AAAA00A  3, 18           3, 18      **Short explanation:**   (key1)   * string at index 2 has an `A` -> item `2` added to the new column    * string at index 3 has a `0` -> item `3` _not_ added to the new column    * string at index 12 has a `0` -> item `12` _not_ added to the new column    * string at index 18 has an `A` -> item `18` added to the new column  I'm doing this in python, but I get stuck in a multiple for over keys and items (the strings are quite long to process), so I thought I could ask for your advices for a command line (lighter) solution. What I was thinking of is:   * split the pos(string) field, get the index that I search for in the string field    * get the character at given index in the string    * for statement(?)


title: Is there any way in BTRFS to set compression permanently?

text: I have a USB HDD. I want to mount it with compression enabled. I can do in the fstab of my system or even using udev rules. The problem is that I won't mount my USB HDD on my computer only. Up to now, I used to trigger a terminal each time I mounted it. Then, I discovered `chattr +c`. This is working very well **but** I want to use LZO instead of ZLIB. Is there any way to be more specific and define the compression algorithm once for all?


title: Script for testing SFTP login status?

text: I need to perform an automated backup task that connects to an SFTP server. The first stage involves testing the server connection by connecting to it. To be absolutely sure that it is connecting to the correct server, I am setting the `StrictHostKeyChecking` in ssh_config to yes. So, when the connection to the SFTP server is made, how do I script the response from the server. The pseudo code is as follows:               If connection success       disconnect       initiate backup procedure          Else       log error       exit script      **Additional Info:** I am using `ForceCommand internal-sftp` in the backup server's sshd_config, so running `ssh` command is out of the question.


title: How does the kernel know how much user addressable memory to set aside?

text: I was reading up on a rather-dated article on the kernel managing memory and had this question on where the Page Table Entries (PTE) would go into. For this example, the author assumes we are on a 32-bit machine with 4GB memory without PAE. The article assumes 3GB to be addressable as virtual memory (4KB pages of 3GB == 786,432 pages). But if there was a PTE of 4 bytes for each page, that in itself would account for ~3.1MB of memory which should be set aside by the kernel. Is this going to be a part of kernel memory? ie. kernel reserved memory apart from the user addressable 3GB? So, does the kernel first calculate and arrive at how much kernel (system) memory would be needed and how much it can mark as user-addressable memory at boot? What other stuff would reside in kernel/system-reserved memory?


title: Unnest directories that have same name

text: I have too many files being in directories with same name EXAMPLE:               ~/foo/bar/foo/bar/1.flac     ~/foo/bar/foo/bar/bar/foo/foo/0.flac      I want to have               ~/foo/bar/0.flac     ~/foo/bar/1.flac


title: Redhat "httpd" start failed showing "ELinks: Connection refused"

text: I'm on RHEL 6.5 and Apache 2.2.15. And now applying a trusted SSL on the Server. After adding the respective SSL related Certs and files, my `Apache` is NOT starting up anymore. Here are some outputs:               # apachectl configtest     Syntax OK     # service httpd fullstatus     ELinks: Connection refused     # service httpd start     Starting httpd:                    [FAILED]     # tail /var/log/httpd/error_log     [Mon Aug 04 17:57:08 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)     [Mon Aug 04 17:57:41 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)     [Mon Aug 04 18:03:31 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)     [Mon Aug 04 18:06:27 2014] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)      And when i do `# tail /var/log/messages`, there's no errors related to Apache or this operations. What seems to be the problem please. I have already turned off the `iptables` also and `SELinux` also.


title: Store output of a command into a ring-buffer

text: I've got a long-running command that generates a lot of output on stdout. I'd like to be able to retain, for instance, only the last three days or the last gibibyte (avoiding cutting lines in the middle), and, if possible, in file chunks not larger than 20 MiB. Each file chunk is being named with a numeric suffix or a timestamp. Something like:               my-cmd | magic-command --output-file-template=my-cmd-%t \                            --keep=1G --keep=3d \                            --max-chunk-size=20M                            --compress=xz      Would write:               my-cmd-2014-09-05Z10:04:23      When it's reaching 20M, it would compress it and open a new one, and so on, and after a while would it starts deleting the oldest files. Does such a command exist? I'm aware of `logrotate` and its ability to manage files written by other applications, but I'm looking for something simpler that doesn't involve having to set up a cron job, specify rules, suspend the process, etc.


title: Map a symbol to a specific key

text: I have the following problem: I use the `intl` variant of `gb` keyboard layout, i.e., what you get with:               setxkbmap -layout gb -variant intl      I use gmail in Firefox, and for some reason, the gmail shortcut to move between tabs in the inbox, which is trigged with the key `~`, does not work. The problem comes from having to press `~` and `Space` afterwards, so 2 keys, to get the symbol (that is the intl variant, which allows me to write `ñ`, the Spanish letter). I've tried the `us` layout with the `intl` variant, and in that case the shortcut works, because the `~` symbol can be triggered with `AltGr` \+ `~`. So, what I want is to have the same behaviour with the `gb` layout. Or, generally, to map `~` to any other combination (not involving more than one key).


title: turn off buffering for `hping` in OpenBSD

text: It would appear that the output from `hping` is _fully buffered_ when piped to `perl` for further line-by-line processing, so piping hping to perl doesn't work. > `hping --icmp-ts example.ca | perl -ne 'if (/Originate=(\d+) Receive=(\d+) > Transmit=(\d+)/) { ($o, $r, $t) = ($1, $2, $3); } if (/tsrtt=(\d+)/) { print > $r - $o, " ", $o + $1 - $t, "\n"; }'` How do I change hping from being _fully buffered_ to being _line buffered_ when piped? Not a duplicate of the following question, since no solution works in OpenBSD base: Turn off buffering in pipe


title: Absolute path to currently-running zsh?

text: Sometimes the output of `ps -p $$` shows the absolute path to the currently- running `zsh`,               % ps -p $$       PID TTY           TIME CMD      1027 ttys005    0:00.11 /usr/local/bin/zsh      but not always:               % ps -p $$       PID TTY           TIME CMD      1507 ttys003    0:00.07 zsh -fl      What is a consistent way to get the path to the currently-running `zsh`? EDIT (clarification): I'm interested in how to do this primarily in Darwin and Linux, but also in NetBSD.


title: How to open the clonezilla initrd.img?

text: I am not understand why I get the error about **initrd.img** ( this **initrd.img** is the original file from clonezilla ISO file               cp initrd.img /tmp     zcat /tmp/initrd.img | cpio -idm     zcat: initrd.img: not in gzip format     cpio: premature end of archive      the full steps that I did are as the following: I download the **clonezilla-live-2.1.2-43-i686-pae.zip** file from the site: http://clonezilla.org/livepxe.php Then I Performed the following in order to get the **initrd.img** file as the following:               unzip -j clonezilla-live-2.1.2-43-i686-pae.zip live/vmlinuz live/initrd.img live/filesystem.squashfs -d /tftpboot/nbi_img      Then I copied the               cp /tftpboot/nbi_img/initrd.img   /tmp      All the last steps are according to the site. Please advice what wrong here? I also tried this but not successfully with that -:( Link: http://www.thegeekstuff.com/2009/07/how-to-view-modify-and-recreate- initrd-img/               mv initrd.img.gz  initrd.gz     gunzip initrd.gz           gunzip: initrd.gz: not in gzip format