title: yum install mod_auth_token not working on CentOS

text: On CentOS 6.5 how do I make `yum install mod_auth_token` work these days? According to my own HOWTO I wrote 12 months back, you used to be able to just type it now you have to DIY it, which is bad because my DIY is bad, and I get this:               # cd        # wget http://dl.fedoraproject.org/pub/epel/6/i386/mod_auth_token-1.0.5-2.el6.i686.rpm     # rpm -Uvh mod_auth_token-1.0.5-2.el6.i686.rpm     error: Failed dependencies:        libc.so.6 is needed by mod_auth_token-1.0.5-2.el6.i686        libc.so.6(GLIBC_2.0) is needed by mod_auth_token-1.0.5-2.el6.i686        libc.so.6(GLIBC_2.1.3) is needed by mod_auth_token-1.0.5-2.el6.i686        libc.so.6(GLIBC_2.3) is needed by mod_auth_token-1.0.5-2.el6.i686        libc.so.6(GLIBC_2.4) is needed by mod_auth_token-1.0.5-2.el6.i686     # yum whatprovides libc.so.6     # yum install glibc-2.12-1.132.el6.i686     # rpm -Uvh mod_auth_token-1.0.5-2.el6.i686.rpm     # yum install mod_auth_token-1.0.5-2.el6.i686.rpm     # rpm -ql mod_auth_token     /usr/lib/httpd/modules/mod_auth_token.so     ls -l /etc/httpd/modules/     cp /usr/lib/httpd/modules/mod_auth_token.so /etc/httpd/modules/      but then I get this                Starting httpd: httpd: Syntax error on line 202 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/mod_auth_token.so into server: /etc/httpd/modules/mod_auth_token.so: wrong ELF class: ELFCLASS32      so obviously I have somehow got a 64 bit/32 bit error. A year ago (I wrote to myself that) you could simply do               yum install mod_auth_token      is there a way to do this so it works? the `mod_auth_toekn.so` needs to be in `/etc/httpd/modules/`


title: How to find files with names having a long string after the first dot

text: My Samsung Galaxy S doesn't like files where the name contains a long string after the first dot. I guess some part of the software has a too short buffer for the file extension. How can I find all files on my Micro-SD-Card mounted at /media/sd where the filename has more than five characters after the first dot? Reading the find manpage, I thought `find . -regex '.*\\..\\{5,\\}'` would work, but it doesn't give any hits, so I somehow don't get my regular expression right.


title: OpenBSD: 32 bit or 64 bit

text: I would like to use the 64 bit version of OpenBSD, but I'm not really sure how good it works. Are there any known problems? Is the 32 bit version more recommended for productive environment?


title: Where should I keep personal files so they are safe across system re-installs?

text: I want to make sure that at the next system installation/restoration my files are not lost. Using tweakers I can change Window's default folders (e.g. move "My documents" from C: drive to D:). Right now I have Linux Mint 15 Mate installed on partition `/` and the rest of HDD mounted to `/home`. Is this right approach? If yes, how can I move default folders to this partition? If no, what is the best approach?


title: Network Manager error

text: When I run NetworkManager's applet, `nm-applet`, on my Scientific Linux 6.4, I get:               [root@computer]# nm-applet      > ** (nm-applet:4157): WARNING **: bus_init(): Could not get the session bus. > Make sure the message bus daemon is running! Message: Did not receive a > reply. Possible causes include: the remote application did not send a reply, > the message bus security policy blocked the reply, the reply timeout > expired, or the network connection was broken. > > GConf Error: Failed to contact configuration server; some possible causes > are that you need to enable TCP/IP networking for ORBit, or you have stale > NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for > information. (Details - 1: Failed to get connection to session: Did not > receive a reply. Possible causes include: the remote application did not > send a reply, the message bus security policy blocked the reply, the reply > timeout expired, or the network connection was broken.) > > An instance of nm-applet is already running. > > (nm-applet:4157): GConf-WARNING **: Directory > `/system/networking/connections' was not being monitored by GConfClient > 0x9cac60 When I pass the command `lspci -v` I get:               0c:00.0 Network controller: Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01)     Subsystem: Dell Wireless 1397 WLAN Mini-Card     Flags: bus master, fast devsel, latency 0, IRQ 17     Memory at f69fc000 (64-bit, non-prefetchable) [size=16K]     Capabilities: [40] Power Management version 3     Capabilities: [58] Vendor Specific Information: Len=78 <?>     Capabilities: [e8] MSI: Enable- Count=1/1 Maskable- 64bit+     Capabilities: [d0] Express Endpoint, MSI 00     Capabilities: [100] Advanced Error Reporting     Capabilities: [13c] Virtual Channel     Capabilities: [160] Device Serial Number 18-6d-04-ff-ff-2c-70-1a     Capabilities: [16c] Power Budgeting <?>     Kernel driver in use: b43-pci-bridge     Kernel modules: ssb      How can I fix this problem?


title: Log-me-in on Angstrom

text: Has anyone got Log-me-in Hamachi running on the Angstrom distribution? When I attempt to install it, it tells me I need the lsb package. I googled it and found that it is a package you can get rpm packages for. I tried to install the rpm packages, but obviously on Angstrom they don't work. I then tried to install `rpm2cpio` by installing `busybox` using `opkg`, but `busybox` on `opkg` does not have the program!


title: Quick and dirty way to edit scans

text: I've got a lot of documents that I want to scan that require only modest editing. Mainly trimming the edges, splitting in two (when I scan two pages in one scan), and possibly adjust the perspective like camscanner. **NOTE:** (You layout a quadrilangle, camscanner then adjusts the perspective so the quadriangle becomes a square). Gimp and a couple of other programs can do this, but it seems to me to be significant overkill. What other options are there for doing these tasks?


title: How to know why server keeps restarting?

text: It seems that my server keeps restarting. I want to know why. How can I know when the last time server was rebooted and why?               root     pts/0        139.193.156.125  Thu Aug  8 21:10   still logged in     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 20:38 - 21:11  (00:33)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 20:15 - 21:11  (00:56)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 19:16 - 21:11  (01:55)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 18:56 - 21:11  (02:14)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 18:24 - 21:11  (02:47)     root     pts/1        139.193.156.125  Thu Aug  8 18:16 - crash  (00:07)     root     pts/0        195.254.135.181  Thu Aug  8 18:10 - crash  (00:13)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 17:52 - 21:11  (03:19)     root     pts/0        195.254.135.181  Thu Aug  8 17:38 - crash  (00:13)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 17:08 - 21:11  (04:02)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 16:58 - 21:11  (04:12)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 16:45 - 21:11  (04:26)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 16:35 - 21:11  (04:36)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 16:27 - 21:11  (04:44)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 15:59 - 21:11  (05:12)     reboot   system boot  2.6.32-358.11.1. Thu Aug  8 06:15 - 21:11  (14:56)     root     pts/1        208.74.121.102   Wed Aug  7 06:03 - 06:04  (00:00)     root     pts/1        208.74.121.102   Tue Aug  6 15:34 - 17:40  (02:05)     root     pts/0        139.193.156.125  Tue Aug  6 11:28 - 04:40 (1+17:11)      In Linux is there ANY WAY to know why the system rebooted? Specifically did high load cause it? If not that then What?


title: Mail queue keep growing

text: My server keeps running short on inodes due the mail queue getting crazy. First, I assumed I had `postfix` not configured properly, so I switched it off. But, it happened again, last time I did it I had :                 # postsuper -d ALL     postsuper: Deleted: 375122 messages      While I could put a cron to run this every morning, that does not seem to be the optimal solution. What could be the cause of such a behaviour? How can I prevent this too happen?


title: Landscape Printing in Linux

text: I'm having trouble printing in landscape mode in a Gentoo (AMD64) installation. The setup:               CUPS-1.7.5     CUPS-Filters-1.0.54     ghostscript-gpl-9.14     proprietary brother drivers          Printer: Brother DCP 7065dn      It will not print in landscape in any application (LO, acroread, evince etc..), instead it is printing the proper image (e.g multiple pages are ordered as I would expect them to be in this mode) but in the wrong orientation. Brlaser (an alt. driver) doesn't offer duplex printing; and the printer works fine from a windows machine. In most applications I have no option of printer language, and in the ones which I do (namely acroread) it makes no difference. This seems to be something of an ongoing problem in Linux, not just with this setup. Has anyone been able to overcome the problem?


title: Pipeline each line of a file to a specific variable in a second command

text: I want to execute the following instruction:               basex -bword=ENTRY consulta.xq      But for every line of a SampleText file (plain text mainly). The SampleText contains the following lines:               hello     evening     courageous     ...     happy      So more or less what I want to do is to execute a instruction in a one liner recipe similar to this:               cat SampleText | basex -bword=EACHLINE searchquery.xq


title: GTK Frontend for locate

text: I am a heavy user of the `locate` tool, which is part of the `findutils` package. It's fine to use it on command line, but sometimes I would also like to search for a file (as fast as with `locate`) within my Xfce 4.10 desktop. Is there any nice GTK frontend (or a panel applet) for the `locate` command?


title: Switch between tabs (panels) in Mint

text: How to switch between tabs (panels) in any window (i.e. setting windows for keyboard) in Linux Mint? I use `Ctrl`+`Tab` in Windows.


title: Munin Server not making Graphs

text: On my Central Monitoring Server previously Munin 1.2.5 Server was installed. So now I update the server with latest Munin 2.0.21 and moved the files for `/var/www/html/munin` to new directory `/var/www/html/oldmunin` and did same for `/var/lib/munin/`. But the server is not generating any files, and this is the error I'm getting when I run `/usr/bin/munin-cron`. > Can't load '/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread- > multi/auto/RRDs/RRDs.so' for module RRDs: librrd.so.2: cannot open shared > object file: No such file or directory at > /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230. at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/UpdateWorker.pm line 19 > Compilation failed in require at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/UpdateWorker.pm line 19. BEGIN > failed--compilation aborted at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/UpdateWorker.pm line 19. > Compilation failed in require at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/Update.pm line 17. BEGIN > failed--compilation aborted at > /usr/lib/perl5/vendor_perl/5.8.8/Munin/Master/Update.pm line 17. Compilation > failed in require at /usr/share/munin/munin-update line 14. BEGIN failed-- > compilation aborted at /usr/share/munin/munin-update line 14.


title: ATI graphics card: Is proprietary firmware needed in any case?

text: I am trying for days now to enable 3d of my ATI X 1900 under Debian GNU/Linux 7.6. I installed the xserver-xorg-drivers-radeon package, however this does not work. Specifically, I receive a similar error message as the user here: How to configure FOSS ATI drivers on Debian Wheezy and ATI RS880 [Radeon HD 4250]? This is (drivers names etc. below are not mine, but similar):               [    8.121829] [drm] Loading RS780 Microcode     [    8.156063] r600_cp: Failed to load firmware "radeon/RS780_pfp.bin"     [    8.156092] [drm:r600_startup] *ERROR* Failed to load firmware!      The hint usually given in the internet is to install the firmware-linux- nonfree package. So my question is: Do you in any case have to install proprietary firmware, even when using free dirvers? Isn't it possible to stay completely free?


title: Where is the ability to hibernate exposed on Linux?

