title: Install Chrome Linux from PXE boot

text: I've got a PXE boot server from which I can boot a selection of LIVE CD's. Mostly different Ubuntu distributions. Setting it up for ubuntu was relatively easy. I have copied the caspar directory from the live cd to the tftp directory and put everything else into an nfs directory. I've created a submenu for ubuntu that looks like this:               LABEL 2             MENU LABEL Ubuntu 11.10 Oneiric Ocelot (64-bit)             KERNEL ubuntu/11.10/amd64/vmlinuz             APPEND root=/dev/nfs boot=casper netboot=nfs nfsroot=192.168.1.2:/srv/install/ubuntu/11.10/amd64 initrd=ubuntu/11.10/amd64/initrd.lz quiet splash --             TEXT HELP             Boot the Ubuntu 11.10 Oneiric Ocelot x64 Live CD             ENDTEXT     LABEL 3         MENU LABEL xubuntu 12.04 LTS Precise Pangolin (32-bit)         KERNEL ubuntu/12.04/x86/vmlinuz         APPEND root=/dev/nfs boot=casper netboot=nfs nfsroot=192.168.1.2:/srv/install/xubuntu/12.04/x86 initrd=ubuntu/12.04/x86/initrd.lz quiet splash --         TEXT HELP         Boot the XUbuntu 12.04 Precise Pangolin x86 Live CD         ENDTEX      etc. Now I would like to do the same for chrome linux x86. I've downloaded the cd image and mounted it under `~/chromelinux`, but there is no casper so I am stuck now. Have no clue what to do next. On that CD mount I have the following files:               .     ├── boot     │   ├── grub     │   │   └── mbrid     │   └── i386     │       └── loader     │           ├── 16x16.fnt     │           ├── af.hlp     │           ├── af.tr     │           ├── animations [error opening dir]     │           ├── ar.hlp     │           ├── ar.tr     │           ├── back.jpg     │           ├── bg.tr     │           ├── bootlogo     │           ├── branding [error opening dir]     │           ├── ca.hlp     │           ├── ca.tr     │           ├── chain.c32     │           ├── cs.hlp     │           ├── cs.tr     │           ├── da.hlp     │           ├── da.tr     │           ├── de.hlp     │           ├── de.tr     │           ├── el.hlp     │           ├── el.tr     │           ├── en.hlp     │           ├── en.tlk     │           ├── en.tr     │           ├── es.hlp     │           ├── es.tr     │           ├── et.hlp     │           ├── et.tr     │           ├── fi.hlp     │           ├── fi.tr     │           ├── fr.hlp     │           ├── fr.tr     │           ├── gfxboot.c32     │           ├── gfxboot.cfg     │           ├── gl.tr     │           ├── gu.hlp     │           ├── gu.tr     │           ├── hapysuse.mod     │           ├── hi.tr     │           ├── hr.hlp     │           ├── hr.tr     │           ├── hu.hlp     │           ├── hu.tr     │           ├── id.tr     │           ├── initrd     │           ├── isolinux.bin     │           ├── isolinux.cfg     │           ├── isolinux.msg     │           ├── it.hlp     │           ├── it.tr     │           ├── ja.hlp     │           ├── ja.tr     │           ├── ka.tr     │           ├── ko.hlp     │           ├── ko.tr     │           ├── kroete.dat     │           ├── ky.hlp     │           ├── ky.tr     │           ├── linux     │           ├── lt.hlp     │           ├── lt.tr     │           ├── mboot.c32     │           ├── memtest     │           ├── mr.hlp     │           ├── mr.tr     │           ├── nb.hlp     │           ├── nb.tr     │           ├── nl.hlp     │           ├── nl.tr     │           ├── pabout.txt     │           ├── pa.hlp     │           ├── panim_a.jpg     │           ├── panim.jpg     │           ├── pa.tr     │           ├── pback.jpg     │           ├── phead.jpg     │           ├── pl.hlp     │           ├── pl.tr     │           ├── pt_BR.hlp     │           ├── pt_BR.tr     │           ├── pt.hlp     │           ├── pt.tr     │           ├── ro.hlp     │           ├── ro.tr     │           ├── ru.hlp     │           ├── ru.tr     │           ├── sk.hlp     │           ├── sk.tr     │           ├── sl.tr     │           ├── sr.tr     │           ├── sv.hlp     │           ├── sv.tr     │           ├── ta.tr     │           ├── text.jpg     │           ├── tg.tr     │           ├── th.hlp     │           ├── th.tr     │           ├── timer_a.jpg     │           ├── tr.tr     │           ├── uk.hlp     │           ├── uk.tr     │           ├── wa.tr     │           ├── welcome.jpg     │           ├── xh.hlp     │           ├── xh.tr     │           ├── zh_CN.hlp     │           ├── zh_CN.tr     │           ├── zh_TW.hlp     │           ├── zh_TW.tr     │           └── zu.tr     ├── Chrome_Linux-read-only.i686-2.1.1145     └── config.isoclient      The contents of `isolinux.cfg` are these:               default Chrome_Linux     implicit 1     display isolinux.msg     ui gfxboot bootlogo isolinux.msg     prompt   1     timeout  200     label Chrome_Linux       kernel linux       append initrd=initrd ramdisk_size=512000 ramdisk_blocksize=4096 splash=silent showopts      label Failsafe_--_Chrome_Linux       kernel linux       append initrd=initrd ramdisk_size=512000 ramdisk_blocksize=4096 splash=silent showopts ide=nodma apm=off acpi=off noresume selinux=0 nosmp noapic maxcpus=0 edd=off          label harddisk       localboot 0x80          label memtest       kernel memtest      So how do I set this up so that computers on the network can boot to this "CD" and install the OS from this? Thank you in advance for any help.


title: FreeBSD installed package location

text: I installed `Unrealircd` on FreeBSD via the `sysinstall` utility. I cannot seem to find the location where it was installed. How can I find the default location of installed packages? **Edit:** I found the package with the `find` utility. But in general, how do I know where `sysinstall` would put the package after installation?


title: Changing file extensions

text: > **Possible Duplicate:**   >  Renaming multiple files (changing extension) Suppose I have a bunch of files with the extension `.x` and I want to change them so that they have the extension `.y`. I know `$ mv *.x *.y` wouldn't work because I havn't expressed each file to change their respective extensions (that and the command expects *.y to be a directory). What command should I issue?


title: Searching for multiple files and changing file extension

text: I want to search and identify multiple files, within a directory, having a particular file extension (.txt) and changing the extension to (.fasta). This is considering not changing the file itself, only the extension, and saving it with the new extension.               file1.txt --> file1.fasta     file3.txt --> file2.fasta     file3.txt --> file3.fasta


title: How can I rename all files in the current directory having a particular extension to another extension?

text: > **Possible Duplicate:**   >  Renaming multiple files (changing extension) Suppose that in my current/working directory I have five files:               file1.xvg     file2.xvg     file3.xvg     file1.eps     file2.eps      Is there any way that I can rename all files in the current/working directory with the extension **.xvg** and give them the new extension **.txt** (leaving the **.eps** files alone)? Can this be done with `rename`, `mv`, or `mmv` perhaps? I am using Ubuntu Linux. Thanks!


title: Renaming all files in a directory while keeping the same initial part of the name

text: I have a directory full of files. I want to rename all the files that match *.py to -backup.py. How do I do that. I know I can use for i in *.py, but from there I'm not sure how to keep the initial name and just append backup to all of them.


title: Crunchbang as an optimal OS?

text: I have a small netbook that I've been using for all of my learning to program/learning to *nix needs. It is pretty underpowered (1gb RAM, 1.66hz processor) and has a dire battery life (under an hour really) as I got it for free from a friend. The Windows OS on it was slowing it down so much, and as they were giving it to me, I formatted and installed Crunchbang over the top. I'd never used Crunchbang before, but I have now become a big fan. It's quite confusing for me still, having no menu bar or anything, and having to manually edit the entries in the right-click menu if I want to add anything to it, but it is pretty speedy, and seems really quite nice to use. However, I'll soon be buying myself a new small netbook, with the same specs, but one with a much better battery life (apparently just under 8 hours in actual tests, with WiFi on and running Windows... two things I will not be doing), and was wondering whether or not Crunchbang would be a good choice of OS to install on it again? I know that 'which OS is better' makes for a very poor question, but I hope that mine is more specific, namely **is Crunchbang good for underpowered systems, and will it ever restrict my ability to do things that I might want to do when it comes to programming/delving further into the workings of computer systems? If so, what is a good alternative? Or is it simply a matter of taste?**


title: Why is the restart inittab action asking me for an id?

text: I am following the NAND firmware update tutorial to try to get my system to run from RAM so I can flash it. I previously had my script running but for some reason unknown to me it is giving me:               INIT: /etc/inittab[44]: missing id field      It worked perfectly fine before and I can't seem to pick out why inittab only just recently started asking me for an id field for the restart action. Any idea why I could be getting this error message? Any insight would be greatly appreciated! NOTE: When `kill -HUP 1` is run I get the error on this line in my `inittab`:               ::restart:/reS      The following is my script that I am trying to use to update my flash               NEWROOTDIR=/tmp/newroot     mkdir -p ${NEWROOTDIR}     mount -t tmpfs none ${NEWROOTDIR}          cd /     echo Copying existing file system ...     echo Copying bin ...     cp -a bin ${NEWROOTDIR}     echo Copying dev ...     cp -a dev ${NEWROOTDIR}     echo Copying etc ...     cp -a etc ${NEWROOTDIR}     echo Copying lib ...     cp -a lib ${NEWROOTDIR}     echo Copying sbin ...     cp -a sbin ${NEWROOTDIR}     echo Copying usr ...     cp -a usr ${NEWROOTDIR}     echo Copying home ...     cp -a home ${NEWROOTDIR}     echo Done copying existing file system               echo Creating folders     mkdir ${NEWROOTDIR}/root     mkdir ${NEWROOTDIR}/proc     mkdir ${NEWROOTDIR}/sys     mkdir ${NEWROOTDIR}/oldroot          echo Killing all system processes     killall5 -9     echo Rebinding /proc to the new root     mount --bind /proc ${NEWROOTDIR}/proc          echo Pivoting to new root     cd ${NEWROOTDIR}     /sbin/pivot_root . oldroot     cd /     echo Cleaning up inittab     grep -v restart /oldroot/etc/inittab > /etc/inittab          echo Inserting the restart command into inittab     echo "::restart:/reS" >> /etc/inittab      echo "umount /oldroot" >> /reS     echo "/usr/sbin/ubiformat ${mtd_fs} -f /oldroot/var/volatile/tmp/fs.img  -O 2048" >> /reS     chmod 777 /reS     echo Killing HUP     kill -HUP 1     sleep 1     echo killing QUIT     echo Restarting     kill -QUIT 1     sleep 5


