Arch-Linux: no boot messages

I'm fairly new to Arch-Linux so maybe this Question is a little bit ridiculous. If I boot the "Live-CD" of Arch-Linux, I see which services are successfully started, indicated by a green [OK] message. After installing Arch-Linux I only get a blank Screen till the login-prompt appears. What should I do to display these messages again?


Shell script works when saved with nano but not when saved with Notepad++

I've been working on a bash script all day and have been testing on the machine I will be using it on. When I copy the script across from Notepad++ into a new file with nano editor inside SSH and save. It runs fine. (sh ./install). But if I save the file (Exact same contents), upload to my web server, download it using Wget on the same machine. I get syntax errors. I've checked the encoding and they seem to be the same. I have since used a plethora of character encoding to see if it will resolve the issue. I am also setting the file to executable once I download it using wget! The file runs fine and I have zero errors when copy and pasting using nano. Any idea what this may be? Anyone experienced the same issue?


I messed up my EFI boot, what do I do?

I have Debian Wheezy installed on my computer using EFI boot. It used Grub2 as the bootloader. I then decided to install Arch Linux, using EFI as well, on another partition and chose Grub bootloader over Gummiboot. When I rebooted my computer, the first Grub menu to display was the one that came with Arch Linux. I tried booting off of it but there was an error and Arch wouldn't boot. It was about an unaligned pointer 0x22 and it advised me to press a key to exit. I did that. Then the Grub menu for Debian came up and I was able to boot into it. I didn't like having 2 grub menus so I searched for a way to remove the arch grub as it wouldn't boot anyway. That's when I found this post. It basically says that Grub is not necessary for booting and it can be handled by efi stub. I'm using the backported 3.11 kernel so I (thought) didn't need to recompile the kernel. So I reformatted my EFI system partition and followed the instructions posted by Marco and rebooted. I now only get a blinking cursor. I've removed the Arch partition and I want to boot back into Debian Wheezy. What do I do?


Checking if folder exist using case/switch

Is it possible to use case to check if folders exist? I have these folders. I need to check if they exist then do something afterwards, I have 5 folders I need to check, and if it does exist, I process something different in each of the folders. Can it be done? If not, what is the best way for that? perhaps a multiple if statements?


Using wget and grep to download HTML pages and filter by keywords