text: When I boot with a `resume=..` option to the kernel and an `initrd` built with a `-h` option, userland tools (say, `batti`) offer me the choice of hibernation; when I boot without them it does not. Where is the fact that I have a system capable of hibernate/resume exposed for these tools to find that out? (This is on Slackware, in case this is init- specific.)


title: Ubuntu completely freezes, suspecting IDLE

text: Relatively inexperienced with both programming and linux so hopefully I'm missing something obvious. Running Ubuntu 12.04 on a Dell Latitude E5530 and haven't had any particular problems so far, but lately it has started freezing completely, forcing me to manually reset power. The only half-way demanding stuff I've done lately is some Python programming in IDLE, but nothing crazy at all (a single Selenium- operated Firefox instance basically). What do I do when this happens in Ubuntu?


title: Double rm verification in zsh

text: When I do a rm * in zsh, I get something like this:               2014-06-08 10:14:23 $ rm *     zsh: sure you want to delete all the files in /home/assay/assay/log [yn]? y     rm: remove regular file `development.log'? y      First zsh asks me if I am sure I want to delete all, and then rm asks for for each specific file. How can I just have the zsh verification?


title: How do you implement totals from usage output generated by a program in a script so that they carry on sanely through repeated execution?

text: I have a script with a pipeline where the data is throttled by a program. Every 20 minutes, a throughput status is sent on _stderr_ , and I simply redirect this to a file:               command | cstream -t -512k -T 1200 -B 64m 2>>/home/user/totals.log | command      I could also send a SIGUSR1 signal to _cstream_ (`kill -s 10 PID`) and it would produce exactly the same output as when I set an interval like I did, and a line is added to the file. The idea is that you can set the interval and also query a status on demand. The output is formatted like this with a single whitespace character all over and terminated with a newline:               ...     1931255808 B 1.8 GB 3683.6 s (1:01 h) 524289 B/s 512.00 KB/s     2560401408 B 2.4 GB 4883.6 s (1:21 h) 524289 B/s 512.00 KB/s     3189547008 B 3.0 GB 6083.6 s (1:41 h) 524289 B/s 512.00 KB/s     3818692608 B 3.6 GB 7283.6 s (2:01 h) 524289 B/s 512.00 KB/s     4447838208 B 4.1 GB 8483.6 s (2:21 h) 524289 B/s 512.00 KB/s     10829824 B 10.3 MB 20.65 s 524487 B/s 512.19 KB/s      You can see the data progress but you couldn't just sum(or average) each column. There are just 2 events in this sample(lines 1-5, 6) i.e. I used the script twice. It just so happens here that we could add the two last lines - because I restarted it and we have a snapshot of that moment but that's arbitrary. Which leads to what happens when I exit the command and restart it, as you can see happening on the last line - the counter is of course reset. The objective is to have a cumulative total of the status output for all the instances of the script I launch over time. I usually never launch more than one instance of it at a time. So I'm thinking of adding to my script("sane" for one instance of the script only):   * First delete all but the last line of my log   * Last, when the script exits, make it write its status to the log      * Sum/avg each column of the first and last line     * Delete all intermediary lines I'm afraid I can't connect the dots. What is the simplest and best way to design and implement what I want? Does the complexity overwhelm the benefit and should I just focus on manipulating the log data with a simple command as it fills up?


title: Dual monitor setup on a laptop: internal monitor peeking through on external display

text: Recently I began to use my laptop (Dell Inspiron N5020) with an external display. I use the displays side-by-side, internal on the left, external on the right. The problem is, however, that the display on the external monitor seems to be shifted to the right by a few pixels, and at the same time a few pixel wide column from the right edge of the internal display is duplicated on the left edge of the external. On a screenshot this is not visible. I illustrated what I'm actually talking about on this image: ![Illustration of the problem](http://i.imgur.com/pacMnzt.png) The type of the external monitor doesn't seem to matter. Same thing with a Medion 1680x1050 monitor with VGA connector, and a Dell U2311H through HDMI. Also I tried to set various resolution combinations, and it seems to only happen when the internal monitor is at its native resolution (which is 1366x768) (I have Linux Mint 15 x64 with Cinnamon.)


title: How does reverse SSH tunneling work?

text: As I understand this, firewalls (assuming default settings) deny all incoming traffic that has no prior corresponding outgoing traffic. Based on Reversing an ssh connection and SSH Tunneling Made Easy, reverse SSH tunneling can be used to get around pesky firewall restrictions. I would like to execute shell commands on a remote machine. The remote machine has its own firewall and is behind an additional firewall (router). It has an IP address like 192.168.1.126 (or something similar). I am not behind a firewall and I know the remote machine's IP address as seen from the Internet (not the 192.168.... address). Additionally, I can ask someone to execute `ssh (something)` as root on the remote machine first. Could anyone explain me, step by step, how reverse SSH tunneling works to get around the firewalls (local and remote machines' firewalls and the additional firewall between them)?   What is the role of the switches (-R, -f, -L, -N)?


title: SSH: connect through intermediary server in just one step (through forwarded port)

text: Related question: initiate ssh connection from server to client I have intermediary server with public IP (let it be `SERVER`), and I need to establish connection between two computers (`A` and `B`) without public IP, through this intermediary server. So, to connect from `A` to `B`, I can now do this:               B$ ssh -N -R 2222:localhost:22 server_user@SERVER      and now, from `A`, I can connect to `B` in two steps:               A$ ssh server_user@SERVER     SERVER$ ssh -p 2222 b_user@localhost      Or in one line, but there are two steps anyway:               A$ ssh -t server_user@SERVER "ssh -p 2222 b_user@localhost"      But, I can't connect in just one step, like this:               A$ ssh -p 2222 b_user@SERVER     ssh: connect to host SERVER port 2222: Connection refused      Why is this, and how to make it work? Note: I don't have any firewall at the `SERVER`, so it should accept incoming connection at port `2222`, it seems.


title: ssh port forward to access my home machine from anywhere

text: http://serverfault.com/questions/303937/how-to-make-freebsd-box-accessible- from-internet I want to understand this whole process of `port forwarding`. I read so many things but failing to understand the very basic concept of port forwarding it self. What I have: > a freebsd server sitting at my home.   >  netgear router This is what I am trying to achieve:   > to be able to access freebsd server from a windows machine over internet to > be able to open a webbrowser and access internet.   > > > I also want to access this freebsd box from a ubuntu machine that I have. It will be great if someone can please help me. **Edit:0** here is the netgear router setup that I did for portforwarding. ![netgear port forwarding](http://i.stack.imgur.com/KiPhu.png)


title: Accessing Apache server over the Internet

text: I'm trying to access my Apache server over the Internet. When I use my external IP to connect from a different system, my router's welcome page is displayed. How can I access the server?


title: Reverse connection to SSH server

text: Machine A is connected to the internet and is behind firewall so it cannot receive incoming connections. Machine B is open to the internet. I want to be able to type commands into B and have them execute on A. Except it is A that has to reach out to B to establish the connection before B can send it commands. Can this be done running SSHd on A and plain SSH client on B or do I need a combination of SSHd and SSH client on A (client to establish reverse tunnel pointing to SSHd).


title: What's ssh port forwarding and what's the difference between ssh local and remote port forwarding

text: I feel confused about ssh port forwarding and the difference between ssh local and remote port forwarding. Could you please explain them in detail and with examples? Thanks!


title: Socks5 server on Debian

text: I would like to setup socks proxy on my Debian VPS. I try to use squid but its to hard for me. I saw a Dante software and think about it. I would like to setup dante to work with the web browser and plug FoxyProxy. So on server (vps-> dante server) and on the client (Firefox + FoxyProxy-> socks5 (user + password)) It should be public access to the socks but allowed to use it with atentication. If not Dante, what other program? I need complete instructions on how to set up a publicly accessible server socks5 with authentication to works fine with the browser with the addition of FoxyProxy Can anyone help?


title: Unix without a GUI for old machine

text: I have been given my father's old computer, which currently runs Windows 95 and has a 133-MHz processor, a Pentium(r) according to "My Computer". It seems a shame to recycle it when it works so well (considering what it is), so I'd like to load some variant of Unix on it and learn some stuff. I happen to have a copy of "Unix for Dummies" 4th edition (copyright 1998), but it assumes someone has already set up Unix on the computer in question, so I need another source for this step. There are several existing questions on here about the Unix-on-old-computer thing (typically Linux), except for one major issue: I specifically want a Unix system **without a GUI** and I cannot for the life of me find simple instructions for getting that. There's people looking for GUIs for their Linux servers and people looking to temporarily remove the GUI, but nothing whatsoever about how to get an **old-school, pre-GUI Unix**. It's not going to be used as a server, but to pretend I'm in a long-gone decade doing programming, file-editing, etc. on my desktop with just text. So, **what Unix should I use, and how do I get it?** The very fact that I have to ask may mean I'm in over my head, but I have to start somewhere. P.S. The computer has an ethernet card but I'm fairly certain it has no means of using wifi, so it may remain disconnected from the Internet unless it becomes necessary to connect it. Edit: It has a CD-ROM drive, as well as a floppy drive, tape drive, and apparently one USB port. 96 MB of RAM. Total capacity of C drive is 1 GB.


title: Why rootfs is mounted multiple times?

text: Here you can see two devices are mounted as root:               $ df     Filesystem                                             1K-blocks      Used Available Use% Mounted on     rootfs                                                  29221788  18995764   8761244  69% /     udev                                                       10240         0     10240   0% /dev     tmpfs                                                     203260      2192    201068   2% /run     /dev/disk/by-uuid/1d8879f2-9c47-4a72-9ef4-a6ecdd7a8735  29221788  18995764   8761244  69% /     tmpfs                                                       5120         0      5120   0% /run/lock     tmpfs                                                     406516       376    406140   1% /tmp     tmpfs                                                     406516        72    406444   1% /run/shm     /dev/sda2                                               29225884  15019636  12741264  55% /home     /dev/sda3                                              226881528 191247596  24275680  89% /opt     ...      However, I didn't specify UUID in /etc/fstab:               proc            /proc           proc    defaults        0       0     LABEL=debian    /               ext4    errors=remount-ro 0       1     LABEL=istore    /mnt/istore ext4    defaults    0   0     LABEL=home  /home           ext4    defaults        0       2     ...      I'd like to see mount info in "/dev/xxx" rather then "/dev/disk/by-uuid/...". Though mount by UUIDs have many advantages, but I prefer to the old style... It's also weired why there are two rootfs mount?


title: Boot Menu Fedora and Window 7

text: I have install Fedora 20 before, a few days ago , I just install Window 7, and now I can not boot to Fedora because I don't have a boot menu. Is there anyway to recover the Fedora boot menu, is there any free software to do it without using the Fedora CD to recover it.


title: "tar (child): Cannot connect to https: resolve failed" when installing Bitmask

text: I am trying to install Bitmask on my system to get the riseup VPN running(https://help.riseup.net/en/vpn/how-to/linux), but as you can see, there are no packages for Fedora. I tried the compressed files you get by using curl as well as the direct download from the Bitmask site, but both give me this output while unpacking:               tar xfj https://dl.bitmask.net/client/GNU/Linux/Bitmask-GNU/Linux64-latest.tar.bz2     tar (child): Cannot connect to https: resolve failed          bzip2: Compressed file ends unexpectedly;         perhaps it is corrupted?  *Possible* reason follows.     bzip2: Inappropriate ioctl for device         Input file = (stdin), output file = (stdout)          It is possible that the compressed file(s) have become corrupted.     You can use the -tvv option to test integrity of such files.          You can use the `bzip2recover' program to attempt to recover     data from undamaged sections of corrupted files.          tar: Child returned status 128     tar: Error is not recoverable: exiting now