title: How can two files in one of my folders have the same name?

text: I downloaded two files, they were both saved to the same filename and then I transferred them with scp to another computer. Why didn't they become one when the second was saved?


title: Forcing an 'added' alias to every command

text: Is it possible to forcibly add a timing alias (for lack of a better way to phrase it) to every command in `bash`? For example, I would like to have a specific user who whenever a command is run, it is always wrapped either with `date` before and after, or `time`. Is this possible, and, if so, how?


title: Time all executions in bash

text: Is there a way to run _all_ commands in `bash` as if they were invoked with `time` in front? I want that I could type `$ some_command` and this will actually invoke `$ time some_command`.


title: For the results of either ps aux or ps -ef, how do I just find the commands with brackets?

text: So I get the results of               root         2     0  0 Jan18 ?        00:00:00 [kthreadd]     root         3     2  0 Jan18 ?        00:00:23 [ksoftirqd/0]     root         4     2  0 Jan18 ?        00:00:00 [events/0]     root         5     2  0 Jan18 ?        00:00:00 [khelper]     root         8     2  0 Jan18 ?        00:00:00 [async/mgr]     root        44     2  0 Jan18 ?        00:00:00 [sync_supers]     root        46     2  0 Jan18 ?        00:00:00 bdi-default     root        48     2  0 Jan18 ?        00:00:00 [kblockd/0]     root        66     2  0 Jan18 ?        00:00:00 [kswapd0]     root        67     2  0 Jan18 ?        00:00:00 [ksmd]     root        68     2  0 Jan18 ?        00:00:00 aio/0     root       185     2  0 Jan18 ?        00:00:00 [jbd2/ubda-8]      How do I just find the commands with the brackets around them?


title: shell script to do some text manipulation of text file data structure and slight content changes

text: Apologies in advance for the wall of text, not sure how else to represent the existing data structure. I have been handed about a years worth of logs collected every hour from a server. Sadly, fixing the data collection script so it builds files the way they want them going forward was easy, but I still have to convert the thousands of existing files. I am running into some stops here, and suspect that either its beyond my skills, or I am mentally making this way harder than it has to be. This is the base iteration of one of the runs (it runs every 5 minutes every hour)               2350      id pool                 type rid rset                  min  max size used load       5 SUNWtmp_serverxd1z1      pset   1 SUNWtmp_serverxd1z1       104  104  104 0.00 6.25       4 SUNWtmp_serverxd1z2      pset   2 SUNWtmp_serverxd1z2        16   16   16 0.00 0.91       0 pool_default         pset  -1 pset_default           24  66K   24 0.00 1.74           id pool                 type rid rset                  min  max size used load       5 SUNWtmp_serverxd1z1      pset   1 SUNWtmp_serverxd1z1       104  104  104 5.01 6.21       4 SUNWtmp_serverxd1z2      pset   2 SUNWtmp_serverxd1z2        16   16   16 0.97 0.91       0 pool_default         pset  -1 pset_default           24  66K   24 3.73 1.78      > output truncated, but it goes on for 50 lines from the prior timestamp, > until the next one. I'm not sure how to display numbers within a block quote, but each run is 50 lines long (they all get combined into a file that is around 14400 lines for each day, with the field in the front of each line being the date derived from the file name. Here is what they want it to look like. Field position in terms of white space doesn't seem to matter, just relative field position, including the new field "int" which is shown iterating to 2, but would actually only iterate once every 50 lines (the complete data collection run), and then start back at 01.               date     hhmm int id pool                type rid rset                  min  max size used load     20121105 2350 01  5 SUNWtmp_serverxd1z1      pset   1 SUNWtmp_serverxd1z1       104  104  104 0.00 6.25     20121105 2350 01  4 SUNWtmp_serverxd1z2      pset   2 SUNWtmp_serverxd1z2        16   16   16 0.00 0.91     20121105 2350 01  0 pool_default         pset  -1 pset_default           24  66K   24 0.00 1.74          date     hhmm int id pool                type rid rset                  min  max size used load     20121105 2350 02  5 SUNWtmp_serverxd1z1      pset   1 SUNWtmp_serverxd1z1       104  104  104 5.01 6.21     20121105 2350 02  4 SUNWtmp_serverxd1z2      pset   2 SUNWtmp_serverxd1z2        16   16   16 0.97 0.91     20121105 2350 02  0 pool_default         pset  -1 pset_default           24  66K   24 3.73 1.78      I've tried a few sed and awk one liners, but come to the sad realization that I've never had to manipulate text in any way that was more complex than a 1 liner could handle, and at this point I see this file needing something more complex than that. example of something I tried to play with format: `gawk -vdate=$DATE -vtime=$TIME '{print date " " time $0 }' ./poolstat_original_format.txt` using date and time derived from file name into those two variables. My prior shell scripting experience is all related to system automation and troubleshooting, never had any real experience with this much moving around of text, so if this is actually an easy problem and I am just over thinking it, great, any useful comments appreciated. Additional info I meant to add but got pulled away. The date is derived from the file name coming in. 20121003-poolstat_serverxd1z0.txt The time is the 4 digit numeric every 50 lines. The int field needs to iterate each time the poolstat is run. Se below for details. In summary, the only fields that need to be changed: field 1, the 8 digit date, derived from filename IE: 20121003-poolstat_serverxd1z0.txt field 2 the 4 digit time that is inside the file every 50th line. field 3 the iteration count, as follows: Based on digits 3 and 4 of the 4 digit time. 00-05-10-15-20-25-30-35-40-45-50-55 minute of run. 01-02-03-04-05-06-07-08-09-10-11-12 iteration. The rest is just printing out existing fields, its getting those onto a line, then awk ( or other) command to print out the other 10 fields, all while keeping track of the current iteration. And just to keep things complex, the fields in the header line also need 3 new fields: date hhmm int the rest of the fields are headers supplied by poolstat.


title: How can I for example list five largest files in /usr/lib -directory?

text: How can I for example list five largest files in `/usr/lib` directory? Please also add some minor explanation for each bit of code that you are using.


title: How to find a writable file owned by root?

text: How can I find a file on my hard drive created by root that has write permissions?


title: Meaning of patching binary files?

text: I am trying to understand what it means by patching binary files in an example from the manpage of `xxd`:               Patch the date in the file xxd.1     % echo "0000037: 3574 68" | xxd -r - xxd.1     % xxd -s 0x36 -l 13 -c 13 xxd.1     0000036: 3235 7468 204d 6179 2031 3939 36  25th May 1996        1. Does it mean editing binary files, or is it like in Wikipedia > A patch is a piece of software designed to fix problems1 with, or update a > computer program or its supporting data.   2. How do `xxd` and `patch` differ, and are they similar?   3. What does the example try to do?


title: What are the cons of using VirtualBox guest additions?

text: There's a number of advantages to installing Guest Additions in VirtualBox guests:   * one can copy-paste between host and guest   * one can run guest as fullscreen There must a whole lot more, so that makes me wonder if there are situations where one wouldn't use the feature.


title: tell xfce to resize all windows when external monitor unplugged

text: I wrote a nice little script that changes my monitor outputs according to whether an external monitor is connected or not and whether the laptop lid is open or closed or not and so on. That works pretty well, the only thing is that when my big external monitor is unplugged the windows on the laptop screen exceed the workspace so that I would have to resize or reopen all windows first. I am looking for a shell command or something that does this for me; it should just resize all windows so that they fit in the workspace. Is this integrated in XFCE4? Or do I need some other program? PS: I am using compiz as window manager and emerald for the decorations.


title: Can't save changes to system settings in Debian Wheezy

text: I installed Debian Wheezy just a few days ago. I used the Live image, downloaded from official Debian website, to install it. Now, the problem is that the changes I make to system settings (like changing keyboard shortcuts, wallpaper, etc), never apply. There are no "apply" buttons, so you'd expect it to work it soon after the change has been made. I've tried rebooting and it hasn't helped, unfortunately. It's confusing because everything else seems to work fine (was able to install the wifi driver and such). Any help will be highly appreciated. I can provide more details if a need arises. * * * ## Edit - more details How I make changes to the system settings:   1. I open the `System settings`,   2. Go to `Mouse & Touchpad`,   3. check/uncheck a checkbox or make any change,   4. close the window (there's no apply/OK button),   5. follow step 1 and 2 and the changes made are back to defaults. I've been using Ubuntu previously (since 2011) and nothing of this sort ever happened. It appears the installation is buggy or something. :|


title: merge 2 rows based on the same column values

text: I have a file like below.               47196436 47723284 name1 1.77273          42672249 52856963 name2 1.06061     52856963 430695 name2 1.16667          55094959 380983 name3 1.55613          17926380 55584836 name4 1.02461     3213456 34211 name4 1.11     54321 34211 name4 1.23      The first 2 columns correspond to the primary keys in my table. I am trying to merge the rows in such a way that if there is same name all the keys will be in the same row. I am trying to get the output as,               47196436 47723284 name1     42672249 52856963 430695 name2     55094959 380983 name3     17926380 55584836 3213456 34211 54321 name4      I was able to achieve it partially using the below command.               awk '{ x[$3]=x[$3] " " $2; }      END {         for (k in x) print k,x[k] >"OUTPUT1";       }' ccc.txt      However, it is not giving me the output correctly. I need some assistance in further modifying the above command.


title: Where are Lenny ISOs now that Squeeze is out?

text: So the next stable version of Debian is out but I need to install the previous one (Lenny) because my VPS is running that version. I haven't been able to find an «official» download link for Lenny's ISOs. Can you help me with this?


title: Print some fields of /etc/passwd

text: I have a question concerning the usage of wild cards in Linux. Here I have some lines from a long list of lines in the /etc/passwd -file.               root:x:0:0:root:/root:/bin/bash     daemon:x:1:1:daemon:/usr/sbin:/bin/sh     bin:x:2:2:bin:/bin:/bin/sh     sys:x:3:3:sys:/dev:/bin/sh     sync:x:4:65534:sync:/bin:/bin/sync     games:x:5:60:games:/usr/games:/bin/sh     ...      What is and appropriate command/commands to print out only the username, UID number and GID number from this line (if possible show multiple ways so I can explore further)?


title: How can sed add text after existing indent?