KEYWORDS=("dolphins" "fish" "dogs" "cats" "iguanas")     IFS=$'\n'     find . -type f -size +1c ! -exec grep -qF "${KEYWORDS[*]}" {} \; -exec truncate -s 0 -f {} \;      * * * If a file is over 1 byte, search for keywords. If keyword is not found, truncate it to 0 bytes. I get the following error:               truncate: invalid option -- 'f'     Try `truncate --help' for more information.


Why starting firefox (from command line) in VM starts the firefox in the host machine and vice-versa?

I have a SLED 10 host machine and I am using a SLES 10 VM via `ssh -X`. When I start `firefox` in my VM using `firefox &` then it runs the `firefox` which is installed in the VM. So that's fine. However, if my host machine's `firefox` is running, and then I start VM's `firefox`, then instead of starting its own, a new session of host's `firefox` starts running. Same happens the opposite way also, if VM's `firefox` is running then I am not able to start host's `firefox`.


mount Linux NFS. rpc.statd is not running

I have Ubuntu 12.04 as the NFS server. The clients are Linux. My `/etc/exports` file has 1 line,               /folderToExport *(rw,async,no_subtree_check)        `/etc/init.d/nfs-kernel-server status` shows that the NFS share is working as expected. The problem is that whenever I attempt to mount the NFS share from another Linux host, stdout says               mount.nfs: rpc.statd is not running but is required for remote locking     mount.nfs: use '-o nolock'...or start statd      `ps -ef |grep statd` shows that `rpc.statd` is already running, so why do they say to "start statd"? Including their `-o nolock` suggestion allows for the mount NFS to occur, but then the mounted NFS becomes read-only. The `/etc/exports` file asks for `rw`. How do you start statd? Is the NFS client or server missing some configuration? * * * Here's what worked for me. Make a declaration for each shared folder in `/etc/exports`, e.g.               /folderToExport *(rw,async,no_subtree_check)       `statd` can be started by `service statd stop` followed by `service statd start`. Then `ps -ef |grep statd` shows `statd 1994 1 0 15:23 ? 00:00:00 rpc.statd -L` Once you've verified that `statd` is running, next run `mount` from the Linux client, `mount 192.168.1.3:/folderToExport /mountFolder` There should no longer be a message `rpc.statd is not running ... start statd` Finally, be sure that permissions on NFS server allow for `rw` permissions. (Modifying the `/etc/exports` file alone was insufficient) `chmod 0777 /folderToExport -R`


apt-get update could not resolve addresses

When I run `apt-get update` (on Ubuntu 12.04) I keep getting these errors:               Err http://security.ubuntu.com precise-security Release.gpg       Could not resolve 'false'     Err https://get.docker.io docker/main amd64 Packages       Couldn't resolve proxy 'false'     Err https://get.docker.io docker/main i386 Packages       Couldn't resolve proxy 'false'      When run `nslookup` on those addesses it works. `/etc/resolv.conf`:               nameserver 8.8.8.8      Any idea what could cause this error?


suEXEC problem start one site, but don't - other one

Running **Apache 2.**2 on **CentOS 6.5**. Config files:               # cat /var/www/php-cgi/domain.com/php.cgi     #!/bin/sh     PHPRC=/etc/     export PHPRC     export PHP_FCGI_MAX_REQUESTS=500     export PHP_FCGI_CHILDREN=4     exec /usr/bin/php-cgi          # cat /var/www/php-cgi/setevoy.org.ua/php.cgi     #!/bin/sh     PHPRC=/etc/     export PHPRC     export PHP_FCGI_MAX_REQUESTS=500     export PHP_FCGI_CHILDREN=4     exec /usr/bin/php-cgi      `VirtualHosts` configs:               # cat /etc/httpd/conf.d/setevoy.org.ua.conf     <VirtualHost 127.0.0.1:8080>       DocumentRoot /var/www/vhosts/setevoy/setevoy.org.ua       ServerName setevoy.org.ua       ServerAlias www.setevoy.org.ua       CustomLog /var/log/httpd/setevoy.org.ua-access.log combined       ErrorLog /var/log/httpd/setevoy.org.ua-error.log            <IfModule mod_fcgid.c>         SuexecUserGroup setevoy setevoy         <Directory /var/www/vhosts/setevoy/setevoy.org.ua>           Options +ExecCGI           AllowOverride All           AddHandler fcgid-script .php           FCGIWrapper /var/www/php-cgi/setevoy.org.ua/php.cgi .php           Order allow,deny           Allow from all         </Directory>       </IfModule>     </VirtualHost>          # cat /etc/httpd/conf.d/domain.com.conf     <VirtualHost 127.0.0.1:8080>       DocumentRoot /var/www/vhosts/User/domain.com       ServerName domain.com       ServerAlias www.domain.com       CustomLog /var/log/httpd/domain.com-access.log combined       ErrorLog /var/log/httpd/domain.com-error.log            <IfModule mod_fcgid.c>         SuexecUserGroup User User         <Directory /var/www/vhosts/User/domain.com>           Options +ExecCGI           AllowOverride All           AddHandler fcgid-script .php           FCGIWrapper /var/www/php-cgi/User/domain.com/php.cgi .php           Order allow,deny           Allow from all         </Directory>       </IfModule>     </VirtualHost>      Correct grants:               # ls -l /var/www/php-cgi/ | grep User     drwxr-xr-x 3 User     User     4096 Sep 12 14:47 User          # ls -l /var/www/vhosts/ | grep User     drwxr-xr-x 3 User     User     4096 Sep 12 14:47 User      If I run domain.com with next:               # su -l User     [User@venti ~]$ cd /var/www/vhosts/User/domain.com/     [User@venti domain.com]$ cat index.php | /var/www/php-cgi/User/domain.com/php.cgi | head     X-Powered-By: PHP/5.3.3     Content-type: text/html          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">     <html><head>     <style type="text/css">     body {background-color: #ffffff; color: #000000;}     body, td, th, h1, h2 {font-family: sans-serif;}     pre {margin: 0px; font-family: monospace;}     a:link {color: #000099; text-decoration: none; background-color: #ffffff;}      It works. But if run via browser - I got just PHP-code:               [User@venti domain.com]$ curl http://domain.com     <?php echo phpinfo(); ?>     Hello      And - nothing in errors (both `/var/log/httpd/domain.com-error.log` and `/var/log/httpd/error_log`). Also - nothing in `/var/log/httpd/suexec.log`, just entries with:               [2014-09-12 15:30:31]: uid: (500/setevoy) gid: (500/setevoy) cmd: php.cgi      after setevoy.org.ua access. So, seems - **suEXEC** doesn't run `/var/www/php-cgi/User/domain.com/php.cgi` at all... But - why? Can't find - what I'm missed there?


Is there a UNIX command to list all recently removed files from a system

Accidentally a `rm -rf` command was launched to my root directory instead of current directory. I stopped file removing by `Ctrl`+`C` but some files has already been removed. Is there a LINUX command to list all recently removed files from the system to get the affected applications ? Operating System: CentOS 6.3


What UNIX File permissions would be necessary for someone to GCC compile my .C program?

I have written a .C program and submit this file to someone in UNIX. However, I didn't change the permissions for the file, beyond whatever they were when it was created. I am simply wondering if i royally screwed up, and they will not be able to use gcc to compile the program, and then run a.out. The permissions were listed as:               -rw-------


Install OS in a directory

We can have the full filesystem structure of any OS in a directory. To which we can `chroot`, so it will behave as good as native login. Is there any way to install the an OS onto a partition with the help of chroot ? e.g. I want to install Ubuntu-14.04 in my `/home/SHW/Ubuntu-14.04` directory. Once installed, I can chroot into it and can do some user-space work ( Installing the OS onto a partition and mounting that at /home/SHW/Ubuntu-14.04 is not what I'm looking for)


Which directories are writeable in a system following FHS?

I need to ensure that, when deleting a specific user from a system, all of his/her files are removed. User creation/deletion will happen a lot on this system, so I want to reuse UID's and want to ensure the new user does not have access to any files of the old user. My question is two-fold:   1. Is there a general and easy way to find all files owned by a specific user? Or is a system-wide `search -uid n` my only option?   2. If a system-wide search is the only option, then which directories are generally writeable by a normal user (suppose a distribution following FHS)?      * His home directory     * /tmp     * ?? The user does not have `sudo` privileges, so he can only write in places that are world-writable in a standard Unix filesystem.


Synchronize software packages between different Linux distributions

Is there any way to synchronize software packages between different Linux distributions? There are several software packages that I need to synchronize between a Linux Mint installation and an Ubuntu installation. Ubuntu already provides a software synchronization service, but it would be even better if software packages could be synchronized between multiple Linux distributions. In order to do this, I would need to find a package installation method that would work on all Linux distributions, and periodically download a list of packages from a central server.


How to rebuild a two drive raid 1 array on Linux?

I need to rebuild a two drive (160x2) raid 1 (mirror) array. It was an Intel raid from a 7 year old Dell computer (Windows). Both drives are assumed to be functioning. The raid was created with an on-board motherboard raid program. It's been quite a while since I had to rebuild a raid, and the last time it was a raid 5 that had been created on Slackware. Where do I get started? I'm putting them in my personal machine and I'm guessing that Linux is going to be the tool to get this done.


No communication services enabled following startup

I recently installed Parsix (Debian) on my system, and I've been struggling to figure out how to autostart my services. Of the list of services that don't run and should run are:   * ssh   * apache   * mysql They run easily enough with the generic: `service ssh start`, and when I run               > update-rc.d ssh defaults      System startup links for /etc/init.d/ssh already exist.      As an added note:               > service ssh status     [FAIL] sshd is not running ... failed!      Edit: `ls /etc/rc*.d/*ssh*` produces               /etc/rc0.d/K50ssh  /etc/rc2.d/K50ssh  /etc/rc4.d/K50ssh  /etc/rc6.d/K50ssh     /etc/rc1.d/K50ssh  /etc/rc3.d/K50ssh  /etc/rc5.d/S50ssh      (does K mean "Kill"??)   Also, the current run-level is set to 5.


Why do piping and redirection work differently with here documents?

Combining a redirect with a here document seems logical enough:               $ bash > foo <<EOF     echo Hello     EOF          $ less foo     Hello      But with a pipe it behaves differently:               $ bash | tee foo <<EOF     echo Hello     EOF          $ less foo     echo Hello      What's also weird is if you immediately type 'history':               $ bash | tee foo <<EOF     echo Hello     EOF     $ history     $ history     1 ...      That is, the first command still seems to be inside the newly created bash. What's going on? Why does the pipe behave differently?


Can't install iwlwifi driver in Crunchbang

i just installed Crunchbang 10 to my Laptop in dual boot with win7, my wlan card is a Intel(R) Centrino(R) Wireless-N 2230. I saw i had no wifi, so I tried to install the driver from here, by extracting them and typing:               sudo su     cp iwlwifi-2030-6.ucode /lib/firmware      After that i rebooted and still had no Wifi. Why?


Linux Mint 16: Petra - Can't wake from hibernate

I have used Linux Mint 16 Petra - cinammon version for a few months. At first hibernate worked pretty well. Now I cannot wake from it - when I try to, the screen just goes blank and nothing responds and I need hard reboot. Here are some commands from suggestions from another thread (ask me if you need more info): `uname -a`:               Linux bartoszkalinowski-PC 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux      `inxi -G`:               Graphics:  Card: Intel Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller                 X.Org: 1.14.3 drivers: intel (unloaded: fbdev,vesa) Resolution: 1920x1080@60.0hz                 GLX Renderer: Mesa DRI Intel Ivybridge Desktop GLX Version: 3.0 Mesa 9.2.1      I use Intel graphics HD4000 I think (i5 3570K) - maybe the case is with graphic drivers? I tried installing them manually but I've read they are included in the kernel and there shouldn't be any trouble with this integrated graphics card.


Packet loss with RX error packets

I am seeing packet loss from all my blade servers within the HP Blade C7000 enclosure.               # ping 192.168.2.140     PING 192.168.2.140 (192.168.2.140) 56(84) bytes of data.     64 bytes from 192.168.2.140: icmp_seq=1 ttl=64 time=0.210 ms     64 bytes from 192.168.2.140: icmp_seq=2 ttl=64 time=0.185 ms     64 bytes from 192.168.2.140: icmp_seq=4 ttl=64 time=0.206 ms     64 bytes from 192.168.2.140: icmp_seq=6 ttl=64 time=0.164 ms     64 bytes from 192.168.2.140: icmp_seq=7 ttl=64 time=0.210 ms     64 bytes from 192.168.2.140: icmp_seq=8 ttl=64 time=0.213 ms     64 bytes from 192.168.2.140: icmp_seq=9 ttl=64 time=0.213 ms          --- 192.168.2.140 ping statistics ---     9 packets transmitted, 7 received, 22% packet loss, time 8000ms     rtt min/avg/max/mdev = 0.164/0.200/0.213/0.018 ms          # ping 192.168.2.165      PING 192.168.2.165 (192.168.2.165) 56(84) bytes of data.      64 bytes from 192.168.2.165: icmp_seq=1 ttl=64 time=0.990 ms      64 bytes from 192.168.2.165: icmp_seq=3 ttl=64 time=0.204 ms      64 bytes from 192.168.2.165: icmp_seq=4 ttl=64 time=0.165 ms      64 bytes from 192.168.2.165: icmp_seq=5 ttl=64 time=0.168 ms           --- 192.168.2.165 ping statistics ---      6 packets transmitted, 4 received, 33% packet loss, time 5001ms      rtt min/avg/max/mdev = 0.165/0.381/0.990/0.352 ms               $ /sbin/ifconfig     eth0      Link encap:Ethernet  HWaddr E4:11:5B:D0:36:B0               inet addr:192.168.2.163  Bcast:192.168.2.255  Mask:255.255.255.192               inet6 addr: fe80::e611:5bff:fed0:36b0/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:44022 errors:29632 dropped:0 overruns:0 frame:10025               TX packets:42694 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:4345443 (4.1 MiB)  TX bytes:4549025 (4.3 MiB)          $ netstat -i     Kernel Interface table     Iface       MTU Met    RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg     eth0       1500   0     5124  32118      0      0     2651      0      0      0 BMRU     lo        16436   0     4522      0      0      0     4522      0      0      0 LRU                $ route -n      Kernel IP routing table      Destination     Gateway         Genmask         Flags Metric Ref    Use Iface      192.168.4.128   0.0.0.0         255.255.255.192 U     0      0        0 eth0      169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0      0.0.0.0         192.168.4.134   0.0.0.0         UG    0      0        0 eth0          # ethtool -S eth0 | grep -i errors       rx_errors: 43821       tx_errors: 0       rx_crc_errors: 14812       rx_alignment_symbol_errors: 0       rx_in_range_errors: 0       rx_out_range_errors: 0       rx_address_match_errors: 150211     # ethtool -S eth0 | grep -i drops       rx_drops_no_pbuf: 0       rx_drops_no_txpb: 0       rx_drops_no_erx_descr: 0       rx_drops_no_tpre_descr: 0       rx_drops_too_many_frags: 0       rx_drops_invalid_ring: 3215       rx_drops_mtu: 0       rx_drops_no_fragments: 0      Network configuration looks fine . Kindly suggest steps how to resolve the issue.


Appending checksum information to file

I'd like to embed checksum information into file, that I transfer. It's `tar.gz` or `tar.xz` file and I can only transfer one file to remote side. How do you recommend I embed checksum information? I want checksum of whole archive, not it's contents (I'd like to check it's integrity "before" unpacking). I know I could pack it again in some format supporting checksums (like `rar`) but it's computational cost to "repack" stuff, just for adding checksum (on the other hand I don't like `rar` format). So preffered would be sth like `gzip` & `gunzip` etc , but for adding, checking, and removing checksum. Any tools, ideas, scripts, workarounds? Am I right `.xz` and `.gz` support concatentation? Maybe it's worth to use this feature to append compressed checksum on the end of file ?


FreeBSD 8.2 STABLE installation failing on VirtualBox

On my pc-bsd box, I installed `VirtualBox` and trying to install FreeBSD 8.2 STABLE in 10GB space. During installation, I selected all the default settings, it looks like this: ![Disk layout](http://i.stack.imgur.com/fjmcc.png) But after this, I get this error: ![error](http://i.stack.imgur.com/26u2o.png) How can I overcome it?


xrandr doesn't detect monitor on hdmi port

I installed Arch on my laptop but I don't think this problem is specfic to Arch. The only problem at the moment is that the display connected to the hdmi port isn't detected. For example running from the gnome control centre the display applet then 'detect' only detects the laptop display, even though there is a 2nd monitor connected to the laptop via the HDMI port. I suspect that the problem is xrandr is not detecting the monitor connected to the HDMI port. How can I fix this? Output from lspci -v for the vga controllers:               01:00.0 VGA compatible controller: nVidia Corporation Device 0df5 (rev a1) (prog-if 00 [VGA controller])         Subsystem: Dell Device 0446         Flags: bus master, fast devsel, latency 0, IRQ 16         Memory at f0000000 (32-bit, non-prefetchable) [size=16M]         Memory at c0000000 (64-bit, prefetchable) [size=256M]         Memory at d0000000 (64-bit, prefetchable) [size=32M]         I/O ports at 3000 [size=128]         Expansion ROM at f1000000 [disabled] [size=512K]         Capabilities: <access denied>         Kernel driver in use: nouveau         Kernel modules: nvidiafb, nouveau00:02.0 VGA compatible controller:          Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) (prog-if 00 [VGA controller])         Subsystem: Dell Device 0446         Flags: bus master, fast devsel, latency 0, IRQ 49         Memory at f1400000 (64-bit, non-prefetchable) [size=4M]         Memory at e0000000 (64-bit, prefetchable) [size=256M]         I/O ports at 4000 [size=64]         Expansion ROM at <unassigned> [disabled]         Capabilities: <access denied>         Kernel driver in use: i915         Kernel modules: i915      output from xrandr:               Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192     LVDS1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 193mm        1920x1080      60.0*+   40.0         1400x1050      60.0         1280x1024      60.0         1280x960       60.0         1024x768       60.0         800x600        60.3     56.2         640x480        59.9      VGA1 disconnected (normal left inverted right x axis y axis)     HDMI2 disconnected (normal left inverted right x axis y axis)     DP1 disconnected (normal left inverted right x axis y axis)


Use find and tar together

I have a directory with many log files, with filenames like `acct.20111001` up to `acct.20111030`. I want to zip them by running:               tar -cvjf acct.20111001.bz2 acct.20111001      How can I use `find` to compress them instead of running the `tar` command for each and every file? I'm thinking something like this, but I know this command doesn't work:               find /home/log/2011/10 -name "acct.201110[0-9]" -exec tar -cvjf {}.bz2 {} \;


cURL/wget - SSLv3, TLS handshake, CERT hangs

I have problems connecting to https sites using cURL or wget. When I download from a https curl seems to be stuck while doing the TLS handshake, CERT. The problem is independent of the site (I noticed it using github) and wget is hanging too (although I didn't look into the verbose outputs there).               $ curl -v --trace-time https://www.google.de     10:35:21.532822 * About to connect() to www.google.de port 443 (#0)     10:35:21.533091 *   Trying 209.85.148.147... connected     10:35:21.538666 * Connected to www.google.de (209.85.148.147) port 443 (#0)     10:35:21.539119 * SSLv3, TLS handshake, Client hello (1):     10:35:21.544129 * SSLv3, TLS handshake, Server hello (2):     10:35:21.544182 * SSLv3, TLS handshake, CERT (11):      I have waited >10 min but nothing happens. I am using OSX Lion.               $curl --version     curl 7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5     Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp      Features: AsynchDNS GSS-Negotiate IPv6 Largefile NTLM SSL libz      I don't know where to look for help so I'd be happy if you could give me some pointers. Thanks


What's up with "Error in lockf()" just for one particular user?

We're running a Java manufacturing/equipment control application on Solaris. Equipment control is done via the serial port on the SunRay terminal at the user station. The interesting thing is that it fails for one particular user. He can go to any machine and have it fail. Works fine for all other users on all machines. The errors returned are:               Error opening "/tmp/SUNWut/sessions/7/unit/dev/term/a"     Error in lockf()      Nothing special about this user account. .profile matches everyone else. Any ideas on what might be broken about this one specific user account that would prevent him from being able to open the serial port?


Set Up New Locale On CentOS 6

I am trying to set up a new locale for my centos server environment. Here is currently shows for `locale -a` command:               en_AG     en_AG.utf8     en_AU     en_AU.iso88591     en_AU.utf8     en_BW     en_BW.iso88591     en_BW.utf8     en_CA     en_CA.iso88591     en_CA.utf8     en_DK     en_DK.iso88591     en_DK.utf8     en_GB     en_GB.iso88591     en_GB.iso885915     en_GB.utf8     en_HK     en_HK.iso88591     en_HK.utf8     en_IE     en_IE@euro     en_IE.iso88591     en_IE.iso885915@euro     en_IE.utf8     en_IN     en_IN.utf8     en_NG     en_NG.utf8     en_NZ     en_NZ.iso88591     en_NZ.utf8     en_PH     en_PH.iso88591     en_PH.utf8     en_SG     en_SG.iso88591     en_SG.utf8     en_US     en_US.iso88591     en_US.iso885915     en_US.utf8     en_ZA     en_ZA.iso88591     en_ZA.utf8     en_ZW     en_ZW.iso88591     en_ZW.utf8      As you can see, there is no other language locale set up at this moment. I need to add 'de_DE' and 'fr_FR' to add on this list properly. Can anyone please suggest how can I achieve this properly? Here is what I have done so far:   I followed the instructions on this link. With its help, it seems the list is being updated with 'de_DE' locale . But that doesn't doing the work I needed (doesn't working with gettext). So, may be I am doing something wrong or there is more to do.


How to get the list of all active X sessions and owners of them

I'm implementing USB plug/unplug notification (here's related question), and I need to execute something like `notify-send "device plugged" "My Device Title"`. The problem is that to make this command work, I should firstly set `DISPLAY`, like this:               export DISPLAY=":0.0"      And secondly, this command should be called by appropriate user. Say, for user `dimon`:               su dimon -c "notify-send 'device plugged' 'My Device Title'"      So, I need to get the list of all active X sessions and appropriate users, and call `notify-send` for each user on his `DISPLAY`. I tried to use `w` for that, example output at Linux Mint 13 MATE:               USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT     dimon    tty8     :0               Sun15    3days  1:38m  1.95s x-session-manager     dimon    pts/0    :0               Sun15    0.00s  0.20s  0.00s tmux      So we have both username and display. I decided to parse it like that:               declare -a logged_users=(`w |grep -vP "^(USER| )" |awk '{if (NF==8){print $1" "$3} else {print $1" :0"}}' |sort |uniq`)      Now, I have array `logged_users`: `[0]` contains `dimon`, and `[1]` contains `:0`. This would be great, but unfortunately it works not everywhere. Say, on Ubuntu 12.04 with lightdm we have this `w` output:               USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT     nui      tty7                      18:22   35:56   1.66s  0.11s gnome-session -     nui      pts/0    :0.0             18:55    5.00s  0.20s  0.00s w      No idea why there's no FROM value for `gnome-session`. And even worse one, at xubuntu:               USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT     nui      tty7                      15:50   31:07  52.55s  0.13s /bin/sh /etc/xd      No display at all! If other user is logged in, no display is specified for him too (but actually it's `:1.0`) So, I'm looking for another approach. I also know we have a list of all active X sessions here: `/tmp/.X11-unix` , and I can get the list of them like this:               cd /tmp/.X11-unix && for x in X*; do echo ":${x#X}"; done      But then, I don't know how to retrieve users. So, how to get the list of all active X sessions and appropriate users?


How to enable right click on desktop? (Linux Mint 12 LXDE)

I accidentally disabled right clicking on the desktop in LXDE. Does anybody know how to enable it again?


VPN tunneling through another VPN

in windows you can simply create two pptp connections and after connecting to one of them, easily connect to the other one while maintaining the first. Is there any way to do this (cli or gui) in linux? I also found this resource, but found it rather unhelpful.


Cannot exit terminal emulator

I have a very strange and intermittent problem. Sometimes, with no pattern I can discern, running `exit` fails to close my terminal emulator. In the screencast below, I open the first terminal and successfully exit with `Ctrl` \+ `D`, open a second one and it hangs: ![enter image description here](http://i.stack.imgur.com/hnxSK.gif) Now the strangeness:   1. This happens sometimes, not always, and I can see no pattern. In the gif above, it is the 2nd terminal, sometimes it is the first or the Nth.    2. The same thing happens whether I run `exit` manually or hit `Ctrl` \+ `D`.   3. I have a shortcut key mapped to `terminator` in my DE's (Cinnamon) keyboard settings. The problem only occurs when launching with this shortcut. It does not seem to ever happen if I launch by running `terminator` manually.   4. It _seems_ to be exclusive to `terminator`, neither `xterm` not `gnome-terminal` display this problem if I assign the same keyboard shortcut to them instead.   5. It happens irrespective of what keyboard shortcut I use (I tried using `Ctrl + O` instead of the `Alt + Z` I normally use)   6. It seems to be specific to Cinnamon, I tried on Mate and xfce and it worked fine. Possibly relevant details:   * This started happening after updating my LMDE to update pack 8.    * The upgrade process was problematic because it wanted to install `libharfbuzz0b` which breaks `libharfbuzz0a` and some packages depend on the latter while others need the former. This has led to a bit of dependency hell which may or may not be relevant here.   * `terminator` is a fork of `gnome-terminal` and Cinnamon is a fork of Gnome. The latest versions of Cinnamon have become completely independent of Gnome and in fact, you can no longer have both Gnome and Cinnamon installed on the same system. This makes me think that there may be some kind of library incompatibility between the Cinnamon-provided libs that `terminator` uses and the Gnome-provided ones it expects. I realize that this is very likely to be an extremely localized problem that only affects my setup but I thought I'd put it out there in case anyone has any ideas on how to solve this or is experiencing similar issues. In the mean time, I have posted a bug report on terminator's bug tracker.


Compile all tex files in a directory

If I do `pdflatex *.tex` in a directory, only one `tex` file is compiled. Which syntax should I use that all `*.tex` files in the directory are compiled?


“tshark: There are no interfaces on which a capture can be done” in Amazon Linux AMI

My goal is to capture packets with tshark in Amazon Linux AMI. While typing **tshark** in the command line there's an error: **"tshark: There are no interfaces on which a capture can be done"** How to implement the solution from Wireshark setup Linux for nonroot user               $ sudo apt-get install wireshark     $ sudo dpkg-reconfigure wireshark-common      $ sudo usermod -a -G wireshark $USER     $ gnome-session-quit --logout --no-prompt      in Amazon Linux AMI (it's not Ubuntu)?


How do I redirect all writes and reads from /sdcard/whatsapp/ to /sdcard/shared/ on android?

I am using bluestacks appplayer beta with a rooted android, I want to redirect all writes and reads from one directory to another, how do I do that? I have a terminal available to put commands in..


Change System Time/Date

I'm running Linux Mint 15 with KDE 4.10.4+ Here's what I get when I run _date_ : > user:~ > date   >  Die Okt 29 15:47:54 UTC 2013 Where "Die Okt" indicates a German-language setting, which I don't mind. However, I'm not in the UTC timezone, and I'd like to configure my system time/date to display the correct timezone. I've tried going into System Settings and configuring Date and Time, which is temporarily successful, but after restarting the system, it always resets to UTC. How do I solve this problem?


locating somebody on IRC servers over the Internet

Is there a way to locate somebody by his nick or IP address on the internet's IRC servers? I guess the protocol doesn't seem to support it! Still... can it be done? like crawling the web for IRC servers and injecting bots to query about if that nick/IP is online on one of the channels? Is there a simpler way?


Prevent access to files on linux file server

I have a linux system running Debian Wheezy stable on it and am using it as a file repository (not a true file server because I am using BitTorrent sync to move files as I move around the world). Some family has expressed a desire to store data similarly but I would like to give them the space without me necessarily having direct access to their files. I know there are some sites that if you store files on them they make it a point to let you know that they can't access it or they can't see it, etc. What mechanism are they using to achieve that level of privacy for their users? Are they able to still scan the directories for viruses or malware or by providing that kind of privacy, do they effectively make it where they cannot see the directory to scan? Or is it something else altogether (encryption, etc)? My apologies if this is better asked somewhere else or if it has already been answered. Thank you for your help! Cheers.


Get "date" to understand a timestamp phrase of a different language

My web-scraping scripts have long enjoyed using `date -d` to read in human- formatted time and date stamps like "March 11, 1999" and convert to any other format I need via the -s parameter. How might I get it to understand dates printed in other locales like `27 Kwi, 13:54` in Polish? I can artifically prepend/append the year (2012) if needed. I checked my `env` and tried the following, but no luck:               LOCALE=PL date -d "30 Kwi, 17:02"     LANGUAGE=pl_PL:pl date -d "30 Kwi, 17:02"     LC_CTYPE=pl_PL:pl date -d "30 Kwi, 17:02"     LANG=pl_PL:pl date -d "30 Kwi, 17:02"     LC_COLLATE=pl_PL:pl date -d "30 Kwi, 17:02"     LC_MESSAGES=pl_PL:pl date -d "30 Kwi, 17:02"     date: invalid date `30 Kwi, 17:02'      In my system as installed,               LANGUAGE=en_US:en     LC_CTYPE=en_US.UTF-8     LC_MESSAGES=en_US.UTF-8     LC_COLLATE=en_US.UTF-8


How to create a file even root user can't delete it ?


dd write vs read performance

I have recently done some performance tests on a new server (using dd) and wonder why read performance is so much worse than write performance? Shouldn't it be another way around? file size was in both tests 550GB, read: in seconds: 3704 in MB/s: 148 and write: in seconds: 1539 in MB/s: 357 write command:               time sh -c "dd if=/dev/zero of=/local/postgresql/bigfile      bs=8k count=67108864 && sync"      read command:               time dd if=/local/postgresql/bigfile of=/dev/null bs=8k      bash time command output:               real: 61m44.335s     user: 0m12.721s     sys: 10m35.884s      Bonnie++ results command:               bonnie++ -f -D -n 0 -u root -d /local/postgresql/      results are for file that was twice as big as RAM size. write: 419 918 K/sec read: ~ 187 000 K/sec


Connect Windows printer to Linux machine via samba

How can I connect my Windows printer to a Linux (RHEL5) box via samba? I'm looking for a clear configuration file


Why does my mapping of <C-PageX> to :bY not work in gvim?

In my `.vimrc` file, I have the following two lines:               noremap! <C-PageDown> :bnext <CR>     noremap! <C-PageUp>   :bprev <CR>      but they do not work! In insert mode, typing               <C-v><C-PageDown>      returns               <C-PageDown>      (literally) and similarly so for `<C-PageUp>` and if I try to execute the command I get               :bnext      (plus a newline). In normal mode there's no effect. Thus, I know that the key map isn't being gobbled up by `X` or my shell but what else could be the problem? Other key maps work fine.


Install rEFInd on OS X 10.10 Yosemite

I want to dual boot my macbook with Arch Linux and thus tried to install `rEFInd` using the install script, however, after install `rEFInd` doesn't seem to start at all? Anyone experienced the same issue or have possible solutions on how to fix this? Best Regards Rawa


Why does SSH hosts keys differ when connecting if the host_keys are the same?

There are 3 machines: A (from where I connect to B and C), B, and C.   B and C have the same SSHD host keys (they have been copied, so they are 100% the same, SSHD has been restarted too, identical sshd_config file). On C the known_hosts file looks like this:               C:~/.ssh # grep B *     C:~/.ssh # grep A *     known_hosts:ssh-rsa xxxx...xxxx     C:~/.ssh #       When we try to connect from C to A then "A" offers it's RSA hosts key.   When we try to connect from C to B then "B" offers it's ECDSA hosts key. **Question:** Why? Wouldn't it be logical that the "A" and "B" server should offer both the ex.: their RSA SSHD hosts keys?


When I restart the named service, it gives me this error:               ./etc/init.d/named restart          Stopping named:                                            [  OK  ]     Starting named:      Error in named configuration:     zone enum4red.com/IN: has 0 SOA records     zone enum4red.com/IN: has no NS records     zone enum4red.com/IN: not loaded due to errors.     _default/enum4red.com/IN: bad zone     zone localhost.localdomain/IN: loaded serial 0     zone localhost/IN: loaded serial 0     zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0     zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0     zone 0.in-addr.arpa/IN: loaded serial 0                                                                [FAILED]     umount: /var/named/chroot/var/named: device is busy.             (In some cases useful info about processes that use              the device is found by lsof(8) or fuser(1))      logs are:               Oct  7 04:35:46 localhost named: zone enum4red.com/IN: has 0 SOA records     Oct  7 04:35:46 localhost named: zone enum4red.com/IN: has no NS records     Oct  7 04:35:46 localhost named: zone enum4red.com/IN: not loaded due to errors.     Oct  7 04:35:46 localhost named: _default/enum4red.com/IN: bad zone     Oct  7 04:35:46 localhost named: zone localhost.localdomain/IN: loaded serial 0     Oct  7 04:35:46 localhost named: zone localhost/IN: loaded serial 0     Oct  7 04:35:46 localhost named: zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0     Oct  7 04:35:46 localhost named: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0     Oct  7 04:35:46 localhost named: zone 0.in-addr.arpa/IN: loaded serial 0      any idea what went wrong?


How can I replace text in the last non-blank line?

I want to find the last line of text in a file, and delete the comma at the end of it. I asked about this already, but, after I got an answer I realized my question was not specific enough. This `sed` command will go to the last line of a file and take action on it. In my case, I want to remove the trailing comma:               sed -i '$ s/",/"/g' file.txt      So this:               blah blah blah,     blah blah blah,     blah blah blah,      ... becomes this:               blah blah blah,     blah blah blah,     blah blah blah      However, **this won't work if there are blank lines after the last line of text** in the file. I've been searching for ways to get the last line of text but haven't come up with anything that I can understand and apply. I've also looked for ways to remove all trailing blank lines, and found this command:               sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' *.txt      But it doesn't work for me (it just seems to output the contents of my files on the command line). In any case, it's inelegant. I'd rather not delete the trailing blank lines, it would be much better to just identify the last line with text in it and act on that. How do I remove the comma from the last line _of text_ in multiple files in a directory?


* not interpreted in ftp, lftp?

I'd been seeing that `*` isn't interpreted on ftp or lftp. Suppose I want to change a directory from current to say `./japan` In ftp> of lftp>, if I give:               $ cd jap*      it would show this error:               No such file or directory      So, I'm forced to give the complete name:               $ cd japan      ### EDIT #1 @thomas, @gold: Thank you for your valuable information. As `*` isn't interpreted with all commands (like `cd`), is there any way so that I can get away from typing every time the complete file name.


Why does ln -sf silently fail?

`ln -sf source_file target_file` succeeds even when source_file does not exist. `ln -f source_file target_file` on the other hand fail, as expected. How can it be tuned to give error on the first case _without_ first testing for the file existence explicitly (i.e. not `[[ -e source_file ]] && ln -sf source_file target_file`)


tmpfs performance

I use avconv to make screen recording of gameplays on linux (yeah, I'm sorry, I am one of them, but I get more excited about the scripts than playing it self), but recently my harddrive has gone and while waiting for the warranty I'm using one from an old notebook. The problem is that I already knew that I cannot record using this HD for it's to much slower than my old one, as it turns out to be true, I gave up trying to record and started to search for other options. That was when I remembered of tmpfs/ramfs, and this is how I'm trying to work things out: 1) I mount the tmpfs:               $ sudo mount -t tmpfs -o size=2048M captura ~/Videos/capture/memoria/     $ df -h     Filesystem      Size  Used Avail Use% Mounted on     /dev/sda1       286G   63G  209G  24% /     ...     captura         2.0G   62M  2.0G   3% /home/rarlei/Videos/capture/memoria      2) Start gaming (Minecraft, heavy memory usage?) 3) Start recording: `avconv $thousands_of_parameters -v:c libx264 -preset fast memoria/video.mp4` (video only) After some playing I just stop recording to see what I have, but what I see is no different from what I see recording to harddrive. I have 8GB of some pretty good memory (1.2ghz or something like that, I don't know how I can see from linux) I'm not using any specific video card, it's just some regular Intel, but this never afected the recording with my previous harddisk. Wasn't tmpfs supposed to be much faster? Does minecraft affect this? Does encoding affect this? Any thoughts? **UPDATE** I think I'm not being clear, what I am doing is compare two videos, one writen onto harddisk partition, and other writen into tmpfs (memory?), both with same codecs, both from X11 display, my expected result was that tmpfs video had much less lags than harddisk (lags that don't appear while playing), but the result is that both video shows lags, in almost same quantity. Worth saying that those lags didn't occur back with my previous harddisk, so I know it's storage related, and not processor/codec. **UPDATE - Solved (?)** Turns out that something seems to happen in the encoding process that is much more memory consuming (which is obvious now, since it need to load each frame into memory and process there, and then write back into another section of the very same memory) than I foresaw, so, doing everything in memory really caused those lags/framedrops while encoding. I tried to record using rawvideo, and after re-encoding back to mp4 there was no lag in the video. Too bad it takes 1GB for every 10 seconds and I don't have enought memory. There was no way to record rawvideo right to harddisk, doing that slowed the game to the point of stopping it until I stop recording. :( Thank you guys anyway :)


emacs shell mode (M-x shell)

When I am using the emacs M-x **shell** mode I see strange characters on my screen which I believe are related to my prompt (which includes an End-Of- Line) and the use of colors. So, here's what I see on the terminal:               mperdikeas@thorin:~#     $       And here's what I see inside Emacs **shell** buffer:               ^[]0;mperdikeas@thorin: ~^Gmperdikeas@thorin:~#     $        Here's the relative section of my **.bashrc** :               if [ "$color_prompt" = yes ]; then       PS1='${debian_chroot:+($debian_chroot)}\[\033[1;32m\]\u@\h\[\033[00m\]:\[\033[1;33m\]\w\[\033[00m\]#\n$'     else       PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w#\n$ '     fi       How can I configure emacs to properly display the prompt in the **shell** buffer?


How to log output to maillog?

On my current Debian setup, I have a file /var/log/mail.log which Dovecot, Postfix, and Spamassassin's spamd all output messages to. I know that the `logger` command can output to syslog, but is there some command that easily lets me output to the mail log from a bash script, or do I have to manually open it and append to it?


Newly installed arch linux problems

First off, I've installed arch before, but managed to not encounter any of the problems I'm having at the moment (not sure how). But I'm well and truly stuck. First, my network interface is now called enp3s0 rather than eth0, so every time I start arch, I need to run               ip link set enp3s0      and then               dhcpcd enp3s0      how do I configure this so it happens automatically? My second issue seems more peculiar; after booting into arch, I installed the enlightenment WM with pacman, and tried to run it, but apparently I did not have a couple of xorg packages, namely xorg-xinit, and another which I forget. After installing these however, editing the .xinitrc file, and running startx, I just got 3 white bash boxes on a black screen. Though if I run enlightenment_start in one of those boxes, enlightenment starts fine (albeit with 3 terminal boxes open, 2 I can close fine, but if the third is closed, enlightenment exits). I am certain this is not normal behaviour, and any help as to what I'm doing wrong here would be much appreciated.


Linux Arch Unity not writeable settings

I am running Linux Arch with KDE till yet. Now I want to move to Unity because of some personal favors. I used the tutorial proposed in the arch wiki for installation (the recommended way using the repositories). https://wiki.archlinux.org/index.php/unity#From_repository_.28recommended.29 The ui seems to be running fine, except that I can't change a lot of settings. For example: I can't set an option to the nautilus, to the gnome-terminal, to the compiz config manager. I also can't add a program to my starter. Everything gets reset one second after I set an option. So it seems to me like a permissions problem, that I have no write access to my profile configs, but I don't know how to tackle it.


Modify sound volume per application

In Fedora 12 + Gnome 2 I used to be able to modify the volume of each application seperately. Now, I'm on Fedora 20 + MATE 1.6.2, and this option is gone. If I click `Notification Area > Sound > Preferences` or `System > Control Centre > MATE Volume Control`, a window opens that shows Master volume and other stuff like Headphones, Speaker, ACM etc., but I can't control each application's volume settings from here. Is there any way how to achieve this? I'm in particular interested in dimming Firefox sounds quite, but only sometimes, and sometimes it's other applications, too.


Ibus input method not work in wine application

I use ibus input mehod to input chinese，and it doesn't work in wine application. When I type in Chinese mode, there are only english letters left in wine application. I found it is related to windows manager. When I use it in fedora+openbox, it works. But when I use it in fedora+icewm, it doesn't work. So my question is:   * How to debug this kind of wine-X-related problem?   * How the windows managers affect behaviors of wine?


Using FACLs to restrict default group but allow others

So, I'm running RHEL 6.x with acls enabled, etc. and I've been fighting this ACL issue for a bit now and I can't seem to get it down. I'm trying to make it so that: /var/www/html/* are owned root:apache   /var/www/html/* are 644   /var/www/html/* are rw- for a group we'll call 'html-slingers'   ./html's getfacl looks like this:               # file: html     # owner: root     # group: apache     # flags -s-     user::rwx     group::r-x     group:html-slingers:rwx     mask::rwx     other::r-x     default:user::rwx     default:group::r---     default:group:html-slingers:rw-     default:mask::rw-     default:other:r--      I would /think/ that would mean files would be created with a default of user:apache, 640 (but with an extra acl entry for html-slingers to have rw) ...and the file ends up being created /looking/ that way via getfacl, but the POSIX permissions end up being 664, and the apache group is able to write to the file (even though getfacl says group::r-- Why does this happen? Is there a way to fix or mitigate this? Any help or advice will be greatly appreciated!


In zsh, how can I dump all configuration?

How can I print my current configuration including defaults and key bindings? This would allow me for example, to find what action is bound to say `^P` in emacs mode and find binding in `vi` mode or set if it is not there instead of browsing manuals.


Run a simple http server locally on a non-80 port

I have access to a Linux server with a non-root user. What I need is to run a simple, HTTP server that will not listen to port 80, but to a different port. I'm looking for the most easiest and quickest solution. Don't need any authentication or whatever. Would be also nice to run it in a SCREEN. Linux version is Red Hat 4.1.2-50


How can I bind Ctrl-Alt-[0-9] in Tmux?

I am able to bind Ctrl-Alt-[a-z] using M-C-a, M-C-b etc. However, when I attempt to bind Ctrl-Alt and a number key I get:               .tmux.conf: 45: unknown key: M-C-0      Any idea why? I'm running tmux ver 1.7 Related: How to bind "Ctrl-Alt-b" to the prefix of tmux?


Is PAE harddrive dependent?

I have two M1400 and I can successfully boot and installed Bodhi Linux on one of them. When I try to boot it on the second one I get a Kernel Error saying that the CPU doesn't support PAE. The two PC's are practically Identical, The same Bios version, same internals. The only difference is that one of them has about 756Mb memory, while the other only has 256Mb... My original question was about if there was a memory requirement but then I had the idea of switching them, but I got the same message. Even the System information indicates that the CPU are exactly the same. I'm not familiar with what difference PAE does exactly, so I'm wondering if maybe because the two hard drives are from different manufacturers? Any explanation? (The model number is the same too?, I'm confused why one works and the other doesn't.


-e option with various terminal emulators

I didn't like how xterm behaved when I tried to scroll the output of less with my mouse (it scrolls the command history instead of scrolling less). So I got Sakura, and it behaved the way I wanted. However, the '-e' option doesn't seem to work well. When I type               xterm -e "ls /usr/bin | less"      I get a new xterm where the command `ls /usr/bin | less` has been executed. However,               sakura -e "ls /usr/bin | less"      seems to ignore my request, and simply starts a new Sakura terminal. In fact, I've experimented with other terminal emulators and options with no success...               sakura -x "ls /usr/bin | less"     xfce4-terminal -e "ls /usr/bin | less"     roxterm -e "ls /usr/bin | less"     lxterminal -e "ls /usr/bin | less"     lilyterm -e "ls /usr/bin | less"      Some of them ignore my request, and sometimes they claim they say "Failed to execute child process ... (No such file or directory)" I'm currently on Arch. I've come across http://osdir.com/ml/general/2013-07/msg06468.html, which seems to suggest Sakura had at one point behaved as I would have wished it (I currently have version 3.1.0). Any help in getting `sakura` or some other 'nice' terminal emulator to behave as expected would be much appreciated (that is, have the command $TERM -e "ls /usr/bin | less" open up a terminal emulator with the given command executed and have the output of less be scrollable with mouse wheel).


Change Folder Permissons in Debian

I have some folders with account/user " **OpenERP** " and i created new folder (web_theme) under this directory . When i try to open/read this folder (web_theme) it throws " **Do not have the Permissions** " I have pointed new folder is in root               drwxrwxr-x 7 openerp openerp 4096 Oct  7 10:25 web     drwxrwxr-x 4 openerp openerp 4096 Oct  7 10:30 web_calendar     drwxrwxr-x 4 openerp openerp 4096 Oct  7 10:30 web_rpc     drwxrwxr-x 4 openerp openerp 4096 Oct  7 10:30 web_tests     drwx------ 4 root    root    4096 Oct 18 02:42 web_theme      Tried below commands               su/sudo chmod -R 0770 web_theme     chmod -R 0755 web_theme     chmod 666 web_theme      It Throws Error:               chmod: changing permissions of `web_theme': Operation not permitted     chmod: cannot read directory `web_theme': Permission denied      How do i resolve.


Remapping shifted function keys in XKB

I'm working on a keyboard layout for the Khmer language and I'm quickly running out of space. My aim is to create a keymap that includes all the characters in the Khmer script as well was their corresponding International Phonetic Alphabet characters. I'd like to be able to remap the `Shift`+`F _n_` , `Alt`+`Fn`, and `Shift`+`Alt`+`F _n_` key combinations to new Unicode code points, but currently it appears that these key combinations are reserved for system shortcuts. How can I override this and remap these keys? The layout I've made in XKB successfully remaps the unmodified `Fn` keys, but `Shift` \+ `F _n_` , `Alt` \+ `F _n_` , etc. are treated the same as if I pressed the `F _n_` key by itself. I'm running Ubuntu 10.04.


Security drawbacks of disabling tty password check

I found that, in `/etc/inittab`, this modification (`-a username`) for the user `u` disables the login/password check for all tty:s:               1:2345:respawn:/sbin/getty -a u 38400 tty1     2:23:respawn:/sbin/getty -a u 38400 tty2     3:23:respawn:/sbin/getty -a u 38400 tty3     4:23:respawn:/sbin/getty -a u 38400 tty4     5:23:respawn:/sbin/getty -a u 38400 tty5     6:23:respawn:/sbin/getty -a u 38400 tty6      That would be great for me, not having to type the password all the time! Question is, apart from the case when the computer gets stolen, the thief could use the system (which I would prefer, come to think of it), what security implications does this configuration have? Possibly relevant: The second column (runlevels).


What are the special characters to print from a script to move the cursor?

I found that by printing `\r` from a script the cursor moves to the beginning of the line. What character will move the cursor up one line? Where is a list of these special characters? EDIT: Working in OSX. Also, `\a` rings the bell.


Controlling openvpn auth-user-pass in ifup scripts?

I have the following configured in /etc/network/interfaces:                iface companyvpn inet manual      openvpn company      This allows me to:                ifup companyvpn      But unfortunately I am unable to provide my credentials as it appears to stop/place the process in the background?                ifup companyvpn       Starting virtual private network daemon: companyEnter Auth Username:      [1]+  Stopped                 ifup companyvpn      Any ideas how to allow the acceptance of username and password at the prompt?


Can't locate shell script

I created a shell script that logs me in to a server. The script was in a directory that was added to `$PATH` I think I might have deleted the script when not paying attention (not on purpose). I cannot find the script anymore. I tried several things:   1. use Spotlight (I'm using a Mac - spotlight does pretty much the same as `locate` afaik)   2. use `which [scriptname]`   3. go to root and type `find * | grep [scriptname]` None of these solutions located the script. HOWEVER: the script is still working. Even after a reboot. What is going on here? Is the script still somewhere on my drive?


How to change output of time command?

How would you change the output of the time command from:               real    0m12.304s     user    0m10.187s     sys     0m1.699s      To:               12.30s      EDIT: Using bash (OSX)


Set internet connection order or preference

I have SL 6.3 installed on two machines. Machine A is a workstation and has two interface `eth0` and `wlan0`. Using `eth0`, it is connected to Machine B (public facing server) with static IP address. Both connect to the internet through their respective `wlan0` interface. The problem is when the workstation is connected to the server, it sends all the packets including those of the internet to `eth0` and therefore fails. To use the internet on workstation, I need to disconnect `eth0` and if I do so then my SSH connection (over `eth0`)to the server hangs! Is there someway, I can compel my workstation to send internet packets to `wlan0` irrespective of the connection state of `eth0`.


Whole disk image incremental save and restore

I want to create a whole disk image and some incremental of them. First I created a disk backup with               dd if=/dev/disk1 of=/Volumes/USBDrive/diskimage.img bs=1024k      and there is my problem: how can I create an incremental disk image of diskimage.img? And how is the way back from the incremental image to a complete disk?


sed remove end of line for specific lines

I'm trying to find the sed command to remove the end of the line (meaning, get the next line to the current), but only if line starts with the string NOTOK. example input:                  NOTOK something detected             details are                : some info      output should be:               NOTOK something detected        details are                : some info


Linux kernel 3.3 power regression

I am using Fedora 16 in my DELL n4110. I recently upgraded the kernel from 3.2 to 3.3. In contradiction to the official claim, my system still drains battery as hell. It only provides 1:30 to 2 hrs of backup under normal stress as before, where as Windows provides 3hrs/+ of backup under similar stress. Below are some screen shots from `powertop`, stats on the services running in my box and few lines from grub.cfg. Hope these will help. `Overview` ![enter image description here](http://i.stack.imgur.com/5gjxu.png) `Idle stats` ![enter image description here](http://i.stack.imgur.com/k5M1f.png) `Frequency stats` ![enter image description here](http://i.stack.imgur.com/SncZ1.png) `Device stats` ![enter image description here](http://i.stack.imgur.com/UvK2B.png) `tunable` ![enter image description here](http://i.stack.imgur.com/7UwE8.png) `services`               /etc/init.d/ceph: ceph conf /etc/ceph/ceph.conf not found; system is not configured.     dc_client.service - SYSV: Distcache is a Distributed SSL Session Cache Client Proxy.           Loaded: loaded (/etc/rc.d/init.d/dc_client)           Active: inactive (dead)            CGroup: name=systemd:/system/dc_client.service     dc_server.service - SYSV: Distcache is a Distributed SSL Session Cache server.           Loaded: loaded (/etc/rc.d/init.d/dc_server)           Active: inactive (dead)           CGroup: name=systemd:/system/dc_server.service     # Generated by ebtables-save v1.0 on Sat Apr 21 09:35:32 NPT 2012     *nat     :PREROUTING ACCEPT     :OUTPUT ACCEPT     :POSTROUTING ACCEPT     httpd.service - The Apache HTTP Server (prefork MPM)           Loaded: loaded (/lib/systemd/system/httpd.service; disabled)           Active: inactive (dead)           CGroup: name=systemd:/system/httpd.service     No active sessions     iscsid.service - LSB: Starts and stops login iSCSI daemon.           Loaded: loaded (/etc/rc.d/init.d/iscsid)           Active: active (running) since Sat, 21 Apr 2012 08:11:58 +0545; 1h 23min ago          Process: 1011 ExecStart=/etc/rc.d/init.d/iscsid start (code=exited, status=0/SUCCESS)         Main PID: 1069 (iscsid)           CGroup: name=systemd:/system/iscsid.service               ├ 1056 iscsiuio               ├ 1068 iscsid               └ 1069 iscsid     libvirtd.service - LSB: daemon for libvirt virtualization API           Loaded: loaded (/etc/rc.d/init.d/libvirtd)           Active: active (running) since Sat, 21 Apr 2012 08:11:58 +0545; 1h 23min ago          Process: 1086 ExecStart=/etc/rc.d/init.d/libvirtd start (code=exited, status=0/SUCCESS)         Main PID: 1111 (libvirtd)           CGroup: name=systemd:/system/libvirtd.service               ├ 1111 libvirtd --daemon               └ 1183 /usr/sbin/dnsmasq --strict-order --bind-interfaces...     started     No open transaction     netconsole module not loaded     Configured devices:     lo Auto_ADW-4401 Auto_PROLiNK_H5004N Auto_korky p4p1     Currently active devices:     lo p4p1 virbr0     radvd.service - router advertisement daemon for IPv6           Loaded: loaded (/lib/systemd/system/radvd.service; disabled)           Active: inactive (dead)           CGroup: name=systemd:/system/radvd.service     sandbox is running     svnserve.service - LSB: start and stop the svnserve daemon           Loaded: loaded (/etc/rc.d/init.d/svnserve)           Active: inactive (dead)           CGroup: name=systemd:/system/svnserve.service      `grub.cfg`               ### BEGIN /etc/grub.d/10_linux ###     menuentry 'Fedora (3.3.1-5.fc16.x86_64)' --class fedora --class gnu-linux --class gnu --class os {         load_video         set gfxpayload=keep         insmod gzio         insmod part_msdos         insmod ext2         set root='(hd0,msdos6)'         search --no-floppy --fs-uuid --set=root 2260640d-2901-49e4-b14f-bf9addb04eb7         echo 'Loading Fedora (3.3.1-5.fc16.x86_64)'         linux   /vmlinuz-3.3.1-5.fc16.x86_64 root=/dev/mapper/vg_machine-lv_root ro pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 rd.lvm.lv=vg_machine/lv_root rd.md=0 rd.dm=0  KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks=0 rd.lvm.lv=vg_machine/lv_swap LANG=en_US.UTF-8         echo 'Loading initial ramdisk ...'         initrd /initramfs-3.3.1-5.fc16.x86_64.img     }     menuentry 'Fedora (3.3.1-3.fc16.x86_64)' --class fedora --class gnu-linux --class gnu --class os {         load_video         set gfxpayload=keep         insmod gzio         insmod part_msdos         insmod ext2         set root='(hd0,msdos6)'         search --no-floppy --fs-uuid --set=root 2260640d-2901-49e4-b14f-bf9addb04eb7         echo 'Loading Fedora (3.3.1-3.fc16.x86_64)'         linux   /vmlinuz-3.3.1-3.fc16.x86_64 root=/dev/mapper/vg_machine-lv_root ro pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 rd.lvm.lv=vg_machine/lv_root rd.md=0 rd.dm=0  KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks=0 rd.lvm.lv=vg_machine/lv_swap LANG=en_US.UTF-8         echo 'Loading initial ramdisk ...'         initrd /initramfs-3.3.1-3.fc16.x86_64.img     }           Is this normal? Are there still problems with power consumption in 3.3? `Is there any way to report this problem to the official kernel group???`


Start a GNU screen window in the background/without focus

The following command `screen -t 'fubar' cmd` will create a new screen window with the command cmd running in it and will set the focus to this window. How can I keep the focus in the current screen window, not the new one?


CUPS compilation fails on Cygwin

I was brave and tried to compile CUPS in a 32-bit Cygwin environment. I used the standard sources from the tarball. All went fine until linking. http://pastebin.com/QSKvLSmT Here's the end of the transcript:               Compiling raster.c...     raster.c:1: warning: -fPIC ignored for target (all code is position independent)     Linking libcupsimage.so.2...     ../cups/libcups.a(file.o): In function `cupsFileRewind':     /opt/cups/cups-1.4.8/cups/file.c:1465: undefined reference to `_inflateEnd'     ../cups/libcups.a(file.o): In function `cups_fill':     /opt/cups/cups-1.4.8/cups/file.c:2096: undefined reference to `_crc32'     /opt/cups/cups-1.4.8/cups/file.c:2098: undefined reference to `_inflateInit2_'     /opt/cups/cups-1.4.8/cups/file.c:2133: undefined reference to `_inflate'     /opt/cups/cups-1.4.8/cups/file.c:2136: undefined reference to `_crc32'     ../cups/libcups.a(file.o): In function `cupsFileSeek':     /opt/cups/cups-1.4.8/cups/file.c:1569: undefined reference to `_inflateEnd'     ../cups/libcups.a(file.o): In function `cups_compress':     /opt/cups/cups-1.4.8/cups/file.c:1873: undefined reference to `_crc32'     /opt/cups/cups-1.4.8/cups/file.c:1900: undefined reference to `_deflate'     ../cups/libcups.a(file.o): In function `cupsFileOpenFd':     /opt/cups/cups-1.4.8/cups/file.c:996: undefined reference to `_deflateInit2_'     /opt/cups/cups-1.4.8/cups/file.c:1002: undefined reference to `_crc32'     ../cups/libcups.a(file.o): In function `cupsFileClose':     /opt/cups/cups-1.4.8/cups/file.c:121: undefined reference to `_inflateEnd'     /opt/cups/cups-1.4.8/cups/file.c:150: undefined reference to `_deflate'     /opt/cups/cups-1.4.8/cups/file.c:174: undefined reference to `_deflateEnd'     collect2: ld returned 1 exit status     Makefile:331: recipe for target `libcupsimage.so.2' failed     make[1]: *** [libcupsimage.so.2] Error 1     Makefile:34: recipe for target `all' failed     make: *** [all] Error 1      What to do?


How to change Grub 2 default permanently?

Fedora now uses Grub 2. Whenever it does a kernel upgrade, it loses my default boot option (Windows). How can I fix this? I resent Grub 2 over this, because the old Grub respected my choices.


Determining media format/encoding for DLNA system

How do you determine what parameters are needed by a DLNA renderer and server? I have a Samsung TV that is a DLNA renderer. I also have a Western Digital NAS running Debian and have Twonky and MediaTomb 0.12.0 installed. The Samsung TV seems to have trouble playing some AV formats. I have tried copying streams with **ffmpeg** to different containers. In some cases, it seems that the **DLNA Server** affects the ability to play back. For instance, _Twonky_ never seems to allow seeking, where as _MediaTomb_ will depending on the AV file; typically only AVI's allow seeking with _MediaTomb/Samsung Tv_. I don't know whether the render or server is responsible. In some cases, it appears that _Twonky_ will not play files that _MediaTomb_ will; Ie, the **DLNA Server** can give up on a media file. Most likely the media server gives up parsing/processing the media file; occasionally this has happened mid-stream. I have _mp4/x264_ files that play and many that don't. Is there some suite of programs I can use to analyze the media files to determine how I need to transcode to ensure play back? I have tried the `midentify.sh` script with **mplayer** and `ffprobe` from **ffmpeg**. Maybe I haven't turned on enough options? Mainly some _x264_ encoded files have trouble playing. _Xvid_ encoded files never have trouble playing. Hopefully it is possible to get _MediaTomb_ to trancode the files on the fly, but I hope it is not the video stream. Is there something better than trial/error encodes? How can I help to zero in on encoding/container parameters that work? Related:   What is the difference between DLNA and UPNP?   Samsung supported formats. **Edit:** Page 34 of the UC6300 user's manual has a list of supported container formats, audio and video codecs, display resolutions and frame and bit rates. For MP4 and AVI, apparently only 1920x1080 resolutions are supported. However, I have been able to play many videos at lower resolutions. 6-30fps is supported. Most encodes are ~24fps so that is not an issue. 8Mbps bit rate for all codecs except H.264BP/MP/HP which lists as 25Mbps (but I think must be 2.5). AVI/MKV and MP4 supports the following audio codecs,   1. MP3   2. ADPCM   3. AAC (MP4 only)   4. AC3 (AVI/MKV)   5. LCPM (AVI/MKV)   6. DTS core (AVI/MKV) I typically use _MP3_ or _AC3_ with the _spdif_ pass-thru to an amp. AVI/MKV/MP4 supports the following video codecs,   1. Divx 3.11/4.x/5.1/6.0 (AVI/MKV)   2. XviD   3. H.264 BP/MP/HP   4. MPEG4 SP/ASP Additionally, H.264 level 4.1 is supported. H.264 FMO/ASO/RS, VC1 SP/MP/AP L4 and AVCHD are not supported. GMC is not supported, H.263 is not supported. How do I translate this to `midentify.sh` or `ffprobe` output?


LANG environment variable not respected

OS: Mint13 I have set my preferred language to zh-cn via the language support option. This has changed the language of a small handful of things (synaptic, dates and times). However everything else is still in English. When i set my LANG and MDM_LANG variables to zh-CN.UTF-8 manually in the terminal, and open an application - the correct language is displayed. However even having placed `export LANG="zh-CN.UTF-8"` and `export LANG="zh- CN.UTF-8"` in my `.bashrc` everything is still in English. (even if run from the terminal which reports the correct LANG etc). EDIT:               ~ $ locale     LANG=en_AU.UTF-8     LANGUAGE=     LC_CTYPE="en_AU.UTF-8"     LC_NUMERIC=zh_CN.UTF-8     LC_TIME=zh_CN.UTF-8     LC_COLLATE="en_AU.UTF-8"     LC_MONETARY=zh_CN.UTF-8     LC_MESSAGES="en_AU.UTF-8"     LC_PAPER=zh_CN.UTF-8     LC_NAME=zh_CN.UTF-8     LC_ADDRESS=zh_CN.UTF-8     LC_TELEPHONE=zh_CN.UTF-8     LC_MEASUREMENT=zh_CN.UTF-8     LC_IDENTIFICATION=zh_CN.UTF-8     LC_ALL=          ~ $ cat /etc/environment     LC_NUMERIC="zh_CN.UTF-8"     LC_TIME="zh_CN.UTF-8"     LC_MONETARY="zh_CN.UTF-8"     LC_PAPER="zh_CN.UTF-8"     LC_IDENTIFICATION="zh_CN.UTF-8"     LC_NAME="zh_CN.UTF-8"     LC_ADDRESS="zh_CN.UTF-8"     LC_TELEPHONE="zh_CN.UTF-8"     LC_MEASUREMENT="zh_CN.UTF-8"     LANGUAGE="zh_CN:en_AU:en"     LANG="zh_CN.UTF-8"


Is any extended logging available for cron jobs?

I have 3 scripts under `/etc/cron.daily`. My cron logs are written in `/var/log/cron`. The below is an entry for the above cron that has run.               (root) CMD (run-parts /etc/cron.hourly)      Here the `stdout` or `stderr` of the scripts inside the cron is unavailable, it shows that `run-parts` command has run over this folder. Is there any tricks that can help to log what happened while the 3 scripts were executed? NOTE: I cannot edit the scripts in `cron.daily` to redirect outs and errs to a log file.


How do I set up several interfaces all bridged onto eth0?

I have found several guides to bridging a single interface (eg `br0`) onto `eth0` but none for multiple interfaces (eg `br0`, `br1` etc). Is this possible?


view file containing ISO-8859 text, CRLF line terminators, and escape sequences

I have stumbled upon a strange text file in an archive of an old dos game downloaded from some abandonware site. The text file is named `WHY_NOT.TXT`. I assume the file is some sort of .NFO file from the group of people who ... um ... 'liberated' the game. I had not much luck viewing the file using cat or less or even nfoview. The question is: how can I view the content of the file as intended? Output from nfoview: ![nfoview](http://i.stack.imgur.com/m6lVy.png) Here is the output of cat and less. I use screenshots because I fear the encoding will get messed up more by the browser and the internets. ![catless](http://i.stack.imgur.com/1iyNn.png) Output of file:               $ file WHY_NOT.TXT      WHY_NOT.TXT: ISO-8859 text, with CRLF line terminators, with escape sequences      Here is the file in raw hex dump created using `xxd -p WHY_NOT.TXT`:               1b5b34306d0d0a1b5b33396d1b5b34306d0d0a1b5b33396d1b5b34431b5b     303b33346ddb1b5b316ddbdfdfdfdfdfdf201b5b303b33346ddb1b5b316d     dbdfdfdfdfdfdb201b5b34346d201b5b34306ddbdfdfdfdfdfdb201b5b30     3b33346ddb1b5b316ddbdfdfdbdfdfdb201b5b303b33346ddb1b5b316ddb     1b5b36431b5b34346d201b5b34306ddbdfdfdfdfdfdb201b5b303b33346d     db1b5b316ddbdfdfdb201b5b303b33346ddb1b5b316ddb201b5b303b3334     6ddb1b5b316ddbdfdfdfdfdfdc0d0a202020201b5b303b33346ddb1b5b31     6ddbdcdcdcdcdcdc201b5b303b33346ddb1b5b316ddbdcdcdcdc1b5b3434     6ddc1b5b34306ddb201b5b34346d201b5b34306ddbdcdcdcdc1b5b34346d     dc1b5b34306ddb201b5b303b33346ddb1b5b316ddb201b5b303b33346ddb     1b5b316ddb201b5b303b33346ddb1b5b316ddb201b5b303b33346ddb1b5b     316ddb1b5b36431b5b34346d201b5b34306ddbdcdcdcdc1b5b34346ddc1b     5b34306ddb201b5b303b33346ddb1b5b316ddb201b5b303b33346ddb1b5b     316ddb201b5b303b33346ddb1b5b316ddb201b5b303b33346ddb1b5b316d     db202020201b5b303b33346ddb1b5b316ddb0d0a1b5b3130431b5b303b33     346ddc1b5b316ddb201b5b303b33346ddb1b5b316ddb1b5b37431b5b3434     6d201b5b34306ddb202020201b5b303b33346ddc1b5b316ddb201b5b303b     33346ddb1b5b316ddb202020201b5b303b33346ddb1b5b316ddb201b5b30     3b33346ddb1b5b316ddb1b5b36431b5b34346d201b5b34306ddb20202020     1b5b303b33346ddc1b5b316ddb201b5b303b33346ddb1b5b316ddb201b5b     303b33346ddb1b5b316ddb201b5b303b33346ddb1b5b316ddb201b5b303b     33346ddb1b5b316ddb202020201b5b303b33346ddb1b5b316ddb0d0a2020     20201b5b303b33346ddc1b5b316ddcdcdcdcdc1b5b34346ddc1b5b34306d     db201b5b303b33346ddb1b5b316ddb1b5b37431b5b34346d201b5b34306d     db202020201b5b34346d201b5b34306ddb201b5b303b33346ddb1b5b316d     db202020201b5b303b33346ddb1b5b316ddb201b5b303b33346ddb1b5b31     6ddbdcdcdcdcdc201b5b34346d201b5b34306ddb202020201b5b34346d20     1b5b34306ddb201b5b303b33346ddb1b5b316ddb201b5b303b33346ddb1b     5b316ddbdc1b5b34346ddc1b5b34306ddb201b5b303b33346ddb1b5b316d     dbdcdcdcdc1b5b34346ddc1b5b34306ddf0d0a1b5b306d1b5b323535440d     0a      You can recreate the original file by copying that string to a file and then use `xxd -r -p filename`. Here is the md5sum to be really sure that you have the identical original file: `e64665b3f6e5fb3ec71c8fbf6cc63875`


How to view bad blocks on mounted ext3 filesystem?

I've ran fsck -c on the (unmounted) partition in question a while ago. The process was unattended and results were not stored anywhere (except badblock inode). Now I'd like to get badblock information to know if there are any problems with the harddrive. Unfortunately, partition is used in the production system and can't be unmounted. I see two ways to get what I want:   1. Run badblocks in read-only mode. This will probably take a lot of time and cause unnecessary bruden on the system.   2. Somehow extract information about badblocks from the filesystem iteself. How can I view known badblocks registered in mounted filesystem?


Dump Page table layout (KERNEL CONFIG)

While configuring kernel for debugging found this option: > CONFIG_X86_PTDUMP: Export kernel pagetable layout to userspace via debugfs Does this mean RAM page-table layouts ? any guides on how to use debugfs and view this layout ?


Filesystem and journal layout

Is there any tools or some way in linux which can be used to view internals of filesystems ? How to view the inode related structures and journal ? and cached pages of files (pagecache).


command line audio with mpg123 - how to save position in audio and begin from that location next time?

I am contemplating using mpg123 as an audiobook player. I can't find any other good audiobook players for Linux, and I think mpg123 may be my best option. My audiobooks are organized by directories and the track names are numbered (e.g., Track-01.mp3, Track-02.mp3, etc.). What I am seeking is a way to save the last location played (the track and the position within the track) when I stop listening, and then be able to start mpg123 at that place in the audiobook the next time I listen. It would be ideal to have this "last location" info saved in a text file in the directory. That way I could start each audiobook at the last location by using the text file stored in that audiobook's directory. A similar bookmark feature would be nice too. It would be almost the same implementation, it seems. The "last location" info could be saved in a text file named e.g. "last" and each bookmark could be saved in a text file named bookmark.N (where N simply increments). Is a trivial implementation possible, maybe as a simple bash script? I'm not a developer.


Host not found trying to restrict access to yahoo.com in elinks using squid

I added this in squid.conf               acl blocked_sites dstdomains .yahoo.com     http_access deny blocked_sites      and this in elinks.conf               set protocol.http.proxy.host = "proxy.localhost:3128"     set protocol.http.proxy.passwd = ""     set protocol.http.proxy.user = ""      And i get HOST NOT FOUND I need some help


core i7 processor - x86-64 , cross compile kernel

I would like to know whether all core i7 processor is of type x86_64.(as per wiki it says so) I have a core i7 machine (from /proc/cpuinfo) where only 32bit kernel in installed on the same. Also, it has 32 bit gcc compiler installed. If core i7 supports x86_64 kernel , I would like to install the same. I hope all the 32 bit binaries can run on x86_64 kernel , so I am not going to do anything with applications. Now, My questions are:   1. whether core i7 supports x86_64?   2. How to install a 64 bit cross compiler in order to build a kernel (64 bit type). My machine is Fedora FC15.   3. I hope all 32 bit apps should work fine with this 64 bit kernel. ?   4. How to get 64 bit cross compiler for fedora (x86_64)? Note, I am aware about cross compiling kernel.


Java NullPointer Exception for Sencha CMD

I've been trying to solve this problem for a few weeks now and it just occured to me, I might be asking the wrong question. I am learning and developing building Sencha Touch 2 applications on my Ubuntu web server. You need an utility called Sencha CMD, which utilizes Java, to execute specific commands in the build process. The problem is after creating a few applications, I got the following error:               > Sencha Cmd v4.0.1.4     >         [INF] Workspace does not have framework touch at /var/www ... copying     >     [ERR] java.lang.NullPointerException     >          at com.sencha.util.Version.<init>(Version.java:36)     >          at com.sencha.command.generator.GeneratorCommands$WorkspaceCommand.getParameters(GeneratorCommands.java:130)     >          at com.sencha.command.BasePluginCommands$BasePluginCommand.doExecute(BasePluginCommands.java:23)     >          at com.sencha.command.generator.GeneratorCommands$WorkspaceCommand.execute(GeneratorCommands.java:89)     >          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     >          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)     >          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     >          at java.lang.reflect.Method.invoke(Method.java:622)     >          at com.sencha.util.MethodInvoker$Arguments.invoke(MethodInvoker.java:175)     >          at com.sencha.cli.Command.dispatch(Command.java:42)     >          at com.sencha.cli.Commands.dispatch(Commands.java:64)     >          at com.sencha.cli.AbstractCommand.dispatch(AbstractCommand.java:124)     >          at com.sencha.command.generator.GeneratorCommands$AppCommand.generateWorkspace(GeneratorCommands.java:397)     >          at com.sencha.command.generator.GeneratorCommands$AppCommand.execute(GeneratorCommands.java:240)     >          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     >          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)     >          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     >          at java.lang.reflect.Method.invoke(Method.java:622)     >          at com.sencha.util.MethodInvoker$Arguments.invoke(MethodInvoker.java:175)     >          at com.sencha.cli.Command.dispatch(Command.java:42)     >          at com.sencha.cli.Commands.dispatch(Commands.java:64)     >          at com.sencha.cli.Commands.dispatch(Commands.java:64)     >          at com.sencha.command.Sencha.dispatch(Sencha.java:80)     >          at com.sencha.command.Sencha.main(Sencha.java:148)      My java version is as follows:               java version "1.6.0_27"     OpenJDK Runtime Environment (IcedTea6 1.12.6) (6b27-1.12.6-1ubuntu0.12.10.4)     OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)      And I'm working with **Sencha Touch 2** and **Sencha Cmd 4.0.2.67** **I've been thinking it's a Sencha issue but is it possible this have little or nothing to do with Sencha and more to do with Java?** If that's the case, can anyone suggect solutions, please?


Read a file and copy to another file

I'm having a issue, I need to copy the file contents and remove a couple of lines if they match the output from a previous command. But so far, I'm having an issue in maintaining the file lines exactly the same. I'm putting the simple part of the script as the if to omit the copy are not part of the problem as this happens with unaffected lines. For the example: In the original file I have the following               Testing,      resuming text      When run the script the fields become:               Testing, resuming text      I'm doing the following:               #!/usr/bin/bash     rm /tmp/dest_file     while read line     do        echo $line >> /tmp/dest_file     done < $1      The problem I have with this is that the files will become different due to the tab formatted fields.


why is my php script slower on debian than freebsd?

We moved a web-based application to a new server recently, but the new server seems to run slower than the old one. The old server was FreeBSD 7 with Apache 2.2, mod_php 5.3, and mySQL 5.1. The new server is Debian 7 with Apache 2.2, mod_php 5.4, and mySQL 5.5. As far as I can tell, the configurations are pretty much stock. The old server took a long time to display results (10+ seconds, 30 at times), but it displayed results as it got them. The new server seems to take about the same amount of time, but it doesn't display any results until the entire page is ready. This makes the application "feel" slower, because anything you do results in a 10+ second delay before you get any response while it loads the page. Why would the new server be buffering the page (if that's what it's doing). Is there some configuration setting I can change to make it stop?


Daemon file access denied while it shouldn't


Why I have two /dev/sdx entries with a single disk?

In my laptop (running Linux) I have only one SSD, connected to the SATA3 port. Why I have two **sdx** entries in `/dev` directory? In particular I see `/dev/sda` and `/dev/sdb`, and `/dev/sda` is the SSD:               # fdisk -l          Disk /dev/sda: 128.0 GB, 128035676160 bytes, 250069680 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Identificativo disco: 0x00034e4b          Dispositivo Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048   125954047    62976000    7  HPFS/NTFS/exFAT     /dev/sda2       125954048   190466047    32256000   83  Linux     /dev/sda3       190466048   222210047    15872000   83  Linux     /dev/sda4       222210048   250068991    13929472    7  HPFS/NTFS/exFAT          $ cat /sys/block/sda/queue/rotational      0      The surprising thing is the following:               $ cat /sys/block/sdb/queue/rotational      1      So it looks like that `/dev/sdb` is considered as a magnetic hard disk drive. What's the point? EDIT:               # lshw -C disk       *-disk                              description: SCSI Disk            product: xD/SD/M.S.            vendor: Generic-            physical id: 0.0.0            bus info: scsi@8:0.0.0            logical name: /dev/sdb            version: 1.00            serial: 3            capabilities: removable            configuration: sectorsize=512          *-medium               physical id: 0               logical name: /dev/sdb       *-disk            description: ATA Disk            product: SAMSUNG SSD 830            physical id: 0.0.0            bus info: scsi@0:0.0.0            logical name: /dev/sda            version: CXM0            serial: S0Z3NSAC905663            size: 119GiB (128GB)            capabilities: partitioned partitioned:dos            configuration: ansiversion=5 sectorsize=512 signature=00034e4b


Copy paste problem on KDE

I've been extremely annoyed with this issue for a while. I'm using TeXMaker on KDE to write my class notes in LaTeX and I sometimes need to copy paste text from it to some other applications while editing, the flashcard program Anki being one of them. TeXMaker uses syntax highlighting and for some reason hitting copy paste will copy the color tags with it together with tags for formatting. The end result is that Anki will treat the color tags as part of the LaTeX code and feed the code together with color tags into LaTeX, which of course makes any LaTeX compile fail. It seems like KDE apps include formatting and color data in the data that is sent to the clipboard. In other words it won't just be a sequence consisting of the characters you've typed, but it will contain various tags that essentially look like HTML. Anyone else stumbled on the same problem? Any way to fix it?


Enabling or disabling one monitor in nVidia Twinview on the command line, like with nvidia-settings

For some reasons, most native games as well as Wine have a problem with Twinview. So when starting SC2 I have to manually disable one of my two screens in nvidia-settings. (By going in X Server Display Configuration > click on second monitor > Display > Resolution: off) I searched hard but couldn't find a way to do that automagically. nvidia- settings itself has non-GUI options (see "nvidia-settings -q all") but none of them seems to do what I want. I want to put that in my startup script for games, which already replaces Compiz with metacity (and back when it exits). Help appreciated.


How do I make my pc speaker beep

Using bash, how can I make the pc speaker beep? Something like `echo 'beepsound' > /dev/pcspkr` would be nice.


How do you correctly extract all command synopses from manpages in /usr/share/man/man1?

I'm trying to extract all _command synopses_ from manpages in `/usr/share/man/man1` using:               #!/usr/bin/env bash     ## synopses - extract all synopses in /usr/share/man/man1          cd /usr/share/man/man1     for i in *.gz; do         echo "$i:" | sed -E "s/.1.gz|.gz//g"         man "./$i" | sed -n '/^SYNOPSIS/,/^[A-Z][A-Z][A-Z]/p' | sed -e '1d; $d' | tr -s [:space:]     done      ...which provides _some_ measure of success - I get complete output for commands from _a_ to _z_. But I'm also getting many errors on _stderr_ using both `for i in ./*.gz; do man "$i"` and `for i in *.gz; do man "./$i"` _as I output to file_ (`synopses > file`)1:               <standard input>:27: expected `;' after scale-indicator (got `o')     <standard input>:29: expected `;' after scale-indicator (got `o')     <standard input>:283: name expected (got `\{'): treated as missing     <standard input>:674: warning: macro `as',' not defined (possibly missing space after `as')     <standard input>:174: name expected (got `\{'): treated as missing     <standard input>:161: warning [p 1, 5.5i]: can't break line     <standard input>:594: warning [p 5, 3.8i, div `an-div', 0.0i]: can't break line     <standard input>:569: warning [p 6, 0.0i]: can't break line     <standard input>:147: warning [p 1, 1.8i]: can't break line     <standard input>:205: warning [p 2, 0.2i]: can't break line     <standard input>:525: warning [p 5, 4.5i]: can't break line     <standard input>:157: warning [p 1, 4.8i]: can't break line     <standard input>:351: warning [p 3, 1.8i, div `an-div', 0.0i]: can't break line     <standard input>:147: a space character is not allowed in an escape name     man: can't open man1/zshmisc.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshexpn.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshparam.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshoptions.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshbuiltins.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshzle.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshcompwid.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshcompsys.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshcompctl.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshmodules.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshcalsys.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshtcpsys.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshzftpsys.1: No such file or directory     man: -:423: warning: failed .so request     man: can't open man1/zshcontrib.1: No such file or directory     man: -:423: warning: failed .so request     <standard input>:423: can't open `man1/zshmisc.1': No such file or directory     <standard input>:424: can't open `man1/zshexpn.1': No such file or directory     <standard input>:425: can't open `man1/zshparam.1': No such file or directory     <standard input>:426: can't open `man1/zshoptions.1': No such file or directory     <standard input>:427: can't open `man1/zshbuiltins.1': No such file or directory     <standard input>:428: can't open `man1/zshzle.1': No such file or directory     <standard input>:429: can't open `man1/zshcompwid.1': No such file or directory     <standard input>:430: can't open `man1/zshcompsys.1': No such file or directory     <standard input>:431: can't open `man1/zshcompctl.1': No such file or directory     <standard input>:432: can't open `man1/zshmodules.1': No such file or directory     <standard input>:433: can't open `man1/zshcalsys.1': No such file or directory     <standard input>:434: can't open `man1/zshtcpsys.1': No such file or directory     <standard input>:435: can't open `man1/zshzftpsys.1': No such file or directory     <standard input>:436: can't open `man1/zshcontrib.1': No such file or directory      What are those `<standard input>` errors about (something escaped?) and why is `man` ending up not finding some files? How could I make this more robust/efficient? * * * 1\. It seems the errors on _stderr_ are the same whatever the implementation/solution I use for the same data. It is striking.


Serialize shell variable in bash or zsh

Is there any way to serialize a shell variable? Suppose I have a variable `$VAR`, and I want to be able to save it to a file or whatever, and then read it back later to get the same value back? Is there a portable way of doing this? (I don't think so) Is there a way to do it in bash or zsh?


Crontab does not run?

# crontab -e               0 */4 * * * root /usr/bin/rsnapshot hourly     30 3 * * * root /usr/bin/rsnapshot daily     0  3 * * 1 root /usr/bin/rsnapshot weekly     30 2 1 * * root /usr/bin/rsnapshot monthly      # tail /var/log/cron               Jun 13 21:01:01 web-backups run-parts(/etc/cron.hourly)[2795]: starting 0anacron     Jun 13 21:01:01 web-backups run-parts(/etc/cron.hourly)[2806]: finished 0anacron     Jun 13 22:01:01 web-backups CROND[2810]: (root) CMD (run-parts /etc/cron.hourly)     Jun 13 22:01:01 web-backups run-parts(/etc/cron.hourly)[2810]: starting 0anacron     Jun 13 22:01:01 web-backups run-parts(/etc/cron.hourly)[2819]: finished 0anacron     Jun 13 22:01:01 web-backups CROND[2822]: (root) CMD (run-parts /etc/cron.hourly)     Jun 13 22:01:01 web-backups run-parts(/etc/cron.hourly)[2822]: starting 0anacron     Jun 13 22:01:01 web-backups run-parts(/etc/cron.hourly)[2831]: finished 0anacron     Jun 13 22:44:59 web-backups crontab[2854]: (root) BEGIN EDIT (root)     Jun 13 22:45:07 web-backups crontab[2854]: (root) END EDIT (root)      But I am not seeing my cronjobs run. I can run the tasks manually and they run fine.