title: Running F.lux (Flux) or Redshift with Multiple Monitors with Nvidia Optimus

text: I have tried installing F.lux and then Redshift, and configured them to run on multiple monitors with no success. I wonder if my setup, which includes Nvidia Optimus setup using Bumblebee could be the cause for this failure. Both programs seems to run fine on my laptop screen, but my external monitor via VGA does not adjust its color with my laptop screen. Has anyone had a similar experience, or been able to get a color adjustment program working on an external monitor using a Nvidia Optimus laptop? The Optimus situation has me configured to run the external monitor using `intel-virtual-output` and Xrandr on Nvidia's drivers, so I wonder if this situation has an effect on my ability to run the F.lux or Redshift programs. Here are some of the guides I followed: https://github.com/Kilian/f.lux-indicator-applet/issues/18 http://justgetflux.com/linux.html http://jonls.dk/redshift/ https://gist.github.com/bcomnes/4243805 I have a W520 ThinkPad with Intel 3000HD and Nvidia Quadro 1000M chipsets, running Ubuntu 13.10 (Saucy Salamander) and Windows 7 dual-boot.


title: wget files by pattern only from specified directories recursively

text: I need to download on an hourly basis (sometimes more frequently), files which are being written in segments of 24 hours. The files I am interested in are in specific subdirectories which I am trying to specify with `-I list` but this doesn't work for some reason. If I don't specify directories the files I need download fine with the `-A acclist` option but I end up with lots of empty directories that are being created because they exist on the host. my current line reads:               wget -np -nH --cut-dirs=X -c -N -r -l 0 \          -I /dir1,/dir2,...,/some_dir -A acclist \          http://hostname/X_sub_directories/      How do I download **only** the files I want and create **only** the directory hierarchy for those files?


title: Linux equivalent for Windows Startup

