title: Maximum memory usable by a 32 bit RHEL 6 system

text: I have installed a _32 bit_ **RHEL OS** on a _64 bit_ system. From the wiki page of PAE: > The Linux kernel includes full PAE mode support starting with version > 2.3.23, with Linus Torvalds mentioning PAE's 4 MB page support in > 1.3.15,[18] enabling access of up to 64 GB of memory on 32-bit machines. The current kernel version in one of the server is:               2.6.32-431.17.1.el6.i686      ### Question 1 Does the kernel version mean that if I add another _24_ GB RAM to my already existing _8_ GB RAM, the entire _32_ GB physical memory will become usable? Currently the system shows that _8_ GB RAM is available (I use `free` command to check it). ### Question 2 I am still confused on the virtual memory concepts. How will the 32 bit system use the virtual memory? I read that _32 bit_ RHEL will use the memory in chunks of _3_ GB. Does this mean, at any point of time, there can be only maximum _3_ GB in the main memory? I thought since I have _32_ GB memory at any time _32_ GB data can reside in main memory. Particularly, I am trying to understand the answer from here: > Each process runs in its own address space, and being 32-bit restricts that > address space to about 3GB for each process. The sum of the memory used by > 32-bit applications is completely irrelevant. There is nothing to get > around.


title: Is there a shorter way to change username, home directory and move files at the same time

text: I wanted to use and have tried               sudo usermod durrantm_test -mdl durrantm_test2      but I get               Usage: usermod [options] LOGIN     ...      However               sudo usermod durrantm_test -l durrantm_test2 -md durrantm_test2      doesn't give an error but seems repetitive, can I shorten it?


title: Xorg Server Failing to Startup

text: I am having difficulty starting up the Xorg server within my Gentoo installation. I set it up via The X Server Configuration HOWTO. When I get to the part where I `startx`, the screen flickers a bit, and then it drops me back into the terminal with the following message:               [some stuff here]     (EE) Failed to load module "vesa" (module does not exist, 0)     (EE) Failed to load module "fbdev" (module does not exist, 0)     FATAL: COuld not load /lib/modules/2.6.35-gentoo-r12/modules.dep: No such file or directory      Two things that are weird to me - I am not using vesa or fbdev drivers. I am using intel and evdev in my `/etc/make.conf`. Secondly, I don't use modules in my kernel. I specifically remove them. This hasn't caused a problem before. I'm not really sure what is going on. Any help would be much appreciated.


title: Write a remote managing script

text: I need to be able to locally run a script that will connect to various servers and run commands on them. What is the best way to accomplish this?


title: What does `{ { (exit 1); exit 1; }; }` mean?

text: I quoted the next code snippet from `config.status` generated by `configure`.               if test ! -f "$as_myself"; then     { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5     echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}     { (exit 1); exit 1; }; }     fi      In the code snippet, what does `{ (exit 1); exit 1; };` do? What's the purpose of only doing `exit` in a subshell?


title: where to (apt-get) install aliases system-wide?

text: I am making a Debian package that contains bash aliases. Where should these aliases be installed, so that they are available system- wide? The "right" place would be `/etc/bash.bashrc`, but this file is owned by the bash package, which will overwrite it on the next upgrade. I tried to put them in `/etc/profile.d/my-aliases.sh` but this affects only _login_ shells (for example it works in the consoles). _Interactive_ shells do not get the aliases. It does "work" if I put them in `/etc/bash_completion.d/my-aliases.sh`, but this is not meant to be used that way. So my question is: Where (or how) should I install aliases, so they are available to _interactive_ shells system-wide?


title: Lm-Sensors: Run specific commands when temperature goes above/below limits

text: I have a pretty badly ventilated computer whose temperature reaches 100º C in some occasions. The poor thing can't be ventilated any better (" _put a bigger fan_ " is not a suitable solution). When the CPU reaches 100º C, the machine stops "violently" (just shuts down). That machine is running Ubuntu 10.10 with lm-sensors-3 (the installed package is lm-sensors 1:3.1.2-6) I know what program is causing the issue (a very demanding media player) I could actually stop it for a while without causing major disruptions when the temperature reaches 98º C and boot it again when it reaches... lets say 90º C. Is that possible to do something like that directly through lm-sensors or do I have to create my own process that checks lm-sensors periodically and "does its things" depending on the temperature? Thank you in advance.


title: How do I see more of the command line with the KDE System Guard Process Table

text: I often have several java programs running and I can't tell which one needs to be killed. The command section of the process table only shows java, but doesn't tell me which jar or class files it is running. Edit: Is there a way to see more of the command call from withing KSysGuard?


title: Uncomplicated Firewall (UFW) and UPNP

text: Is it possible to configured UFW to allow UPNP between computers in the home network? Everything works if I turn off the firewall. I can see in syslog the firewall is blocking me. I've tried all sorts of tips out there like open 1900, 1901, 5353, these all seemed like random attempts. I know the issue is UPNP requests a random port and UFW is simply blocking it.


title: How well does alien work for converting packages?

text: Is it feasible to build an RPM package and then utilize alien to create the DEB package rather than investing time in building a DEB package? Or do certain pieces not translate well?


title: How can a Windows based DHCP server update DNS Server on Linux?

text: The updates to the zone is protected by the key (similar to: allow-update { key "rndc-key"; }).


title: How to migrate existing linux system to LVM partitioning

text: I want to migrate my system to LVM. My current setup is the following:               Disk /dev/sda: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x6fa8e725             Device Boot      Start         End      Blocks   Id  System     /dev/sda4       662097920  1953523711   645712896    f  W95 Ext'd (LBA)     /dev/sda5   *   662099968  1945352191   641626112   83  Linux     /dev/sda6      1945354240  1953523711     4084736   82  Linux swap / Solaris     Note: sector size is 4096 (not 512)      My plan is the following:   * Create LVM partition in unallocated space from 0 to 662097920   * Copy everything to it.   * Delete everything from 662097920 to 1953523711    * Extend LVM to have 100% of the HDD How can I do this ? I'm on Kubuntu 13.04 **Status update:** I created a primary partition on the unallocated space, to use pvcreate afterwards on that partition to create the LVM. Next step should be to copy everything to it, and delete the former partitions, and after, extend the primary partition where the LVM resides.


title: Correct permissions for /var/www/html?

text: I'm able to write changes in the home directory, but when it comes to the `/var/www/html` folder, it's not allowing me to make any changes or create new files or folders. I'm able to view the files in the directory. Please suggest what are the correct steps to set the permissions.


title: I have an ATI Radeon HD 6300 series video card; what do I use, radeon or radeonhd driver?

text: I want to install the correct driver for my video card under Debian and I don't know which to install, xserver-xorg-video-radeon or xserver-xorg-video- radeonhd? I've also read some of the documentation of the package and it mentions AMD/ATI Radeon r5xx, r6xx and r7xx families of chipsets. And I don't know what chipset family Radeon HD 6300 is under.


title: how to Update QT 4.5.3 of OpenSuse 11.2 to QT 4.7.3?

text: I just installed QT 4.7.3 in OpenSuse 11.2 (which has 4.5.3). I ran `configure`, `gmake`, and `gmake install`, but when I check qmake's version, it's still returning 4.5.3. What should I do?


title: ::1 during exim-config?