Gnome Terminal appearance

Is it possible to get the gnome-terminal in GNOME 3 to be borderless, similar to how urxvt looks? Without the big top of it that says Terminal with your working directory or the menu bar?


Download file linked in MySQL DB, extract text and insert into db with bash script?

I want to download a file (only download if the url ends with a certain string), which URL is in a MySQL database, extract the text and write the text to the database, by replacing the url.   And this have to be done for every row (approx. 25k rows). Is there a way to do this with a bash script (or something else e.g Java)? The MySQL server runs on my linux root, I have full access to it. My desktop OS is also linux (Linux Mint with many customizations). This is what I made so far:               #!/bin/bash          for (( i=1; i <= 5; i++))     do             DBQUERY=`mysql -B -ss -uuser -ppassword -e "USE table; SELECT column FROM table WHERE pid='$i';"`             if [[ $DBQUERY == *.pls ]] ;        then             wget -O tempfile.pls $DBQUERY             while read line             do                 if [[ $line == File1=* ]] ;                 then                     mysql -B -ss -uuser -ppassword -e "USE table; UPDATE table SET column = '${line:6}' WHERE pid = '$i';"                 fi             done <tempfile.pls        fi     done      How can I secure it?


Is there a way to get *actual* (uninterpreted) shell arguments in a function or script?