text: I have a sed script that has:               sed -i '/ *it.*do/! {               /\.should/ {                 s/\.should/)\.to/                 s/\(\S\)/expect(\1/                  # ...others      The last `s` adds `expect(` to the start of the line. I don't understand how it works. It works though for: Original:                 it "uses the given count if set" do         call('5').should == 5       end            it "uses the processor count from Parallel" do         call(nil).should == 20       end      After:                 it "uses the given count if set" do         expect(call('5')).to eq 5       end            it "uses the processor count from Parallel" do         expect(call(nil)).to eq 20       end      But it doesn't add the `expect(` for: Original:                 it "does not wait if not run in parallel" do         ParallelTests.should_not_receive(:sleep)         ParallelTests.wait_for_other_processes_to_finish       end            it "stops if only itself is running" do         ENV["TEST_ENV_NUMBER"] = "2"         ParallelTests.should_not_receive(:sleep)         with_running_processes(1) do             ParallelTests.wait_for_other_processes_to_finish           end       end      After - no `expect(`...                 it "does not wait if not run in parallel" do         ParallelTests).to_not receive(:sleep)         ParallelTests.wait_for_other_processes_to_finish       end            it "stops if only itself is running" do         ENV["TEST_ENV_NUMBER"] = "2"         ParallelTests).to_not receive(:sleep)         with_running_processes(1) do             ParallelTests.wait_for_other_processes_to_finish           end       end      However it **DOES** work for:   After:                 it "should be true when there is a Gemfile" do         use_temporary_directory_for do           FileUtils.touch("Gemfile")           expect(ParallelTests.send(:bundler_enabled?)).to eq true         end       end


title: Web navigation with dark color schemes

text: I use KDE with a dark color scheme so the text main color is white. Unfortunately this causes many websites to be unusable because text inside combobox, checkbox, and similar inherits the white color and so is white, while the background does not inherits the black color from the color scheme so is again white. So you have white on white. I use firefox as my main browser but this happens also in chromium and rekonq. Is it possible to fix this?


title: Fedora 17 : hotkey for terminal

text: Each time, if I want to use terminal, I press super key, typing terminal in search box, and enter to select terminal icon. How can I have hotkey to open terminal. (I'm not say hotkey : control + alt + Fn because it will open a full-console, not what I want). I just want a terminal windows. I have searched in keyboard shortcut, but I don't see option to select hotkey for this purpose. I just see one option : "Hotkey to enter command", when use this hotkey, it will apppear a small popup, but I don't know what command exist. (and it doesn't look like terminal) Thanks :)


title: “No such file or directory” when executing a cross-compiled program on a Raspberry Pi

text: I recently bought a Raspberry Pi. I already have configured it, and I install a cross compiler for arm on my desktop (amd64). I compiled a simple "hello world" program and then I copy it from my desktop to my Pi with `scp ./hello david@192.168.1.33:~/hello`. After login in my Pi I run `ls -l hello` and I get a normal response:               -rwxr-xr-x 1 david david 6774 Nov 16 18:08 hello      But when I try to execute it, I get the following:               david@raspberry-pi:~$ ./hello     -bash: ./hello: No such file or directory          david@raspberry-pi:~$ file hello     hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0x6a926b4968b3e1a2118eeb6e656db3d21c73cf10, not stripped     david@raspberry-pi:~$ ldd hello          not a dynamic executable


I installed Debian 7 using a USB flash drive "burned" from the first DVD ISO of the Debian installation CD/DVD. I did a very minimal install without Debian desktop environment, Print server and Standard system utilities. After installation and a reboot, I was presented with a console with the words _Debian GNU/Linux 7 hostname tty1_. I supplied the login username and password. After I typed the command _sudo apt-get install xorg_ , an error message popped up stating:               Media changed: please insert the disk labeled 'Debian GNU/Linux 7.4.0 _Wheezy_ - Official amd64 DVD Binary-1 20140208-13:47' in the drive and press Enter      I inserted the same USB flash drive into the same port and after waiting for a few seconds, I pressed Enter. The same error message popped up. I have tried the following steps on the advice of some of my colleagues:   1. remove/delete all the entries in /etc/apt/sources.list and reboot the computer   2. dmesg and fstab show that the USB thumb drive is mounted on /dev/sdb1   3. sudo mount /dev/sdb1 /media/usb0   4. sudo apt-cdrom -m -d /media/usb0 add After doing the above, the following error message appears:               Using CD-ROM mount point /media/cdrom/     Identifying.......{a long string of alphanumeric characters}     Scanning disc for index files...............     Found 0 package indexes, 0 source indexes, 0 translation indexes and 0 signatures     W: Failed to mount '/dev/sr0' to '/media/cdrom/'     E: Unable to locate any package files, perhaps this is not a Debian disc or the wrong architecture      I prefer to install Xorg (60MB) and gnome-core (400MB) from the USB stick. The NGO that I am working with is in a developing country with a very basic internet access infrastructure. Internet access is very patchy and the average download speed is less than 2 Mbps. A solution will be much appreciated.


title: How to have Kate spell check ignore run together words?

text: I use Kate editor for scientific programming (Fortran, Python, matlab) and would like to leave spell check on, but have it automatically ignore words that have been run together to create a variable name, e.g., NewVariable or HugeMatrix. There is an option in the spelling menu, but the spell check still highlights these words. Any ideas?


title: Have bash script wait for password

text: I want to write a little script which sets up a socks proxy via ssh and then starts a browser using that proxy.               #!/bin/bash     ssh -D 1234 user@host #&     chromium-browser --proxy-server="socks5://127.0.0.1:1234"      If I add the `&`-sign at the end of the first line the script just asks for my password and then opens an `ssh` terminal. The browser is started not before the ssh terminal is closed which is pretty useless. If I add the `&`-sign the script doesn't wait until I typed in the password and I don't know how I can cleanly end the `ssh` session. I don't want to use automatic `ssh` login via `rsa`-keys. Any suggestions how I could circumvent the problems described above?


title: What is the definition of a regular expression?

text: I recently got into a friendly argument with Ghoti about what constitutes a regular expression in the comments to my answer to this question. I claimed that the following is a regular expression:               `[Rr]eading[Tt]est[Dd]ata`      Ghoti disagreed, claiming it is a file glob instead. The glob page on wikipedia claims that (emphasis mine): > Globs do not include syntax for the Kleene star which allows multiple > repetitions of the preceding part of the expression; **thus they are not > considered regular expressions, which can describe a larger set of regular > languages over any given finite alphabet.** However, there is no citation for this claim, indicating that it is just a particular wikipedia editor's opinion. The The Single UNIX ® Specification, Version 2, states that a Basic Regular Expression (BRE) can even be a single character: > An ordinary character is a BRE that matches itself: any character in the > supported character set, except for the BRE special characters listed in BRE > Special Characters . So, what is the definition of a regular expression in the *nix world, and does that definition exclude file globs?


title: Using Diff with -y to get side-by-side output

text: I am trying to use `diff` with `-y` to get side-by-side output, but my output gets messed up after about 18 lines. Here is an example, any clue why? (Check from `*.java_pool_size=134217728`) :               *._unnest_subquery=FALSE                    *._unnest_subquery=FALSE     *.archive_lag_target=1800                   *.archive_lag_target=1800     *.audit_file_dest='/u01/app/oracle/admin/xxxxxxx/adump'       <     *.audit_sys_operations=TRUE                 *.audit_sys_operations=TRUE     *.audit_trail='DB_EXTENDED'                 *.audit_trail='DB_EXTENDED'     *.compatible='11.2.0.1.0'                   *.compatible='11.2.0.1.0'     *.control_files='/u01/app/oracle/oradata/xxxxxxx/control01.ct | *.control_files='/u01/app/oracle/oradata/xxxxxxx/control01.ct     *.cursor_sharing='EXACT'                      | *.cursor_sharing='SIMILAR'                                       > *.cursor_space_for_time=TRUE     *.db_block_size=8192                        *.db_block_size=8192     *.db_domain='xxxxxxxxxx.com'                      | *.db_domain=''     *.db_file_multiblock_read_count=8                 | *.db_file_multiblock_read_count=32     *.db_name='xxxxxxx'                     *.db_name='xxxxxxx'     *.db_writer_processes=8                     *.db_writer_processes=8     *.diagnostic_dest='/u01/app/oracle'             *.diagnostic_dest='/u01/app/oracle'     *.dispatchers='(PROTOCOL=TCP) (SERVICE=xxxxxxxXDB)'     *.dispatchers='(PROTOCOL=TCP) (SERVICE=xxxxxxxXDB)'                                       > *.EVENT='1652 TRACE NAME ERRORSTACK LEVEL 3'     *.fast_start_mttr_target=300                    *.fast_start_mttr_target=300     *.java_pool_size=134217728                    | *.instance_name='xxxxxx'     *.job_queue_processes=10                      | *.log_archive_dest_1='LOCATION=/xxxxxxx-05/oradata/arch'     *.large_pool_size=167772160                   | *.log_archive_dest_state_1='enable'     *.log_archive_dest_1='LOCATION=/xxxxxxx-04/oradata/arch'      <     *.log_archive_format='arch_%t_%s_%r.arc'            *.log_archive_format='arch_%t_%s_%r.arc'     *.log_checkpoint_timeout=0                    | *.log_buffer=1048576     *.log_checkpoint_to_alert=TRUE                    | *.log_checkpoint_interval=0     *.log_buffer=14289920                         | *.log_checkpoints_to_alert=TRUE     *.open_cursors=4000                       | *.open_cursors=1500     *.parallel_adaptive_multi_user=FALSE                  | *.optimizer_features_enable='10.2.0.4'     *.pga_aggregate_target=2500M                      | *.optimizer_mode='ALL_ROWS'     *.processes=3000                          | *.pga_aggregate_target=527433728     *.query_rewrite_integrity='TRUSTED'               | *.processes=800                                       > *.query_rewrite_enabled='TRUE'                                       > *.query_rewrite_integrity='Trusted'     *.recyclebin='OFF'                      *.recyclebin='OFF'     *.remote_login_passwordfile='EXCLUSIVE'             *.remote_login_passwordfile='EXCLUSIVE'     *.sec_case_sensitive_logon=FALSE                  | *.SEC_CASE_SENSITIVE_LOGON=FALSE     *.session_cached_cursors=1000                     | *.session_cached_cursors=1200     *.session_max_open_files=30                   | *.session_max_open_files=20     *.sga_target=4G                           | *.sessions=2000     *.standby_file_management='AUTO'                  | *.sga_max_size=2600M                                       > *.sga_target=2600M                                       > *.sort_area_size=524288                                       > *.star_transformation_enabled='FALSE'     *.streams_pool_size=50331648                    *.streams_pool_size=50331648                                       > *.timed_statistics=TRUE     *.undo_management='AUTO'                    *.undo_management='AUTO'     *.undo_retention=18000                        | *.undo_retention=21600     *.undo_tablespace='UNDOTBS1'                    *.undo_tablespace='UNDOTBS1'