text: While executing               sudo dpkg-reconfigure exim4-config      there is this screen (IP adresses on which exim shall listen): ![enter image description here](http://i.stack.imgur.com/cf1et.png) What does the ::1 mean? Is it an exim specific thing or - as I assume - some genereal linxu thing?


title: Copying files between users Using Telnet

text: How to copy a file from home directory `User A` to home directory of `User B` using `telnet`.


title: view stdout for another pts

text: Here is the situation. I left my pc at home doing an rsync from a 2TB hard drive to another 2TB hard drive (it's going to take a while since they are both USB 2.0). I am now at work and I have ssh-ed into my home pc. If I do `ps aux | grep rsync` I can see the following:               1000  7214 18.8  0.1  30636  1368 pts/0 S+   00:52 134:00 rsync -vr /media/master /media/slave      However I want to see exactly what rsync is doing. When I was at home, the standard output was shown in my terminal and the verbose mode of rsync showed which files were currently being copied. Is there any way to read stdout for another pts?               $ ps -t pts/0     7214 pts/0    02:14:42 rsync      I did a little bit of googling and it seems that `/proc/pid/fd` may hold the answer but I'm not sure about this... P.S. I have sudo privileges of course.


title: Grep rest of line.....after match

text: I have a file containing only two lines, with the following structure:               $ cat /tmp/pwpower.log     000D6F0000D34227, -114.10     000D6F0001A405C4, -130.09      The values are power values of my solar plant. Negative value means generation. I would need the values extracted via grep/sed/awk - whatever is the smartest way. I need to have both values extracted separately and without the minus sign. What I do now is kind of stupid but it works - I'm sure many of you will have smarter ways for me :-) Here of course I only see the values plus Minus. To get the first value:               cat /tmp/pwpower.log |grep -o "\-.*" | head -n 1      To get the second value:               cat /tmp/pwpower.log |grep -o "\-.*" | tail -n1      And related question, is there a simple way to take these STRINGs and transform so that I can calculate the SUM ?


title: How do you truncate all columns in a file to a specific length?

text: Given columned text in a file that is delimited by a certain character, how do you truncate the width of either a specific column(s) or all columns? The use case is that I am reading some log files that have space delimited columns. Some of the columns in the log are very long urls that make the file difficult to read. I don't really care about the entire content of the urls, so I would like to truncate the length of these columns to something more readable. I would be curious to know how to specify specific columns to truncate, but really I only need to figure out how to just truncate all columns of length greater than N. So far I have found utils `column`, `colrm`, and `cut`, which all seem to be similar to this, but nothing that does what I am looking for. (Optimally, if there is a compiled utility that already does that, this would be best, but I would also be happy to find a way to do this with `sed`, `awk`, `perl`, etc.)


title: Using sed, how can I replace a line containing a pattern with contents from another file?

text: **input_file.txt** :               one fffds     two xxxx     three ffff     four ffde      **data_file.txt** :               six     seven      I want to replace the line containing `two xxxx` in **input_file.txt** with the content of **data_file.txt**. The output file should look like this: **output_file.txt** :               one fffds     six     seven     three ffff     four ffde


title: Need command-line program to download all of http:// https:// scp:// ftp:// style links (on e.g. ubuntu)

text: I'm writing a perl program where I want to accept all kinds of "file names" from the user, including `/home/foo/bar.txt` and `scp://server/some/file.txt` or whatever. And then I thought that if I can find a cmd line program that does it, I'll find a perl module that does it too, or I'll just run it through perl's `system()` call. I thought of cURL and/or lftp, but on ubuntu, I get:               > curl scp://server/some/file     curl: (1) Protocol scp not supported or disabled in libcurl     > lftp -c 'get scp://server/some/file'     get: scp - not supported protocol      For curl I investigated why that was on Ubuntu and found curl and pycurl is not compiled with sftp support - basically it _ain't gonna happen_ unless I recompile libcurl*, but I don't want to require my users to apply a patch to libcurl*. Sure, I can write it myself as in:               if ($proto eq 'scp') {         # handle scp         open I, 'scp ...' or die;     } elsif ($proto eq 'http') {         open I, 'wget ...' or die;     } else {         # whatever     }      But I'd much rather somebody else write/test/debug that with a huge list of protocols and I'm surprised I couldn't find anything that does this out-of- the-box! Do you know of any that I missed?


title: linux shell global linux memory in mem variable - from shell

text: Is there any way for me to set an env variable without editing files to be in memory and effect other shells as well, which will take effect on any new user who connects that machine and will take effect only after next reboot of the Linux machine? I'm trying to remember something in my linux which will be effective (from a script) only for the time the machine is up (I don't want a file for that reason) so from my shell I want to set some flag which will be valid for any user connecting like:               linux_test_run=yes      however I want it to be effective for any new shell opened on that Linux. and I want that next time someone reboots that machine that variable disappears... Any (simple) for me to achieve that? (without using files...)


title: rsync, delete files on receiving side that were deleted on sending side. (But don't delete everything)

text: I'd like to use rsync to...   * delete files on the receiving side that were also deleted on the sending side   * not delete other files that are in the rsynced directory on the receiving side For example, let's say I have a directory `local-src`: **BEFORE:** `local-src` locally contains...               a.txt     b.txt     c.txt      my remote directory that I'd like to sync to contents of `local-src` to is called `remote-src`. **BEFORE:** `remote-src` remotely contains...               a.txt     b.txt     c.txt     d.txt     README.md      Let's say that I delete some files in `local-src`: **AFTER LOCAL DELETE:** `local-src` locally contains...               c.txt      How can I use rsync in a way to ensure that the files deleted at the source are also deleted at the destination, but without deleting other files at the destination. For example, I'd like to have the following at the destination: **AFTER LOCAL DELETE:** `remote-src` remotely contains...               c.txt     d.txt     README.md      That is, `a.txt` and `b.txt` are remotely deleted as well, but `d.txt` and `README.txt` are left alone. Is there any way to achieve this with rsync? **EDIT:** The verdict seems to be that this might be impossible with rsync. I've been asked why I need this, so to illustrate my use-case: Let's say I have a web server. On that web server, I've got a bunch of directories, let's say that I have a directory `A` and a `public_html` directory that my site is served from. Let's say that I have some automated process that produces files in directory `A`. I'd like to rsync (or sync using some other tool) the files generated or **updated** in `A` to the `public_html` directory, without deleting other arbitrary files that might be within `public_html`. I certainly don't want rsync to to accidentally delete my website. If rsync isn't the tool for this job, does someone else know how I can do this?


title: sed command to leave two decimals and remove the rest after comma

text: I have a numeric value, for example 19.3478 or 22.456 or 10. I would like to remove extra decimals if there are more than two decimals, so that there is never more than two decimals after the comma. If the value is 10.0 it should stay as 10.0 or 10, but it should never be "10.". Is this possible with sed?


title: Where does grep -r search by default?

text: I found if I search using grep without specifying a path, like `grep -r 'mytext'` it takes infinitely long. Meanwhile if I search with path specified `grep -r 'mytext' .` it instantly finds what I need. So, I'm curious, in first form, in which directory does grep search? UDATE: grep version: grep (GNU grep) 2.10


title: JOIN command does not return results

text: I am trying to join 2 large files(1 file is 699M and other is 20GB). Both the files have only 2 columns. The command I am using is: `join -1 2 -2 1 -t , -o 1.2,0,2.2 file1 file2`. When I try the command using a smaller `file1`, the command works fine. I tried printing `$?` to see if the exit code is non zero, but it is not. How can I debug to find out the reason?               Some info:     O.S: RHEL5     Arch: x86_64


title: zsh broke compose key and special chars

text: I thought I'd switch to zsh, so I did just that with `chsh -s /usr/bin/zsh user`, unfortunately, it broke my compose key (unresponsive both in the console and in an X terminal); also, when I read email in emacs rmail, Swedish characters are not displayed correctly (diamonds in the console, question marks in an X terminal) - but it **is** possible to display them, for example if I `cat` the mail files instead. To possibly reinitialize the compose key, I run `setupcon` again as superuser but it didn't help. In `/etc/default/keyboard`, this line is present `XKBOPTIONS="compose:lwin,terminate:ctrl_alt_bksp"`. As for the compose key in X, and the character set in both the console and an X terminal, I'm clueless because I can't remember anytime "setting up" those things, they just worked. To double check, I switched back to bash with `chsh -s /bin/bash user`, and everything worked as before. I examined `.profile` and `.bashrc` to see if I possibly had done some keyboard/charmap initialization there, but I couldn't find anything to that extent.               zsh --version     zsh 4.3.17 (i686-pc-linux-gnu)


title: howto inflate AND extract a .tar.bz2 using the 7-zip command line tool

text: I have a .tar.bz2 file that I want to be decompressed and extracted via the 7-zip commandline tool. So basically I'm looking for the equivalent of               tar -xjf foo.tar.bz2      with 7-zip there is only the option "x" for extract, so doing               7z x foo.tar.bz2      gives me the inflated foo.tar file instead of unpacking all the directories inside the tar. What's the corresponding option for 7z?


title: How to map ataX.0 identifiers in kern.log error messages to actual /dev/sdY devices?

text: Consider following `kern.log` snippet:                ata4.00: failed command: WRITE FPDMA QUEUED      ata4.00: cmd 61/00:78:40:1e:6c/04:00:f0:00:00/40 tag 15 ncq 524288 out             res 41/04:00:00:00:00/04:00:00:00:00/00 Emask 0x1 (device error)      ata4.00: status: { DRDY ERR }      ata4.00: error: { ABRT }      ata4: hard resetting link      ata4: nv: skipping hardreset on occupied port      ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300)      ata4.00: configured for UDMA/133      ata4: EH complete      How can I identify which hard drive the kernel actually means when it talks about `ata4.00`? How can I find the corresponding `/dev/sdY` device name?


title: Printing to a SAMBA-share HP: Multiple copies appear

text: I have a Windows machine (W7.Ultimate) with a shared HP LaserJet CP1215. I have set this up via SAMBA as a shared printer on my laptop, running Fedora Core 15, using Foomatic/foo2hp. My problem (which has only started happening in the last month or so; clearly I changed something) is that every print job sent to the printer comes out as 3 copies. Print a 7-page document? Get 21 pages, 3 copies of each page, as Page 1 x3, Page 2 x3, etc.. I have checked every setting under Printer Configuration in KDE, gone through the CUPS setup and checked every setting there, and also checked the settings on the Windows machine. Everywhere I've looked, it says "1 copy" as the default. This issue does not happen if I print from the desktop machine where the printer is attached, and does not happen when printing from my wife's Windows laptop. It seems to be localized to my machine only. Any suggestions as to how to fix this issue would be appreciated.


title: How to return both file name and line number with find ... -exec grep?

text: When using `find`, how do I return the file name and the line number when searching for a string? I manage to return the file name in one command and the line numbers with another one, but I can't seem to combine them. File names: `find . -type f -exec grep -l 'string to search' {} \;` Line numbers: `find . -type f -exec grep -n 'string to search' {} \;`


title: Prevent claiming of novelty usb device by usbhid so I can control it with libusb?

text: I have a USB rocket launcher that I wish to experiment with through `libusb`. However, libusb cannot claim the interface; presumably because the output of `usb-devices` lists 'usbhid' as the driver for the device. From reading around on the internet, I've only come to the conclusion that I need to detach this driver from the device so I can use it with libusb. However, I have not found a single definitive way to do that, only several different ideas and bug reports. So, is there a way to detach the usbhid driver from a device that would be relevant with the kernel and tools supplied with Ubuntu 11.04? EDIT: I tried creating the file               /etc/udev/rules.d/10-usbhid.rules      and writing the following:               ATTRS{idVendor}=="0a81", ATTRS{idProduct}=="0701", OPTIONS=="ignore_device"      Saving, then rebooting. The file is still there, but it doesn't appear to be working at all. EDIT: Okay, I tried this:               sudo -i     echo -n "0003:0A81:0701.0006" > /sys/bus/hid/drivers/generic-usb/unbind      After that, navigating to /sys/bus/hid/devices/0003:0A81:0701.0006 and ls yields:               drwxr-xr-x 2 root root    0 2011-05-29 15:46 power     lrwxrwxrwx 1 root root    0 2011-05-29 13:19 subsystem ->       ../../../../../../../../../bus/hid     -rw-r--r-- 1 root root 4096 2011-05-29 13:19 uevent      It no longer lists a "driver" symlink like it did before, so I would assume that it unbound it. However, all evidence seems to suggest that the driver is still usbhid. For example usb-devices yields:               T:  Bus=02 Lev=03 Prnt=07 Port=00 Cnt=01 Dev#=  9 Spd=1.5 MxCh= 0     D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1     P:  Vendor=0a81 ProdID=0701 Rev=00.01     S:  Manufacturer=Dream Link     S:  Product=USB Missile Launcher v1.0     C:  #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA     I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid      libusb still retuns -1 on usb_claim_interface()....


title: Show top five CPU consuming processes with `ps`

text: How to show top five CPU consuming processes with ps?


title: How can I search for a file with fixed name length using ls?

text: In a directory, I have files like               lazer_100506     lazer_100707     lazer_091211     lazer_110103     lazer_100406_temp     lazer_100622#delete      etc How can I get a listing of only the first four files?               $ ls lazer_......     ls: lazer_......: No such file or directory     $


title: How to find out how much memory a program taking

text: I use htop to watch my processes, but most of services ran are multi threaded, so they are shown on several lines with a % of memory use which in some cases is the same for all, sometimes it varies among them. Say in the case of Firefox it can list 15 processes each consuming 13% of memory. Can I know hoc much memory is Firefox, MySQL, some fcgi script or anything is consuming? since the htop output seems misleading.


title: Which parts of an ELF executable get loaded into memory, and where?

text: What I already know: An ELF executable has a number of sections, obviously the .text and .data sections get loaded into memory as these are the main parts of the program. But for a program to work, it needs more info, especially when linked dynamically. What I'm interested in are sections like .plt, .got, .dynamic, .dynsym, .dynstr etcetera. The parts of the ELF that are responsible for the linking of functions to addresses. From what I've been able to figure out so far, is that things like .symtab and .strtab do not get loaded (or do not stay) in memory. But are .dynsym and and .dynstr used by the linker? Do they stay in memory? Can I access them from program code? And are there any parts of an executable that reside in kernel memory? My interest in this is mostly forensic, but any information on this topic will help. The resources I've read about these tables and dynamic linking are more high level, they only explain the workings, not anything practical about the contents in memory. Let me know if anything in unclear about my question.


title: Webmin alternative that installs & runs on the client machine & communicate via SSH

text: Are there any Webmin alternatives that don't consume server resources but instead install on client machine & communicate via SSH client. So effectively all the actions made on that GUI are converted to terminal commands & executed via SSH. Are there any tools like that to communicate to a remote ubuntu server ?


title: rotating buffer type file logging utility

text: I'am trying to debug a server that throws a lot of logs on stdout/stderr. I need to redirect only last N lines to a file. Something like a rotating buffer feature there in `tcpdump`'s `-C` & `-W` flags. It would be nice if I could view the log while the server is still running and throwing the logs (I could `cp` it in another file to view it). Is there a utility that does this? From my little understanding of `logrotate` tool, it should be run repeatedly. I don't think it fits my need. What I would like is:               serverd -d | $TOOL -n 100 srv.log      ...where at any time `srv.log` contains last 100 lines outputted from `serverd`.


title: Formatting external drive in CentOS previously used on OS X

text: I have a USB key they I want to use on a CentOS box. The USB key was previously used on OS X so I want to erase it to make it writable by CentOS. Can someone help me with the commands I need to run? I'm guessing it has something to do with fdisk and mkfs (possibly mkfs.ext3). If it makes any difference, the USB key is 32GB. The disk is located at `/dev/sdb`.


title: Possible to download all the packages from "groupinstall" and then run ( yum --nogpgcheck localinstall *.rpm )?

text: This is the original command:               yum groupinstall "Desktop" "Desktop Platform" "X Window System" "Fonts"      I would like to create 4 folders for these. (1 folder for each).               mkdir Desktop     mkdir Desktop_Platform     mkdir X_Window_System     mkdir Fonts      Then I would like to run:               yum groupinfo Desktop      to see what packages are in that group, and download each one to the first folder above, via:               yumdownloader --resolve <package_name>      Same thing for every other folder and group above. So I repeat this process 4 times, until each folder has all the RPM files for each group. Now I re-install CentOS Linux minimal, and then I want to install all of the groups without running:               yum groupinstall "Desktop" "Desktop Platform" "X Window System" "Fonts"      Can it be done by going into each one of those folders individually and running this command:               yum --nogpgcheck localinstall *.rpm      ?


title: Linux fullscreening video

text: So I can only fullscreen some certain sites' videos. Youtube works sometimes as does another (entertainment) site. Both are using Flash, I do not have YT set to use HTML5. Clicking fullscreen freezes the video but it does not show as fullscreen. Audio continues working. I can hit Esc to close out of the non-functioning "fullscreen" video, but then the smaller embedded one does not start. I will have to refresh the page. What can I do to make this work on everything?


title: invisible bridged router with 2 route table

text: **my setup** I have 2 ISP connexion : ADSL and SDSL. A qos (named qos, ip : 192.9.201.252) server stands before the ADSL router. It is the only way to access the ADSL gateway (192.9.201.254)   through a bridge (br0). so this qos server is invisible and can easily be unplugged if it fails. As for now, the default gateway of all LAN computers is 192.9.201.254, and so all traffic pass through the qos. This setup work very well. **my need** Now, I need to route a defined service (isl) (already marked by iptable for the qos purpose) to the SDSL (192.9.201.251) gateway. I can achieve that by creating another route table named «isl» and create the default gateway pointing to the SDSL router. after that, I create a rule that               grep "30 isl" /etc/iproute2/rt_tables || echo "30 isl" >> /etc/iproute2/rt_tables     ip route add default via 192.9.201.251 dev br0 table isl     ip rule add fwmark 0x1e table isl      with this setup, I work if I change all default gateway to 192.9.201.252. **my question** how to force these routing table to apply even if the hosts don't have my qos server as gateway, but always the ADSL router my thought was to use some iptables rules to NAT all marked packet to local host, which will then redirect traffic to SDSL, but I feel wrong with that.


title: udev randomly mixing up ethernet devices on Debian Squeeze

text: Installing Squeeze with newer kernels on servers with 4, 6 or more interfaces, I keep getting this really annoying problem: interfaces are always mixed up across cards, and don't even follow ascending hardware address order. What's going on? Typical example of 70-persistent-net.rules on a machine with 2 dual port GigE cards :               # This file was automatically generated by the /lib/udev/write_net_rules     # program, run by the persistent-net-generator.rules rules file.     #     # You can modify it, as long as you keep each rule on a single     # line, and change only the value of the NAME= key.               # PCI device 0x8086:0x105e (e1000e)     SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="68:05:ca:04:f8:5e", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"          # PCI device 0x8086:0x105e (e1000e)     SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="68:05:ca:04:f8:5f", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"          # PCI device 0x8086:0x10c9 (igb)     SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:72:55:71", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"          # PCI device 0x8086:0x10c9 (igb)     SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:90:72:55:70", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"      I know I can change the order easily; however I must not forget doing it on all and every server else it will cause all sorts of weird problems; it's particularly annoying when it mixes up 1 GigE and 10 GigE interfaces.


title: ipsec auto --status fails in cronjob

text: I have a server monitoring script which, among other things, checks the state of an IPSec tunnel using               ipsec auto --status      It works like a charm when run from the console (as root) but as soon as I run it from a (root) cronjob, the command fails: no output at all. I even tried to create this simple root cronjob:               */1 * * * * ipsec auto --status > /tmp/ipsec.txt      All it does is create an empty /tmp/ipsec.txt file! Note: All other tasks in the script including networking and DB access work fine. Any lights welcome.


title: Multiboot USB drive using relative paths with Syslinux (or another bootloader)

text: I want to make a multiboot USB drive with Ubuntu, Backtrack and Mantra-OS on it (all Ubuntu variants as you can see). Those are the steps I've done:               sudo su     unmount /dev/sdb1                          # unmount the drive     mkfs.vfat -F 32 -n disqus /dev/sdb1        # Format the disk with vfat     syslinux -maf /dev/sdb1                    # Install syslinux and the mbr     mkdir /media/disqus                        # Mount for the disk     mount /dev/sdb1 /media/disqus     mkdir /media/disqus/syslinux               # Syslinux configuration folder     cp /usr/lib/syslinux/{vesamenu.c32,reboot.c32,poweroff.com} /media/disqus/syslinux          # Files needed for syslinux     mkdir /media/disqus/syslinux/iso           # A folder that will contain extracted isos     mkdir /media/disqus/syslinux/iso/ubuntu     mkdir /media/disqus/syslinux/iso/backtrack     mkdir /media/disqus/syslinux/iso/mantra-os      After that I mounted and copied files in the respective isos to folders I've made:               mkdir /media/iso     mount mount -t iso9660 -o loop,ro /home/nizar/Destkop/ubuntu.iso /media/iso     cp -r /media/iso/* /media/disqus/syslinux/iso/ubuntu     umount /media/iso/     mount -t iso9660 -o loop,ro /home/nizar/Destkop/backtrack.iso /media/iso     cp -r /media/iso/* /media/disqus/syslinux/iso/backtrack     umount /media/iso/     mount -t iso9660 -o loop,ro /home/nizar/Destkop/mantra-os.iso /media/iso     cp -r /media/iso/* /media/disqus/syslinux/iso/mantra-os     umount /media/iso/     rmdir /media/iso/      After that I filled on the configuration file `syslinux.cfg` in `/media/diqus/syslinux` with that:               DEFAULT Backtrack     PROMPT 0     allowoptions 0     TIMEOUT 100     UI vesamenu.c32          MENU TITLE Disqus: The Ultimate Disk     MENU BACKGROUND anon1.png          MENU COLOR border       30;44   #40ffffff #a0000000 std     MENU COLOR title        1;36;44 #9033ccff #a0000000 std     MENU COLOR sel          7;37;40 #e0ffffff #20ffffff all     MENU COLOR unsel        37;44   #50ffffff #a0000000 std     MENU COLOR help         37;40   #c0ffffff #a0000000 std     MENU COLOR timeout_msg  37;40   #80ffffff #00000000 std     MENU COLOR timeout      1;37;40 #c0ffffff #00000000 std     MENU COLOR msg07        37;40   #90ffffff #a0000000 std     MENU COLOR tabmsg       31;40   #30ffffff #00000000 std          MENU WIDTH 80     MENU MARGIN 10     MENU ROWS 5     MENU VSHIFT 10     MENU TIMEOUTROW 13     MENU TABMSGROW 18     MENU CMDLINEROW 11     MENU HELPMSGROW 16     MENU HELPMSGENDROW 29          LABEL Backtrack         MENU LABEL Backtrack         kernel iso/backtrack/casper/vmlinuz         append initrd=iso/backtrack/casper/initrdf.gz file=/cdrom/preseed/custom.seed boot=casper quiet splash --          LABEL Ubuntu         MENU LABEL Ubuntu         kernel iso/ubuntu/casper/vmlinuz         append initrd=iso/ubuntu/casper/initrd.lz file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash --          LABEL Mantra-OS         MENU LABEL Mantra-OS         kernel /mantra-os/casper/vmlinuz         append initrd=/mantra-os/casper/initrd.lz file=/cdrom/preseed/xubuntu.seed boot=casper quiet splash --          LABEL Reboot     MENU LABEL Reboot     COM32 reboot.c32          LABEL Power Off     MENU LABEL Power Off     COMBOOT poweroff.com      (`anon1.png`: 640x480 8bit png in `/media/disqus/syslinux/`) Now everything is going alright and I'm able to boot, I have the Syslinux menu and even load `vmlinuz` and `initrd`! The OS is actually loading (I have the splash screen) but then I have the error (something about BusyBox):                (initramfs) unable to find a medium containing a live file system      I'm not quite sure what's the problem but I think it's about relative paths and the CDROM "thing".. I've tested many of them (even relative and absolute) but nothing works.. Please note that I'm not interested in answers about MultiBootUSB, MultiSystem, Yummi or any other tool; it must not be also about Grub any other bootloader: I WANT TO MAKE THAT WORK! ^_^


title: Linux Mint can't set brightness of screen

text: I'm on the latest Linux Mint release on an Acer Aspire S3. Unfortunately I can't set the screen brightness in the Screen preferences. It doesn't matter which position the slider has, it's always the same brightness. Am I doing something wrong? Is there another way to set the brightness?


title: Trapping dot (.) file not found errors in KSH

text: In ksh88, I can source a file using the "dot" command, like               . /my/file/source.ksh      However, if source.ksh doesn't exist, I want to trap the error. So I tried this:               #!/bin/ksh          trap "echo 'Source Not Found'; exit 1" ERR     . test2.ksh      But the trap never displays the error message, the script returns with:               ./test.ksh[4]: test2.ksh:  not found.      I even tried just using `trap` without any signals and it still doesn't catch the error. Is there any way to catch this error? I must use ksh88 for this script. Bash answers are useless for this question. I am aware that I can test for the existence of the file beforehand, I was just hoping there would be a way to trap this error without having to do that, as there are a bunch of these includes in my script.


title: NFS Option Reload without Service Restart

text: What do I need to do to change the RPCNFSDCOUNT setting without a full service restart? I need to reload the NFS configuration without restarting the service. The RPCNFSDCOUNT thread count is too low for the workload but I cannot get the management to agree on a schedule for a change window. A normal service can frequently do this with a SIGHUP. I did attempt this with a `kill -HUP $(pidof rpc.mountd)`, but that was unsuccessful in getting the new RPCNFSDCOUNT setting applied from /etc/sysconfig/nfs on this old Fedora 8 box. The man pages for the other NFS daemons incline me to think that HUP'ing those processes won't be of any benefit, and I'm rather reluctant to HUP the kthreadd process that is the parent process of the nfsd threads themselves.


title: Debian - auth.log missing from /var/log

text: I am learning Debian on RaspberryPI. I've installed 'logwatch' and 'fail2ban' recently and those two were working Great! A few days ago I've spotted that I don't have a file "auth.log" but I do have "auth.log.gz1" etc. (so archive data) I've used command:               touch auth.log      to create this file, than `chown root:adm` to change its premissions. However this file is still not working - I can't see any entry in to for the last 2 days even if I was loging in trough SSH. Can you advise:   1. why this file is gone? where to look for a reasons?    2. how to fix the issue, so all my SSH connections (and attacks) will be recorded?  PS.               pi@pi ~ $ uname -a      Linux pi.local 3.10.25+ #622 PREEMPT Fri Jan 3 18:41:00 GMT 2014 armv6l GNU/Linux


title: Reading multine text inside a bash script

text: I have following `graphviz` script which I wish to convert to a bash script.               #!/bin/bash       graph=$(cat <<GRAPHEND     graph match {          node[style=filled shape=point label= ""];         size="40.0,40.0";         fontsize=10.0;         overlap=false ;         spline=true;          nodesep=4.0;         "aaa" -- "aab" [penwidth=2.25 color="red" label="4" fontsize=7.0];     } GRAPHEND     )     echo $graph     #neato -Tpng $graph > graph.png      This trial is failing with following error               ./high_match.dot: line 2: unexpected EOF while looking for matching `)'     ./high_match.dot: line 11: syntax error: unexpected end of file      PS : Line no in second line may not be accurate as I have edited the file here.


title: File manager which is able to filter using regular expressions

text: Is there any graphical file-manager which supports thumbnails for linux like thunar or nautilus, which allows me to filter a directory by a regular expression. For example typing `/home/user/*tex` should show all tex-files, or `[AB].*` all files starting with A or B etc.


title: Fix or alternative for mktemp in OS X

text: I'm looking at a bash script someone else wrote that uses `mktemp`:               TEMP=`mktemp --directory`      However, this line does not work on my machine (OS X 10.6). How would I fix this line so that it is cross-un*x-like-platform compatible? **EDIT:** An alternative command would be sufficient as well.


title: Copy image from command-line to clipboard

text: Is there a way in a bash to copy a picture to the clipboard? For example if there is a picture `mypic.png` I want to have a command like `clipcopy mypic.png` such that I can go for example to inkscape and paste it afterwards.


title: Help me understand this echo/spawn/send/expect construct

text: Here is a line from a bash script I am trying to understand:               echo "spawn myscript.sh arg1 arg2; expect \"Please enter your value: \"; send \"myval\r\"; expect eof" | expect      I think I understand the first `expect` and the `send`. Q1: Does `expect` work only with `spawn`? Q2: What is the purpose of the last expect after the pipe? Q3: In general, can you guess what the original author of this line was attempting to accomplish?


title: How to change the primary display of dual screen Fedora 16?

text: I have a dual display Fedora 16. How can I change the primary screen (the one with the panel)?


title: How to execute udhcpc as non-root

text: On a Linux machine, I am trying to run the `udhcpc` command as non-root. I am getting the error `udhcpc: socket: Operation not permitted`. Is there any way to execute `udhcpc` as a simple user in Linux?


title: Obtain user and kernel time of a running process?

text: Is there way to determine using standard Linux/Unix tools how much a process has spent in User mode and how much waiting for kernel? In other words, exactly the "user" and "sys" values that you get when using `time`, but **during** process runtime? **NOTE:** one way is to use WBEM and enumerate Linux_UnixProcess, but I need to use _other_ tool than this; my aim is to verify what WBEM provider tells me, i.e. I need to use different tool.


I am trying to install ODBC driver for Debian according to those instructions: https://blog.afoolishmanifesto.com/posts/install-and-configure-the-ms-odbc- driver-on-debian/ However, when I type `sqlcmd -S localhost`, I get the error `libcrypto.so.10: cannot open shared object file: No such file or directory`. What to do? I tried 1.                $ cd /usr/lib       $ sudo ln -s libssl.so.0.9.8 libssl.so.10      $  sudo ln -slibcrypto.so.0.9.8 libcrypto.so.10      2.               Add /usr/local/lib64 to the /etc/ld.so.conf.d/doubango.conf file      3.               sudo apt-get update     sudo apt-get install libssl1.0.0 libssl-dev     cd /lib/x86_64-linux-gnu     sudo ln -s libssl.so.1.0.0 libssl.so.10     sudo ln -s libcrypto.so.1.0.0 libcrypto.so.10      4.               sudo apt-get install libssl0.9.8:i386      but none of those helped.


title: Measuring internet connection quality

text: I'm having WLAN trouble on my dualbooting win/linux laptop - the connection on linux side has occasional trouble, and seems somewhat slow and chunky. I would try to fix this issue by fiddling with all sorts of router settings, or WLAN kernel modules backports, or whatever - but problem is, it's hard to know if the settings have had any effect, since the problem appears in only subjective feeling about connection speed. So I'd like to have some way of executing a measurement that would tell me if the problem was affected or not. So far I've just used `iwconfig` which returns normal data, and `ping -c 100 -i 0.2` on the router and some stabile website ip addresses, but the summary doesn't give me all that good data, only the occasional packet loss. One information that's missing from the summary is the count of packets with clearly deviating roundtrip time, since that's one of the symptoms I've noticed - most packets come back with a regular time, but some of them take a lot longer. **So what tools can I use to get some _actual, numerical data_ on the quality of my internet connection?** (And just in case someone's wondering, yes, the problem _is_ real and not just confirmation bias, as it sometimes appears bad enough to throw me off the WLAN connection. It's probably somehow related to this Ubuntu bug and/or this Redhat bug)


title: Why does readelf show "System V" as my OS instead of Linux?

text: I compiled a small C program (2 lines of codes) with gcc to try to understand ELF file format. Doing a `readelf -h` on the object file, I have in the header :               OS/ABI:                            UNIX - System V       I am using Fedora, so why isn't it Linux instead ? **Edit** : I compiled               int main(){       int x = 0;       x++;     }      with `gcc -o main.o -c main.c`. My gcc version is               gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4)


title: Getting an existing Linux installation from one computer to boot on another

text: I have an existing Dell Precision 690 workstation setup to dual boot Windows XP and CentOS 5.5. These operating systems are installed on two separate drives. I have a grub menu on the Linux drive with it set as drive 1 and points to the windows boot info on drive 2. I tried taking the linux drive and installing it in a new HP Z800 workstation to see if I could be lucky enough to get it to boot, but it didn't. Immediately after it starts to boot I get a few errors. Here is what the system shows: Right after this message `Red Hat nash version 5.1.19.6 starting` I get the following lines:               Unable to access resume device (LABEL=SWAP-sda2)     mount: could not find filesystem '/dev/root'     setuproot: moving /dev failed: No such file or directory     setuproot: error mounting /proc: No such file or directory     setuproot: error mounting /sys: No such file or directory     switchroot: mount failed: No such file or directory     Kernel panic - not syncing: Attempted to kill init!      Is there something I can tweak to get this to possibly boot? I'd really like to not have to reload CentOS 5.5 and the specialized software on this machine. I do have a grub menu setup on this drive, could this by chance be my problem? The drives in the old machine are setup with Linux as drive 1, and Windows as Drive 2, and the Linux drive hosts the grub menu allowing me to boot to Linux or Windows. Could this some how be the problem? I do know of a way around this with Windows: install a secondary HDD controller card in the machine, install the drivers, hooked up drive to controller in old machine and make sure it boots, move the drive and controller to the new machine and boot off it, load the motherboard drivers (specifically the hdd controller drivers) and then you can take out the controller card, connect the hdd directly to the motherboard and you're set. This same thing is probably accomplish able in Linux, but I'm not sure. This might be a last ditch effort to try if nothing else works.


title: How to select an expandable folder when saving?

text: I have IMAP folders like this:               A     A/A     A/B     B     B/A     C      When I save (`s` in mutt) a mail and use `?`, I'm presented with a view like this:               A +     B +     C      It works perfectly until I want to move to `A` or `B`. If I click on `A`, it automatically expands `A` and presents me with its children (`A` and `B`). Is there a way to do that? Or is there a way to write it without using the `?` view?


title: What is the point of the `yes` command?

text: This question concerns the `yes` command found in UNIX and Linux machines: Basically, what is the point (if any) and history of this tool? Are there practical applications for it? Can an example be shown where it is useful in a script or chained (via pipe or redirect) with another tool? The manpage is below:               YES(1)                    BSD General Commands Manual                   YES(1)          NAME          yes -- be repetitively affirmative          SYNOPSIS          yes [expletive]          DESCRIPTION          yes outputs expletive, or, by default, ``y'', forever.          HISTORY          The yes command appeared in 4.0BSD.          4th Berkeley Distribution        June 6, 1993        4th Berkeley Distribution      Sample output:               $ yes why     why     why     why     why     ^Cwhy


title: Offline install wi-fi drivers on old PC using Linux Mint 15

text: I want to use wi-fi connection on my old notebook on which the Linux Mint 15 is installed, but I can't because it doesn't see any available installed drivers on it. I have searched many website and read different variations of setup, but no success. I have installed offline the b43-fwcutter perfectly, which is needed for wi-fi driver configuration, but have problems with activating driver. Some details about my settings on Linux Mint:               iwconfig      shows: 1). lo no wireless extensions eth0 2). no wireless extensions               sudo modprobe wl      shows: FATAL: Module wl not found               sudo lspci -vnn -d 14e4:      shows me , that I have 4311 version of the device               rfkill list      shows be , that neither software nor hardware is blocked if in the GUI mode (in my desktop environment) I click on the wireless icon, nothing appears in the application manager I haven't installed the STA broadcom drivers if to open Wireless Network drivers utillity in Mint , it doesn't show me any driver I also was trying to onstall `wl_apsta.o` with the next command               sudo b43-fwcutter -w /lib/firmware wl_apsta.o      all was extracting pretty fine but when I try to               sudo modprobe b43      nothing happens How to make work Wi-Fi with the Mint 15 perfectly in offline mode?


title: What does zsh's magic-space command do?

text: I found the following command in my `.zshrc`, probably copied from some website:               bindkey " " magic-space # do history expansion on space      The manpages are about as helpful as the very succinct comment:               magic-space         Perform history expansion and insert a space into the buffer. [...]      So what does `magic-space` actually do? Under which circumstances can I see this history expansion in action?


title: execute bit on directories, but not files

text: > **Possible Duplicate:**   >  How to apply recursively chmod directories without affecting files? What is the command to apply execute permission for directories (for traversal), but leave the execute bit off for files contained in the directory?


title: How do I know if software raid is running or setup correctly

text: This is what I pulled:               mdadm --monitor --scan -f --pid-file=/var/run/mdadm/mdadm.pid           cat /proc/mdstat     Personalities : [raid1]     md0 : active raid1 sda1[0] sdb1[1]           262080 blocks super 1.0 [2/2] [UU]          md1 : active raid1 sdb2[1] sda2[0]           8187840 blocks super 1.1 [2/2] [UU]          md2 : active raid1 sdb3[1] sda3[0]           479800128 blocks super 1.1 [2/2] [UU]           bitmap: 3/4 pages [12KB], 65536KB chunk          unused devices: <none>           fdisk -l          Disk /dev/sda: 500.1 GB, 500107862016 bytes     255 heads, 63 sectors/track, 60801 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00075973             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *           1          33      262144   fd  Linux raid autodetect     Partition 1 does not end on cylinder boundary.     /dev/sda2              33        1053     8192000   fd  Linux raid autodetect     /dev/sda3            1053       60802   479931392   fd  Linux raid autodetect          Disk /dev/sdb: 500.1 GB, 500107862016 bytes     255 heads, 63 sectors/track, 60801 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00038574             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1   *           1          33      262144   fd  Linux raid autodetect     Partition 1 does not end on cylinder boundary.     /dev/sdb2              33        1053     8192000   fd  Linux raid autodetect     /dev/sdb3            1053       60802   479931392   fd  Linux raid autodetect          Disk /dev/md2: 491.3 GB, 491315331072 bytes     2 heads, 4 sectors/track, 119950032 cylinders     Units = cylinders of 8 * 512 = 4096 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000               Disk /dev/md1: 8384 MB, 8384348160 bytes     2 heads, 4 sectors/track, 2046960 cylinders     Units = cylinders of 8 * 512 = 4096 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000               Disk /dev/md0: 268 MB, 268369920 bytes     2 heads, 4 sectors/track, 65520 cylinders     Units = cylinders of 8 * 512 = 4096 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x00000000      I am correctly to believe that all the partitions are correctly being mirrored right? Is there a way to check each individual drive to ensure?


title: What does the Windows flag in the Linux logo of kernel 3.11 mean?

text: I've just installed kernel-3.11.0-1.fc20 for my Fedora 19 installation. During the rebooting progress, I saw the Linux logo with a Windows flag in it, what does it mean? ![a Windows flag in Linux logo of Linux kernel 3.11](http://i.stack.imgur.com/1BTi0.jpg) The Fedora 19 is installed in an ASUS TX300CA notebook, secure boot is off, CSM (BIOS Compatibility Support Module) mode is on.


title: Hard drive partitioning

text: I have Linux installed on my computer. I have `/dev/sda1` where the mount point is `/` and `/dev/sda2` which contains `/dev/sda5` which is my swap space. I want to partition /dev/sda1. How do I go about doing this?


title: Once sudo su'd to root, is there a command to see my username?

text: I have sudo rights on a redhat box; once I've "sudo su -" to become root in a shell, are there any commands I can run to see what username I su'd FROM?


title: What distribution-maintained cross-compile toolchain packages exist?

text: I have just learned of Gentoo's sys-devel/crossdev package. This is a package that is useful for creating a cross-compiling toolchain. Are there any other such packages out there on other distributions? I'm specifically interested in distro-maintained packages because I've tried a couple of others (buildroot, crosstool) and it seems that and any time the distribution touches gcc or binutils, it invariably breaks at least the building of the toolchain if not the building of the project itself.


title: unresolved dependencies of bz* files for rpm make from source

text: I am trying to do a build of rpm from source. I got through the `./configure` and ran through a good chunk of `make`. Unfortunately I keeping getting stopped up on undefined references to `bzerror`, `bzwrite`, `bzflush` and others. Looking around online I see these functions are part of the `bzip2` package. Ive installed the development libraries, but I am still getting this message. Can anyone assist me in resolving these dependencies? thanks...               make[2]: Entering directory `/mnt/fedRoot/rpm-4.6.1/lib'     make  all-am     make[3]: Entering directory `/mnt/fedRoot/rpm-4.6.1/lib'     /bin/sh ../libtool --tag=CC   --mode=link gcc -std=gnu99  -g -O2 -fPIC -DPIC -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wno-char-subscripts  -fno-strict-aliasing -fstack-protector   -o rpmdb_archive  ../db3/db_archive.o ../db3/util_sig.o librpm.la -lrt -lpthread      gcc -std=gnu99 -g -O2 -fPIC -DPIC -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wno-char-subscripts -fno-strict-aliasing -fstack-protector -o .libs/rpmdb_archive ../db3/db_archive.o ../db3/util_sig.o  ./.libs/librpm.so /mnt/fedRoot/rpm-4.6.1/rpmio/.libs/librpmio.so -lmagic -lelf -llua -lm -lnss3 -lpopt -lrt -lpthread  -Wl,--rpath -Wl,/usr/local/lib          /mnt/fedRoot/rpm-4.6.1/rpmio/.libs/librpmio.so: undefined reference to `bzerror'     /mnt/fedRoot/rpm-4.6.1/rpmio/.libs/librpmio.so: undefined reference to `bzwrite'     /mnt/fedRoot/rpm-4.6.1/rpmio/.libs/librpmio.so: undefined reference to `bzflush'     /mnt/fedRoot/rpm-4.6.1/rpmio/.libs/librpmio.so: undefined reference to `bzdopen'     /mnt/fedRoot/rpm-4.6.1/rpmio/.libs/librpmio.so: undefined reference to `bzread'     /mnt/fedRoot/rpm-4.6.1/rpmio/.libs/librpmio.so: undefined reference to `bzclose'     /mnt/fedRoot/rpm-4.6.1/rpmio/.libs/librpmio.so: undefined reference to `bzopen'     collect2: ld returned 1 exit status     make[3]: *** [rpmdb_archive] Error 1     make[3]: Leaving directory `/mnt/fedRoot/rpm-4.6.1/lib'     make[2]: *** [all] Error 2     make[2]: Leaving directory `/mnt/fedRoot/rpm-4.6.1/lib'     make[1]: *** [all-recursive] Error 1     make[1]: Leaving directory `/mnt/fedRoot/rpm-4.6.1'     make: *** [all] Error 2


title: How do you set the path in a non-shell environment (KDE)?

text: I'd like to override one of the applications set in `/usr/bin/`. I have created an alternative with the same name in `~/bin/` which in in my `PATH` (as set both in `.bashrc` and in `.profile`). When I start the application from the console, I get the expected result: my application is started instead of one from the distribution. However, within KDE, when I do alt+F2 and type in the application name, the one in `/usr/bin` starts instead of the one in `~/bin/`. How do I set KDE so that `~/bin` is recognized from everywhere in KDE. I'll probably also have to edit the K-menu, although I am not sure how to do it with KDE4.


title: Python Web interface for simple mysql database

text: We need a new web interface for our internal car booking system, which is implemented in mysql database. Could somebody please advise, what would be a suitable solution (which framework, if any). The main criteria is **simplicity** and future **maintainability**. We therefore would like some clean, minimalistic solution. Once completed, the interface will be expected to be running for many years (5-10). We would therefore like to use some technology, which is likely to be around in 5-10 years time. We would like to implement it in python.


title: Replacing Upstart with Sysvinit in Wheezy results in error

text: I have a Debian Wheezy server with upstart installed. I removed upstart and replaced it with sysvinit, which resulted in the following error:               apt-get install --reinstall sysvinit     Reading package lists... Done     Building dependency tree     Reading state information... Done     0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 2 not upgraded.     Need to get 0 B/133 kB of archives.     After this operation, 0 B of additional disk space will be used.     (Reading database ... 102927 files and directories currently installed.)     Preparing to replace sysvinit 2.88dsf-41+deb7u1 (using .../sysvinit_2.88dsf-41+deb7u1_amd64.deb) ...     Unpacking replacement sysvinit ...     Processing triggers for man-db ...     Setting up sysvinit (2.88dsf-41+deb7u1) ...     sysvinit: restarting...init: timeout opening/writing control channel /run/initctl     .init: timeout opening/writing control channel /run/initctl     .init: timeout opening/writing control channel /run/initctl     .init: timeout opening/writing control channel /run/initctl     .init: timeout opening/writing control channel /run/initctl     .init: timeout opening/writing control channel /run/initctl     .init: timeout opening/writing control channel /run/initctl     .init: timeout opening/writing control channel /run/initctl      failed.      I'm afraid if i restart the server won't boot anymore... what exactly is the problem here?


title: How to diagnose/troubleshoot bogus applets in Cinnamon?

text: I discovered that on Cinnamon 1.8, when there is a problem with the JavaScript code in Cinnamon applet, sometimes user don't get an error message, but the whole desktop freezes (i.e. applications keep running, but nothing gets displayed on screen). Unfortunately, I have experienced such freezing behavior on Cinnamon 2.0 (Linux Mint 16 64bit), and I have had a hard time tracking down this problem. This event occurs rarely (1 in 3-5 hours), so debugging it by means of bisection is very time consuming. And when it does, I am often forced to restart `mdm` and lose all unsaved data. Besides, applications don't like such brutal restarting and I expect to have problems with Firefox and Eclipse profiles if I continue restarting them in such a way.


title: Apache mail sending flowchart / workflow?

text: I am currently trying to get my head into learning how Linux systems send mail, starting from Apache, to Sendmail and finally out the door. Specifically I'm using CentOS 5 which is using Sendmail, I'm fairly sure it's the vanilla setup although I didn't set it up myself. I'm interested in things like, how mail is queued when a service like sendmail is disabled, how Apache and Sendmail talk to each other, what other options are there instead of Sendmail etc. My most immediate mission is to figure out how to create a whitelist for sending out, so that mail can only be sent to specific recipients, and if a mail is blocked then it's either rerouted to a specified address. I'm in no way partial to sendmail, and if performing such a task involved switching software then I'm all for it. The server itself is a staging server, however it recently managed to send out some production data to production email addresses which caused a bit of embarrassment and so I've been tasked with locking it down, however I'm pretty fresh to the entire mailing process on Linux. **Edit:** Additionally, the current state of the server I'm working on is that; sendmail is disabled and a bunch of emails are now stacked up in clientmqueue, however some of these don't appear to hold any recipient data. Is recipient data held elsewhere? What is likely to happen if I now enable sendmail, will these items send out?


title: What would it take for a *nix system to shutdown, then continue to grub?

text: Is this possible to shutdown to grub, not all the way so you don't have to load back up the BIOS and other things. Like to give you the ability to quickly boot for Linux to Windows?


title: sed replace only lines with matching groups

text: Currently, I have this command:               sed 's/\([^C]*\)/\1AB/'      It inserts "AB" before the first instance of "C" on a line. But it is also adding "AB" at the end of every line without a "C". How can I have it only edit when it finds "C"?


title: difference between omz "plugins" and "themes"?

text: What exactly is the difference, _operationally_ , between plugins and themes in oh-my-zsh? I.e. how would things break (if at all) if a plugin were instead put among the themes, or a theme among the plugins? Or is the distinction purely organizational?


title: Mouse BTC 5213RF (M) does not work under Ubuntu 13.10 Server

text: I have been given BTC wireless mouse/keyboard with RF transciever. This RF transciever plugs in into PS2 keyboard and mouse ports and turn on mouse and keyboard and both were working (mouse and keyboard) were working in Windows XP. I've moved this mouse/keyboard system to my Ubuntu 13.10 Server and now the keyboard works, but mouse does not. Does anyone have some ideas what might be wrong? The keyboard model is BTC 5213RF (TX). The mouse model is BTC 5213R (M).


title: Gentoo Linux portage USE flags: what is the difference between removing a default vs. not having a default, how do the defaults compare, no-multilib?

text: Gentoo Linux `portage` relies on USE flags to customize compiling options for software. Here's an example showing how to organize USE flags in a `make.conf` file:               # ************ USE **************     # ******** profile 'kde' ********     MYPROFILE="apache2 mysql"     HW="3dnow -bluetooth directfb fbcon hddtemp lm_sensors mmx nvidia smp svga xcomposite xvmc"     SYSTEM="caps -cups curl -fortran java nsplugin -oss syslog"     NET="-ipv6 -isdnlog -ldap ppp wifi"     CMDL="bash-completion gpm offensive vim-syntax"     KDE="htmlhandbook plasma semantic-desktop"     GNOME_DEPS="gstreamer -gtk"     DEV="tidy vhosts"     MMEDIA="aalib cdda cddb css dvb exif ffmpeg fontconfig gd gimp gphoto2 imagemagick libcaca lame matroska mplayer musicbrainz quicktime theora v4l v4l2 xine xpm xscreensaver"          USE="${MYPROFILE} ${HW} ${SYSTEM} ${NET} ${CMDL} ${GNOME_DEPS} ${KDE} ${DEV} ${MMEDIA}"      And this configuration is meant to upstage (because of precedence) the cumulative 13.0 profile containing the default flags for instance:               (This example is the sum of the settings in base, default/linux,      default/linux/x86 and default/linux/x86/13.0/)     USE="a52 aac acpi alsa branding cairo cdr dbus dts dvd dvdr emboss encode exif     fam firefox flac gif gpm gtk hal jpeg lcms ldap libnotify mad mikmod mng mp3     mp4 mpeg ogg opengl pango pdf png ppds qt3support qt4 sdl spell     startup-notification svg tiff truetype vorbis unicode usb X xcb x264 xml xv     xvid"        * What is the difference between removing support for a feature that appears in the defaults by using `-useflag` in the `make.conf` file vs. not having a feature in the cumulative defaults at all and having nothing related to it either in the make.conf file?   * Can an application sourced from the default profile be qualified in relation to a standard application compiled in one of the standard Linux distributions? (is the default profile close to some "standard" or is it already a pretty much customized subset?)   * Is it really an issue nowadays to select a no-multilib profile for the whole build?


title: How to delete the clipboard in the middle wheel

text: Right click on the text field the popup mouse menu shows that the clipboard is blank, but when press the wheel in the middle of the mouse the previous selected text is pasted. Why is this and how can I clear that text? Gnome 3.6.2 + opensuse 12.3


title: Linux empty buffer cache command permission denied

text: I'm using the following commands to flush cache:               # sync; echo 3 > /proc/sys/vm/drop_caches     # sync; echo 2 > /proc/sys/vm/drop_caches     # sync; echo 1 > /proc/sys/vm/drop_caches      When I use one of the above commands, I get the following:               -bash: /proc/sys/vm/drop_caches: Permission denied      My system running CentOS 6.5, I logged in as root via SSH. Any suggestions?


title: How can I get kqemu or even just qemu to show up in virsh capabilities on CentOS 6.4?

text: I have a CentOS 6.4 box that I'm trying to set up a VM on to run WinXP. This box doesn't have VT, which may not be ideal, but I'll settle for less than ideal. Apparently I should be able to install a kqemu kernel module and then use `\--virt-type kqemu` with `virt-install`, and it should at least run, albeit slowly.               $ sudo modprobe kvm     FATAL: Module kvm_intel not found.      Same with `kqemu`. Okay, so:               $ sudo yum install kvm     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile      * base: less.cogeco.net      * extras: www.cubiculestudio.com      * updates: centos.mirror.rafal.ca     Setting up Install Process     No package kvm available.     Error: Nothing to do      And same with `kqemu` and `qemu` (despite the official docs). Meanwhile:               $ virsh capabilities     ...     <domain type='lxc'>     </domain>      The docs say that this last one should tell me which hypervisors are available, but I want to install WinXP on the VM, so LXC will not do the trick. How can I get `kqemu` or even just `qemu` to show up in `virsh capabilities`?


title: What is the tun network interface for?

text: I noticed when running ifconfig that there is a network interface called tun0 and it has an ipv4 address. A bit of research shows that it is a tunneling device, but I don't really know how it's used, what's using it, and why it has an IP address. I do have iptables enabled, and there seems to be some link between iptables and tun, if that helps.


title: fixing cpan by resetting it

text: So I ran into a simple little problem. This is a somewhat rookie mistake. I wasn't connected to the internet and started cpan. It started to configure for the first time and then when I realised a few seconds later that the internet wasn't connected I hit `Ctrl + C` When I connected to the internet and brought CPAN up again, it asked me to continue from where is left, but prompted me for a WHOLE lot of configuration options. I left them to default. It then asked me for a **mirror URL** , I think I typed it incorrectly. Now cpan doesn't work at all!! I would like to reset to the typical first start I'm used to where it will ask to configure everything for me. I looked at this perlmonks post which suggested deleting `/etc/perl/CPAN/Config.pm` but it doesn't exist for me. `/etc/perl` doesn't exist itself. **Question** : I'm on CentOS 6.4, how do I reset cpan?


title: Mount NTFS image file created using partimage

text: From an old disk which I don't have at hand, I have created a file named winxp.img using `partimage`. As the filename suggests, the partition contained Windows XP and was formatted with NTFS. (The file contains only a 4.6 GiB NTFS partition, not the whole disk.) How can I access the files inside this image without restoring it onto a physical disk?


title: Too many smtpd daemon forks?

text: I have many forks from `smtpd` in my process list on my webserver. What does this mean? Is my mailbox full?                  postfix   2662  0.0  0.9 106336  4856 ?        S    17:37   0:00 smtpd -n         smtp -t inet -u -c -o stress yes        postfix   2800  0.0  0.9 106336  4860 ?        S    15:59   0:00 smtpd -n         smtp -t inet -u -c -o stress yes        postfix   3644  0.0  0.9 106336  4864 ?        S    13:47   0:00 smtpd -n         smtp -t inet -u -c -o stress         postfix   3732  0.0  0.9 106336  4872 ?        S    14:36   0:00 smtpd -n         smtp -t inet -u -c -o stress yes        postfix   3835  0.0  0.9 106336  4868 ?        S    14:36   0:00 smtpd -n         smtp -t inet -u -c -o stress yes        postfix   4309  0.0  0.9 106336  4864 ?        S    13:48   0:00 smtpd         -n smtp -t inet -u -c -o stress         postfix   4603  0.0  0.9 106336  4860 ?        S    16:13   0:00 smtpd -n         smtp -t inet -u -c -o stress yes        postfix   4843  0.0  0.9 106336  4864 ?        S    13:49   0:00 smtpd -n         smtp -t inet -u -c -o stress       I have plenty more of these lines in my process list. Output of pstree gives me:                ├─master─┬─anvil      │        ├─cleanup      │        ├─pickup      │        ├─proxymap      │        ├─qmgr      │        └─100*[smtpd]      Edit: Recently I've changed the mysql to listen from localhost to my extern ip. Now I'm getting this error in the mail log:               warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on        '127.0.0.1' (111)     May 21 22:23:00 postfix/trivial-rewrite[15741]: fatal: mysql:/etc/postfix/mysql-        virtual_mailbox_domains.cf(0,lock|fold_fix): table lookup problem     May 21 22:23:01  postfix/smtpd[31036]: warning: problem talking to service rewrite:         Success     May 21 22:23:01  postfix/smtpd[30757]: warning: problem talking to service      rewrite:          Connection reset by peer      It's flooding my log and it's already >600MB. How can I change postfix to listen to my extern ip? I need to connect to mysql from my home location and not from localhost? Edit: Nevermind.


title: vim custom pop up menu

text: How do I create a custom completion pop up menu. I would like to be able to begin typing a part of a string then press a custom key combination to bring up a pop up completion of just a certain group of strings.   I already have omni complete set up and do not want to add to that list. For example I have the list:   spo   spe   spa      I would like to be able to type sp then press ctrl+> and have a completion box come up for just that specific list.


title: Permissions don't restrict access to NFS mount

text: We've got a RHEL 5.9 server with NFS mounted directories from a central NAS. There we've got a directory owned by `aird1(11055):app_dev(1101)` user/group with `rwxrwsr-x` permissions (i.e. _sgid_ to app_dev). And finally we've got a process running as `grid(1001)` user. The trouble is that the `grid` user can write into the directory although it shouldn't be able to. When I make a local test directory with the same ownership and permissions as the NFS mounted one I can't write to it, which is what I expect. For some reason the NFS mounts don't fully obey the permissions. Here's an example:               $ ls -ldn /nfs/aird1/tmp     drwxrwsr-x 5 aird1(11055) app_dev(1101) 24576 Oct 17 13:21 /nfs/aird1/tmp      The directory is owned by `aird1(11055):app_dev(1101)` and has no ACLs attached. When I attempt to create a file under my account it fails:               $ id     uid=20501(myuser) gid=1003(mygroup) groups=10(wheel),1003(mygroup)          $ ls -l /nfs/aird1/tmp/xyz     ls: /nfs/aird1/tmp/xyz: No such file or directory          $ touch /nfs/aird1/tmp/xyz     touch: cannot touch `/nfs/aird1/tmp/xyz': Permission denied      That's expected, but now the same as user `grid`...               $ id     uid=1001(grid) gid=1001(oinstall) groups=1001(oinstall),1002(dba)          $ touch /nfs/aird1/tmp/xyz          $ ls -l /nfs/aird1/tmp/xyz     -rw-r--r-- 1 grid(1001) app_dev(1101) 0 Oct 17 13:24 xyz      How come I was able to create the file?? There is no overlap between the UIDs and GIDs of directory ownership and either the `myuser` or `grid` yet with some UIDs/GIDs I can create the file and with some others I can't. This is the record from `/etc/fstab`:               nas:/vol/... /nfs  nfs   rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,vers=3,timeo=600,nosuid,actimeo=0 0 0      Any ideas what's going on here? Thanks!


title: File descriptor limits are lost after a system reboot

text: I'm trying to increase the default file descriptor limits for processes on my system. Specifically I'm trying to get the limits to apply to the Condor daemon and its sub-processes when the machine boots. But the limits are never applied on machine boot. I have the limits set in `/etc/sysctl.conf`:               [root@mybox ~]# cat /etc/sysctl.conf     # TUNED PARAMETERS FOR CONDOR PERFORMANCE     # See http://www.cs.wisc.edu/condor/condorg/linux_scalability.html for more information          # Allow for more PIDs (to reduce rollover problems); may break some programs     kernel.pid_max = 4194303          # increase system file descriptor limit     fs.file-max = 262144          # increase system IP port limits     net.ipv4.ip_local_port_range = 1024 65535      And in `/etc/security/limits.conf`:               [root@mybox ~]# cat /etc/security/limits.conf     # TUNED PARAMETERS FOR CONDOR PERFORMANCE     # See http://www.cs.wisc.edu/condor/condorg/linux_scalability.html for more information     # Increase the limit for a user continuously by editing etc/security/limits.conf.     *        soft  nofile        32768     *        hard  nofile      262144 #65536      The trouble I run in to is, on system reboot, the limits don't seem to apply to Condor and its processes. After a reboot, if I look at the file descriptor limit for a Condor process I see:               [root@mybox proc]# cat /proc/`/sbin/pidof condor_schedd`/limits | grep 'Max open files'     Max open files            1024                1024      But if I restart the `condor_schedd` process after a reboot the limits are increased as expected:               [root@mybox proc]# cat /proc/`/sbin/pidof condor_schedd`/limits | grep 'Max open files'     Max open files            32768                262144      The `boot.log` indicates these limits are being set before my Condor daemon and its processes are being started:               May 18 07:51:52 mybox sysctl: net.ipv4.ip_forward = 0     May 18 07:51:52 mybox sysctl: net.ipv4.conf.default.rp_filter = 1     May 18 07:51:52 mybox sysctl: net.ipv4.conf.default.accept_source_route = 0     May 18 07:51:52 mybox sysctl: kernel.sysrq = 0     May 18 07:51:52 mybox sysctl: kernel.core_uses_pid = 1     May 18 07:51:52 mybox sysctl: kernel.pid_max = 4194303     May 18 07:51:52 mybox sysctl: fs.file-max = 262144     May 18 07:51:52 mybox sysctl: net.ipv4.ip_local_port_range = 1024 65535     May 18 07:51:52 mybox network: Setting network parameters: succeeded     May 18 07:51:52 mybox network: Bringing up loopback interface: succeeded     May 18 07:51:57 mybox ifup: Enslaving eth0 to bond0     May 18 07:51:57 mybox ifup: Enslaving eth1 to bond0     May 18 07:51:57 mybox network: Bringing up interface bond0: succeeded     May 18 07:52:17 mybox hpsmhd: smhstart startup succeeded     May 18 07:52:17 mybox condor: Starting up Condor     May 18 07:52:17 mybox rc: Starting condor:  succeeded     May 18 07:52:17 mybox crond: crond startup succeeded      Obviously I'd like to avoid having to boot a machine and then restart process that I need these increased limits to apply to -- what have I done wrong that's preventing these limits from applying to the processes when the machine boots?


title: A command used in another command

text: For djvused command, there is an option: > -e command > > Cause djvused to execute the commands specified by the option argument > commands. It is advisable to surround the djvused commands by single quotes > in order to prevent unwanted shell expansion. For example, `djvused myfile.djvu -e 'print-pure-txt'`. It is quite unusual to me in that a command (here djvused) can run other commands (here by `-e` option). I was wondering how it is possible? Is this a frequent practice in command line interface? Is this similar to print command used in awk command? The only way I know for a command to be used in another command is:               echo `echo hello`      Thanks and regards!


title: How can I use my TV as a second display over HDMI on Linux at its native resolution?

text: My TV is a Philips 19PFL4322. It's native resolution is 1440x900 . My laptop's graphics card is a ATI Radeon HD 3650, using the open source `radeon` driver on X.org server 1.10. If I connect them via VGA in Linux, or via anything in Windows, it displays correctly at that resolution. If I connect it via HDMI in Linux, it defaults to a 1024x768 resolution, and GUI tools will only allow me to set it up to 1360x768, all of which look pretty bad on it. If I force the issue by generating a modeline using `cvt 1400 900` and then setting that as the mode using xrandr, I get no output on that monitor. When connnected via VGA, Linux correctly identifies it as a Philips 19" TV. When connected via HDMI, it misidentifies it as an 18" TV. How can I get the monitor to display correctly on Linux using HDMI? **EDIT: xrandr output**. `VGA-0` and `HDMI-0` are both my TV, `LVDS` is my laptop display, 1280x960 which is listed under HDMI-0 is not a valid output for my TV. 1440x900 which isn't listed is a valid output.               Screen 0: minimum 320 x 200, current 2880 x 900, maximum 8192 x 8192     VGA-0 connected 1440x900+1440+0 (normal left inverted right x axis y axis) 410mm x 257mm        1440x900       59.9*+        1360x768       59.8          1280x720       60.0          1024x768       75.1     70.1     60.0          832x624        74.6          800x600        72.2     75.0     60.3     56.2          640x480        72.8     75.0     66.7     60.0          720x400        70.1       LVDS connected 1440x900+0+0 (normal left inverted right x axis y axis) 367mm x 23000mm        1440x900       60.8*+        1280x854       59.9          1280x800       59.8          1280x720       59.9          1152x768       59.8          1024x768       59.9          800x600        59.9          848x480        59.7          720x480        59.7          640x480        59.4       HDMI-0 connected (normal left inverted right x axis y axis)        1920x1080i     25.0 +        1280x960       60.0          1360x768       59.8          1280x768       59.9          1280x720       60.0          1024x768       75.1     70.1     60.0          800x600        72.2     75.0     60.3     56.2          640x480        72.8     75.0     66.7     60.0          720x400        70.1


title: Can I run a command with specific privileges on certain directories?

text: I would like to be able to run a command, passing in parameters to bash or similar, such that this command is not allowed to write to a particular path, overriding the user's other privs. Eg:               root> /bin/bash -protect /folder/to/protect mycommand.sh      In this example, the root user can obviously do what it wants, but while I test a new script I'm writing, I would like to protect a folder, as if the folder was read only for that user. Is there a way to do this without adding a new user and adjusting that user's privs accordingly? It doesn't have to be in bash by the way, I don't mind the approach - as long as I can protect folders without adding a new user I don't mind! (I'm sorry about the title, I can't really think of how to explain my requirements in one line!)


title: How to format a USB storage no detected in Ubuntu?

text: I have a memory stick that is not mounted in Ubuntu and it doesnt works in Windows. I can check is connected using               Bus 003 Device 011: ID 05e3:0727 Genesys Logic, Inc. microSD Reader/Writer      But I cannot mount it. I want to try formating it to check if is detected again in Windows and Linux. How could I do without mount it?


title: safely killing a background process

text: I'm writing data to a pipe in a parent process. The parent process creates a background job that reads data from the pipe & write it to the screen & to a log file.   How can I know when to kill the background job? `wait` command simply waits forever. I prefer to not use a token to detect the "end of output". Code example:               function log()     {         if [ -z "$counter" ]; then             counter=1         else             (( ++counter ))         fi              if ! [[ -z "$teepid" ]]; then             # ***** How can I know if it's safe to kill here?             kill $teepid         fi         # Display text-to-be-logged on screen         #  & write text-to-be-logged to it's corresponding log file         tee <"$pipe" 1>&4 "${logs_dir}/${counter}_${1// /_}" &         teepid=$!     }          logs_dir="/path/to/log/dir"          pipe_dir=$(mktemp -d)     pipe="${pipe_dir}/cmds_output"     mkfifo "$pipe"     exec 3<>"$pipe" # link file descriptor (FD) #3 to $pipe for r/w     exec 4<&1   # save value of FD1 to FD4     exec 1>&3   # redirect all output to FD3          log # Logs the following code block     {         # ... Many bash commands ...     }          log # Logs the following code block     {         # ... Many bash commands ...     }          if ! [[ -z "$teepid" ]]; then         # ***** How can I know if it's safe to kill here? Maybe it's still logging         kill $teepid;     fi      * * * **Edit:** I tried:               exec 3>&-     #exec 1>&- # Have tried also uncommenting this row     wait $teepid     exec 3<>"$pipe"     exec 1>&3     kill $teepid      but the wait command still hangs... I found that `ps -o pid,ppid,s --pid $teepid` shows the state of the process. Should I count on that?


title: SSH Port Forward a local IRC server to my remote server

text: So, I have this slight dilemma: I am not allowed to host an IRC server on my VPS, but I am allowed to use tunneling of some sort to let users connect to an IRC server I have set up locally on my Mac Mini. Basically - how would I go about tunneling connections to port 6667 of my VPS to my Mac Mini without opening a port in my router (that's what I get for having a technically inclined dad)? I've read up a little on SSH port forwarding, but after about 3 hours of constant googling and trying things out, I just can't seem to get it to work. I've also been considering things like Himmachi(or whatever it's actually called now) and then somehow route the Himmachi IP of my Mac Mini to be public. I know that my writing probably sounds hopelessly confused, but that's because I'm hopelessly confused as to where I could go from here. I'd appreciate any help in this subject.


title: Is it possible to "hide" an account from /etc/passwd?

text: A typical Linux system has not only accounts for the actual user(s) of the system, but also various system accounts. Is there any file like `/etc/passwd` for daemons, or other means resources where an account might be defined? I heard that it is possible to camouflage a account as a service account, I'm trying to find accounts like these in a computer.


title: writing a command transcript to file

text: Here is a script from Mercurial issue 2743. Call it `mq.sh`. I'm trying to get it to do the following things, on Debian squeeze.   1. Echo commands + standard output + standard error to a file.   2. Prefix with working directory. Sticking in $PWD doesn't work, as it presumably just keeps using the value from when it was first   sourced.   3. Reset redirection back to normal standard output/error at the end. I'm not sure how to do this, but I imagine I'd have to use `exec` again.   4. I'm calling this with `sh mq.sh`. I'd like to do everything portably (if possible), and it seems exec is bash-specific, so I'm puzzled why this is working. Also `set -x xtrace` is probably bash specific as well. I got it from the Bash reference manual. Doesn't calling with `sh` run everything through `dash` on Debian? 1 currently works, I think. How do I do 2 and 3? And can I have a clarification on 4?               export PS4="$PWD$ "     exec > mq.log 2>&1     export HG="hg-crew"     rm -r main clone          set -o xtrace     $HG init main     cd main     $HG init --mq     $HG qnew foo     echo a > a     $HG add     $HG qref     $HG ci --mq -Am.     cd ..     $HG qclone main clone     cd clone     $HG paths --mq     mv .hg/patches/.hg/hgrc{,.foo}     $HG paths --mq     $HG push --mq     echo b >> a     $HG qref     $HG ci --mq -m.     mv .hg/patches/.hg/hgrc.foo .hg/patches/.hg/hgrc     $HG push --mq


title: Forwarding X11 over SSH if the server configuration doesn't allow it

text: Consider a situation where I'm logging in over SSH from machine A to machine B, I have an X session on machine A, and I want to run an X program on B. `ssh -X B` makes this work transparently. But what if the server configuration lacks `X11Forwarding yes`, I don't have root permissions on the server, and the server administrator is indifferent? It's obviously possible to forward the X11 connection, since I can transfer whatever I want over the SSH channel. In fact, if the local X server allows TCP connections, it's as easy as `ssh -R 6010:localhost:6000` (to be adjusted for the display numbers). What about the common case where the local X server only allows socket connections? How do I do X forwarding conveniently and securely, with a minimum of installation requirements (especially on B)?


title: Permission issues while setting up cakephp

text: I am pretty new to linux and trying to setup cakephp on opensuse 12.1. I did as told on the cakephp website(blog tutorial) and most probably encountering some permission issues. I slapped the cakephp folder in /srv/www/htdocs and then tried to access it using localhost/cakephp where it says               Access forbidden!     You don't have permission to access the requested object. It is either read-protected or not readable by the server.     If you think this is a server error, please contact the webmaster.     Error 403      But as i check for permissions I get               Suse:/srv # ls -lR shows sankalp as owner for all the files down the tree.          sankalp@Suse:/srv/www/htdocs> whoami     sankalp     sankalp@Suse:/srv/www/htdocs> ls -l     total 108     drwxrwxrwx  6 sankalp users  4096 Jun 27 12:44 cakephp     -rw-r--r--  1 sankalp users 73728 Jul  6 10:41 das     -rwxrwxrwx  1 sankalp  root    302 Mar 13  2006 favicon.ico     -rwxrwxrwx  1 sankalp  root     26 Jun 28 19:04 whoami.php      Neither can I access whoami.php while favicon.ico gets displayed in the browser.What am I doing wrong here when I have given 777 to the user.


title: Debian Squeeze as a router

text: I'm trying to setup Debian Squeeze (ala Dreamplug) as a router. I can't seem to get the pieces to fit together. ETH0: Upstream/internet - DHCP-Client   ETH1: Downstream/Lan - 192.168.0.1 DHCP-Server sudo vim /etc/network/interfaces               auto lo br0     iface lo inet loopback          auto eth0     iface eth0 inet dhcp          auto eth1             iface eth1 inet static             address 192.168.0.1             network 192.168.0.0             netmask 255.255.255.0             broadcast 192.168.0.255          iface br0 inet dhcp             bridge_ports eth0 eth1      sudo vim /etc/dhcp/dhcpd.conf               option domain-name "MyPlug.MyServer.com";     option domain-name-servers 8.8.8.8, 192.168.0.1;          default-lease-time 600000000;     max-lease-time 720000000;          subnet 192.168.0.0 netmask 255.255.255.0 {         range 192.168.0.100 192.168.0.200;         option routers 192.168.0.1;         option broadcast-address 192.168.0.255;     }      sudo vim /etc/default/isc-dhcp-server               INTERFACES="eth1"      service networking restart   service isc-dhcp-server restart My windows 7 machine picks up an IP... AFTER I force release/renew. I was able to get it to connect to the server via putty once. Anything noticeably wrong with my settings? or anything else I can look for?


title: How to create a fake device file that accepts input from a C program?

text: I want to create a C program that accepts input from a joypad (`/dev/input/js0`), processes it, and then sends it to a fake device file (character _or_ block) labeled as a keyboard (oh, and what _is_ the device file for a keyboard?. I would like to know if it is possible to do this, and if so, how.


title: Disallow switching to other windows

text: I'm working on a python project where I'm displaying a graphical window with a login screen. I've disabled the close, re-size and minimize buttons. The OS is Ubuntu. I have to disable all the interrupts, including disabling system shortcuts like `Alt`+`Tab`, `Alt`+`F4`, etc. so that a user can log in only after entering the username and passwords on the screen.


title: Vim colorscheme background not filling terminal

text: I am using vim with lxterminal, and the colorscheme kolor, and I am experiencing an issue where vim's background color does not fill the entire terminal. ![vim background](http://i.stack.imgur.com/iWd37.png) It can be seen clearly at the bottom of this screenshot, as you can see the color of my terminal. My .vimrc is as follows;               syntax on          " Enable syntax highlighting          set number         " Enable line numbers     set smartindent    " Automatically indent text     set tabstop=4      " Set tab width to 4 spaces     set shiftwidth=4   " Indent text when using '>'     set expandtab     set nocompatible   " Disable compatibility mode (prevent ABCD key bugs)     set viminfo=          filetype plugin on " Enable filetype plugins          au BufNewFile,BufRead *.ino set filetype=cpp " Alias arduino (ino) files      I have tried changing my `TERM` environment variable to `screen-256color`, but to no avail. `TERM` is currently set to `xterm-256color`.


title: delete files matching pattern

text: I need to recursively remove all files in all subdirs where the filename contains a number followed by an 'x' followed by a number, at least two times. Example: I'd want to remove these files:               'aaa-12x123-123x12.jpg'     'aaa-12x12-123x12-12x123.jpg'      But I do NOT want to remove these files:               'aaa.jpg'     'aaa-12x12.jpg'     'aaaxaaa-123x123.jpg'     'aaaxaaa-aaaxaaa.jpg'      How can I do that (from the bash shell)


title: Removing unwanted lines in text file

text: All I need is the `sed` or `awk` code to remove the even numbered lines in a text file. Nothing fancy I just need to remove irrelevant data on the even lines of a text file.


title: How to use netstat command

text: My question is what does it mean to LISTEN or ACCEPT on a port as it relates to my example? Example: I have a tomcat server, and It will use port 8080. I want to make sure that port is available for me to use. What commands should I perform on my unix server and why? what information would a command like this give me: `netstat -an | grep LISTEN`


title: Create multiple databases in one command line?

text: Can this command be scripted?               $ mysqladmin -u username -p create databasename      I'd like to do it for multiple names all at once? Also I'd like to then set permissions for all of them at once as well. I'm not sure how to do this?


title: Recovering files using extundelete

text: I've accidentally deleted some files in my package managers's cache after an update (so I've deleted all packages that were downloade and unforunately they weren't even installed). Here's what I've done:   1. Booted to a Ubuntu System that's on the same HDD as the Arch system.   2. Now that I booted into Ubuntu the root partition of the Arch System is unmounted so, extundelete gave me this output:              $ sudo extundelete /dev/sda1 --restore-directory /var/cache/pacman/pkg/          WARNING: Extended attributes are not restored.          Loading filesystem metadata ... 232 groups loaded.          Loading journal descriptors ... 30722 descriptors loaded.          Searching for recoverable inodes in directory /var/cache/pacman/pkg/ ...           9385 recoverable inodes found.          Looking through the directory structure for deleted files ...           9385 recoverable inodes still lost.          No files were undeleted.      Is there anything I can do about it? Or am I completely screwed?


title: systemd - Timer units that mimic anacron behaviour

text: I need to write a timer unit for a machine which is turned of frequently (e.g. classical desktop setup). This timer unit needs to be activated regularly but not very often (e.g. weekly, monthly). I did find some approaches but they all don't really fit:   * According to the man pages only the `OnBootSec` and the `OnStartupSec` directives will be activated if the configured point of time is in the past. I found as well some examples using a combination of these with `OnActiveSec` to define a regular event. The problem is: Every time the machine is booted the timer will activate the configured unit. If you got a timer which should run ONCE a week/month that is far too often. For example: I don't want to get my logs rotated three times a day...   * Solutions with the `OnCalendar` directive. If the machine is powered off at the configured point in time (mostly midnight because if you omit the hour in the time specification it defaults to 00:00:00) the timer won't be activated after the next boot. That's at least how I got it. Is that right ? So here comes the question:   **Are timer with calendar events activated right after the next startup if the configured time is in the past ?   If not: Is there a workaround to get such a behaviour ?**


title: Batch file move to directory structure based on filename

text: I am writing a script to move files into directories based on the filename. Files have `yyyyddmm-xxxxxxx.jpg` name format. The desired directory structure is in the format `2013/01 Jan/31`. I am unable to get `date` to format correctly with a space between month number and month name. When I try to use `+%Y/%m %b` format, I get this error message: > date: extra operand `%b"' I tried double and single quotation marks, but to no avail. However, `date +"%Y/%m %b/%d"` works fine in `sh`: > 2013/10/27 Oct Also, is there a better way to generate the directory name than using `MOVEDIRSTR` and `MOVEDIR` variables (see script)? Here's my current script:               FLIST=`ls "$IMGDIR" | grep -E '^.*\.jpg$'`          # If there are files to move     if [ -n "${FLIST}" ]; then         # For each file         while read -r line; do             # Parse filename to YYYY/mm Mmm/Dd             echo $line             MOVEDIRSTR=`sed -r -e 's:([0-9]{4})([0-9]{2})([0-9]{2}).*:date -d \1-\2-\3 +%Y/%m_%b/%d:' <<< "$line"`             MOVEDIR=`$MOVEDIRSTR`                  # If a directory does not exist, create it             [ -d "$ARCHIVEDIR/$MOVEDIR" ] || (mkdir -p "$ARCHIVEDIR/$MOVEDIR")                  # Move file into YYYY/mm Mmm directory             # mv -f "$IMGDIR/$line" "$ARCHIVEDIR/$MOVEDIR"         done <<< "$FLIST"     fi


title: Is there a command to move a file, and symlink it back to where it was?

text: I often find myself wanting to move a file, then create a symlink where it was. In doing this by hand I tend to twist my mind. (Esp after doing half a dozen files) Use cases:   * Moving all my "dot files" to a folder so i can version control them   * Moving a file onto a faster disk (scratch) for High Performance Computing If there is not a single command,   I would appreciate a fish script.   (fish is not a POSIX shell, does not s pport the sh language)