I have a function `posix` that I use in the Git bash shell on Windows to transform DOS-style paths to normal Unix-style paths. Since DOS-style paths use a backslash as separator, I have to quote the path argument to prevent the backslashes as being used by the shell to denote the next character as a literal. Is there any way to get the _uninterpreted_ argument from inside my function, so that I don't need to quote it? Here is my function, if it helps:               function posix() {       echo $1 | sed -e 's|\\|/|g' | sed -re 's|^(.)\:|/\L\1|'     }      (By the way, I welcome any _comments_ with tips for improving the function in other ways unrelated to solving the quoting/shell-interpretation problem.)


Auto-expansion problem with array elements containing an '*' (asterisk)

I'm trying to write me a `find` script that should later be able to read a list of directories to be excluded from an external file. Whilst I can accomplish that part myself, it's the annoying array expansion that makes the task difficult. First, some "preparations" in order to obtain a suitable sample directory tree:               $ mkdir tmp && cd tmp     $ mkdir excl1_dirx excl2_dirx excl3_dirx     $ touch excl1_dirx/dummy1.txt excl2_dirx/dummy2.txt excl3_dirx/dummy3.txt     $ mkdir excl1_diry excl2_diry excl3_diry     $ touch excl1_diry/dummy4.txt excl2_diry/dummy5.txt excl3_diry/dummy6.txt     $ touch dummy00.txt dummy01.txt      If the script works, only `dummy00.txt` and `dummy01.txt` may be shown.               #!/bin/bash     excl_d=("excl*_dirx" "excl*_diry")          find_str=" . -type f ! ( "          for ((i=0 ; i<$((${#excl_d[*]})) ; i++)); do        if [[ $i > 0 ]]; then          find_str+=" -o "        fi            find_str+=" -path \"./${excl_d[i]}/*\""     done          find_str+=" )"          # this is just for debugging     echo "[debug] value of str = find $find_str"          find $find_str      First of all: why so (seemingly) complicated in the line before the "`done`"? Well, `bash` sometimes likes to annoy the users by doing things they don't expect. Without those quotes, it will **expand** each array element; e. g. `excl*_dirx` will become `excl1 dirx excl2 dirx excl3 dirx`, which (obviously) breaks the `-path` line! And that although I've used a pair of double quotes per array element, which was actually supposed to prevent bash from doing its expansion mischief! However, the best is yet to come: the second last line - when the `(` `)` are escaped to `\(` `\)` \- will work fine in the shell, but not in a standalone script. Even though it won't throw any errors, the result in the latter implementation will be wrong. I've tried all kinds of combinations with single and double quotes in the               find_str+=" -path \"./${excl_d[i]}/*\""      line, but I just can't get it to work even though it looks absolutely perfect when displayed as in the second last line. It seems that `bash` internally treats my escaped quotes `\"` differently from non-escaped ones. Ah, and quotes inside quotes work near everywhere _but_ for some reason will get filtered out when using that `+=` operator. Not only am I looking for an explanation for this behavior but also for a solution how it could be made work in a standalone script. It must really be a stupid mistake I've made. :-/