title: openSuse, new user cannot login

text: I am using openSuse 12.3. I have created a new user using:               linux-amvn:~ # useradd -m -G users,dev -s /bin/bash -p pass123 harbir-PC      The user `harbir-PC` is not able to login, when I try to log using `ssh`. I went ahead and looked into the `/etc/passwd` file and I see the following:               harbir:x:1000:100:harbir:/home/harbir:/bin/bash     kdm:x:489:487:KDM Display Manager daemon:/var/lib/kdm:/bin/false     harbir-PC:x:1001:100::/home/harbir-PC:/bin/bash      There is a difference between the user `harbir` and `harbir-PC`. I have no problem with the user `harbir` (who I have created during installation), but I need to login using the user `harbir-PC`. I also checked the `/etc/shadow`, and passwords are encrypted.


title: Handle local links to local files in emacs

text: I have a `LaTeX` document where I often have to insert pathnames of files on my machine of other `LaTeX` files. Is there a way in `emacs` do get the following:   1. A command which opens a file selection dialogue such that the choosen filename + path will be inserted at point.   2. A macro which opens the file under point. For example when the point is on `~/mytex.tex` and I press a certain key sequence it should open `~/mytex.tex` in a new buffer.   3. A macro which opens the corresponding `pdf` file of `tex` filename under point in `evince`, for example `~/mytex.pdf`.   4. A command which opens a file selection dialogue to change the filename under point. It is important to have the file-path names in a plain style because they should be proceed by latex as well.


title: run a script at shutdown in Debain

text: I am using Debain wheezy. My problem is , I am using a limited 2.5 GB net connection. My idea is simply running a script as               #!/bin/bash     date >> ~/mydatausage.txt     ifconfig -a >> ~/mydatausage.txt      at the time of shutdown.   * how to run this script at shutdown    * this script needs to run as root, how can I achieve this ?  Thanks in advance.


title: Change directory based on a pipeline's output

text: I want to go to a directory with using filter For example there is a file named `this-is-awsome`               ls | grep this-is-awsome | xargs cd      How can I go to a directory with filter?


title: Can I recursively print all current remote shells?

text: Is there a way to print out all of the local and remote shells I am currently in, recursively? For example, on my local machine, I will ssh into another machine. From there, I may switch users (opening another shell). Then I ssh to my local machine again, etc. And to complicate matters, I'll generally have multiple tabs (and even windows) of shells, so I can't usually remember my trail for each one. What I would like is to have each of those sessions print out in order where I am. Or at least what shell I will be kicked back into if I `exit` the current shell. After a few days or weeks of having multiple shells open, I have no idea where I will be sent if I type in `exit`. Will my shell window close (because I'm at the 'root' shell)? Will I be kicked back to another server? In other words, I'd like a trace of my SSH hops.


title: Linux : how to redirect stdout & stderr to logger?

text: I have a program I need to run at startup, it has output on stdout and stderr that I want to redirect to the system log using the logger command. What I have in my startup script is thie:               /home/dirname/application_name -v|logger 2>&1 &      This is redirecting the stdout to syslog just fine but stderr is coming to the console, so I need some help on refining the command.


title: memtester runs faster after couple of runs

text: I am using this test tool : http://pyropus.ca/software/memtester/ And I noticed that first 3 iterations take 4 hours but 30 iterations take only 12 hours. I was hoping that 30 iterations will take 40 hours. I looked at the code and I am surprised, because you see there is no file system i/o involved in this case and all it does is run bunch of tests on malloc'ed memory. Any pointers to the cause would be appreciated?


title: How to change from csh to bash as default shell

text: I have `csh` as my default shell, as shown by `echo $SHELL`. I want to switch to `bash` as my default shell. I tried the following approaches to no avail:   1. chsh. I get:              chsh: can only change local entries; use ypchsh instead.        2. ypchsh. I get:              ypchsh: yppasswdd not running on NIS master host ("dcsun2").      I only have `.chsrc` in my home directory and I cannot find any `.profile` files in `/etc`. How can I change my default shell to `bash`?


title: Bluetooth mouse disconnects every ~30 seconds

text: I am running Linux Mint 16 Petra, and I have a Bluetooth mouse that I would like to use with it. Unfortunately, the mouse disconnects around every 30 seconds and has to be rebooted by physically turning the power button on the mouse off and on again to reconnect. The Bluetooth adapter is identified as a `ASUSTek Computer, Inc. BT-253 Bluetooth Adapter`. How can I make the mouse stay connected?


title: /home partition

text: I am facing the following doubt. I installed Arch time ago with a home separate partition. My issue is that I need to reinstall the system and I don't have a backup of my `/home`. Would a new installation overwrite my home and leave it empty or keep my current files? The question is because theorically keeping the data is the main purpose of having one I guess, but it happened to me before that left my home partition empty as new (had a back-up before, but not now). In the installation, when specifying the mounting points, I selected home as `/home` mounting point and deleted the previous data it had. I will appreciate if someone passed through a similar issue and knows for sure a safe way of reinstalling the system, selecting home mounting point in `/home` partition and managed to keep the old home data intact. Would installing the system with home included in the partition A `/` and then manually specify in fstab partition B `/home` mounting point the cleanest/safer way to do it? EDIT: I finally backed up my data there as is the only real safe thing to do, and I dont feel so comfortable with luck. Anyway my old home partition I will divide it again, will left around 5 GB partition just to have my recovery partition and avoid having to deal with this again. I'm not sure if its correct to ask it here or should I open a new question but my doubt is if I copy `*.*` from my fresh installation `/` to my new 5 GB recovery partition, next time I run into a similar situation, I just boot with a live USB and copy `*.*` from recovery partition to normal `/` partition and it is restored as brand new, am I right?


title: rtorrent: Can't connect to trackers on CentOS 5.6

text: I'm trying to set up rtorrent on my CentOS 5.6 server, and it currently cannot connect to any trackers. I compiled `libtorrent-0.12.6` and `rtorrent-0.8.6`. I also compiled `libcurl 7.21.7` with `c-ares 1.7.5` because the in-repo version of curl didn't have c-ares so it couldn't resolve tracker host names (not asynchronously at least). I forwarded ports 6890-6999 through iptables using the following in `/etc/sysconfig/iptables`:               -A INPUT -p tcp --destination-port 6890:6999 -j ACCEPT     -A OUTPUT -p tcp --source-port 6890:6999 -j ACCEPT      But even if I stop iptables it doesn't work. When I start rtorrent it will say something like `Connecting to http://torrent.fedoraproject.org:6969/announce`, then quickly followed by `Couldn't connect to server`. I know there isn't much information about why it can't connect, but is there a way I can find out? **Edit** I tried rtorrent on my local machine running Fedora 15 using all in- repo software and I have the same problem. But ktorrent runs on Fedora 15 with no problem.


title: Books/Resources which explain TCP/IP kernel implementation

text: I only know about: 1) Internetworking with TCP/IP: Vol.II, Design, Implementation, and Internals 2) TCP/IP Illustrated, Vol. 2: The Implementation but these are quite dated. I am particularly interested in Open source implementations. Any ideas? EDIT: I found another book 1) TCP/IP Architecture, Design and Implementation in Linux


title: Files uploaded as root to the web server can't be overwritten by web application

text: Here is my problem. I am developing a web application in PHP/MySQL and I am having some problems setting up the accounts I need to use. Development workstation: WinXP SP3, Eclipse PDT Development server: Debian 6.0, Apache2, MySQL 5, XDebug Connected through a LAN. While I am developing I upload code that needs to be tested to the server. I use GIT and ssh:root@myserver. As expected, the files end up being owned by root in the server. My web application needs to update some of the files. To allow that I ran chmod in the server to change ownership of the files to www-data. This works fine. The problem is that every time I change a file and upload it again it reverts back to root ownership and I have to manually change it back to www-data. I don't think this will be a problem in the production environment because I can ensure the files will have the correct ownership when they go live. However it is a pain the development process. What I am thinking: 1 - I probably should not be uploading with a root account. I tried connecting to the server through ssh using the user www-data. However it asks for a password and after some reading I found out that it is probably not a good idea to mess with www-data user. 2 - I could probably create another account for development purposes and upload the files with that account. The problem is that I don't know how to configure my web application to use that account when connecting to the server and database. 3 - I could probably configure my application and database to run as root in the development environment. This would resolve the problem. However as stated in 2 above, I don't know how to do it and I something tells me that this would not be a good idea. So I am looking for advice on how to solve my problem. I could go with any one of the three alternatives above (or even a 4th one that I haven't considered). Thanks. ### Update - 2011-09-13 One solution from the responses below (thank you cdp1337) is to run a script to update the file permissions when I upload files to the development server. In my case, I could run               chown -R www-data:www-data *      in the root of my website. **_NOTE: this is NOT in the production environment and the development web server cannot be accessed outside our company. This is not a solution to deploy to production environment._** Any other ideas? Thanks.


title: What is the equivalent of update-modules in CentOS 6.4?

text: I am adding files to `/etc/modprobe.d`, and a README of some software that I'm installing advised to run `update-modules` afterwards.               $ sudo update-modules     -bash: update-modules: command not found      What is the equivalent of this program in CentOS 6.4? Or is `update-modules` deprecated? What is the new program called?


title: In an empty environment, how are executables found?

text: For experimentation purposes I created a binary that prints the `$PATH`, and calls `which` as follows:               #include <stdlib.h>     #include <stdio.h>          int main() {         char *path = getenv("PATH");              if (path)             printf("got a path: %s\n", path);         else             printf("got no path\n");              system("which which");         return 0;     }      when I run it in an empty environment via               env -i ./printpath      I get the following printout:               got no path     /usr/bin/which      My question is: **why is the correct`which` binary called, even if there is no `$PATH`?**


title: "$!" is used for?

text: While going through:               info coreutils 'dd invocation'      I came across:               dd if=/dev/zero of=/dev/null count=10MB & pid=$!      What is `$!` used for?


title: How to force crontab to check for changed files

text: I have a gentoo Linux system in which I am logged in as root. How can I force `crontab` to read new/changed files in `/etc/cron.d` immedeately, so that even a new cronjob is executed if even only seconds away?