text: **Is there any way to add an application/script to the Linux startup so every time the system is on it executes** [i'm looking for some automated way, user should not add this by cron job or something like that].   Yeah you are right, i want to create a little cute virus :) and also want to know if it is possible.


title: Is this what it looks like in the terminal on the client side when you are blocked out via fail2ban?

text: I am a new server admin. I just setup fail2ban on an ubuntu 12.04 VPS. I used this tutorial. Then I tried to login to the system via ssh from a friend's machine. It is showing "operation timed out." It seems like this means fail2ban is working -- but I want to double check to be certain. Is this what it looks like on the client side when fail2ban has blocked your IP? Your SSH login times out because fail2ban/iptables does not allow it to initiate on the server side?               $ ssh -p# user@IP     user@IP's password:      Permission denied, please try again.     user@IP's password:      Permission denied, please try again.     user@IP's password:      ^C     $ ssh -p# user@IP     ssh: connect to host IP port #: Operation timed out     $ ssh -p# user@IP     ssh: connect to host IP port #: Operation timed out


title: Linux Mint 14 system language turns into chinese. How can I switch back to English?

text: Today for testing purpose I installed KDE alongside Cinnamon in Linux Mint 14. Unfortunately, after that my system language switch to Chinese!!! All the menus and notification is in Chinese now!! How can I switch back to English?


title: Unable to login to Linux box running Xfce using LXDM login manager

text: I am running a Linux box with the `LXDM` login manager and Xfce as my desktop environment. Every time I login, this is the screen I get: ![enter image description here](http://i.stack.imgur.com/mh0Nh.png) If I enter the right password, the system logs me in without any problems. But if I enter the wrong password, after a few seconds, this is what I get: ![enter image description here](http://i.stack.imgur.com/78GEG.png) Because of this, I end up rebooting the whole machine so that I can get the input box to enter the correct password. Could someone please tell me how I might solve this issue? Or at least point me in the right direction?


title: LAMP Server setup for personal development

text: I am setting up a LAMP server in VirtualBox for personal development. This will be an Ubuntu Server 12.04 install, and I will be using Virtual Hosts for Drupal, Yii, and other small PHP apps. Ideally I'd like to avoid creating new Virtual Hosts in `/var/www` and instead opt for creating these under a `public_html` folder in my user's _home_ directory. Please bear in mind that this isn't a " _Need Your Advice_ " style question - instead I would like to know the following in helping me set this up properly: Is there any benefit in creating another user (non-root) that will "host" these apps in their home directory, or will the root user created in the setup process suffice? I realise I'm being a bit pedantic by asking this, but its based on a recommendation I saw on another site (can't remember the URL) for setting up a LAMP server for personal development. I imagine this is only critical in a production environment. I'm thinking in terms of permissions, security, etc. **EDIT** : Will I run into any issues using the root user to this end, or would I be safer creating a new non-root user? **EDIT2** : Please don't down-vote this post! I would really like some clarity on this as I'm still walking the Linux learning path :)


title: Which header defines the macro that specifies the machine architecture?

text: _Shorter version of question:_ Which C header contains the macro that corresponds to the machine architecture of the system (e.g., `__x86_64__`, `__ia64__`, `__mips__`?) _Longer version of question:_ I'd like to run the ganglia monitoring tools on a Tilera-based system that runs Linux. Ganglia doesn't currently have support for Tilera. To get this to work, I ned to modify a C function called machine_type_func that returns the machine architecture. The body of this function is determined at compile-time, it looks like this:               g_val_t     machine_type_func ( void )     {        g_val_t val;          #ifdef __i386__        snprintf(val.str, MAX_G_STRING_SIZE, "x86");     #endif     #ifdef __x86_64__        snprintf(val.str, MAX_G_STRING_SIZE, "x86_64");     #endif     ...        return val;     }      I need to add the appropriate line for Tilera, but I don't know the name of the macro that specifies a Tilera-based system. I'm guessing this macro is defined in one of the standard Linux headers, but I don't know which one to look in.


title: Vim markers and macros

text: Is there a way to make a macro operate up to a marker? I know if I do `5@a` my macro will operate on 5 lines. Example:               set marker with `mc`     record a macro with `qa`     ... now what?      Obviously `'c@a` just moves the cursor to the marker at c. I've tried buffers, `"b'c`, but that just goes to the marker. I'm probably missing something very basic or just looking in the wrong places.


title: What's the difference between tar.gz and tar.Z?

text: The downloads on this page, e.g. of NetCDF C/C++/Fortran 4.1.3, show `tar.Z` and `tar.gz` formats. The `tar.Z` doesn't even have a configure file in it. What is it used for?


title: What is the interaction of the rsync --size-only and --sparse options?

text: If I use `rsync` with the `\--size-only` and `\--sparse` options together, if a file already exists at the destination as a full file (otherwise the same) it's not overwritten. If I omit the `\--size-only` option, the non-sparse file is overwritten with the sparse version. I _do_ want the file to be overwritten and I want to keep the `\--size-only` option (unless I can be convinced that I don't). This is part of a script that gets run periodically. In the past, the `\--sparse` option was not used and a lot of space has been wasted. How can I continue to use `\--space-only` (and other options I haven't included here) and have the large files overwritten as the script does its work? A search-and-destroy mission would be too "expensive". I have tested this with `rsync` 3 in Ubuntu with ext3 and CentOS with ext4. The actual `rsync` is performed over an `ssh` connection. Note that in the following demonstration nothing changes about the source or destination files (size, times or contents) between runs of `rsync`. Demonstration:               $ dd if=/dev/zero of=sparse.out bs=1 seek=1M count=1     1+0 records in     1+0 records out     1 byte (1 B) copied, 0.000307332 s, 3.3 kB/s          $ stat sparse.out       File: `sparse.out'       Size: 1048577         Blocks: 16         IO Block: 4096   regular file     Device: 802h/2050d      Inode: 2377326     Links: 1     Access: (0644/-rw-r--r--)  Uid: ( 1000/  dennis)   Gid: ( 1000/  dennis)     Access: 2011-07-28 22:06:52.000000000 -0500     Modify: 2011-07-28 22:06:52.000000000 -0500     Change: 2011-07-28 22:06:52.000000000 -0500          $ du -h sparse.out     8.0K    sparse.out          $ rsync --size-only sparse.out sparse.out.rsync          $ stat sparse.out.rsync       File: `sparse.out.rsync'       Size: 1048577         Blocks: 2064       IO Block: 4096   regular file     Device: 802h/2050d      Inode: 2377329     Links: 1     Access: (0644/-rw-r--r--)  Uid: ( 1000/  dennis)   Gid: ( 1000/  dennis)     Access: 2011-07-28 22:09:19.000000000 -0500     Modify: 2011-07-28 22:09:20.000000000 -0500     Change: 2011-07-28 22:09:20.000000000 -0500          $ du -h sparse.out.rsync     1.1M    sparse.out.rsync          $ rsync --size-only --sparse sparse.out sparse.out.rsync          $ stat sparse.out.rsync       File: `sparse.out.rsync'       Size: 1048577         Blocks: 2064       IO Block: 4096   regular file     Device: 802h/2050d      Inode: 2377329     Links: 1     Access: (0644/-rw-r--r--)  Uid: ( 1000/  dennis)   Gid: ( 1000/  dennis)     Access: 2011-07-28 22:09:19.000000000 -0500     Modify: 2011-07-28 22:09:20.000000000 -0500     Change: 2011-07-28 22:09:20.000000000 -0500          $ du -h sparse.out.rsync     1.1M    sparse.out.rsync          $ rsync --sparse sparse.out sparse.out.rsync          $ stat sparse.out.rsync       File: `sparse.out.rsync'       Size: 1048577         Blocks: 16         IO Block: 4096   regular file     Device: 802h/2050d      Inode: 2377330     Links: 1     Access: (0644/-rw-r--r--)  Uid: ( 1000/  dennis)   Gid: ( 1000/  dennis)     Access: 2011-07-28 22:11:23.000000000 -0500     Modify: 2011-07-28 22:11:23.000000000 -0500     Change: 2011-07-28 22:11:23.000000000 -0500          $ du -h sparse.out.rsync     8.0K    sparse.out.rsync          $ stat -c '%b %B %o %s' sparse.out sparse.out.rsync     16 512 4096 1048577     16 512 4096 1048577          $ cmp sparse5.out sparse5.out.rsync     $


title: What Unix programs can I *not* install when I have a standard undergraduate directory account?

text: I'm an undergrad in the astrophysics department and I have access to the Red Hat Linux computers, but only from an undergrad account I tried installing matplotlib once, but it was a massive pain (and I had to do it with substantial assistance) I know that I can't install anything that absolutely has to change files that are below my user directory. But what portion of programs can I then not be able to install?


title: Is there a maximum size to the bash history file?

text: Can I increase the size of the command history in bash? Note that I use a Red Hat Linux computer in the undergraduate astrophysics department here (so I don't get that many privileges).


title: How to configure DUAL-WAN on a Linux/*BSD machine?

text: I have two internet connections. The cables from the two ISP's (dhcp; 1-10/10 Mbit; 2-20/20Mbit connection) are on two interfaces: eth0 and eth1. On eth3 there is a Gbit switch and on the switch there are many clients. How do I configure the Dual-Wan? I mean I don't want that the clients get notice of that one of the ISP has failed, and "not serving internet"! So if a client runs `ping 8.8.8.8` and the cable of one of the ISP is torn apart because of a yellow monster :) then there would be no ping outage. Any Linux-based OS would do (or even *BSD!)


title: Command-line way of send pinging

text: I have lots of Drupal powered website. Each of the website has Multiping module to pinging ping server. Is there any way of send pinging through command-line? I hope I can build dedicated server for pinging.


title: Is it possible to change passwords temporarily?

text: I have a Linux system with several users. I don't know their passwords, nor do I want to know them. I have to do a batch copy of some of their directories over SSH, with their account and password. My idea was to make a backup of `/etc/shadow`, then alter it with new passwords for each user (one that I know, like "tmppass"), do my backups, then replace the `/etc/shadow` file with the old one. Will that work? If so, how do I generate the password/s? (The passwords are like $1$xxxxxx/xxxxx).


title: Prompting for input in post-install script in dpkg

text: I am writing a debian package and need to prompt the user for some textual details(default password, etc), as well as some one-of-many choices("Pick one of the following: foo, bar"). Will shell scripts run in dpkg use `read` or `select` correctly, or do I need another solution? If so, please point me to a quick guide about it(not necessarily noob-friendly).


title: Can't access HTTP contents, but HTTPS and SSH are fine

text: I'm having a weired issue wih my Fedora 14 recently. Many details involed. Let's start from this: I've been using Fedora 14 for months, and recent few days, offten I can't access Internet for hours. I can verify by a iPod Touch that connected to the same router, that the connection is fine. Say the `traceroute` below. Any tips? **-- updates --** The computer has two network devices, eth0 and wlan0. When having the problem in Linux, I can't access Internet from neither. But if booted into Windows 7 on the same machine and the same time, Internet is available via wlan0, but not eth0! It sounds like that eth0 is broken? But I can use SSH and HTTPS via eth0 under Linux. Now it's fine again. But I suspect it will happens again in few days. I'll post the tcpTraceroute then. **traceroute on Linux**               traceroute to 163.com (220.181.8.178), 30 hops max, 60 byte packets      1  * * *      2  58.246.230.1 (58.246.230.1)  6.228 ms * *      3  * * *      4  * * *      5  * * *      6  * * 112.64.243.170 (112.64.243.170)  6.627 ms      7  * * *      8  219.158.15.141 (219.158.15.141)  7.874 ms * *      9  * * *     10  * * *     11  * * *     12  * * 202.97.53.21 (202.97.53.21)  57.812 ms     13  * * *     14  220.181.16.138 (220.181.16.138)  57.633 ms * *     15  * * *     16  * * *     17  * * *     18  * * 220.181.8.178 (220.181.8.178)  59.643 ms      **traceroute on Router (Tomato)**               traceroute to 163.com (220.181.8.90), 30 hops max, 38 byte packets      1  58.246.230.1 (58.246.230.1)  2.178 ms  2.125 ms  9.450 ms      2  112.64.245.49 (112.64.245.49)  1.491 ms  1.361 ms  1.104 ms      3  112.64.245.37 (112.64.245.37)  1.647 ms  1.351 ms  1.712 ms      4  112.64.247.1 (112.64.247.1)  1.911 ms  4.424 ms  2.837 ms      5  112.64.243.170 (112.64.243.170)  2.322 ms  2.242 ms  2.126 ms      6  112.64.243.89 (112.64.243.89)  2.903 ms  2.345 ms  2.032 ms      7  219.158.21.237 (219.158.21.237)  3.180 ms  2.553 ms  2.501 ms      8  219.158.96.49 (219.158.96.49)  25.018 ms  24.734 ms  24.605 ms      9  219.158.5.82 (219.158.5.82)  24.555 ms  24.450 ms  24.473 ms     10  219.158.35.2 (219.158.35.2)  53.599 ms  77.827 ms  53.791 ms     11  202.97.53.21 (202.97.53.21)  55.111 ms  54.861 ms  55.390 ms     12  220.181.16.2 (220.181.16.2)  55.531 ms  56.193 ms  55.430 ms     13  220.181.16.138 (220.181.16.138)  52.883 ms  56.370 ms  54.770 ms     14  220.181.17.58 (220.181.17.58)  61.931 ms  51.274 ms  53.879 ms     15  220.181.8.90 (220.181.8.90)  50.331 ms  50.219 ms  50.177 ms


title: Disable /net ghosting for autofs5

text: I recently have been trying out Arch Linux. It seems that their autofs has a usability bug, although I confess that I'm new enough to Arch that I may be missing something horribly obvious. I want autofs to automagically mount hosts under `/net` like it has always done. Traditionally it used `/etc/auto.net` to accomplish this, however it seems that they've done away with this and now you simply use the following line:               /net -hosts --timeout=60      Fine and dandy, most things seem to work. However, under Arch it seems that ghosting is enabled by default. This is a bad thing, because it uses my hosts file which only contains aliases of my local host (which is NOT running an NFS server, mind you). As a result, I get all kinds of errors about being unable to mount these hosts _every time_ I run an `ls` in `/net`. Notice: I'm not using `\--ghost`, and yet it enables it by default. Arch confirms this on their wiki. This is extremely annoying, how do I _disable_ ghosting? Google has failed me horribly, any insight is appreciated. Thanks.


title: How do I kill 1 gnome-terminal window?

text: Why in the world do all my gnome terminals run under 1 process in Ubuntu? This is integrating things that should remain separated! I much prefer `xterm`'s rational mode of running one process per window. I tried to switch some auto-started windows from `xterm` to `gnome-terminal` so I can freeze a log file from scrolling while I'm looking at it. Unfortunately, I can no longer kill my log windows that are littering my desktop. Just accidentally killed every terminal I had open!!!   1. Can I kill individual `gnome-terminal` windows as if they are single shell processes? (you know, like a normal process)   OR   2. Can I stop auto-scrolling of `tail -f` inside an `xterm` by manually scrolling up, so I can read the log file while it's growing?


title: Applications are not using the same keyboard mappings, it seems

text: I’m using an american keyboard and writing in Portuguese. I updated `/etc/sysconfig/keyboard` as the following article suggested. It worked but only in the console. Firefox and Sublime Text2 shows **'+c** (ç) as **ć** , gedit shows nothing. In Firefox and Sublime Text2 the only problem is **ç** , gedit is quite different, it seems like a Brazilian ABNT2 keyboard. **OS: CentOS 6** Contents of locale:               LANG=pt_BR.UTF-8     LC_CTYPE=”pt_BR.UTF-8″     LC_NUMERIC=”pt_BR.UTF-8″     LC_TIME=”pt_BR.UTF-8″     LC_COLLATE=”pt_BR.UTF-8″     LC_MONETARY=”pt_BR.UTF-8″     LC_MESSAGES=”pt_BR.UTF-8″     LC_PAPER=”pt_BR.UTF-8″     LC_NAME=”pt_BR.UTF-8″     LC_ADDRESS=”pt_BR.UTF-8″     LC_TELEPHONE=”pt_BR.UTF-8″     LC_MEASUREMENT=”pt_BR.UTF-8″     LC_IDENTIFICATION=”pt_BR.UTF-8″     LC_ALL=      contents of `/etc/sysconfig/keyboard`               KEYTABLE=”br-latin1-us”     MODEL=”latin1-us”     LAYOUT=”br”     KEYBOARDTYPE=”pc”


title: Linux VPS Configuration

text: I just recently got my hands on a linux (Fedora) VPS and I would like to ask if there are special configurations that I have to be wary of. Do I still configure it like I would configure a normal virtual machine? Are there more things to take care of, or be cautious about because that machine is 24/7 available online, and can fall pray to those (hackers/crackers) seeking a machine to test their knowledge on? I would appreciate your input.


title: How to enable WIFI on VMWare Fedora 12? (It's detecting and working fine on Windows 7)

text: I am new to Linux. I have Fedora 12 running on my VMware. I am unable to see any options to enable WIFI connection on Fedora. When I am accessing Internet through WIFI and its working perfectly fine on Windows 7 (on which VMware is running on). Am I missing something here? Can someone help me out with this!


title: Earphone remote in sound jack as X input

text: I have got new earphones, the AKG K318's to be exact and they have one of those remotes. On a smartphone, such as an Android phone or iPhone, the buttons map to actions on the music player such as play/pause, volume up/down, skip, previous, you get the idea. I was wondering how I could replicate the same function on my computer. I imagine the process consists of getting X to recognize the input, and then somehow mapping those inputs for an application to use. The "device" (which would connect via sound jack) isn't listed in `xinput`, nor do the buttons trigger regular keyboard events. **How can I use the earphones plugged in the output sound jack as X key inputs?**


title: How to define a `bc` function for later use?

text: I've always found `bc` kind of mysterious and intriguing. It was one of _the_ original Unix programs. And it's a programming language unto itself. So I gladly take any chance I can find to use it. Since bc doesn't seem to include a factorial function, I want to define one like so:               define fact(x) {       if (x>1) {         return (x * fact(x-1))       }       return (1)          }      But... I can't then reuse that, can I? I'd want to be able to do something like               me@home$ bc <<< "1/fact(937)"


title: Why do we use "./" to execute a file?

text: Why do we use `./filename` to execute a file in linux? Why not just enter it like other commands `gcc`, `ls` etc...


title: What is the difference between running "bash script.sh" and "./script.sh"?

text: If script.sh is just something typical like               #!/bin/bash     echo "Hello World!"      Is there a preferred way to run the script? I think you first have to chmod it so it becomes executable?


title: Use of ./ in running the compiled code

text: Why do we use **./** before running a compiled code in linux? It does not seem to necessary if I am in a directory higher than the one having compiled code. Let me explain by example. If my code is in **/home/uname/code** , and I am also in the same directory, I have to use **./a.out**. But if I am in **/home/uname/** then I can use **./code/a.out**. Here I am using **./** but I think it is more to navigate through the directories and not as an indication that it has to run a code. So why do I need to use **./** to run a compiled code if I am in same directory as the code?


title: Why is ./filename required to run executable script?

text: After creating a Python script file, test.py, in my home directory, and running `chmod +x test.py` to make it executable, and placing `#!usr/bin/env` as the file header, I expected to be able to run the script from `bash` on OS X, using:               $ test.py      but `bash` returned:               -bash: test.py: command not found      The following command worked:               $ ./test.py      Why is the relative path required for this executable script in the present working directory?


title: What does ./ mean?

text: I'm having a hard time getting what `./` does. In the Linux Essentials books, it asks me in an exercise to delete a file named `-file`. After googling, I found that I need to do `rm ./-file` but I don't get why!


title: Why do you need the "./" when executing programs in the current directory?

text: > **Possible Duplicate:**   >  Why do we use "./" to execute a file? It seems redundant and gets annoying after a while -- is there a way to change this? If not, can somebody explain the reasoning behind this? Thanks!


title: Upstart: How to run a "stop" before stopping other services?

text: I recently found out about the upstart "service starter" that Ubuntu is using and that is (apparently) the future to start/stop jobs in Linux. It's pretty new to me (I was used to the old SysV system of putting scripts in `/etc/rc[X].d/`) and I don't know if it's possible to stop a service (call the service with the "`stop`" parameter, although the parameter doesn't seem to matter that much anymore) before other services are stopped. I want to run a small script that informs a remote server that the machine is shutting down. I need to run that script before the `dbus` and the `network` services are taken down. Is there any way of doing it with Upstart? Or... better said, what is the way of doing that through Upstart `.conf` files? (I'm sure there's a way, I just don't know it)


title: ssh-agent not starting in OpenSuSE desktop

text: It seems that ssh-agent is not starting on my OpenSuSE system. When I run `pgrep -fl ssh-agent`, the result is blank. On my Linux Mint laptop, I get `1785 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session x-session- manager`. How do I fix this? Can anyone with OpenSuSE check to see if it's not started up by default, or if I maybe messed something up? ### things tried... I've tried adding the following to `.xinitrc`,               if test -S "$SSH_AUTH_SOCK" -a -x "$SSH_ASKPASS"; then           ssh-add < /dev/null     fi      and my `.xsession` file contains,               ssh-agent {       ssh-add &       startkde     }      but neither of these things seems to do anything. Thanks in advance!!


title: Is there some way to make alias expansion work inside if...fi on Bash?

text: Check this script:               #!/bin/bash     if true;then         alias WeirdTest='uptime';shopt -s expand_aliases         WeirdTest     fi     WeirdTest      The first time `WeirdTest` is executed it says "command not found".


title: Debian Jessie GRUB2 on a multi-boot EFI laptop cannot start a Gentoo kernel-initramfs

text: I have an HP Pavillion Touch 14-N009LA laptop running on an AMD A8-4555M CPU, 8 GB of RAM, and a 750 GB HD, currently running on dual boot Windows 8.1 accessible via the system's EFI boot manager, and Debian Jessie accessible via a special option on my startup menu to start an OS installed under legacy BIOS mode. I am trying to install Gentoo on a dm-crypt partition and I have already set up an encrypted partition for the system's root, and a plaintext partition for the Gentoo kernel, initramfs and GRUB configuration. I have already installed the stage 3 files, Portage, compiled the kernel and generated a LUKS-capable initramfs using `genkernel --luks all`. After unsuccessfully getting the system to boot from Gentoo's GRUB2, I figured I could also boot Gentoo by adding an entry to Debian's GRUB configuration, so I edited `/etc/grub.d/40_custom` with the following:               menuentry "Gentoo Linux" {     set root=(hd0,9)     linux /kernel-genkernel-x86_64-3.12.21-gentoo-r1 cryptdevice=/dev/sda11:dm-root root=/dev/mapper/dm-root     initrd /initramfs-genkernel-x86_64-3.12.21-gentoo-r1     }      After running `update-grub2` the entry shows up just fine on the GRUB configuration. However, when I try to boot said entry, GRUB claims that it can't find the specified kernel image, even though I'm absolutely sure I'm specifying it fine. ![Debian GRUB2 error message](http://i.stack.imgur.com/5BBqE.jpg) * * * **More details about my system's configuration:** Output of `lsblk`:               NAME    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sda       8:0    0 698.7G  0 disk      ├─sda1    8:1    0   400M  0 part      ├─sda2    8:2    0   260M  0 part /boot/efi     ├─sda3    8:3    0   128M  0 part      ├─sda4    8:4    0 183.1G  0 part /media/C <Windows 8.1>     ├─sda5    8:5    0   350M  0 part      ├─sda6    8:6    0  25.2G  0 part      ├─sda7    8:7    0   1.6G  0 part /boot <Debian boot>     ├─sda8    8:8    0   8.2G  0 part [SWAP]     ├─sda9    8:9    0    40G  0 part / <Debian system root>     ├─sda10   8:10   0   4.4G  0 part <Gentoo boot>     ├─sda11   8:11   0 426.4G  0 part <Gentoo encrypted system root>     └─sda12   8:12   0   8.7G  0 part      sr0      11:0    1  1024M  0 rom        Output of `parted -l`:               Model: ATA WDC WD7500BPVX-6 (scsi)     Disk /dev/sda: 750GB     Sector size (logical/physical): 512B/4096B     Partition Table: gpt          Number  Start   End    Size    File system     Name                          Flags      1      1049kB  420MB  419MB   ntfs            Basic data partition          hidden, diag      2      420MB   693MB  273MB   fat32           EFI system partition          boot      3      693MB   827MB  134MB                   Microsoft reserved partition  msftres      4      827MB   197GB  197GB   ntfs            Basic data partition          msftdata     10      197GB   202GB  4719MB  ext2                                          msftdata     11      202GB   660GB  458GB                                                 msftdata     12      660GB   669GB  9343MB  linux-swap(v1)      7      669GB   671GB  1709MB  ext2                                          msftdata      8      671GB   680GB  8791MB  linux-swap(v1)      9      680GB   723GB  42.9GB  ext4                                          msftdata      5      723GB   723GB  367MB   ntfs                                          hidden, diag      6      723GB   750GB  27.1GB  ntfs            Basic data partition          hidden, msftdata      Contents of `/dev/sda10`, my Gentoo boot partition:               total 9436     drwxr-xr-x 4 root root    4096 Jul  1  2014 grub     -rw-r--r-- 1 root root 3916272 Jul  1  2014 initramfs-genkernel-x86_64-3.12.21-gentoo-r1     -rw-r--r-- 1 root root 3603216 Jul  1 17:16 kernel-genkernel-x86_64-3.12.21-gentoo-r1     drwx------ 2 root root   16384 Jun 30 17:09 lost+found     -rw-r--r-- 1 root root 2103510 Jul  1 17:16 System.map-genkernel-x86_64-3.12.21-gentoo-r1


title: How can you avoid clobbering configuration files when installing with make

text: When using the autotools build system and installing with `make install` how is it possible to avoid clobbering existing configuration files? I've defined a configuration file in a `Makefile.am` like so:               dist_sysconf_DATA = $(top_srcdir)/server.conf      How is it possible to define data files in such a way that `make install` will not clobber an existing version?


title: gpg uses temporary files, instead of pipe

text: I have my `/root` mounted as `read-only`. I have a script that sends an encrypted email using `gpg`. something like the following:               echo "hello" | gpg --no-verbose -e -a -r martin@example.com | mail martin@example.com      But I get an error:               gpg: failed to create temporary file `/root/.gnupg/.#dkflsfj: Read-only file system      How can I tell `gpg` not to use temporary files? I have found an option `use- temp-files` in `man gpg`               use-temp-files     On  most Unix-like platforms, GnuPG communicates with the keyserver helper program      via pipes, which is the most efficient method. This option forces GnuPG to use      temporary files to communicate. On some platforms (such as Win32  and  RISC  OS),     this  option  is  always enabled.      I don't have this option enabled in my config. Apparently, it is set by default. Is there any way I could "negate" this option? Or any other way to fix this problem? **UPDATE** : the option `no-use-temp-files` does not seem to have any effect:               echo "asdf" | gpg --keyserver-options no-use-temp-files -e -a -r martin@example.com      I still get the same error: `gpg: failed to create temporary file`/root/.gnupg/.#jkfjg': Read-only file system`


title: phpmyadmin in linux installation

text: I am trying to install **Request Tracker** tool in my **RHEL 5.6** machine.I am following the instructions as mentioned in this link. However, I am facing couple of issues. The first issue is in the below step. I have some dependency issues for php files.               # yum install  rpm* nmap expect vsftpd net-snmp* ntp* subversion subversion-devel      mysql mysql-server mysql-devel screen perl-Crypt- PasswdMD5 graphviz php-xml      php-cli php-mhash php-ldap php-devel php-pdo php-imap php-readline      php-ncurses php-soap php-snmp php-common php-mcrypt php-odbc php-mbstring      php-gd php-bcmath php php-xmlrpc php-pear php-mysql php-dba mod_perl-devel      mod_auth_mysql mod_perl mod_authz_ldap gd gd-devel gd-progs gcc*      -- exclude=gcc-java* -- exclude=gcc4-java phpmyadmin mod_fcgid perl-GD      perl-GnuPG-Interface perl-GraphViz perl-YAM       So, I tried to do the below command.               yum install php      When I do the above command, I received the below message.               Package matching php-5.1.6-40.el5_9.i386 already installed. Checking for update.     Nothing to do      So, as per the tutorial link, I needed **phpmyadmin**. So, I used the below command. It gave me the below output.               Error: Missing Dependency: php-api = 20041225 is needed by package php-mcrypt-5.1.6-5.el5.i386 (epel)     Error: Missing Dependency: php-common = 5.1.6-40.el5_9 is needed by package php-gd-5.1.6-40.el5_9.i386 (rhel-i386-server-5)      If I try to install the missing dependencies, **php-common** using yum command, I receive the below message.               Package matching php-common-5.1.6-40.el5_9.i386 already installed. Checking for update.      If I try to install the missing dependency, **php-api** using yum command, I receive the below message.               php53-common-5.3.3-21.el5.i386 from rhel-i386-server-5 has depsolving problems       --> php53-common conflicts with php-common      How can I install the phpmyadmin so that I can continue with the installation of Request tracker tool?


title: gparted without GUI / X

text: Is there a CLI gparted version without GUI / X? parted shows warnings like the following when resizing / moving partitions: > WARNING: you are attempting to use parted to operate on (resize) a file > system. parted's file system manipulation code is not as robust as what > you'll find in dedicated, file-system-specific packages like e2fsprogs. We > recommend you use parted only to manipulate partition tables, whenever > possible. Support for performing most operations on most types of file > systems will be removed in an upcoming release. or > Error: file system has incompatible feature enabled. Compatible features are > has_journal, dir_index, filetype, sparse_super and large_file Use tune2fs or > debugfs to remove features. gparted can move / resize them. I thought they were using the same libraries. Is there any alternative to parted?


title: Install another PHP version. Fedora 17

text: How can I install another PHP version? I have php 5.4.5 for now, but I need the version 5.3.15 running too. How can I perform this on Fedora 17? Without using a Virtual Machine?


title: Rename multiple files removing last characters and renumbering

text: I have a photo directory with hundreds of files named in the format:               2013-08-02 19.21.27.jpg      I wish to keep the first 10 characters (date) and append "-001", etc. being consecutive for each date. The output would be:               2013-08-02-001.jpg     2013-08-02-002.jpg     2013-08-03-001.jpg      etc. I then plan to resize the jpg's using something like:               for file in *.jpg; do convert $file -resize 900x900\> 900x900-$file; done


title: Rewrite module won't work on Xubuntu/Apache

text: I have a Xubuntu (12.10) machine with Apache and PHP servers from the apt-get repository. I need to create a simple REST service in PHP and therefore need to set up .htaccess so that arbitrary URLs would get redirected to my PHP script. I have the following FS structure               -- /var/www/       -- service/         -- .htaccess         -- index.php      I found an article online that recommends to create a syntactic error in your .htaccess file and then see if the server answers with a 500 instead of a 404. That's why I have the following .htaccess contents.               RewriteEngine on     some junk     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d      I also have the following snippet in my apache2.conf (which was there by default and I checked that it should be OK).               <Files ~ "^\.ht">         Order allow,deny         Deny from all         Satisfy all     </Files>      I have enabled the rewrite module using the `a2enmod` command. My `/etc/apache2/mods-enabled` folder therefore contains the `rewrite.load` symlink. When I hit `http://localhost/service` or `http://localhost/service/index.php` everything works fine (i.e. I get the correctly processed index.php results). When I try any other URL, though, such as `http://localhost/service/whatever` I get a 404 error page. Restarting the apache service does not help either. It seems that the Apache server is still ignoring my `.htaccess` file. What am I missing?


title: Is there any web browser that uses keybinding apart from uzbl?

text: I have just found out about uzbl but for some reason it crashes with segmentation fault when I log into gmail (Arch). I don't have the time nor the knowledge of dealing with this segmentation fault so I have thought about using another browser of that type. Are there any? Thanks.


title: Should I put application into /usr/local or /usr/local/share?

text: What are the "standards" -- should I put application (not just binary, but entire distribution) to /usr/local or /usr/local/share. For example scala or weka -- it contains examples, binaries, libraries, and so on. So it would be               /usr/local/scala-2.9.1       or               /usr/local/share/scala-2.9.1      Since I am the only admin it is not a big deal for me, but I prefer to using something which is widely used, not with my own customs. **Important:** I am not asking about cases, where you should split app into /usr/local/bin, /usr/local/lib and so on. Rather I am asking about case when you have to keep one main directory for entire application.


title: Why this error: "cannot create directory `foo': Permission denied"

text: I get this error when I try creating a directory:               [rex <03:57 PM> /var/tmp/pb82]$  mkdir foo     mkdir: cannot create directory `foo': Permission denied      But doesn't the following output indicate that I should be able to create directories there since I am a member of the www-data group to which that directory belongs?               [rex <03:57 PM> /var/tmp/pb82]$  ls -l ..     total 8     drwxrwxr-x 5 root www-data 4096 Aug  7 15:32 jinfo     drwxrwxr-x 3 root www-data 4096 Aug  7 20:43 pb82     [rex <03:58 PM> /var/tmp/pb82]$  whoami     rex     [rex <03:58 PM> /var/tmp/pb82]$  groups rex     users www-data      Edit: in response to @UlrichDangel:               [rex <04:08 PM> /var/tmp/pb82/jinfo]$  id     uid=1008(rex) gid=100(users) groups=100(users)


title: How to set up the DOMAIN_HOME environment variable in SUSE Linux

text: I am running Java NetBeans 6.9 jdk 6 on SUSE Linux (a newbie on linux) and I currently need to get the path of the weblogic domain of my Java application. I have read that I can directly access the environment variable by using this :               System.getenv("DOMAIN_HOME")      The problem is I couldn't find the `DOMAIN_HOME` environment variable (actually I have no idea on setting up the env. variable in linux). I found instructions on the internet telling me that I could set this up by setting :               Export DOMAIN_HOME = /desired_path_to_domain      Following several instructions found on the internet, I have already tried the following resolutions :   1. I wrote this on my home's .profile : **`export DOMAIN_HOME=$DOMAIN_HOME:/path_to_domain`**   2. I also wrote that on my home's .bashrc and on `/etc/bash.bashrc`   3. I executed this on the konsole printenv ... and as expected I saw the list of all the environment variables. At first, I thought it was pointed to .profile but it wasn't. It was displaying an entirely different value from what was defined on .profile when I executed the line echo #PATH ... so I concluded that my environment variables weren't defined on .profile The question is, where exactly is that printenv (environment variables) defined and how can I modify it to include my `DOMAIN_HOME` variable. Guys, I really need this. I came up posting on forums because none of the solutions above or anywhere else could solve my problem. `DOMAIN_HOME` remains null (even after restarting my linux server).


title: Linker error: /usr/bin/ld: cannot find -lgcc_s

text: I am trying to compile `symlinks` (tar.gz-file), which is a very small tool with one line for compilation:               gcc -Wall -Wstrict-prototypes -O2 -N -s -o symlinks symlinks.c      which gives the error               ....         /usr/bin/ld: cannot find -lgcc_s     /usr/bin/ld: cannot find -lgcc_s     collect2: ld returned 1 exit status      The output of               /sbin/ldconfig -p | grep libgcc      is               libgcc_s.so.1 (libc6) => /lib/i386-linux-gnu/libgcc_s.so.1      and trying to include the mentioned directory directly               gcc -Wall -Wstrict-prototypes -L /lib/i386-linux-gnu/  -O2 -N -s -o symlinks symlinks.c      produces the same error. Three questions:   1. Why does it not work with the first command, as the lib seems to be in the search path   2. Why does including the path itself does not help   3. How to fix this?


title: curious soft raid 5 setting inconsistency

text: Lately I bit the bullet and upgrade my OS from Fedora 11 to Fedora 15, and I've been trying very hard to figure out why Fedora 15 can't see the Raid setup that I created in Fedora 11. I think I must have missed something so I resort to group wisdom here. When I upgraded, I used a new boot drive for Fedora 15, so I can physically swap the boot drives and boot into either Fedora 11 or 15. Fedora 11 can still see the Raid and everything works. Fedora 15 shows something very strange. [edited to add the output of the request of @psusi ] **On Fedora 11** I had a regular boot drive (/dev/sda) and an lvm built on raid 5 (/dev/sdb, /dev/sdc, /dev/sdd). Specifically, the raid disk /dev/md/127_0 is built from /dev/sdb1, /dev/sdc1, /dev/sdd1, where each partition takes the whole disk space. The volume group of the boot drive (/dev/vg_localhost/) is irrelevant. The volume group that I created onto the raid disk is called /dev/lvm-tb-storage/. The following is the settings that I got from the system (mdadm, pvscan, lvscan, etc.)               [root@localhost ~]# cat /etc/mdadm.conf           [root@localhost ~]# pvscan       PV /dev/md127   VG lvm-tb-storage   lvm2 [1.82 TB / 0    free]       PV /dev/sda5    VG vg_localhost        lvm2 [61.44 GB / 0    free]       Total: 2 [1.88 TB] / in use: 2 [1.88 TB] / in no VG: 0 [0   ]          [root@localhost ~]# lvscan       ACTIVE            '/dev/lvm-tb-storage/tb' [1.82 TB] inherit       ACTIVE            '/dev/vg_localhost/lv_root' [54.68 GB] inherit       ACTIVE            '/dev/vg_localhost/lv_swap' [6.77 GB] inherit          [root@localhost ~]# vgdisplay       --- Volume group ---       VG Name               lvm-tb-storage       System ID                    Format                lvm2       Metadata Areas        1       Metadata Sequence No  6       VG Access             read/write       VG Status             resizable       MAX LV                0       Cur LV                1       Open LV               1       Max PV                0       Cur PV                1       Act PV                1       VG Size               1.82 TB       PE Size               4.00 MB       Total PE              476839       Alloc PE / Size       476839 / 1.82 TB       Free  PE / Size       0 / 0          VG UUID               wqIXsb-KRZQ-eRnH-JvuP-VdHk-XJTG-DSWimc            --- Volume group ---       VG Name               vg_localhost       System ID                    Format                lvm2       Metadata Areas        1       Metadata Sequence No  3       VG Access             read/write       VG Status             resizable       MAX LV                0       Cur LV                2       Open LV               2       Max PV                0       Cur PV                1       Act PV                1       VG Size               61.44 GB       PE Size               4.00 MB       Total PE              15729       Alloc PE / Size       15729 / 61.44 GB       Free  PE / Size       0 / 0          VG UUID               IVIpCV-C4qg-Lii7-zwkz-P3si-MXAZ-WYUSe6          [root@localhost ~]# vgscan       Reading all physical volumes.  This may take a while...       Found volume group "lvm-tb-storage" using metadata type lvm2       Found volume group "vg_localhost" using metadata type lvm2          [root@localhost ~]# mdadm --detail --scan     ARRAY /dev/md/127_0 metadata=0.90 UUID=bebfd467:cb6700d9:29bdc0db:c30228ba          [root@localhost ~]# ls -al /dev/md     total 0     drwxr-xr-x.  2 root root   60 2011-09-13 03:14 .     drwxr-xr-x. 19 root root 5180 2011-09-13 03:15 ..     lrwxrwxrwx.  1 root root    8 2011-09-13 03:14 127_0 -> ../md127          [root@localhost ~]# mdadm --detail /dev/md/127_0      /dev/md/127_0:             Version : 0.90       Creation Time : Wed Nov  5 18:26:25 2008          Raid Level : raid5          Array Size : 1953134208 (1862.65 GiB 2000.01 GB)       Used Dev Size : 976567104 (931.33 GiB 1000.00 GB)        Raid Devices : 3       Total Devices : 3     Preferred Minor : 127         Persistence : Superblock is persistent              Update Time : Tue Sep 13 03:28:51 2011               State : clean      Active Devices : 3     Working Devices : 3      Failed Devices : 0       Spare Devices : 0                   Layout : left-symmetric          Chunk Size : 64K                     UUID : bebfd467:cb6700d9:29bdc0db:c30228ba              Events : 0.671154              Number   Major   Minor   RaidDevice State            0       8       17        0      active sync   /dev/sdb1            1       8       49        1      active sync   /dev/sdd1            2       8       33        2      active sync   /dev/sdc1          [root@localhost ~]# cat /proc/mdstat      Personalities : [raid6] [raid5] [raid4]      md127 : active raid5 sdb1[0] sdc1[2] sdd1[1]           1953134208 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]          unused devices: <none>          [root@localhost ~]# mdadm --examine /dev/sdb1     /dev/sdb1:               Magic : a92b4efc             Version : 0.90.00                UUID : bebfd467:cb6700d9:29bdc0db:c30228ba       Creation Time : Wed Nov  5 18:26:25 2008          Raid Level : raid5       Used Dev Size : 976567104 (931.33 GiB 1000.00 GB)          Array Size : 1953134208 (1862.65 GiB 2000.01 GB)        Raid Devices : 3       Total Devices : 3     Preferred Minor : 127              Update Time : Tue Sep 13 03:29:50 2011               State : clean      Active Devices : 3     Working Devices : 3      Failed Devices : 0       Spare Devices : 0            Checksum : f1ddf826 - correct              Events : 671154                   Layout : left-symmetric          Chunk Size : 64K                Number   Major   Minor   RaidDevice State     this     0       8       17        0      active sync   /dev/sdb1             0     0       8       17        0      active sync   /dev/sdb1        1     1       8       49        1      active sync   /dev/sdd1        2     2       8       33        2      active sync   /dev/sdc1          [root@localhost ~]# fdisk -lu 2>&1     Disk /dev/dm-0 doesn't contain a valid partition table     Disk /dev/dm-1 doesn't contain a valid partition table     Disk /dev/md127 doesn't contain a valid partition table     Disk /dev/dm-2 doesn't contain a valid partition table          Disk /dev/sda: 250.0 GB, 250000000000 bytes     255 heads, 63 sectors/track, 30394 cylinders, total 488281250 sectors     Units = sectors of 1 * 512 = 512 bytes     Disk identifier: 0x00000080            Device Boot      Start         End      Blocks   Id  System     /dev/sda1              63      610469      305203+  83  Linux     /dev/sda2          610470   359004554   179197042+  83  Linux     /dev/sda3   *   359004555   359414154      204800   83  Linux     /dev/sda4       359422245   488279609    64428682+   5  Extended     /dev/sda5       359422308   488278371    64428032   8e  Linux LVM          Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors     Units = sectors of 1 * 512 = 512 bytes     Disk identifier: 0xb03e1980            Device Boot      Start         End      Blocks   Id  System     /dev/sdb1              63  1953134504   976567221   da  Non-FS data          Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors     Units = sectors of 1 * 512 = 512 bytes     Disk identifier: 0x7db522d5            Device Boot      Start         End      Blocks   Id  System     /dev/sdc1              63  1953134504   976567221   da  Non-FS data          Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors     Units = sectors of 1 * 512 = 512 bytes     Disk identifier: 0x20af5840            Device Boot      Start         End      Blocks   Id  System     /dev/sdd1              63  1953134504   976567221   da  Non-FS data          Disk /dev/dm-0: 58.7 GB, 58707673088 bytes     255 heads, 63 sectors/track, 7137 cylinders, total 114663424 sectors     Units = sectors of 1 * 512 = 512 bytes     Disk identifier: 0x00000000               Disk /dev/dm-1: 7264 MB, 7264534528 bytes     255 heads, 63 sectors/track, 883 cylinders, total 14188544 sectors     Units = sectors of 1 * 512 = 512 bytes     Disk identifier: 0x00000000               Disk /dev/md127: 2000.0 GB, 2000009428992 bytes     2 heads, 4 sectors/track, 488283552 cylinders, total 3906268416 sectors     Units = sectors of 1 * 512 = 512 bytes     Disk identifier: 0x00000000               Disk /dev/dm-2: 2000.0 GB, 2000007725056 bytes     255 heads, 63 sectors/track, 243153 cylinders, total 3906265088 sectors     Units = sectors of 1 * 512 = 512 bytes     Disk identifier: 0x00000000      The kernel boot parameter that I have               kernel /vmlinuz-2.6.30.10-105.2.23.fc11.x86_64 ro root=/dev/mapper/vg_localhost-lv_root rhgb quiet      **On Fedora 15** I installed Fedora 15 on a new boot drive, on which the installation program also created an lvm (/dev/vg_20110912a/) for me, but again that's irrelevant. Under Fedora 15, `lvm`, `pvscan`, `vgscan` see nothing but the irrelevant boot drive. `mdadm`, however, shows something very strange -- the original raid is broken into three raid, and the combination is very puzzling.               [root@localhost ~] # cat /etc/mdadm.conf     # mdadm.conf written out by anaconda     MAILADDR root     AUTO +imsm +1.x -all          [root@localhost ~]# pvscan       PV /dev/sda2   VG vg_20110912a   lvm2 [59.12 GiB / 0  free]       Total: 1 [59.12 GiB] / in use: 1 [59.12 GiB] / in no VG: 0 [0   ]          [root@localhost ~]# lvscan       ACTIVE            '/dev/vg_20110912a/lv_home' [24.06 GiB] inherit       ACTIVE            '/dev/vg_20110912a/lv_swap' [6.84 GiB] inherit       ACTIVE            '/dev/vg_20110912a/lv_root' [28.22 GiB] inherit          [root@localhost ~]# vgdisplay       --- Volume group ---       VG Name               vg_20110912a       System ID                 Format                lvm2       Metadata Areas        1       Metadata Sequence No  4       VG Access             read/write       VG Status             resizable       MAX LV                0       Cur LV                3       Open LV               3       Max PV                0       Cur PV                1       Act PV                1       VG Size               59.12 GiB       PE Size               32.00 MiB       Total PE              1892       Alloc PE / Size       1892 / 59.12 GiB       Free  PE / Size       0 / 0          VG UUID               8VRJyx-XSQp-13mK-NbO6-iV24-rE87-IKuhHH          [root@localhost ~]# vgscan       Reading all physical volumes.  This may take a while...       Found volume group "vg_20110912a" using metadata type lvm2          [root@localhost ~]# mdadm --detail --scan     ARRAY /dev/md/0_0 metadata=0.90 UUID=153e151b:8c717565:fd59f149:d2ea02c9     ARRAY /dev/md/127_0 metadata=0.90 UUID=bebfd467:cb6700d9:29bdc0db:c30228ba          [root@localhost ~]# ls -l /dev/md     total 4     lrwxrwxrwx. 1 root root   8 Sep 13 02:39 0_0 -> ../md127     lrwxrwxrwx. 1 root root  10 Sep 13 02:39 0_0p1 -> ../md127p1     lrwxrwxrwx. 1 root root   8 Sep 13 02:39 127_0 -> ../md126     -rw-------. 1 root root 120 Sep 13 02:39 md-device-map          [root@localhost ~]# cat /dev/md/md-device-map     md126 0.90 bebfd467:cb6700d9:29bdc0db:c30228ba /dev/md/127_0     md127 0.90 153e151b:8c717565:fd59f149:d2ea02c9 /dev/md/0_0          [root@localhost ~]# mdadm --detail /dev/md/0_0     /dev/md/0_0:             Version : 0.90       Creation Time : Tue Nov  4 21:45:19 2008         Raid Level : raid5         Array Size : 976762496 (931.51 GiB 1000.20 GB)       Used Dev Size : 976762496 (931.51 GiB 1000.20 GB)        Raid Devices : 2       Total Devices : 2     Preferred Minor : 127         Persistence : Superblock is persistent              Update Time : Wed Nov  5 09:04:28 2008             State : clean      Active Devices : 2     Working Devices : 2      Failed Devices : 0       Spare Devices : 0                  Layout : left-symmetric         Chunk Size : 64K                  UUID : 153e151b:8c717565:fd59f149:d2ea02c9             Events : 0.2202              Number   Major   Minor   RaidDevice State         0       8       48      0   active sync   /dev/sdd         1       8       16      1   active sync   /dev/sdb          [root@localhost ~]# mdadm --detail /dev/md/127_0     /dev/md/127_0:             Version : 0.90       Creation Time : Wed Nov  5 18:26:25 2008         Raid Level : raid5         Array Size : 1953134208 (1862.65 GiB 2000.01 GB)       Used Dev Size : 976567104 (931.33 GiB 1000.00 GB)        Raid Devices : 3       Total Devices : 2     Preferred Minor : 126         Persistence : Superblock is persistent              Update Time : Tue Sep 13 00:39:51 2011             State : clean, degraded      Active Devices : 2     Working Devices : 2      Failed Devices : 0       Spare Devices : 0                  Layout : left-symmetric         Chunk Size : 64K                  UUID : bebfd467:cb6700d9:29bdc0db:c30228ba             Events : 0.671154              Number   Major   Minor   RaidDevice State         0   259     0       0   active sync   /dev/md/0_0p1         1       0       0       1   removed         2       8       33      2   active sync   /dev/sdc1          [root@localhost ~]# cat /proc/mdstat     Personalities : [raid6] [raid5] [raid4]     md126 : active (auto-read-only) raid5 md127p1[0] sdc1[2]         1953134208 blocks level 5, 64k chunk, algorithm 2 [3/2] [U_U]          md127 : active (auto-read-only) raid5 sdb[1] sdd[0]         976762496 blocks level 5, 64k chunk, algorithm 2 [2/2] [UU]          unused devices: <none>          [root@localhost ~]# mdadm --examine /dev/sdb1     /dev/sdb1:             Magic : a92b4efc             Version : 0.90.00             UUID : bebfd467:cb6700d9:29bdc0db:c30228ba       Creation Time : Wed Nov  5 18:26:25 2008         Raid Level : raid5       Used Dev Size : 976567104 (931.33 GiB 1000.00 GB)         Array Size : 1953134208 (1862.65 GiB 2000.01 GB)        Raid Devices : 3       Total Devices : 3     Preferred Minor : 127              Update Time : Tue Sep 13 00:39:51 2011             State : clean      Active Devices : 3     Working Devices : 3      Failed Devices : 0       Spare Devices : 0         Checksum : f1ddd04f - correct             Events : 671154                  Layout : left-symmetric         Chunk Size : 64K              Number   Major   Minor   RaidDevice State     this    0       8       17      0   active sync   /dev/sdb1             0    0       8       17      0   active sync   /dev/sdb1        1    1       8       49      1   active sync   /dev/sdd1        2    2       8       33      2   active sync   /dev/sdc1          [root@localhost ~]# fdisk -lu 2>&1     Disk /dev/mapper/vg_20110912a-lv_swap doesn't contain a valid partition table     Disk /dev/mapper/vg_20110912a-lv_root doesn't contain a valid partition table     Disk /dev/md127 doesn't contain a valid partition table     Disk /dev/mapper/vg_20110912a-lv_home doesn't contain a valid partition table          Disk /dev/sda: 64.0 GB, 64023257088 bytes     255 heads, 63 sectors/track, 7783 cylinders, total 125045424 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     Disk identifier: 0x0001aa2f            Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *        2048     1026047      512000   83  Linux     /dev/sda2         1026048   125044735    62009344   8e  Linux LVM          Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 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     Disk identifier: 0xb03e1980            Device Boot      Start         End      Blocks   Id  System     /dev/sdb1              63  1953134504   976567221   da  Non-FS data          Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 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     Disk identifier: 0x7db522d5            Device Boot      Start         End      Blocks   Id  System     /dev/sdc1              63  1953134504   976567221   da  Non-FS data          Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 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     Disk identifier: 0x20af5840            Device Boot      Start         End      Blocks   Id  System     /dev/sdd1              63  1953134504   976567221   da  Non-FS data          Disk /dev/mapper/vg_20110912a-lv_swap: 7348 MB, 7348420608 bytes     255 heads, 63 sectors/track, 893 cylinders, total 14352384 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     Disk identifier: 0x00000000               Disk /dev/mapper/vg_20110912a-lv_root: 30.3 GB, 30299652096 bytes     255 heads, 63 sectors/track, 3683 cylinders, total 59179008 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     Disk identifier: 0x00000000               Disk /dev/md127: 2000.0 GB, 2000009428992 bytes     2 heads, 4 sectors/track, 488283552 cylinders, total 3906268416 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 65536 bytes / 131072 bytes     Disk identifier: 0x00000000               Disk /dev/md126: 1000.2 GB, 1000204795904 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953524992 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 65536 bytes / 65536 bytes     Disk identifier: 0x20af5840               Device Boot      Start         End      Blocks   Id  System     /dev/md126p1              63  1953134504   976567221   da  Non-FS data     Partition 1 does not start on physical sector boundary.          Disk /dev/mapper/vg_20110912a-lv_home: 25.8 GB, 25836912640 bytes     255 heads, 63 sectors/track, 3141 cylinders, total 50462720 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     Disk identifier: 0x00000000      My kernel boot parameter:               kernel /vmlinuz-2.6.40.4-5.fc15.x86_64 ro root=/dev/mapper/vg_20110912a-lv_root rd_LVM_LV=vg_20110912a/lv_root rd_LVM_LV=vg_20110912a/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us rhgb quiet rdblacklist=nouveau nouveau.modeset=0 nodmraid      The last `mdadm --examine /dev/sdb1` shows exactly the same result as in Fedora 11, but I don't understand why `mdadm --detail /dev/md/0_0` shows only /dev/sdb and /dev/sdd, and `mdadm --detail /dev/md/127_0` shows /dev/sdc1 and /dev/md/0_0p1 . Since `mdadm --examine /dev/sdb1` shows the correct result, Fedora 15 is able to access the raid somehow, but I am not sure what to do. Shall I create/assembly a new raid /dev/md2 and hope that the `lvm` that I had created will magically show up? Thank you in advance.


title: Increase Space of /usr directory in Cent OS

text: On my CentOS 5 server, `fdisk -l` outputs:               Disk /dev/xvda: 100.0 GB, 100000595968 bytes     255 heads, 63 sectors/track, 12157 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes          Device Boot      Start         End      Blocks   Id  System     /dev/xvda1               1         487     3911796   83  Linux     /dev/xvda2             488         731     1959930   82  Linux swap / Solaris     /dev/xvda3             732       12157    91779345   8e  Linux LVM      and `df -h` outputs:               Filesystem            Size  Used Avail Use% Mounted on     /dev/xvda1            3.7G  1.4G  2.4G  37% /     /dev/mapper/vg00-usr  4.0G  4.0G   20K 100% /usr     /dev/mapper/vg00-var  4.0G  440M  3.6G  11% /var     /dev/mapper/vg00-home 4.0G  269M  3.8G   7% /home     none                  512M  1.4M  511M   1% /tmp     tmpfs                 512M     0  512M   0% /usr/local/psa/handlers/before-local     tmpfs                 512M     0  512M   0% /usr/local/psa/handlers/before-queue     tmpfs                 512M     0  512M   0% /usr/local/psa/handlers/before-remote     tmpfs                 512M   16K  512M   1% /usr/local/psa/handlers/info     tmpfs                 512M     0  512M   0% /usr/local/psa/handlers/before-local     tmpfs                 512M     0  512M   0% /usr/local/psa/handlers/before-queue     tmpfs                 512M     0  512M   0% /usr/local/psa/handlers/before-remote     tmpfs                 512M   16K  512M   1% /usr/local/psa/handlers/info     tmpfs                 512M     0  512M   0% /usr/local/psa/handlers/spool      My `/usr` drive doesn't have any free space, but `fdisk` shows 100GB of unused space. Can I use that space to increase the capacity of the `/usr` directory? How? And how can I remove unwanted files from `/usr`?


title: How to iterate through a list of files with spaces that is sorted (case insensitive)?

text: I am doing this in OSX which uses bash but obviously, not all bash conventions are used so hopefully your suggestion is available to me :) I have the following files   1. `fun bar1.txt`   2. `Foo bar2.tXT` (that's an uppercase XT)   3. `fun fun.txt` What I was is to iterate through the file list in a sorted manner? something like:               for i in (my-sorted-file-list); do         echo $i     done      Any ideas how this can be done? thanks a lot


title: How to paste same information into 2 different files?

text: I'd like to create two files in `/etc/skel` using a script which does many other things in addition to the creation of the files in `/etc/skel`. The part from script regarding `/etc/skel` looks like this:               cat <<EOF > /etc/skel/.vimrc     :set nu     set incsearch     :set ignorecase     :set smartcase     :set ts=2     EOF      I tried adding `&& /etc/skel/.virc` on the end of the first line in the script but to no avail. Is there any way to do that other than doing the whole `cat` again into the other file?


title: How to disable a mouse movement input, while leaving mouse buttons enabled?

text: I have a mouse I just use for the buttons. I want to disable only the movement input of the mouse. Physically covering the sensor doesn't work.


title: How to randomize the output from seq?

text: I know I can use seq to generate a random list of numbers 1, 2, 3, 4... I want to get those numbers into a random order like 3, 1, 4, 2... I know I can use shuf to shuffle the lines of a file. So I could use seq to write random numbers to a file and then use shuf to shuffle them -- or write some sort of shuffle function. But this seems needlessly complex. Is there a simpler way to randomize the items in an array with a single command?


title: Does watch only monitor the visible output?

text: Does `watch` only monitor the visible output of a command? Say I'm in a directory with the following contents:               $ ls     a  b  c  d  e  f  g  h  i  j  k  l  m  n      If I run `watch -g ls -1` I expect it to exit if a file is added or removed. What actually happens is that it exits _only_ if the file in question is visible in the terminal output of `watch`:               $ watch -g ls -1     Every 2.0s: ls -1                                                                 Wed Nov 13 16:35:03 2013          a     b     c     d     e     f      Deleting the file `m` which is not visible because of the size of my terminal does nothing. Deleting a visible file, say `d`, causes `watch` to exit as expected. The `-g` flag is explained thusly in my `man` page:                  -g, --chgexit               Exit when the output of command changes.      What's going on? Is this normal? How can I use `watch` for commands with long output? I am using `watch from procps-ng 3.3.4` which was installed from the Debian repos.


title: Why do I need to specify two init images - initrd and boot - inside KVM to boot to bash?

text: My machine is running inside a KVM virtual machine (Parallels Desktop v8), having a BIOS (not UEFI), having one SATA drive connected, one GPT partition on that disk, the partition is ext4 formatted, the bootloader is extlinux v. 4.05, and the kernel is Ubuntu 13.10 package linux-image-3.11.0-18-generic. The system boots to (initramfs) prompt when only `initrd` and no `boot` argument is specified:               (initramfs) cat /proc/cmdline     initrd=/boot/initrd.img-3.11.0-18-generic ro quiet BOOT_IMAGE=/boot/vmlinuz-3.11.0-18-generic      Only after inserting `boot=/dev/sda1` the system boots to bash prompt, as pointed out in the answer of question How to fix boot into initramfs prompt and "mount: can't read '/etc/fstab': No such file or directory" and "No init found"? I have read that the kernel is usually able to find its boot partition without additional configuration. Environment:               $ sudo efibootmgr     Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.     $ sudo modprobe efivars     (no result)      Faulty (initramfs) prompt:               mount: can't read '/etc/fstab': No such file or directory     mount: mounting /dev on /root/dev failed: No such file or directory     mount: mounting /sys on /root/sys failed: No such file or directory     mount: mounting /proc on /root/proc failed: No such file or directory     The filesystem doesn't have requested /sbin/init.     No init found. Try passing init= bootarg.          (initramfs) cd /root || mkdir /root     (initramfs)      ### Update #1 - (initramfs) echo $(pwd) output               (initramfs) cd /root && echo $(pwd) || mkdir /root?     /root     (initramfs)      ### Update #2 - (initramfs) ls /dev output               (initramfs) ls /dev     vga_arbiter rfkill mem null port zero full random urandom kmsg tty console     tty0-tty63 vcs vcsa vcs1 vcsa1 snapshot ecryptfs fuse ptmx ttyS0-ttyS31     ttyprintk hpet ram0-ram15 loop-control loop0-loop7 net ppp bus input psaux     uinput rtc0 mapper mcelog cpu_dma_latency network_latency network_throughput     pts core fd stdin stdout stderr btrfs-control char rtc sg0 bsg sda sda1      ### Update #3 - (initramfs) ls / && ls /*/ output               (initramfs) ls /     dev root conf bin etc sbin run init lib64 scripts lib sys proc tmp var     (initramfs) ls /*/     /var/:     lock          /tmp/:          /sys/:     hypervisor kernel power block dev fs module firmware class devices bus          /scripts/:     panic init-bottom local-premount nfs functions local init-top          /sbin/:     blkid wait-for-root rmmod hwclock udevadm dumpe2fs modprobe          /run/:          /root/:          /proc/:     1-130 142-148 167-169 219-231 233 243-245 248 self ounts net sysvipc fs     driver tty bus sys cgroups irq mtrr fb acpi misc scsi mdstat execdomains     ioports imem schedstat sched_debug timer_list timer_stats dma modules     kallsyms latency_stats buddyinfo pagetypeinfo vmstat zoneinfo slabinfo     vmallocinfo swaps filesystems locks cmdline consoles cpuinfo devices      interrupts loadavg meminfo stat uptime version softirqs kcore kmsg      kpagecount kpageflags version_signature key-users crypto diskstats     partitions sysrq-trigger          /lib64/:     ld-linux-x86-64.so.2          /lib/:     udev klibc-dev6iJxsMLkI8yu6xMVSFDIuVsJk.so x86_64-linux-gnu modules firmware systemd          /etc/:     modprobe.d ld.so.conf.d udev ld.so.conf ls.so.cache mtab          /dev/:     ...see above...          /conf/:     initramfs.conf arch.conf conf.d          /bin/:     kmod udevadm dmesg busybox poweroff fstype losetup ipconfig reboot halt sh     run-init pivot-root date dd insmod nfsmount sleep mount cpio resume      ### Update #4 - ls /scripts/* /conf/* /sys/firmware/*/ output               (initramfs) ls /scripts/* /conf/* /sys/firmware/*/     /scripts/functions /scripts/local /scripts/nfs /conf/initramfs.conf /conf/arch.conf            /sys/firmware/memmap/:     9 8 7 6 5 4 3 2 1 0          /sys/firmware/acpi/:     hotplug tables pm_profiles interrupts          /conf/conf.d:          /scripts/panic:     ORDER keymap          /scripts/local-premount:     ORDER fixrtc resume          /scripts/init-top:     ORDER all_generic_ide blacklist udev          /scripts/init-bottom:     ORDER udev      Why isn't the kernel not able to find the boot partition in this case?


title: Equivalent of VINO in Red Hat

text: Vino is a VNC server which is installed by default on Ubuntu (Debian family). Is there a VNC Server installed by default on Red Hat, is it the same?


title: GNU Screen doesn't echo unicode characters correct

text: When I do this in my terminal:               echo -e "\xF0\x9f\x8d\xba"      I get a cool beer mug in my terminal: However, when I start screen, and try the same, I'm getting a �. How do I get the nice beer mug? This is my .screenrc:               nethack on     startup_message off     defscrollback 3000     hardstatus on     hardstatus alwayslastline     hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %c"     termcapinfo xterm 'bc@:bs@'     ignorecase on     maptimeout 0     vbell off     defutf8 on     defencoding utf8      Also running screen with the `-U` option doesn't help.


title: Can 32-bit and 64-bit CentOS 6.4 servers both be AD domain controllers for the same domain?

text: If I have two CentOS 6.4 servers, one i386 and the other x86_64, running Samba 4.0.7, will they replicate domain controller data with each other (and from a Windows Server 2003 AD DC) without any special setup? Can anyone confirm this or a similar setup as having worked?


title: Running VNC viewer without opening a console

text: Right now I have to open a console and type:               xtightvncviewer [ip-address]      to open the viewer. That's okay, but then I need to leave the console open or otherwise the viewer will close. I've tried:               nohup xtightvncviewer [ip-address] &      and:               xtightvncviewer [ip-address]     [ctrl-Z]     bg      In both cases, it pops up a little password dialog, and opens the viewer, but it's still dependent on the console being open. Is there a way to open xtightvncviewer as "headless"?