title: I quite like mercurial .hgignore-style globbing. Is there a Linux shell that supports it?

text: I quite like mercurial .hgignore-style pattern globbing. > Globs are rooted at the current directory; a glob such as *.c will only > match files in the current directory ending with .c. > > The supported glob syntax extensions are ** to match any string across path > separators and {a,b} to mean "a or b". Is there a Linux shell that supports this?


title: Why gnustep-config outputs nothing for any parameter?

text: Regardless of what I run:               gnustep-config --debug-flags     gnustep-config --objc-flags     gnustep-config --base-libs      It outputs nothing. How would I debug this? PS: the OS details: Ubuntu 12.04.2 LTS, gnustep-make-2.6.1-1 PPS:               zerkms@ubuntu-1204-2-server-amd64:~$ . /usr/share/GNUstep/Makefiles/GNUstep.sh     zerkms@ubuntu-1204-2-server-amd64:~$ gnustep-config --debug-flags     zerkms@ubuntu-1204-2-server-amd64:~$ gnustep-config --base-libs     zerkms@ubuntu-1204-2-server-amd64:~$ gnustep-config --objc-flags      and after executing `GNUstep.sh` there are a lot of `GNUSTEP_*` environment variables added:               GNUSTEP_IS_FLATTENED=yes     GNUSTEP_LOCAL_ROOT=/usr/Local     GNUSTEP_HOST=x86_64-pc-linux-gnu     LD_LIBRARY_PATH=/home/zerkms/GNUstep/Library/Libraries:/usr/local/lib:/usr/lib     GUILE_LOAD_PATH=/home/zerkms/GNUstep/Library/Libraries/Guile:/usr/local/lib/GNUstep/Libraries/Guile:/usr/lib/GNUstep/Libraries/Guile     GNUSTEP_MAKEFILES=/usr/share/GNUstep/Makefiles     GNUSTEP_NETWORK_ROOT=/usr/Network     GNUSTEP_FLATTENED=yes     GNUSTEP_HOST_OS=linux-gnu     GNUSTEP_HOST_VENDOR=pc     PATH=/home/zerkms/GNUstep/Tools:/home/zerkms/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games     GNUSTEP_HOST_CPU=x86_64     GNUSTEP_USER_ROOT=/home/zerkms/GNUstep     GNUSTEP_SYSTEM_ROOT=/usr/System     GNUSTEP_PATHLIST=/usr/System:/usr/Network:/usr/Local:/home/zerkms/GNUstep     CLASSPATH=/home/zerkms/GNUstep/Library/Libraries/Java:/usr/local/lib/GNUstep/Libraries/Java:/usr/lib/GNUstep/Libraries/Java     INFOPATH=/usr/share/info::/usr/local/share/info::/home/zerkms/GNUstep/Library/Documentation/info:


title: Cannot find Audio Hardware for my Workstation

text: Audio is NOT working in HP workstation xw 4600. I cannot find any hardware present at > System-> Preferences -> Sound -> Hardware (Tab) The command `lspci -v` shows following output of Audio Device:               01:00.1 Audio device: nVidia Corporation Device 0bee (rev a1)         Subsystem: ZOTAC International (MCO) Ltd. Device 5194         Physical Slot: 2         Flags: bus master, fast devsel, latency 0, IRQ 5         Memory at fa000000 (32-bit, non-prefetchable) [size=16K]         Capabilities: [60] Power Management version 3         Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+         Capabilities: [78] Express Endpoint, MSI 00         Kernel modules: snd-hda-intel      And when I am configuring via `alsamixer` and press tab **F6** [Select Sound Card], there is only one **default** option is present. **Update 1:** The output of the commands shows no hardware present ! is it True?               [root@target ~]# cat /proc/asound/cards        --- no soundcards ---       [root@target ~]# rmmod snd-hda-intel; modprobe snd-hda-intel       ERROR: Module snd_hda_intel does not exist in /proc/modules      Is my hardware NOT properly installed OR I need proper drivers? If so, which?. **Update 2:** After reconnecting the hardware and following _Gilles_ instructions, the output is as below: > [root@target ~]# modprobe snd-hda-intel   >  [root@target ~]# lsmod |grep '^snd_hda_intel'   >  snd_hda_intel 25771 0   >  [root@target ~]# uname -rv   >  2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010   >  [root@target ~]# I **still** don't know which drivers should I install for proper functioning of this card, please help! **Update 3:** Yes, I have tried configuring with alsaconf. But I get following errors:   `[root@target ~]# alsaconf`   ![enter image description here](http://i.stack.imgur.com/2z3N6.png)   ![enter image description here](http://i.stack.imgur.com/uDugg.png)   ![enter image description here](http://i.stack.imgur.com/n5m1B.png) and after this I got following Error Output. > [root@target ~]# alsaconf   >  ERROR: modinfo: could not find module snd-opl3sa2   >  ERROR: modinfo: could not find module snd-cs4236   >  ERROR: modinfo: could not find module snd-cs4232   >  ERROR: modinfo: could not find module snd-cs4231   >  ERROR: modinfo: could not find module snd-es18xx   >  ERROR: modinfo: could not find module snd-es1688   >  ERROR: modinfo: could not find module snd-sb16   >  ERROR: modinfo: could not find module snd-sb8   >  [root@target ~]# Still NOT getting any hardware information:   ![enter image description here](http://i.stack.imgur.com/NUSoo.png)


title: Centreon Web Interface Slow

text: Our Centreon web interface is so slow ! about 3/4 mins to have my click's results ... While Nagios is working perfectly ... Thanks to Google, i guess it comes from mysql. But I can't understand anything with it ... If someone already solve this, would be perfect ! Thanks, Nico. P.S : also posted on centreon forum, and server fault P.S2 : can't add Centreon as tag, not enough reputation.


title: FFmpeg-php installation error on CentOS 6 x64 bit

text: I'm trying to install `ffmpeg` and `ffmpeg-php`. FFMpeg installed perfectly. When I try to install `ffmpeg-php`, I'm running `./configure` and it's configured fine. However, when I run `make` it gives me the following error:               /bin/sh /usr/local/src/ffmpeg-php-0.6.0/libtool --mode=compile cc  -I. -I/usr/local/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/  -DHAVE_CONFIG_H  -g -O2 -Wall -fno-strict-aliasing   -c /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c -o ffmpeg_movie.lo      cc -I. -I/usr/local/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c  -fPIC -DPIC -o .libs/ffmpeg_movie.o     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie___construct’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:311: error: ‘list_entry’ undeclared (first use in this function)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:311: error: (Each undeclared identifier is reported only once     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:311: error: for each function it appears in.)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:311: error: ‘le’ undeclared (first use in this function)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:346: error: expected ‘;’ before ‘new_le’     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:356: error: ‘new_le’ undeclared (first use in this function)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie_getComment’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:531: warning: ‘comment’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:760)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:531: warning: ‘comment’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:760)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie_getTitle’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:546: warning: ‘title’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:757)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:546: warning: ‘title’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:757)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie_getAuthor’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:561: warning: ‘author’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:758)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:561: warning: ‘author’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:758)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie_getCopyright’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:575: warning: ‘copyright’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:759)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:575: warning: ‘copyright’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:759)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie_getAlbum’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:590: warning: ‘album’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:761)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:590: warning: ‘album’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:761)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie_getGenre’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:604: warning: ‘genre’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:764)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:604: warning: ‘genre’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:764)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie_getTrackNumber’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:619: warning: ‘track’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:763)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘zim_ffmpeg_movie_getYear’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:632: warning: ‘year’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:762)     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function ‘_php_read_av_frame’:     /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_movie.c:1215: warning: ‘avcodec_decode_video’ is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:3656)     make: *** [ffmpeg_movie.lo] Error 1      My OS is CentOS 6.4 x86_64 virtuozzo – VPS. How can I fix this?


title: What is the meaning of the errors from my cpio command?

text: I have been using the following command on my system to create the .cpio archive to create an initramfs for my embedded target device               sudo find . | cpio -H newc -oc > ~/initramfs.cpio      This has always worked for me without any problem. Yesterday I was generating a new archive and I received the following error:               cpio: Archive format multiply defined: Operation not permitted     cpio: ./etc/shadow: Function open failed: Permission denied     cpio: ./usr/lib/ssh-keysign: Function open failed: Permission denied     64842 blocks      I never received these errors in the past, the files mentions with failed opens have not been touched either so I cannot understand why this has started happening. I update my host system with Ubuntu package manager so it is possible that my `cpio` package has been updated too. I obviously have no faith in the initramfs generated here due to all of the errors which confuse me greatly. The only option I can think of is to try and find out if my `cpio` version has changed and if so remove and replace with the older version I had. Is there any way I can find out this information on my system (Ubuntu 12.04)? Or is there some other way I can get around this problem?


title: Permissions on an ext4 filesystem on a removable drive used in different machines

text: I have a USB flash drive with `ext4` file system and its files are owned by my user on my local machine, for example by `myuser@myhost` with `700` permissions. If I unplug my flash drive and plug it in other Linux machine, can users of that machine have access to files in the flash drive? What if there is also a user named `myuser`, can he access those files?


title: Automatically mount encrypted home folder on login

text: I'm looking into encrypting my home folder with Truecrypt, and mounting it after I've logged in, which should be pretty straightforward. However, it occurred to me that it should be theoretically possible to mount it _as_ I'm logging in, as long as my account password is the same as my Truecrypt password. Is there a way to get PAM to run a command on login and pass the command my password as an argument? Or is there some other way to accomplish the same effect, without me needing to provide the password multiple times?


title: How to find out how fc-match matches?

text: When I run `fc-mach Sans`, it returns `DejaVuSans.ttf: "DejaVu Sans" "Book"` but if it is run like `fc-match "Sans "` or `fc-match "Sans 9"` it returns `unifont.ttf: "unifont" "Medium"`. I prefer to always use DejaVu Sans but I can't figure out why fontconfig selects unifont. Neither the global nor the local config seems to mention unifont (`grep -ri unifont /etc/fonts/ ~/.fonts.conf` returns nothing). Playing with LC_DEBUG didn't help me either. Is there a way to get the information why fontconfig behaves like this?


title: How can I set environment variable permanently through shell script?

text: Let's say I have a script:               #!/bin/bash     echo $1     if [[ ! $1 ]];then     echo "True"     fi     export ABC="/home/aashish"      `ABC` is not available after the execution of this script. How can I make that variable persist after the execution as well?


title: Is it possible to change password database file(/etc/passwd) in linux?

text: Is it possible to change password database file(`/etc/passwd`) to some other file. How does this authentication mechanism work internally ? Does it depend on pam ?


title: Literally grep the only word in a line

text: I know `grep -F` can search for literal strings, but I want to do something like               while read word; do       grep -F "^$word$" FILE;     done < wordlist      i.e. the words need to be treated literally, at the same time, `^` and `$` conditions need to be satisfied. How to do this?


title: how to create php-fastcgi.sock for Nginx

text: I've installed Debian Wheezy and downgraded php5.4 to php5.3, and wanted to use fastCgi instead of php-fpm since it is not included in php5.3 package. now I run into a little issue and can't seem to find a way around it. This issue is unix:/var/run/php-fpm/php-fpm.sock can't be created. I have created a file for UNIX socket **/usr/bin/php-fastcgi**               #!/bin/bash          FASTCGI_USER=www-data     FASTCGI_GROUP=www-data     SOCKET=/var/run/php-fastcgi/php-fastcgi.socket     PIDFILE=/var/run/php-fastcgi/php-fastcgi.pid     CHILDREN=6     PHP5=/usr/bin/php5-cgi          /usr/bin/spawn-fcgi -s $SOCKET -P $PIDFILE -C $CHILDREN -u $FASTCGI_USER -g $FASTCGI_GROUP -f $PHP5      And this my Nginx vhost:               server {         server_name www.mydomain.com mydomain.com;         root /srv/www/www.example.com/public_html;              location / {             index  index.html index.htm;         }              location ~ \.php$ {             include /etc/nginx/fastcgi_params;             fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket;             fastcgi_index index.php;             fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;         }     }      The main issue is always this:               connect() to unix:/var/run/php-fastcgi/php-fastcgi.socket failed (2: No such file or directory)      And this is for Enable and Start fastcgi service:               #!/bin/bash     ### BEGIN INIT INFO     # Provides:          php-fcgi     # Required-Start:    $nginx     # Required-Stop:     $nginx     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: starts php over fcgi     # Description:       starts php over fcgi     ### END INIT INFO          (( EUID )) && echo .You need to have root priviliges.. && exit 1     BIND=127.0.0.1:9000     USER=www-data     PHP_FCGI_CHILDREN=10     PHP_FCGI_MAX_REQUESTS=10000          PHP_CGI=/usr/bin/php-cgi     PHP_CGI_NAME=`basename $PHP_CGI`     PHP_CGI_ARGS="- USER=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND"     RETVAL=0          start() {           echo -n "Starting PHP FastCGI: "           start-stop-daemon --quiet --start --background --chuid "$USER" --exec /usr/bin/env -- $PHP_CGI_ARGS           RETVAL=$?           echo "$PHP_CGI_NAME."     }     stop() {           echo -n "Stopping PHP FastCGI: "           killall -q -w -u $USER $PHP_CGI           RETVAL=$?           echo "$PHP_CGI_NAME."     }          case "$1" in         start)           start       ;;         stop)           stop       ;;         restart)           stop           start       ;;         *)           echo "Usage: php-fastcgi {start|stop|restart}"           exit 1       ;;     esac     exit $RETVAL      I'm wondering what is missing?? any comment is appreciated!!


title: I/O schedulers for normal harddisks

text: For me figuring out what is the best choice for I/O in kernel was a challenge. First I learned that it is subjective then it is depend upon the File-System you use. **I know you should use`No-op` for Solid Sate Drives or SSD s for sure.** What I want to know is the best choice for normal (rotating) HDD containing ext4 and NTFS File systems. (MBR style). And does GPT or MBR style has any effect on the choice I make?


title: Can inotify be used to watch for a specific file to be created without monitoring the entire directory?

text: I want to be notified when a specific filename is created. I'm looking at `inotify`. The `IN_CREATE` flag is available for monitoring a directory for any changes within it, but I'd prefer not to monitor the entire directory since there may be a good deal of activity in that directory besides the file I'm interested in. Can this be done?


title: Apache refuses to start on any port

text: I can't seem to get Apache to start on any port. I'm always getting the error:               apache2(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80      I checked to make sure that nothing is running on port 80 with `netstat -plant|grep 80` and I even ran `sudo nc -l 80` with no problems just to be certain. I thought maybe it might be a permissions thing (it shouldn't since it should be starting from an initscript), so I changed the listening port for Apache to 8080, and got the same error except on port 8080 (and nothing is running on that port either). I even tried setting `ports.conf` to have `Listen 127.0.0.1:80` and even `Listen 127.0.0.1:8080` and still more or less the same error except for showing the corresponding address and port. I should note that I'm on Debian Unstable. At this point, I'm at a loss for what else to check.


title: Is there logitech gaming mouse programming software for any Linux Distro?

text: I happened upon an unopened Logitech G502 programmable gaming mouse. I would like to program buttons to do things like write commonly used lines in programs (which I know is possible in Windows; my college roommate did it earlier this year). The problem is, the device is meant to be programmed by software designed explicitly for Windows. The website download page only offers versions for different versions of Windows. A quick Google search yields nothing useful. Does anyone know if there is Linux/Unix software available for programming the mouse? I am using Fedora 20, but knowledge of any software for this mouse which will run on a Linux OS would be useful. The mouse's defaults work when simply plugged in (scroll, clicking/moving pointer, and page fwd/bkwd).


title: how to parse a file that is changed continuously using awk?

text: for example if we have a file contains :               Hello world     Hello earth     Hi everybody      we can easily parse it to get the first and second columns of the lines contains the word `Hello` using `awk`:               awk '/Hello/ { print $1 }' file     awk '/Hello/ { print $2 }' file      What if the content of the file is changed:               Hello world     Hello earth     Hi everybody     Hello sky     Hi madame     Hello USA      How can we parse only the new entries added to this file (using `awk`):               Hello sky     Hi madame     Hello USA      without re-parsing the already parsed Information?               Hello world     Hello earth     Hi everybody


title: load program/module at boot

text: I'm trying to load a program I wrote at boot. The program is also a module.ko and a small bash script. For the module I tried doing `depmod mymodule.ko` and `modprobe -a` and messing around with modprob libaries and .conf files without any success. So, I wrapped it all (module and my executed program) in a bash script. I tried to load it at boot with rc.d. I failed this one too cause I think rc.d runs only executed files and not bash. If I'm right how do I change my bash file to an executed one? And install it in rc.d too? Is my strategy right? Thank you all in advance :) *working on Linux CentOS


title: What firmware works with a D-Link DIR-600?

text: I'm planning on getting a D-Link DIR-600 to be used as a WLAN access point, and for WEP/WPA certificate management. I know it works with DD-WRT, and OpenWRT, but not Tomato. Now, I've been looking what firmware I can put on that device, prior to getting it. Tomato is my favorite option, but since it doesn't work with the router, I'm getting second thoughts about getting it at all. If you happen to have a better suggestion for a router, please do so, but I'd like to stay in the same price range as the DIR-600 (around 25€).


title: In new users's home directory create sub-directory with a specific group and permissions

text: Linux will copy the the contents of `/etc/skel` when a new user is created. I want to have a sub-directory in each user's home directory, `MyStevedore`. I want this directory to have the owner be the new user and the group to be the group `stevedore` with the permissions `drwxrwxr-x`. The user is not a member of the group `stevedore`.


title: Default username for Samba share that is not the user name on the client system

text: When mounting a Samba share the user name is defaulting to the user name from the client machine rather than the "User Name" field from the earlier "Connect to Server" dialogue. Accessing a Samba share over ssh from Linux with Nautilus where the client user name is "lfm" and the user name on the server system is "lastfirstmiddle":               $ who | awk '{print $1}'     lfm     lfm     $ sudo ssh lastfirstmiddle@example.com -L 445:samba.example.com:445 -L 139:samba.example.com:139 -f -N     [sudo] password for lfm:      lastfirstmiddle@example.com's password:     $ nautilus      The user home share does not exhibit the problem. The password dialog is using the user name as specified in the "Connect to Server" dialogue as expected:               lfm - File Brower     Location: [/home/lfm]     File>Connect To Server...>          Connect To Server     Service type: [Windows Share]     Server: [localhost]     Share: [lastfirstmiddle]     User Name: [lastfirstmiddle]     Domain Name: [example-com]     <Connect>          Password required for share lastfirstmiddle on localhost     [x]Forget password immediately     Password: [*******]     <Connect>          lastfirstmiddle on localhost - File Browser     Location: [smb://example-com;lastfirstmiddle@localhost/lastfirstmiddle/]      Using the "Connect to Server" dialogue one can get a list of "Windows Shares" by leaving the "Share" field blank.               lastfirstmiddle on localhost - File Browser     File>Connect To Server...>          Connect To Server     Service type: [Windows Share]     Server: [localhost]     Share: []     User Name: [lastfirstmiddle]     Domain Name: [example-com]     <Connect>          Password required for share lastfirstmiddle on localhost     [x]Forget password immediately     Password: [*******]     <Connect>          On localhost - File Brower     Location: [smb://localhost/]      Then select a share and "Open with Open Folder" produces the "Connect to Server" dialog which unlike the previous case defaults the "User name" to the user on the client system. It does not pick up the value used in the "Connect to Server" dialogue that produced the list of shares.               On localhost - File Brower     Location: [smb://localhost/]     ----------- ---- ----    -----     Name        Size Type    Date     ----------- ---- ----    -----     AShare      --   Folder Unkown     BShare      --   Folder Unkown     CShare      --   Folder Unkown     {{XShare    --   Folder Unkown}}     YShare      --   Folder Unkown     ZShare      --   Folder Unkown     File>Open with Open Folder>      One can use "Connect to Server" and specify a "Bookmark" which can be used later to mount a share without having to compete the "Connect to Server" dialog each time. To have access to all six shares listed above (ABCXYZ) one would need to create six bookmarks. This might be OK for six shares but if there are dozens of shares this would be a bit obnoxious. Is there a way to change the default user name to something other than the client system's user name?


title: How can I best copy large numbers of small files over scp?

text: I have a directory that's got several gigabytes and several thousand small files. I want to copy it over the network with scp more than once. CPU time on the source and destination machines is cheap, but the network overhead added by copying each file individually is huge. I would tar/gzip it up and ship it over, but the source machine is short on disk. Is there a way for me to pipe the output of `tar -czf <output> <directory>` to scp? If not, is there another easy solution? My source machine is ancient (SunOS) so I'd rather not go installing things on it.


title: How to deliberately activate cooling fan of laptop?

text: Hi I have a laptop (Fujitsu Siemens Amilo 4000), I'd like to control the cooling fan manually. How do I do that? `/proc/acpi/fan/` is empty, the fan is otherwise working well. Distro is Fedora 14.


title: internal speaker not working ubuntu 10.10

text: I have a dv6000 laptop . My speaker and mic were working few days ago . But now only external speaker works. Can anyone suggest me some solutions please. Thanks.


title: Why would SSH server not accept forwarded Kerberos ticket?

text: I have an environment where I can SSH in using forwarded Kerberos credentials (using ASP.NET delegation), however in another I cannot. I have               GSSAPIAuthentication yes      in the ~/.ssh/config on each machine, in fact both files on each machine are identical. Are there any other settings that could contribute to this behavior? I'm on Red Hat Enterprise Linux Client release 5.3 (Tikanga) where it's not working and CentOS release 5.7 (Final) where it is working both have OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008


title: Why does only mplayer play music in Debian?

text: I installed Debian 7. I wanted a music player, so I tried `banshee`, `xine`, `amorak`, `exaile`, `mp3blaster`, `totem`, `lxmusic`, `xmms2`. After trying all of these, the only that would play any sound was `mplayer` and various other software based on `mplayer`, such as `gnome-mplayer`, `gmplayer`, etc.   * I installed all necessary dependencies, recommendations, and suggested software listed for the other music players.   * I solved the codec problems for the other software. When played, the timers moved, but there was no sound. What makes `mplayer` different from the other players that allows it to play audio?


title: Bandwidth improvements expected from switching to Wayland or Mir?

text: I was intrigued by this answer regarding why X is not scalable. I'm unable to find any specific speed comparisons between x forwarding on these different protocols. How much % gain in network speeds should I expect and will these be at a compromise of significant memory/CPU resources? I'm into low resource computing, but about to transfer to a country with worse internet than Japan and fear I may have to compromise power for speed.


title: Is there a difference in resource use/requirements between Ubuntu and Debian versions of Linux Mint (under the same DE)?

text: I intend to use Linux Mint on a RAM/1GB laptop. I'm used with Xfce and LXDE and I see that both Linux Mint 14 Nadia and Linux Mint Debian have Xfce versions. Is there a reason to prefer one to the other - from this point of view?


title: how to limit dma address to specific range in linux kernel?

text: I want to limit the dma address the device can access to 0x0100_0000~0x03ff_ffff. But I don't know how to set the `dma_mask` and `coherent_dma_mask`. It's easy to set the "dma mask" for a range start from 0. Can anybody help about this?


title: fdisk -l shows ext3 file system as HPFS/NTFS

text: I have an external HDD which I formatted as NTFS partition in Windows. Now, I formatted this HDD in my linux system using the below command.               mkfs.ext3 /dev/sdb1      It was formatted successfully. However, when I run the `fdisk -l` command, it gives me the system as NTFS/HPFS.                  Device Boot      Start         End      Blocks   Id  System        /dev/sdb1               1      121601   976760001   83  HPFS/NTFS      However, the command `df -T /dev/sdb1` was still giving me the file system type as `ext3`. Why is it not showing me the system as Linux when I run the `fdisk -l` command?


title: Ubuntu crontab php not working

text: Yes, I have read many, many documentations but I can't get it to work. I have a simple single php file which I want to run once or twice in a minute. My php file is called: cronjob_refresh.php and I'm using Ubuntu 12. After typing > crontab -e I'm getting in terminal: > root@cron:~# crontab -e > > no crontab for root - using an empty one > > 888 I don't know what '888' is meaning... And I'm writing (after 888) my cronjob string > */1 * * * * php /var/www/cronjob/cronjob_refresh.php After hitting enter I'm getting '?' symbol after the cronjob string entered. > root@cron:~# crontab -e > > no crontab for root - using an empty one > > 888 > > */1 * * * * php /var/www/cronjob/cronjob_refresh.php > > ? Then I hit CTRL + Z to exit. After all this I'm executing > crontab -l to check if the cronjob is added to my cronjob list but it's saying that the list is empty. I don't know what I'm doing wrong. Also I wan't to execute twice in a minute, 30 - 30 sec. How to set the cronjob? I want to log everything in a file named logs.log in the same directory, is this is possible?


title: Finding dependencies for a compiled C++ program

text: I wrote and compiled a C++ program using Qt Creator in Ubuntu 13.10 (32 bit). I tried to run the compiled program in a newly installed Ubuntu 13.10 (64 bit). But it is not run. I think the problem is with dependencies. How can I find (=know the name and version of) necessary dependencies?


title: Why doesn't grep ignore binary files by default?

text: The manpage for `grep` describes the `-I` flag as follows: `-I Ignore binary files. This option is equivalent to --binary-file=without- match option.` It also says this about binary files: `\--binary-files=value Controls searching and printing of binary files. Options are binary, the default: search binary files but do not print them; without-match: do not search binary files; and text: treat all files as text.` I cannot think of a scenario where I would care about matches in binary files. If such a scenario exists, surely it must be the exception rather than the norm. Why doesn't `grep` ignore binary files by default rather than requiring setting this flag to do so?


title: How to migrate data from server to server with as little downtime as possible?

text: I have a server running dovecot using the maildir format with a fairly large userbase (10k users or so) with each user having around a GB quota. The actual mail directories are stored on a separate storage system that our email server mounts via NFS. Due to performance issues on our storage system, we are upgrading to a new storage system. We have been rsyncing data from the old system to the new system directly, but this process still takes a rather lengthy amount of time (16+ hrs). Our plan is to run rsyncs back to back, after the second one finishes, immediately take down dovecot/qmail/etc on the mail server, switch mount locations to the new system, and bring email back up. That'd only total a minute or two for downtime with luck. The problem is any E-Mail that came in while the last rsync was running is still not going to be copied over. So, to alleviate this, after the switch we would rsync again without the --delete flag we typically use. There are some issues with this, but the biggest from my perspective is users not having access to email they JUST had right before the switch. Does anyone have a suggestion on how to do this with having very minimal downtime still and NOT losing out on the data for any amount of time? The old storage system is a NetApp, the new system is just a freebsd box with a large san attached, and the email server is Ubuntu. It feels to me like there should be a way to overlap the storage systems from the user's perspective until the migration is complete, but I simply don't have the knowledge on how to do such a thing if it's even possible.


title: How can I upgrade MySQL in Debian using apt-get?

text: I'm using the Turnkey Linux virtual machine. The version of Debian in there is apparently on the "Wheezy" upgrade path (if that's what you call it). I'm not completely comfortable with Linux, as you can see. I need some new features that MySQL 5.6 offers, while my current installation is MySQL 5.5.35. I'd like to get the latest version (5.6.17 as of this posting) or at least any 5.6.x. I've tried `apt-get update`, `apt-get upgrade`, `apt-get dist-upgrade`. These updated a bunch of things successfully, but none were MySQL. I tried `apt-get upgrade mysql-server`, which says I already have the latest version. A Debian Wheezy package repository list on the web shows MySQL 5.5 and nothing else, when I need 5.6. I then read something about "backports", which sounds like it might be able to get me things that my particular Debian isn't supposed to have yet -- but I can't seem to get it working. It requires adding lines to `/etc/apt/sources.list.d/sources.list`. When I try doing that, then running `apt-get update`, I get 404 errors. I've tried several other routes as well, one being compiling the vanilla MySQL download, which I failed at miserably and would rather not try again. I'm positively baffled at how this is done. Most of the URLs listed on forums/blogs for `apt-get`, and even for `wget`, seem to die soon after they're posted, so I can't understand how anyone even goes about finding the right information. I've been trying to do this for two days straight now and can't get anywhere. So assuming you've read this far, I would love to know if anyone has any way of upgrading MySQL in Debian in some relatively painless automated way (one where I wouldn't have to use `make` or export/import my current databases and configs manually).


title: I hit Ctrl+d while in a screen session, how do I now send commands?

text: I was trying to `Ctrl``a``d`, and failed miserably and input `Ctrl``d` instead, now the screen won't respond to my commands. They appear, and the app running in the screen (a minecraft server) is still ticking along nicely, but I can't issue the server commands. `Ctrl``a``d` works and reconnecting with `screen -r -d -S minecraft` works fine, but no commands register. Any way to regain control?


title: theharvester.py "No such file or directory"

text: I just installed Kali Linux as a virtual machine in VMware Fusion, and I was following along in Patrick Engebretson's _The Basics of Hacking and Penetration Testing, 2nd Edition_ , in which I was prompted to open "The Harvester" in Kali. As instructed in the book, I tried the following command at top level in the terminal:               ./theharvester.py –d syngress.com –l 10 –b google      To which the system reported:               bash: ./theharvester.py: No such file or directory      Wondering if for some reason the software just wasn't included in the version of Kali I downloaded, I attempted to `locate theharvester` on the system. This returned a multitude of files under `/user/share` and a directory at `/usr/bin/theharvester` but no contained files. As expected though, `theharvester.py` was not on the list. I then tried uninstalling the current software/files and reinstalling with `apt-get`, just to get the same `No such file or directory` error. What do I need to do to get `theharvester.py` (and any other missing files) on my system in the right spot? **UPDATE:** Just running the command `theharvester` does indeed return the following screen: ![enter image description here](http://i.stack.imgur.com/mWa3u.png)


title: Why do ls and hexdump disagree about my file size?

text: I have a file I created (in vim), for testing purposes (testing UTF-8 output in an SSH client). Odd things, however, are happening to this file. I wondered what bytes were in the file, so I used `hexdump`:               username@computername:~$ hexdump -x intl.txt     0000000    9ecf    000a     0000003      Ok, there's four bytes in there, How the 00 and the 0a got in there, I'm not clear, but whatever. Here's where it gets weird, though:               username@computername:~$ ls -al intl.txt     -rw-rw-r-- 1 username username 3 Mar 26 15:14 intl.txt      Wait, it's three bytes? What's going on here? As if that wasn't odd enough, `hexdump -C` gives very different output:               username@computername:~$ hexdump -C intl.txt     00000000  cf 9e 0a                                          |...|     00000003      Vim is also a bit confused about the file. When I start it up, it gives this in the status line:               "intl.txt" 1L, 3C      Up top, however, I get this (using `set list`):               Ϟ$     ~     ~     ~     ~      So, it thinks there's 3 characters, but only prints one. I could understand if it printed the koppa and a blank line under it...


title: Can't install gnome shell extensions

text: Just did a fairly minimal install of OpenSUSE 13.1, including `gnome-shell` 3.10.1. [Long frustrated rant deleted] I can't get GNOME shell extensions to work at all. Initially when I went to the extensions website, I couldn't install anything. Eventually I discovered the secret, undocumented `gnome-shell-browser-plugin` package. Having installed that, the little on/off switch now appears on the website. However, when I switch it to On, nothing happens. And if I navigate off the page and back again, it's gone back to Off. Who do I have to murder to make this actually work again?


title: davfs2 keep files cached longer

text: I'm using `davfs2` to sync with my box.com account and I'm trying to play with the cache settings to get more Dropbox-like functionality. I've noticed that after I don't open a file for a little while it gets removed from the cache. I've set my cache size to 2GB and my account only has 700MB of data. The functionality I'm trying to achieve is to basically keep files in the cache until it's full. I realize that I could probably keep the files open in the background, but I'm wondering if there's a clean way to accomplish this. Here's my `davfs2.conf`:               use_locks 0     cache_size 2048     file_refresh 5      I'm not so sure I want to play with `dir_refresh` since I definitely want to detect updated files (or am I understanding this option poorly?).


title: Linux basic web server setup and access

text: very simple questions: I installed CentOS7 and Apache on my work PC (connected to my company's network with a given IP address). No other OS installed, just Linux. I created a simple hello.html file in /var/www folder. I typed /var/www/hello.html in the web browser and I could see the text hello world. So far so good.   1. Now, how do I access the same basic web page from a different computer on my company's network?    2. I know Apache listens to PORT 80 for incoming requests. So how do I open up PORT 80?   3. In my case, hello.html is the source file for my web page. On my Linux PC browser, I can type /var/www/hello.html to see the page. But suppose I want to call my website www.mywebsite.com. How do I translate from /var/www/html to www.mywebsite.com. In other words, when I direct other coworkers to my website, I want to give them www.mywebsite.com as a name, and not /var/www/hello.html, which would be meaningless to them.   4. Based on question 3, does this mean that I have to create a "local" DNS that somehow combines my IP address along with hello.html into www.mywebsite.com?


title: Add/delete workstation ip to /etc/sysconfig/iptables and then run service iptables reload

text: I need a script to add a users workstation ip to `/etc/sysconfig/iptables` and then run a `service iptables reload`. I need the same type of script for removing this rule from iptables. I found the code below on a different forum.   It's somewhat what I need to do. It includes _add_ and _remove_ options, but instead of `adduser` it needs to reflect the iptable rule such as   `iptables -I INPUT 1 -p tcp -s xxx.xxx.xx.xxx --dport 22 -m comment --**comment "testing for user1" -j ACCEPT`. The ip address itself needs to be passed as a parameter, so I can execute as   `./script 155.154.15.00` I am using RHEL version 6.4.   Any feedback is appreciated.               #!/bin/bash          clear       echo "########## MENU ############\n"       options=("add_user" "delete_user" "exit")       select opt in "${options[@]}"       do         case $opt in         "add_user")           clear           while [ 1 ]           do             clear             echo "1. Add user manually"             echo "2. Add user via TXT file"             read -p "Enter your choice" ch             case $ch in                1)                 read -p "Enter user name : " useradd                 read -p "Enter user password:" passwd                 echo -e "Successfully added the user"               ;;               2)               if [ $(id -u) -eq 0 ]; then                 for row in `more $1`                 do                   username=${row%:*}                   password=${row#*:}                       egrep "^$username" /etc/passwd >/dev/null                   if [ $? -eq 0 ]; then                     echo "$username exists!"                     exit 1                   else                     pass=$(perl -e 'print crypt($ARGV[0], "password")' $password)                     useradd -m -p $pass $username                     [ $? -eq 0 ] && echo "User has been added to system!" || echo "Failed to add a user!"                       fi                 done               else                 echo "Only root may add a user to the system"                 exit 2               fi                 esac             done         ;;         "delete_user")           read -p "Enter a User name to delete "UNAME           passwd           userdel $UNAME           echo "User $UNAME has been deleted"                     ;;         "exit")           break         ;;         esac       done


title: How do I make Kate indent with spaces on Python files but use tabs for text files and other files?

text: My goal is to set Kate up to work properly on Python files but to use different settings (tabs not spaces) on other documents. I'm sure others are doing this, but I can't figure out a convenient solution. I appreciate any advice. Kate has settings for indentation here:   1. Click the Settings menu   2. Click "Configure - Kate"   3. On the right expand "Editor"   4. Click "Indentation" One option is "Default indentation mode". One choice for that setting is Python. However, I cannot find where to set (or even display) the options used for the Python choice. Furthermore, it is not clear what is the interaction between "Default indentation mode" and the explicit settings for indentation on that page. Does one override the other?


title: How do I keep the .local TLD in my intranet

text: I use vagrant to launch VM's and bridge the network access to my local machine. Unfortunately exvery VM launch gives me a new IP address, and MAC address. I have a domain.local that I use and currently I have to change my computer's hosts file every launch to match. I have admin access to all the machines (local, VM, and the router for the intranet). How to I tell .local domains to resolve locally only in a way that won't require me to change (or set at all) my local hosts file?


title: Remove last character from line

text: I want to remove last character from a line:               [root@ozzesh ~]#df -h | awk  '{ print $5 }'     Use%     22%     1%     1%     59%     51%     63%     5% Expected result:               Use     22     1     1     59     51     63     5


title: Is the last new line on fstab important?

text: What happens if the last line of fstab is not terminated by a newline? Why do people get a warning when that last line is not terminated by a newline?


title: What do all the letters and numbers in a Red Hat RPM version number mean e.g. openssl-devel-0.9.8e-27.el5_10.1?

text: What do all the letters and numbers in the rpm name openssl- devel-0.9.8e-27.el5_10.1 mean? I recognize the openssl-devel-0.9.8e part because that's the same number applied by the developement team at openssl.org. But what do the numbers and letters in the 27.el5_10.1 part mean? I've googled and searched on Red Hat's web site for an explanation. The best explanation I've found is https://access.redhat.com/site/security/updates/backporting/ but it doesn't really go into the version string scheme/format. Context: We're developing software which compiles and links against openssl, so our code depends on openssl-devel. To make this convenient, we repackage some binaries from the openssl-devel installation (e.g. /usr/lib/libssl.a) as a maven artifact and upload the artifact to a private maven repo. Maven artifacts have version numbers, so I'm planning to version it identically to its RPM source. I'd like to simplify the version string a bit for example, if I know that all the 27.x versions of openssl-devel-0.9.8e-27.el5_10.1 will be compile and link compatible then I could get by with a simpler artifact version of 0.9.8e-27 rather than the full 0.9.8e-27.el5_10.1.


title: Is it true that the first version of Linux was based on parts of Unix?

text: Me and a friend had a discussion about Linux and Unix today and my friend kept saying that the first version of the Linux kernel was based on [parts] of the Unix kernel. This really surprised me because I always thought that the architecture of Linux is just similar to Unix — since the very first version. So, is it really true that the first Linux version was based on parts of Unix?


title: Multiple bindings for the same action

text: Like many `screen` users I'm used to `Ctrl``a`, so on my machine I changed the binding to `Ctrl``a`, however, I wish to keep `Ctrl``b` since on some machines it's the default and when sharing work with other people this can be very confusing. I tried putting two lines in my `.tmux.conf` but only one of them will work.


title: How to show time away from computer?

text: I was wondering how to measure the time elapsed after, say, screensaver starts and then show that time on a freedesktop notification when back.


title: How to transfer files over bluetooth?

text: How can I connect my mobile phone and Lubuntu 11.10 laptop over bluetooth so that I can transfer files between them?


title: Wrong Opera Icon in Gnome Shell

text: I am using Opera 11.60 on ArchLinux (64bit) with Gnome3 and KDE4. Since I installed KDE4 last week Gnome3 shows the wrong Icon for Opera in the upper left corner and in the task switcher (alt+tab). Here is a screenshot of what I see: http://i.stack.imgur.com/wAfGz.png Does anybody know how to get the correct icon and title back, as it also says "opera" instead of "Opera" (capital "O")? I already tried reinstalling and removing my `.opera` files but that did not help. Thanks in advance


title: get information about screen windows

text: I run two scripts simultaneously within `screen`. `screen` is started by a script. I am working on a method for automatic window selection depending on the state of the scripts. This works (`screen -S mysession select win1`) but for certain improvements I need information (i.e. a script need it thus interactive features are of little use) about the windows (and the processes within):   1. How can I determine the tty (`/dev/pts/xy`) that belongs to a certain window?   2. How can I determine which is the foreground / active window? Answering (1) would be possible by running `tty` after starting the new window and write its output somewhere. But a `screen`-internal solution would be more elegant and easier to implement (I guess). Interactively the commands `windowlist` and `windows` give the answer to (2) but I haven't managed to get this output as input into a script. Furthermore: Coding this information as highlighting is nice for the user but not so nice for a script.


title: file(1) and magic(5) : describing other formats

text: Can I use `file` and `magic` ( http://linux.die.net/man/5/magic ) to override the description of some other known formats ? for example, I would like to describe the following formats:   * BED: http://genome.ucsc.edu/FAQ/FAQformat.html#format1   * Fasta : http://en.wikipedia.org/wiki/FASTA_format   * ... that are 'just' text file Or   * BAM http://genome.ucsc.edu/FAQ/FAQformat.html#format5.1 that is 'just' a gzipped-file starting with the magic-number `BAM\1` ? do you know any example ? Is it possible to provide a custom C code to test the file instead of using the magic format ?


title: Having trouble reinstalling Grub from live CD

text: I have a 64-bit Sabayon Linux and Mac OS X dual boot. After using gparted to resize my partitions, I can no longer boot Sabayon. I've tried chrooting and fixing grub from several live CDs, but they have all said "command not found" about either grub or chroot. Knoppix came close but then said it couldn't restore grub because it's 32 bits, rather than 64 like my Sabayon installation. Tips?


title: Block specific IP from accessing gateway

text: Suppose you are on linux internet gateway/router. What would you do to block a client with specific IP using bash script. I prefer something like `./block_client.sh 192.168.1.123` to block and `./unblock_client.sh 192.168.1.123`


title: Oldest Linux machine you still run

text: What is your oldest machine you ever installed Linux on and currently still run? What are the specs, kernel version or distro, and for what purpose?


title: Install Ubuntu from a small USB stick

text: I'd like to install Ubuntu (Desktop or netbook edition, preferably latest version), onto a laptop using a small USB stick. (480 MB free space.) How can I do this?