I have an Open Office Spreadsheet document stored inside a bash variable. I want to do something like the following to feed Open Office via `STDIN`:               echo "$openOfficeDoc" | ooffice      But it doesn't work. _Note:_ The content of the bash variable must not be written to disk. I'll emphasize that I'm trying to pass to Open Office the actual data of the file. I'm trying to store passwords in an Open Office Spreadsheet file. The passwords are encrypted using GPG. I don't want the passwords to be written to disk for security reasons. The bash variable value is a binary blob of an Open Office Spreadsheet document. It is **not** ASCII. The bash code I used to create the blob is:               data=$(cat "Encrypted.gpg" | gpg -u "Dor" -d)      While `Encrypted.gpg` is an encrypted file of an Open Office Spreadsheet. Is it possible to feed Open Office via STDIN?


title: Installing USR 5422 on Ubuntu 12.04

text: I am a newbie to Linux. I was trying to set up the USR5422 USB adapter. It worked fine for the first time, but since then it freezes the computer most of the time. What commands can I fire to see what's going on? I followed the instructions on Ubuntu Forums thread titled How do I get a USR 5422 usb wlan adapter to work under hardy heron? **Update:** It's stopped freezing, but is unable to connect to the wireless network. My network authentication has the following properties:   * Security type: WPA-Personal   * Encryption type: TKIP I've got the following settings in the linux laptop:   * Security: WPA & WPA2 Personal


title: Indent several lines with VIM?

text: For eample, I'm editing this code:               <html>     <body>     <script>         var a = 10;         a += 100;     </script>     </body>     </html>      now I need to indent the script line:               <html>     <body>         <script>             var a = 10;             a += 100;         </script>     </body>     </html>      How could I do this without moving cursor to the begin of each line and press Tab?


title: Running jobs in parallel on Ubuntu - I/O contention differences between Perl and Java

text: _Apologies if this is off topic - it concerns the relative efficiencies of running I/O-heavy Perl/Java scripts in parallel on a Ubuntu system._ I have written two simple versions of a file copy script (Perl and Java) - see below. When I run the scripts on a 15GB file, each takes a similar amount of time on a 48-core machine running Ubuntu Server 12.04 (perl 2m10s, java 2m27s). However, when I run six instances in parallel, each operating on a different 15GB input file, I observe very different processing times:   * Perl: one instance completes in 2m6s, all others take 27m26s - 28m10s.   * Java: all instances take 3m27s - 4m37s. Looking at the processor cores in `top` during the long-running Perl processes, I see that the occupied cores have I/O wait percentages (%wa) of 70%+, implying some kind of disk contention (all files are on one HD). Presumably, then, Java's `BufferedReader` is somehow less sensitive to this disk contention. Question - Does this seem like a reasonable conclusion? And if so, can anyone suggest any actions I can take at the OS-level or in Perl to make the Perl script as efficient as Java for this kind of task? _Note - my goal is not simply to copy files - my real scripts contain additional logic, but exhibit the same performance behaviour as the simplified scripts below._ **Perl**               #!/usr/bin/perl -w     open(IN, $ARGV[0]) || die();     open(OUT, ">$ARGV[1]") || die();     while (<IN>) {         print OUT $_     }     close(OUT);     close(IN);      **Java**               import java.io.*;     public class CopyFileLineByLine {         public static void main(String[] args) throws IOException {             BufferedReader br = null;             PrintWriter pw = null;             try {                 br = new BufferedReader(new FileReader(new File(args[0])));                 pw = new PrintWriter(new File(args[1]));                 String line;                 while ((line = br.readLine()) != null) {                     pw.println(line);                 }             }             finally {                 if (pw != null) pw.close();                 if (br != null) br.close();             }         }     }


title: Setting a name for a screen session

text: Is there a way to give a particular name to a unix screen session? For instance, say I'm running the same program multiple times, each with different parameters and I want to tell which one is which.


title: Is there any way to use xargs across a pipe?

text: I'm trying to automatically convert flac files moved to a folder into mp3 in another folder. My current line of code is this:               inotifywait -m -r -q -e moved_to --format "'%w%f'" ~/test |  xargs -I x flac -cd x - | lame -b 320 - /media/1tb/x.mp3      To explain how this works so far, inotifywait monitors ~/test recursively for files moved there, outputting the path and filename to a pipe. xargs takes that name and creates the proper flac command, replacing x with the filename and decoding the file to another pipe. In the new pipe lame processes the output of flac into mp3 under /media. I want xargs to either reach across the pipe in some way, replacing the x in the lame command or in some way send it to a variable both commands can access or something. I tried messing around with named pipes and that jazz but the fact that there is actual data being piped between the two commands has me in way over my head. Any suggestions would be appreciated, and if something is unclear, please let me know.


title: Is it safe to use GParted while booted?

text: I have Linux Mint installed on an external hard drive, and I have the 4 main partitions (`/boot`, `swap`, `/`, and `/home`). I also have 600GB of unallocated space. I know there's always the chance of data loss, but would it be any more dangerous to add a partition while booted to that physical disk than it would while booted to another? Would adding a partition while booted to that disk be like erasing `/` as root?


title: How are email headers generated?

text: When you send an email a header is part of the message. For example, when you check your mail you can view the raw source and see the headers, which has information about the sender of email in it, etc. When I send mail using the `mail` command, from address1 to address2, the header includes some information about the sender, like sender's hostname, IP, etc. Now my Question is: How is the information for the header generated, and how can I avoid or change them (i.e, forge them)? I'm use Fedora 17 and Sendmail.


title: File size of 60.0 PB is wrong. Can deleting it cause data loss?

text: While backing up some data (a 200 GB home directory) with `rsync`, I got an I/0 error for a particular file, after which _rsync_ continued on "normally" with its backup. The problem source file showed as having a file size of 72 bytes. I cancelled _rsync_ , and ran the same command again. This time that same file showed to be transferring data.. _lots of data_ ...and more data, and more... I checked the destination file's size, and it was up to 13 GB! so I used Ctrl-c to cancel _rsync_. On checking the source file size again, in Nautilus, it showed a size of `60.0 PB` (Peta Bytes!) on a 500 GB drive. Now, the main point of all this: Would/could deleting this file cause loss of data in other files, seeing that the file system can perceive it to be much bigger than it actually is... The file system is `ext4`.. I could just skip over it with an _rsync_ exception, but I'm particularly interested in what could happen if it is deleted. UPDATE: Both target and source are `ext4` Regarding suggestions of it being a sparse file: If it is a sparse file, why would it show different sizes from one minute to the next? The file was certainly(?) not in use at the time. It is a `~/.macromedia/Flash_Player/#SharedObjects/someting-or-other.sol` file, of which there are _many_ more such _.sol_ files in that directory .. plus it did show an I/0 error on the first pass. Also, according to `man rsync`, the suggested `-S` option is to handle sparse files _efficiently_ , not _properly_ , so that suggests to me that even though I wasn't using `-S` it should copy a sparse file accurately in either case: which it didn't, and even it if it is a sparse file, being 60.0 Peta Bytes seems surely(?) to be an error in the file system, somewhere... and that is my main concern: If there is a glytch in the file system, could deleting that file have repercussions on other files? More specifically: as it wrote 13 GB of data, and climbing! when I cancelled it, could it also delete 13 GB - 60 PB of data when I delete it?


title: Is there an easy way to migrate from thunderbird to evolution?

text: I want to be able to use the calendar evolution: the calendar in Thunderbird is a plugin (Lightning) and from time to time when Thunderbird receives a new update, Lightning does not always update automatically as well. So I wanted to have it native in GNOME. Can anyone explain to me how to do this?


title: What's the most resource efficient way to count how many files are in a directory?

text: CentOS 5.9 I came across an issue the other day where a directory had a lot of files. To count it, I ran `ls -l /foo/foo2/ | wc -l` Turns out that there were over 1 million files in a single directory (long story -- the root cause is getting fixed). My question is: is there a faster way to do the count? What would be the most efficient way to get the count?


title: XRDP Custom Resolution (Fedora 19)

text: How can I configure a custom display resultion for xrdp sessions? I want the session to use all the display size, minus few lines for the original decorations. that will be around 1920x1050, a resultion that isn't available in xrandr. I'm using i3 as wm, so there is no GUI or DE configuration tool.


title: Convert between Unicode Normalization Forms on the unix command-line

text: In Unicode, some character combinations have more than one representation. For example, the character _ä_ can be represented as   * "ä", that is the codepoint U+00E4 (two bytes `c3 a4` in UTF-8 encoding), or as   * "ä", that is the two codepoints U+0061 U+0308 (three bytes `61 cc 88` in UTF-8). According to the Unicode standard, the two representations are equivalent but in different "normalization forms", see UAX #15: Unicode Normalization Forms. The unix toolbox has all kinds of text transformation tools, _sed_ , _tr_ , _iconv_ , Perl come to mind. How can I do quick and easy NF conversion on the command-line?


title: How do I split up a large .iso file across multiple DVDs via command line tools?

text: Say I have an ISO file that is 5GB in size. How can I split it across 2 DVDs? Please I'm looking for an actual example showing me how to do it, not just recommendations. The solution would leave the files written to disk in a browseable state, not requiring another tool to reassemble the pieces before being accessible. I'm currently using this type of a command to author the ISO file:               $ mkisofs -o $backup -r -J -hide-rr-moved -V "Backup $date" \         -graft-points " dir1 dir2      And then this command to author a DVD with the resulting ISO file:               $ growisofs -Z /dev/dvd=$backup     $ mkisofs -o $backup -r -J -hide-rr-moved -V "Backup $date" \         -graft-points " dir1 dir2      And then this command to author a DVD with the resulting ISO file:               $ growisofs -Z /dev/dvd=$backup


title: Measuring last-level cache misses through PAPI on AMD machine running Ubuntu Linux

text: It looks like by default PAPI (Performance Application Programming Interface) is not supporting to measure last-level cache misses (L3) on my AMD machine running Ubuntu Linux. However, I can measure L1/L2 cache misses. You can see the details of the processor below. I heard that it is possible to measure last level cache misses if install appropriate driver. Could some one provide me more information about this, please?               $ uname -a     Linux 2.6.32-21-server #32-Ubuntu SMP Fri Apr 16 09:17:34 UTC 2010 x86_64 GNU/Linux          $cat /proc/cpuinfo     processor   : 0     vendor_id   : AuthenticAMD     cpu family  : 16     model       : 8     model name  : Six-Core AMD Opteron(tm) Processor 8431     fpu     : yes     fpu_exception   : yes     cpuid level : 5     wp      : yes     flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt     bogomips    : 4788.66     TLB size    : 1024 4K pages     clflush size    : 64     cache_alignment : 64     address sizes   : 48 bits physical, 48 bits virtual     power management: ts ttp tm stc 100mhzsteps hwpstate


title: KDE: how do I make applications present on all activities by default

text: When I'm at work, I use KDE activities and map them to my projects. I always use the same applications on every project, so I'd like to keep my windows visible when I change the activity. For the moment, what I do is go through every window, right click on the title bar, and check the checkbox that makes the window appear on all activities. How can I configure my windows default value for this choice? I'd like every window to appear on all activities by default.


title: How to recover a utility. (Accidentally Deleted /usr/bin/php file)

text: New Linux user. I accidentally overwrote my /usr/bin/php file. The php command no longer works. What's the best way to recover that file? Using bash and Linux Mint distro.


title: Where are cron errors logged?

text: If I setup `cron` jobs incorrectly they appear to silently fail. Where should I look for an error log to understand what went wrong?


title: How to add self to sudoers list?

text: I've added myself into the sudoers users list by using the command               root@debian:/home/oshirowanen#adduser oshirowanen sudo      If I try to run that command again,               root@debian:/home/oshirowanen# adduser oshirowanen sudo     The user `oshirowanen' is already a member of `sudo'.     root@debian:/home/oshirowanen#       All looks good so far. When I then exit the root user and try to install/remove/search something using my own account, it doesn't work and complains that I am not a sudoer... For example               root@debian:/home/oshirowanen# exit     exit     oshirowanen@debian:~$ sudo aptitude search ice     [sudo] password for oshirowanen:      oshirowanen is not in the sudoers file.  This incident will be reported.     oshirowanen@debian:~$       Why is this happening? * * * This is what I get from `visudo`               #     # This file MUST be edited with the 'visudo' command as root.     #     # Please consider adding local content in /etc/sudoers.d/ instead of     # directly modifying this file.     #     # See the man page for details on how to write a sudoers file.     #     Defaults        env_reset     Defaults        mail_badpass     Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"          # Host alias specification          # User alias specification          # Cmnd alias specification          # User privilege specification     root    ALL=(ALL:ALL) ALL          # Allow members of group sudo to execute any command     %sudo   ALL=(ALL:ALL) ALL          # See sudoers(5) for more information on "#include" directives:          #includedir /etc/sudoers.d


title: Emacs ediff not scrolling buffers equally

text: In Emacs ediff, I can use `v` and `V` to scroll up and down the buffers that I am comparing simultaneously. However, I have noticed that:   1. If I start scrolling **each buffer independently**   2. Then place the point (cursor) on the very first line on both buffers,    3. Try to move them at the same time using `v` Then the buffers don't scroll equally (e.g. the buffer on the rights scrolls one extra line). I noticed that if I close the ediff session and open a new one with both files, the problem goes away though. The files have some substantial differences near the end of the respective files, but for the first 2K lines or so they are identical. I would be very surprised if this is a bug, so there must be something that I am not understanding. Are there any parameters that control the scrolling? The shortcuts `v` and `V` are supposed to scroll both buffers by the same amount, right? The files that I am comparing end each line with `CR` `LF`. I have included a snapshot below from an alternative editor (Notepadd++):    ![enter image description here](http://i.stack.imgur.com/jlQfv.png) Note: This is with Emacs 23.3.1 (most recent stable version)


title: Need to execute javascript as a cron job... possible?

text: I need to load a page once per hour and execute the javascript on that page. I currently load the page manually with Firefox, but I would like to automate this by running a cron job on the server, which is Ubuntu **Server** 8.04 LTS. Some web searching suggests that the best thing would be to run `firefox -remote openurl(...)` and let gecko run the javascript, but this requires X11 which I don't know how to simulate on a server install. So essentially I want an hourly job to run `firefox` in a simulated environment and discard the output. (I'm not wed to `firefox`... I'd happily take a `wget`-like command that executes javascript.)


title: Encoding changed after running cat

text: After running `cat` on some files I get the infamous 'bushes': ␌⎺└⎻⎼␊⎽⎽␊␍ ├▒⎼ °␋┌␊. B␊├├␊⎼ ┤⎽␊ ├▒⎼'⎽ ≥ which I believe are result of encoding being changed. Is there any way to recover the terminal after the encoding has changed?


title: directions about customized Layer 2 implementation in linux

text: I have some machines running on the same network. One node is the control node which distributes traffic coming to it to the other nodes. The thing is that I want to have a custom protocol header between MAC header and IP(or whatever) payload incoming to the control node. Control node receives this any packet like this:               ------------------------------------------------     | Layer 2 | IP(or whatever protocol) | Payload |     ------------------------------------------------      This packet should be distributed like this to other nodes               ----------------------------------------------------------------     | Layer 2 | Custom Header | IP(or whatever protocol) | Payload |     ----------------------------------------------------------------      I want some directions to do such a thing, Is there any current solution which I can use and I have to hack kernel for it from the scratch. A similar approach is to use L2TP but that runs over IP layer so I dont want that. I also want this communication to be appeared as a seperate interface in linux like tun0 apart from physical eth0 interface. Any help or ideas would be highly appreciated. I dont know in what stack-exchange website this question belongs to so directions to correct website are also appreciated.


title: FreeBSD: Getting pkg_add to use stable packages rather than release packages?

text: Using FreeBSD 8.2-RELEASE. I want to use the latest binary packages rather than the packages at the time of the 8.2 release. That is, I want to use packages in ftp://ftp2.freebsd.org/pub/FreeBSD/ports/i386/packages-8-stable/All/ rather than ftp://ftp2.freebsd.org/pub/FreeBSD/ports/i386/packages-8.2-release/All/. I'm not interested in compiling a bunch of stuff so I don't want to simply upgrade ports and then be forced to compile everything. For compiling small things it's ok, but I don't want to wait hours to get some of the bigger programs. How can I get my system to use the stable binary packages (and upgrade ports so everything is in sync)?


title: Padding a number in a filename to a fixed length

text: I have a directory of files such as:               file.1.png     file.2.png     …     file.10.png     …     file.1000.png     file.1001.png     …      How can I pad the number to 4 digits? It should end up like this:               file.0001.png     file.0002.png     …     file.0010.png     …     file.1000.png     file.1001.png     …


title: Is there a command like head but for line truncation?

text: Linux's `head` selects a number of lines from the top of a file. Is there a command that selects a number of characters from the front of a line? The use case behind the question is this: I want to `head` the first 10 lines from a file, but each of those 10 lines is extremely long and contain lots of white space, making it hard to discern where the line breaks are. It would be much easier to get a general idea of the contents of the file if I could `head` the first 10 lines, but only view the first 50 characters of each line.


title: How do I build custom Ubuntu CD's automatically?

text: I'd like to build custom Ubuntu installation CD's daily (CRON job). Think Daily Build but with custom packages coming from a text file. Packages would be a mix of some official Ubuntu packages as well as some custom packages from other sources. Any help would be appreciated but I'm specifically looking for suggestions on what tools/software I could use to get this done. Less software = better :)


title: How to disable SSLv2 in OpenSSH?

text: Due to the recent deprecation of SSLv2, is it possible to disable SSLv2 in OpenSSH? Is OpenSSH even using SSLv2? From digging around, I see the sshd is not compiled against openssl , but it is compiled against libcrypto (which is part of the openssl package).


title: How to rsync a chroot without breaking symlinks?

text: I'd like to rsync (backup) a chroot environment from outside the chroot. For that I first make a lvm snapshot of the chroot volume and then run rsync on that. The only problem with this approach: Symlinks that inside the chroot are absolute are now pointing to the outer-chroot-system and are of course not matching. Since I would like to use copy-unsafe-links, this leads to a false link resolution. Is there a way to make rsync resolve symlinks from another directory than the main root or is there another way to solve this?


title: How to test if a variable is defined at all in Bash prior to version 4.2 with the nounset shell option?

text: For Bash versions prior to "GNU bash, Version 4.2" are there any equivalent alternatives for the `-v` option of the `test` command? For example:               shopt -os nounset     test -v foobar && echo foo || echo bar     # Output: bar     foobar=     test -v foobar && echo foo || echo bar     # Output: foo


title: Is there a tool for seeing audit events as they happen without writing them to the disk?

text: Linux has an audit system that is usually used together with auditd, a daemon that, as far as I know, is designed for logging all events to the disk. However, I would like a way to directly get the events as output of a command. Is there a command that attaches to the kernel the same way auditd does, but then just prints the audit events to stdout or so instead of writing them to a file?


title: print lines between start and end using sed

text: I need to print the lines between two delimiters. For example, given the input               fluff1     fluff2     BEGIN     good3     good4     END     fluff5     fluff6     BEGIN     good7     good8     END     more fluff      I want the output to be               good3     good4     good7     good8      I know how to do it with `awk`, but hoping to find a shorter solution with `sed`. What I would like it to be is the following, but that is of course invalid syntax:               sed -n '/BEGIN/+1,/END/-1p'


title: Apt-get refuses to stop trying to install Acroreader

text: I'm using Mint 13 if that matters. And I'm new. Anyway, I tried installing Adobe Reader 9 using their installer from: http://www.adobe.com/support/downloads/product.jsp?product=10&platform=Unix It got stuck when on a line that said something about setting up icons. There was no CPU usage for about an hour, so I killed the process. Of course, running `apt-get again` (to install another program) gives me a lock error. So after rebooting to unlock, I use this command:               sudo dpkg -a --configure and then...               sudo apt-get -f install ... as instructed by similar questions on the "AskUbuntu" forum. However, it once again gets stuck at an installation step and gives me this line: > Setting up acroread (9.4.7-1oneiric1) ... ...which I then kill. I tried using Synaptic to mark the incomplete acroread install for deletion, but it gets hung up on another line. It says something about a plugin being invalid if I recall correctly. I want to tell apt-get to just stop trying to install acroread every time I use the command. Any ideas?


title: Pass arguments to function exactly as-is

text: I have the following function:               bar() { echo $1:$2; }      I am calling this function from _another_ function, `foo`. `foo` itself is called as follows:               foo "This is" a test      I want to get the following output:               This is:a      That is, the arguments that `bar` receives should be the same tokens that I pass into `foo`. How does `foo` need to be implemented in order to achieve this? I’ve tried the following two implementations, but neither works:   * `foo() { bar $*; }` – output: `this:is`   * `foo() { bar "$*"; }` – output: `this is a test:` My question is effectively how I can preserve the quoting of arguments. Is this possible at all?


title: Python in GNOME code base

text: Is Python present in the Gnome code base? If so, how is it involved? **Note** : My question concerns the core GNOME Desktop Environment only (e.g. **`nautilus`** , **`gnome-session`** , **`NetworkManager`** ) and any underlying App or library.


title: last time file opened

text: Is it possible to get the time when file was opened last time and sort all files in a directory by those times?


title: Ideas for securing OpenVPN on an OpenWrt router

text: I put an OpenVPN server on port 1194 on an OpenWrt 10.03 router:               echo "nameserver 8.8.8.8" > /etc/resolv.conf; opkg update; opkg install luci-app-openvpn openvpn openssl-util openssh-sftp-server ntpd     vim /etc/ssl/openssl.cnf # modify a few lines     [ CA_default ]     dir             = /etc/openvpn     new_certs_dir   = $dir/certs     certificate = $dir/ca.crt     private_key = $dir/ca.key          touch /etc/openvpn/index.txt; touch /etc/openvpn/serial; echo 01 > /etc/openvpn/serial     openssl req -nodes -new -x509 -keyout /etc/openvpn/ca.key -out /etc/openvpn/ca.crt -days 3650 # give a common name, like: vpnserver     openvpn --genkey --secret /etc/openvpn/ta.key     openssl req -nodes -new -keyout /etc/openvpn/server.key -out /etc/openvpn/server.csr # give a common name, like: vpnserver     mkdir -p /etc/openvpn/certs; mkdir -p /etc/openvpn/private     openssl ca -out /etc/openvpn/server.crt -in /etc/openvpn/server.csr     time openssl dhparam -out /etc/openvpn/dh1024.pem 1024 # it could take 10 minutes!          # generate certs for clients [X = client number]     openssl req -nodes -new -keyout /etc/openvpn/clientX.key -out /etc/openvpn/clientX.csr # give a common name! it will be the user name     openssl ca -out /etc/openvpn/clientX.crt -in /etc/openvpn/clientX.csr     # e.g.:      openssl req -nodes -new -keyout /etc/openvpn/client1.key -out /etc/openvpn/client1.csr # give a common name! it will be the user name     openssl ca -out /etc/openvpn/client1.crt -in /etc/openvpn/client1.csr          vim /etc/config/openvpn     config 'openvpn' 'openvpn_server'         option 'enable' '1'         option 'port' '1194'         option 'proto' 'udp'         option 'dev' 'tap'         option 'ca' '/etc/openvpn/ca.crt'         option 'cert' '/etc/openvpn/server.crt'         option 'key' '/etc/openvpn/server.key'         option 'tls_auth' '/etc/openvpn/ta.key 0' # server: 0         option 'dh' '/etc/openvpn/dh1024.pem'         option 'comp_lzo' '1'         option 'server' '10.20.30.0 255.255.255.0'         option 'keepalive' '10 120'         option 'persist_key' '1'         option 'persist_tun' '1'         option 'mute' '20'         option 'verb' '3'         option 'client_to_client' '1'         list 'push' 'dhcp-option DNS 10.20.30.1'     /etc/init.d/openvpn enable     /etc/init.d/openvpn start     ifconfig -a | less     ping 10.20.30.1          # here comes the firewall part     vim /etc/config/firewall # modify it     config 'include'         option 'path' '/etc/firewall.user'          config 'redirect'         option 'src' 'wan'         option 'proto' 'udp'         option 'src_dport' '1194'         option 'dest_port' '1194'         option '_name' 'OpenVPN'          vim /etc/firewall.user # modify it     iptables -t nat -A prerouting_rule -i $WAN -p udp --dport 1194 -j ACCEPT     iptables -A input_rule -i $WAN -p udp --dport 1194 -j ACCEPT     iptables -A forwarding_rule -i tap+ -o br-lan -j ACCEPT     iptables -A forwarding_rule -i br-lan -o tap+ -j ACCEPT     iptables -A input_rule -i tap+ -j ACCEPT     iptables -A output_rule -o tap -j ACCEPT          /etc/init.d/firewall restart          # tar the files that goes to the client1     mkdir -p /root/client1     cp /etc/openvpn/ca.crt /root/client1/; cp /etc/openvpn/client1.crt /root/client1/; cp /etc/openvpn/client1.key /root/client1/; cp /etc/openvpn/ta.key /root/client1/     cd /root/; tar -cf client1.tar client1          # configure the client     # extract the client1.tar's content to "~/.cert" on the clients pc     # if you're using e.g.: Fedora/SELinux, then     restorecon -Rv ~/.cert*     # then:      # ca.crt: the ca certificate     # client1.crt: the users certificate     # client1.key: the users private key     # ta.key: tls authentication [1]      What could I do (on the server side) to increase security regarding this OpenVPN server? Here are some of my ideas:   1. I `sed 's/1194/50000/'` the port number to a higher one to make it harder for port scanners to find   2. iptables? I should only allow IP ranges [on the input chain] that I will use in reality? +Only allow my laptop's MAC address     3. If I don't use my router (e.g.: when I'm sleeping) I just turn it off. Is there anything I'm missing? From the `ps` command I can see that OpenVPN is run by root, which is unsafe. What else should I do to increase security?


title: Obtaining Solaris 10 patches

text: I have a Solaris 10 server. I've been trying to find from where I can download patches/updates. The specific bug I'm running into (http://bugs.opensolaris.org/view_bug.do?bug_id=6551484) is reportedly fixed, according to that report:               Commit to Fix   s10u4_12     Fixed In    s10u4_12     Release Fixed    solaris_10u4(s10u4_12) , solaris_nevada(snv_70)      So far, all the potential Solaris patch download sites that Google returns all redirect to the My Oracle Support portal. I signed up for that, but now I need an "Oracle Support Identifier". According to the FAQ: > After you log in with your SSO account, you must register your Oracle > Customer Support Identifiers (Support IDs) or your Sun Contract Number. Most > customers have only one Support ID. Your Support ID is included in the > welcome letter sent from Oracle. This is a number similar to 3434354 that > defines for Oracle the products you have licensed for support. After you > have registered your Support IDs, you must be approved by the Customer User > Administrator (CUA) for your organization. There is no paperwork, I have a SPARC machine with Solaris 10 installed on it. Am I out of luck regarding getting it updated?


title: understanding "-dao", "-sao", "-tao" and "-raw" writing modes for wodim in practice

text: In wodim one can choose between many different writing modes like Disk At Once("-dao"), Session At Once("-sao"), Track At Once("-tao") or Raw writing mode("-raw"). As I understand, Track At Once writes one track at time while in SAO and DAO modes laser does not stop between tracks. Is this important only in case of audio CD's and there is no difference in case of data CD's(for example burning Linux distribution image)? In addition, even in case of audio CD's and TAO mode, how does wodim know where one track starts or ends? Am I correct that SAO mode allows one to write multiple times to a CD-R media? Last but not least, in which case is raw writing mode useful?


title: How can i free up memory / manage memory on a linux box?

text: I am running two `Ubuntu 12.04` servers (no GUI / desktop) using canonical's cloud images on `Amazon EC2`. One is a `micro` with `613MB` of RAM and one is a medium with `3.75GB` of RAM. I only have opscode's chef installed on the `micro` box, and on the large box I have a java app / SOLR index initialized with 2048MB of ram:               JAVA_OPTIONS="-server -Xms2048m -Xmx2048m -XX:+UseParallelGC -XX:NewRatio=5"      If I have had `chef` running on the micro box for a while, and then try and install a new program, or start up something like the `RabbitMQ` or `Apache2` I will get an error about not having enough free memory to complete the operation. On the large box, it seems that the Java application will periodically crash when the memory gets low, or after the box has been on for a while. Using the `free` / `free -m` command I see there is in fact not much memory available, at which point I usually have to reboot the system to "clear out" the memory. It seems to be that either the memory should be automatically freed or "cleared" after some point of time, or if it must be done manually there might be a better way to free up / clean/ manage the memory more efficiently. Is there a way I can manually free up / clear the system's memory? Is there a tool that will check / clean the memory automatically?


title: How to flush local DNS cache in CentOS

text: (I am aware that googling this question gives me tons of stuff, but literally none worked) I'm looking for a way to flush the local DNS cache on a Centos 6 system, it is not running any DNS server or anything. I wish to let every DNS query go out to the configured nameserver, even for the duplicate ones. 90% of what I found tells me to               service nscd restart or reload or               nscd -i hosts . Well none seems to flush the cache. So I'm wondering if anyone has an idea of how do I do this? Is there some kind of switch in the kernel I need to flip? Or any kind of work around is fine as well. Thanks a lot!


title: what determines overburn capability of CD-R?

text: I had a 733MiB ISO image which I tried to write to a CD-R. I had two CD-R disks from different manufacturers. With first CD-R disk(TDK) the burning process failed, but using the second CD-R(EMTEC), it succeeded. Command used for burning was `wodim -v speed=1 dev='/dev/scd0' -sao -overburn /home/martin/Downloads/linux.iso` _Unsuccessful attempt:_               root@T42:~# ls -lh /home/martin/Downloads/linux.iso     -rw-r--r-- 1 martin martin 733M Feb  7 19:30 /home/martin/Downloads/linux.iso     root@T42:~# wodim -v speed=1 dev='/dev/scd0' -sao -overburn /home/martin/Downloads/linux.iso     TOC Type: 1 = CD-ROM     scsidev: '/dev/scd0'     devname: '/dev/scd0'     scsibus: -2 target: -2 lun: -2     Linux sg driver version: 3.5.27     Wodim version: 1.1.11     SCSI buffer size: 64512     Device type    : Removable CD-ROM     Version        : 5     Response Format: 2     Capabilities   :      Vendor_info    : 'HL-DT-ST'     Identification : 'DVDRAM GSA-4083N'     Revision       : '1.00'     Device seems to be: Generic mmc2 DVD-R/DVD-RW.     Current: 0x0009 (CD-R)     Profile: 0x0012 (DVD-RAM)      Profile: 0x0011 (DVD-R sequential recording)      Profile: 0x0015 (DVD-R/DL sequential recording)      Profile: 0x0016 (DVD-R/DL layer jump recording)      Profile: 0x0014 (DVD-RW sequential recording)      Profile: 0x0013 (DVD-RW restricted overwrite)      Profile: 0x001A (DVD+RW)      Profile: 0x001B (DVD+R)      Profile: 0x002B (DVD+R/DL)      Profile: 0x0010 (DVD-ROM)      Profile: 0x0009 (CD-R) (current)     Profile: 0x000A (CD-RW)      Profile: 0x0008 (CD-ROM)      Profile: 0x0002 (Removable disk)      Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).     Driver flags   : MMC-3 SWABAUDIO BURNFREE      Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R     Drive buf size : 1053696 = 1029 KB     Beginning DMA speed test. Set CDR_NODMATEST environment variable if device     communication breaks or freezes immediately after that.     Drive DMA Speed: 15251 kB/s 86x CD 11x DVD     FIFO size      : 12582912 = 12288 KB     Track 01: data   732 MB             Total size:      840 MB (83:17.54) = 374816 sectors     Lout start:      841 MB (83:19/41) = 374816 sectors     Current Secsize: 2048     ATIP info from disk:       Indicated writing power: 5       Is not unrestricted       Is not erasable       Disk sub type: Medium Type B, low Beta category (B-) (4)       ATIP start of lead in:  -12369 (97:17/06)       ATIP start of lead out: 359849 (79:59/74)     Disk type:    Short strategy type (Phthalocyanine or similar)     Manuf. index: 69     Manufacturer: Moser Baer India Limited     Manufacturer is guessed because of the orange forum embargo.     The orange forum likes to get money for recent information.     The information for this media may not be correct.     Blocks total: 359849 Blocks current: 359849 Blocks remaining: -14967     wodim: WARNING: Data may not fit on current disk.     wodim: Notice: Overburning active. Trying to write more than the official disk capacity.     Speed set to 1764 KB/s     Starting to write CD/DVD at speed  10.0 in real SAO mode for single session.     Last chance to quit, starting real write in    0 seconds. Operation starts.     Waiting for reader process to fill input buffer ... input buffer ready.     Performing OPC...     Sending CUE sheet...     Writing pregap for track 1 at -150     Starting new track at sector: 0     Track 01:  724 of  732 MB written (fifo 100%) [buf 100%]  10.7x.Errno: 5 (Input/output error), write_g1 scsi sendcmd: no error     CDB:  2A 00 00 05 A9 9D 00 00 1F 00     status: 0x2 (CHECK CONDITION)     Sense Bytes: 70 00 03 00 00 00 00 0A 3C 30 00 80 02 00 00 00     Sense Key: 0x3 Medium Error, Segment 0     Sense Code: 0x02 Qual 0x00 (no seek complete) Fru 0x0     Sense flags: Blk 0 (not valid)      cmd finished after 26.366s timeout 200s          write track data: error after 760014848 bytes     wodim: A write error occured.     wodim: Please properly read the error message above.     Writing  time:  549.691s     Average write speed   9.1x.     Min drive buffer fill was 99%     Fixating...     Fixating time:    0.183s     wodim: fifo had 12091 puts and 11972 gets.     wodim: fifo was 0 times empty and 11841 times full, min fill was 96%.     root@T42:~#       _Successful attempt:_               root@T42:~# wodim -v speed=1 dev='/dev/scd0' -sao -overburn /home/martin/Downloads/linux.iso         TOC Type: 1 = CD-ROM         scsidev: '/dev/scd0'         devname: '/dev/scd0'         scsibus: -2 target: -2 lun: -2         Linux sg driver version: 3.5.27         Wodim version: 1.1.11         SCSI buffer size: 64512         Device type    : Removable CD-ROM         Version        : 5         Response Format: 2         Capabilities   :          Vendor_info    : 'HL-DT-ST'         Identification : 'DVDRAM GSA-4083N'         Revision       : '1.00'         Device seems to be: Generic mmc2 DVD-R/DVD-RW.         Current: 0x0009 (CD-R)         Profile: 0x0012 (DVD-RAM)          Profile: 0x0011 (DVD-R sequential recording)          Profile: 0x0015 (DVD-R/DL sequential recording)          Profile: 0x0016 (DVD-R/DL layer jump recording)          Profile: 0x0014 (DVD-RW sequential recording)          Profile: 0x0013 (DVD-RW restricted overwrite)          Profile: 0x001A (DVD+RW)          Profile: 0x001B (DVD+R)          Profile: 0x002B (DVD+R/DL)          Profile: 0x0010 (DVD-ROM)          Profile: 0x0009 (CD-R) (current)         Profile: 0x000A (CD-RW)          Profile: 0x0008 (CD-ROM)          Profile: 0x0002 (Removable disk)          Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).         Driver flags   : MMC-3 SWABAUDIO BURNFREE          Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R         Drive buf size : 1053696 = 1029 KB         Beginning DMA speed test. Set CDR_NODMATEST environment variable if device         communication breaks or freezes immediately after that.         Drive DMA Speed: 15143 kB/s 86x CD 10x DVD         FIFO size      : 12582912 = 12288 KB         Track 01: data   732 MB                 Total size:      840 MB (83:17.54) = 374816 sectors         Lout start:      841 MB (83:19/41) = 374816 sectors         Current Secsize: 2048         ATIP info from disk:           Indicated writing power: 5           Is not unrestricted           Is not erasable           Disk sub type: Medium Type A, high Beta category (A+) (3)           ATIP start of lead in:  -11634 (97:26/66)           ATIP start of lead out: 359846 (79:59/71)         Disk type:    Short strategy type (Phthalocyanine or similar)         Manuf. index: 3         Manufacturer: CMC Magnetics Corporation         Blocks total: 359846 Blocks current: 359846 Blocks remaining: -14970         wodim: WARNING: Data may not fit on current disk.         wodim: Notice: Overburning active. Trying to write more than the official disk capacity.         Speed set to 1764 KB/s         Starting to write CD/DVD at speed  10.0 in real SAO mode for single session.         Last chance to quit, starting real write in    0 seconds. Operation starts.         Waiting for reader process to fill input buffer ... input buffer ready.         Performing OPC...         Sending CUE sheet...         Writing pregap for track 1 at -150         Starting new track at sector: 0         Track 01:  732 of  732 MB written (fifo 100%) [buf  99%]  10.6x.         Track 01: Total bytes read/written: 767623168/767623168 (374816 sectors).         Writing  time:  520.286s         Average write speed   9.6x.         Min drive buffer fill was 99%         Fixating...         Fixating time:    4.733s         wodim: fifo had 12091 puts and 12091 gets.         wodim: fifo was 0 times empty and 11889 times full, min fill was 96%.         root@T42:~#      Does the overburn capability depends solely on CD-R/CD-RW lead-out are size? In addition, any ideas what the _"low Beta category (B-) (4)"_ and _"high Beta category (A+) (3)"_ mean in CD-R ATIP info section?


title: Temporarily controlling a shell

text: On my office computer (running Scientific Linux 6.3) I have several windows running some processes in separate terminal emulators (`/dev/pts/`). I often connect to my office computer with iSSH from my iPad, but I can only see the results of the programs that have been written to a file and can't see what each terminal is showing or control the terminals. I want to be able to temporarily switch control of a terminal to my iPad iSSH terminal, look at the results, run new commands (on my office terminal from my iPad) then let the program run on my office computer and return back to my iSSH terminal, so I can check other terminals or simply quit. Since I use 3G most of the time to connect with my iPad I don't want to use any graphically depenent method which will be very slow. As far as I have understood, something like `reptyr` seems to permanently move control of a process from one terminal to another, I haven't seen any one talk (or ask) about giving control back to the original terminal. I want to return it back to it's original terminal after I finish. I would really appreciate any suggestions or help. Thanks in advance


title: Very strange ls > textfile problem when viewing with emacs

text: I want to list the components of the current working directory in a text file               ls -1 > textfile      Output looks fine with more.               1010661085645     1010729039145     1010747080245     1010849051345     1010859053445     1011046075845      However when I view this textfile with emacs, several strange characters appear               [0m[01;34m1010661085645[0m     [01;34m1010729039145[0m     [01;34m1010747080245[0m     [01;34m1010849051345[0m     [01;34m1010859053445[0m     [01;34m1011046075845[0m      Can anyone explain what is going on here?


title: Unit multiplier conversion in a shell script

text: I need to convert human-readable sizes into bytes. Unfortunately numfmt function is not accessible for me. Is there any other alternative? I need a shell/bash function to call from inside the sh script. 1K should be converted to 1000, 1M to 1000 000 etc.


title: Why doesn't su change the user ID of the shell from which it was run?

text: Instead, it starts a new shell process with the new user ID. The original shell is blocked until the new shell completes and su exits. Why does it work like this?


title: Disable vi from going to the last visited line upon file opening

text: Is there something I can put in my `exrc` file to prevent `vi` from going to the last line I was on last time I had the file open and just set the cursor at the top by default? I think it is distro-specific -- it doesn't behave like that on Solaris but does on RHEL Thanks


title: Why do entrepreneurial companies choose Linux rather than FreeBSD?

text: FreeBSD is an operating system. Linux, strictly speaking, is just a kernel, but the two systems are not too much different and in performance, at least, we can say they are comparable. Open source software works across the two platforms so there are no cross- platform issues. Reliance on professional services support will not be too high as web applications can get help from the community. How did this trend develop? FreeBSD best practices? Are there any success stories?


title: How do add GNU findutils into an existing location

text: I have installed the GNU "core" utilites coreutils-8.21 into this location on my UNIX server:               /opt/app/p1sas1c1/apps/GNU      I would now like to **ADD** the findutils-4.4.2 package. My reading the INSTALL document, I see I can configure using this command:               ./configure --prefix=/opt/app/p1sas1c1/apps/GNU      That is the same "prefix" I used to install the core utilities. _**My question is_** : If I do this and follow with a "make install" command, will that over-write the existing files in that target location or just "add" the new elements into the corresponding directories? I want to check first on the "best practices" for doing things like this. I am not a trained "SA" and do not have "root" access; I'm using an application account to do the install.


title: Allowing access to single folder in centos

text: I have a java application in `/usr/local` that keeps writing to a text file on a daily basis. I need a particular user to be able to read this file. What is the best way to do that? I have recently read a lot about `chroot`/`jailkit`, including this question \-- is `chroot` a good way to handle it?


title: No sound on Debian VM

text: I installed Debian+XFCE using VMware and this YouTube video. Everything runs OK, but I have no sound in the VM. What's wrong?


title: How to stream video from webcam to network with ffmpeg?

text: I'm trying to stream h264 video from my Logitech C920 webcam. I'm using such ffserver.conf:               Port 8099          NoDaemon          BindAddress 0.0.0.0               RTSPPort 5004     RTSPBindAddress 0.0.0.0          MaxClients 10          MaxBandwidth 10000          CustomLog -               <Feed feed1.ffm>             File /tmp/feed1.ffm             FileMaxSize 20M     </Feed>          <Stream viewport1>             Feed feed1.ffm             Format rtp             VideoCodec libx264             VideoFrameRate 15             VideoBufferSize 40             VideoBitRate 3000             VideoQMin 1             VideoQMax 31             VideoSize 640x480             PreRoll 0             NoAudio             Strict -1     </Stream>          <Stream stat.html>             Format status     </Stream>          <Redirect index.html>             URL http://ffmpeg.sourceforge.net/     </Redirect>      And I'm starting ffmpeg like this:               ./ffmpeg -f video4linux2 -s 640x480 -r 15 -re -i /dev/video0 -an -vcodec libx264  -bf 5  http://localhost:8099/feed1.ffm      But in the output there is:               [video4linux2,v4l2 @ 0xc0b5e0] Estimating duration from bitrate, this may be inaccurate     Input #0, video4linux2,v4l2, from '/dev/video0':       Duration: N/A, start: 2930.711051, bitrate: 73728 kb/s         Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 73728 kb/s, 15 tbr, 1000k tbn, 15 tbc     [libx264 @ 0xc183f0] using cpu capabilities: ARMv6 NEON     [libx264 @ 0xc183f0] VBV buffer size cannot be smaller than one frame, using 400 kbit     [libx264 @ 0xc183f0] profile High 4:2:2, level 2.2, 4:2:2 8-bit     [libx264 @ 0xc183f0] 264 - core 120 r2151 a3f4407 - H.264/MPEG-4 AVC codec - Copyleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=0 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=5 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=1 weightp=2 keyint=50 keyint_min=5 scenecut=0 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=3000 ratetol=1.0 qcomp=0.50 qpmin=10 qpmax=51 qpstep=4 vbv_maxrate=6000 vbv_bufsize=400 nal_hrd=none ip_ratio=1.40 aq=1:1.00     Output #0, ffm, to 'http://localhost:8099/feed1.ffm':       Metadata:         creation_time   : now         encoder         : Lavf54.44.100         Stream #0:0: Video: h264, yuv422p, 640x480, q=10-51, 3000 kb/s, 1000k tbn, 15 tbc     Stream mapping:       Stream #0:0 -> #0:0 (rawvideo -> libx264)     Press [q] to stop, [?] for help     [libx264 @ 0xc183f0] VBV buffer size cannot be smaller than one frame, using 400 kbit     frame=   12 fps=0.0 q=0.0 size=       4kB time=00:00:00.00 bitrate=   0.0kbits/sframe=   22 fps= 20 q=0.0 size=       4kB time=00:00:00.00 bitrate=   0.0kbits/sframe=   30 fps= 19 q=0.0 size=       4kB time=00:00:00.00 bitrate=   0.0kbits/sframe=   38 fps= 18 q=0.0 size=       4kB time=00:00:00.00 bitrate=   0.0kbits/s      Any suggestion how not to do transcoding and stream the video directly?


title: Remove noexec from Home folder

text: I trying to deploy an rails application into `/home/app/myapp`, but when application tries to connect to Mysql, I get this error:               ** [out :: 192.168.110.50] /home/app/myapp/shared/bundle/ruby/1.9.1/gems/mysql2-0.3.11/lib/mysql2/mysql2.so: failed to map segment from shared object: Operation not permitted - /home/app/myapp/shared/bundle/ruby/1.9.1/gems/mysql2-0.3.11/lib/mysql2/mysql2.so      'app' user has root privilegies, so it no make sense. After googling, I find that `noexec` in home folder can block system calls. This my fstab file:               $cat /etc/fstab          #     # /etc/fstab     # Created by anaconda on Wed Oct 17 16:48:10 2012     #     # Accessible filesystems, by reference, are maintained under '/dev/disk'     # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info     #     /dev/mapper/VG00-LVbarra /                       ext4    defaults        1 1     UUID=3d5ccda7-932f-4b48-a010-9ddcb99873c0 /boot                   ext4    defaults        1 2     /dev/mapper/VG00-LVhome /home                   ext4    defaults,noexec,nosuid        1 2     /dev/mapper/VG00-LVtmp  /tmp                    ext4    defaults,noexec,nosuid        1 2     /dev/mapper/VG00-LVusr  /usr                    ext4    defaults        1 2     /dev/mapper/VG00-LVvar  /var                    ext4    defaults,noexec,nosuid        1 2      How to remove noexec flag from home folder? Thank you!


title: Install init scripts manually under Debian Wheezy

text: I played around with LSB-compatible init-scripts under Debian Wheezy (`init` is from sysvinit package version 2.88dsf-41+deb7u1). My script in the `/etc/init.d` directory is as follows:               root@T60:~# ls -l /etc/init.d/test-script     -rwxr-xr-x 1 root root 811 Aug 10 03:18 /etc/init.d/test-script     root@T60:~# cat /etc/init.d/test-script     #! /bin/sh          ### BEGIN INIT INFO     # Provides:          test     # Required-Start:    $all     # Required-Stop:     $all     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: test script     # Description:       test script     ### END INIT INFO          # always executes     touch /var/test-file          case "$1" in       start)         echo "Starting script test"         touch /var/test-file-start         ;;       stop)         echo "Stopping script test"         touch /var/test-file-stop         ;;       restart)         echo "Restarting script test"         touch /var/test-file-restart         ;;       force-reload)         echo "Force-reloading script test"         touch /var/test-file-force-reload         ;;       status)         echo "Status of test"         touch /var/test-file-status         ;;       *)         echo "Usage: /etc/init.d/test-script {start|stop}"         exit 1         ;;     esac          exit 0     root@T60:~#       As a next step I added symlink to `/etc/rc3.d` directory:               root@T60:~# file /etc/rc3.d/S05test-script     /etc/rc3.d/S05test-script: symbolic link to `../init.d/test-script'     root@T60:~#       Now if I changed my runlevel from 2 to 3 I expected script to be executed, but this did not happen:               root@T60:~# who -r              run-level 2  2014-08-01 20:47                   last=S     root@T60:~# init 3     root@T60:~# who -r              run-level 3  2014-08-10 03:27                   last=2     root@T60:~# ls -l /var/test*     ls: cannot access /var/test*: No such file or directory     root@T60:~#       I am aware that I could use `insserv` or `update-rc.d` to install scripts and then they will work as expected. Am I correct that both `insserv` and `update- rc.d` take some additional steps when enabling the script besides installing the symlinks? If yes, then which steps?


title: Galculator does not compile

text: I'm trying to compile `galculator-2.0.1` but when I run `make` I get some errors like               galculator-general_functions.o: In function `set_button_color':     /home/user/Downloads/galculator-2.0.1/src/general_functions.c:268: undefined reference to `GTK_COLOR_CHOOSER'      I'm using Lubuntu 11.10. I read something about update to gtk3 but I don't want to install many thins or update almost the whole LXDE. What should I install to solve the problem?


Wikipedia says that: > A page, memory page, or virtual page is a fixed-length **contiguous** block > of virtual memory, described by a single entry in the page table. It is the > smallest unit of data for memory allocation performed by the operating > system on behalf of a program, and for transfers between the main memory and > any other auxiliary store, such as a hard disk drive. Is a page contiguous in the virtual address space or physical memory or both? Thanks.


title: Samba not working through AD

text: I'm trying to get a samba to work with a windows AD. And i can't use my shares through samba. My `smb.conf`               #GLOBAL PARAMETERS     [global]        workgroup = MY_DOMAIN        realm = MY_DOMAIN.COM        preferred master = no        server string = Linux Test Machine        security = ADS        encrypt passwords = yes        password server = MY_MASTER_DOMAIN_CONTROLLER        log level = 3        log file = /var/log/samba/%m        max log size = 50        printcap name = cups        printing = cups        winbind enum users = Yes        winbind enum groups = Yes        winbind use default domain = Yes        winbind nested groups = Yes        winbind separator = +        idmap uid = 1100-20000        idmap gid = 1100-20000        ;template primary group = "Domain Users"        template shell = /bin/bash                    [homes]        comment = Home Direcotries        valid users = %S        read only = No        browseable = No          [tmp]        comment = Directory for storing pictures by jims users        path= /var/tmp        Valid Users = @"MY_DOMAIN+group name" MY_DOMAIN+MY_ACCOUNT       ; public=no        writable=yes        browseable=yes        read only = no        guest ok = no        create mask = 0777        directory mask = 0777      `wbinfo -u and wbinfo -g` work as expected. `kinit MY_ACCOUNT@MY_DOMAIN.COM` works too. But i can't connect to samba. I'm using debian 5, samba 3.2.5 and kerberos 5. My `/var/www` is 777. Any ideas ? UPDATE : testparm ==>               Load smb config files from /etc/samba/smb.conf     Processing section "[homes]"     Processing section "[tmp]"     Loaded services file OK.     'winbind separator = +' might cause problems with group membership.     Server role: ROLE_DOMAIN_MEMBER      UPDATE 2 : I'm able to connect on linux with my AD credentials, but samba don't want to let me access to my shares with the same credentials.


title: How to link the unlinked files?

text: When you `rm` a file it will call unlink(), and unlink() will remove the file from the Directory entry and its inode is freed. But, the actual content of the file is still in the disk. Is there any way to get back the file again i.e add it back to directory entry ?


title: grub waits for user input when booting as guest in virtualbox

text: I have several ubuntu guests inside a Mac OS X virtualbox host. When I start them, about half of the time they correctly boot and get to their login screens/start all their services. The other half of the time, they sit waiting for me to choose an OS. This is fine when I'm sitting in front of them, but I'd like the VMs to automatically boot when the machine starts. It's worth noting that the same problem doesn't seem to happen if I do a reboot from within the guest OS. ### What I've tried: I've tried uncommenting `GRUB_HIDDEN_TIMEOUT` and running `update-grub`, this makes the guest OS boot correctly more often, but doesn't fix the problem. Booting them headlessly doesn't help either. ### Where they get stuck: ![what I see about half the time](http://i.stack.imgur.com/P3uWv.png) `/etc/default/grub`:               # If you change this file, run 'update-grub' afterwards to update     # /boot/grub/grub.cfg.     # For full documentation of the options in this file, see:     #   info -f grub -n 'Simple configuration'          GRUB_DEFAULT=0     GRUB_HIDDEN_TIMEOUT=0     GRUB_HIDDEN_TIMEOUT_QUIET=true     GRUB_TIMEOUT=2     GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`     GRUB_CMDLINE_LINUX_DEFAULT=""     GRUB_CMDLINE_LINUX=""          # Uncomment to enable BadRAM filtering, modify to suit your needs     # This works with Linux (no patch required) and with any kernel that obtains     # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)     #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"          # Uncomment to disable graphical terminal (grub-pc only)     #GRUB_TERMINAL=console          # The resolution used on graphical terminal     # note that you can use only modes which your graphic card supports via VBE     # you can see them in real GRUB with the command `vbeinfo'     #GRUB_GFXMODE=640x480          # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux     #GRUB_DISABLE_LINUX_UUID=true          # Uncomment to disable generation of recovery mode menu entries     #GRUB_DISABLE_RECOVERY="true"          # Uncomment to get a beep at grub start     #GRUB_INIT_TUNE="480 440 1"      Versions:               Grub 1.99-21ubuntu3.9     Ubuntu Server LTS     Virtualbox 4.2.10


title: No AirPlay in XBMC on EeePC (Debian)

text: I have a Asus EeePC (900 model I think) and I've installed Debian 6.0 on it. I've managed to get WiFi working on it and I've installed XBMC. It's working with our NAS drive on the network but for some reason, if I go to Settings->Network in XBMC, the only things that appear are General, SMB, and Internet Access. The main things I want/need are AirPlay and Remote Control - both of which I can not see settings anywhere. I have installed ssh, and avahi-daemon also. Can anybody suggest why these options aren't available and how I can resolve the problem. Thanks


title: explanation of the output's command "ifconfig ppp0"

text: I'm trying to understand the meaning the output of the command:               ifconfig ppp0      Note that I'm using an internet-usb-board and so I'm sure that **ppp0** interface is associated to it. In particular I have these questions:   1. What is the field `P-t-P:x.x.x.x`?   2. Why is the subnet field set to 255.255.255.255?   3. If the inet address is my internet address, why is it different from the internet address computed by a generic web site (I mean http://www.whatismyip.com)?   4. inet = internet? :)   5. At the third line there is the uppercase string `UP POINTOPOINT RUNNING NOARP MULTICAST`; does it mean that my subnet doesn't support multicast of level 2?


title: What's the difference between Ctrl-Z and kill -STOP?

text: When I run a command (`make` on a large project) from the shell, I can type Ctrl-Z to stop the process and return to the shell. Subsequently, I can run `fg` to continue the process. I'm trying to write a shell script to automate this (specifically, to check my CPU temperature every few seconds and stop the process if it gets too hot, since my computer is prone to overheating). My first attempt worked like this (simplified):               make &     subpid="$!"          sleep 2     # If the CPU temperature is too high...     kill -STOP "$subpid"          sleep 2     # If the CPU temperature has dropped to safe levels...     kill -CONT "$subpid"          wait "$subpid"      Unfortunately, this didn't work; sending SIGSTOP to the process didn't pause it (as made evident by its continuing to send output to the terminal). I ran `make &` at the command line, sent SIGSTOP, and checked the process status with `ps`; it was listed as stopped (and started again when I sent SIGCONT), but it was still spewing output and driving up my core temperature! Stopping it with Ctrl-Z never had this problem, but I don't know how to do that in a script. What makes Ctrl-Z different from `kill -STOP`, and how can I get the behavior of the former in a shell script?


title: Using apt or aptitude to get version information about an uninstalled package?

text: I'm looking to install a package, but I'd like to make sure that I can't get a more recent version than, e.g., a PPA. Is there an `aptitude` or `apt-get` command that will enable me to input a package name and have it dump out the version information?


title: Is a symbolic/soft link similar to a shortcut/alias on a desktop?

text: It sounds to me like the basic idea of soft/symbolic links compared to shortcuts (on a PC) or aliases (on a Mac) are the same thing. Am I way off? Are they similar?


title: Regex : match 2nd and 3rd character

text: I was doing some exercises on regular expressions, but I can't seem to be able to crack this one : > egrep in a file where the 2nd and 3rd character are the same. I tried :               egrep  '^..{2}' /usr/share/dict/dutch      However this is wrong, how should I match the 2nd and 3rd character in a regex? How would I match the 2nd and 4th character in a regex (not an exercise, but I would like to know this one as well.)?


title: How to make exported shell variables permanent?

text: export LD_PRELOAD=/usr/lib/libtsocks.so      It's ok that I can export in this way, but how can I make it permanent? I want LD_PRELOAD to still be changed after a reboot. I'm using Ubuntu and Fedora


title: ./configure, how to provide a different executable during the checking phase

text: I am trying to install the MonoDevelop IDE from source. One of its prerequisites is Mono 2.10. Unfortunately the preinstalled mono runtime on my current Ubuntu system is 2.6.7. I managed to make a parallel mono install on my system. It is located at `/opt/mono-2.10`. Sadly, once I run the `./configure` script, it fails saying that the `/usr/bin/mono` executable is outdated (as well as other executables related to mono). I would want to try to pass a different path to `./configure`, to point to my parallel mono install (`/opt/mono-2.10/bin/mono`) etc. How can I do that? Thanks in advance.


title: Upstart and bash function names containing "-"

text: I inherited some bash scripts where the author used "-" in the function names instead of the more normal "_" e.g.:               function a-b {     ...     }      Ugly but legal in bash. Problem is I sourced this inside an upstart script and got > x.sh: line 5: `a-b': not a valid identifier Took a while to realize it was the name and not the function contents. Anyway, renaming is not an easy option in this case and as I've learned, upstart uses `/bin/sh` not `/bin/bash` to parse? run its scripts. Hence I guess this issue. Any ideas on a workaround other than renaming? If nothing else, at least I hope this question will warn others on the perils of odd bash coding styles and how they come back to bite you sometimes.


title: How do I stop a find from descending into found directories?

text: I'm wanting to find all directories with a specific string so I can do another find on the files contained within. So I don't want to waste time on `./my-search-term/dir/my-search-term` etc. How can I stop recursing when I've found the first my-search-term directory?


title: Power off USB storage device/port to avoid power consumption

text: A connected USB storage device, even if unused (unmounted, etc.), consumes power. How can I turn it off / turn its power off so that it doesn't consume power as if it was disconnected, but without actually disconnecting it? I suppose that [temporary] disabling the USB port the device is connected to would lead to the same results. Is that possible? ** Running Linux Kernel 3.1 (Arch Linux)


title: KDE Startup Applications over xrdp

text: I have Google Chrome installed on my machine. The new chrome runs in the background (for addons like google chat) and has an entry in the KDE startup apps. The trouble I am facing is that when I log in to an xrdp session, a chrome window starts up on the local session along with more vino-server session. How do I fix this? How do I stop chrome from opening a new window at the local session? I am using Mint 13 on x64


title: Identifying local and remote sessions

text: I would like to write a startup script that would perform it's task if it was run on the local machine, but not if it was called from a remote xrdp session.               If Local     {      do something     }     If remote     {      do something else     }      How would I identify if the session is locally started or remotely started?


title: can't start default network, is there a way to run dnsmasq for both local and kvm?

text: I can't start KVM since I use dnsmasq on my laptop as a DNS cache server, ![enter image description here](http://i.stack.imgur.com/MNOBv.png) So, I'm wondering if this can be merged to the server I'm running.


title: Top and ps not showing the same cpu result

text: This is linked to this question. When I run `top` I get the following result: ![enter image description here](http://i.stack.imgur.com/YeYpy.png) pid `3038` is using 18% cpu, however when running ![enter image description here](http://i.stack.imgur.com/uCoFi.png) the result is 5.5%. And this number does not appear to be changing with time (i.e. when running the same command a bit later)... Is the `ps` command somehow averaging the cpu usage?


title: Directory filenames with sed with whitespaces

text: I'm working on a script and I'm stuck, even with the help of teh googles. Here's my code:               for FOLDER in `find . -type d | sed "s#^.#$(pwd)#" | sed 's/ /\ /g'`     do         echo "$FOLDER"     done      This will replace only the first instance of " " with "\ " but not the rest. Any ideas?


title: Where does Mac OS X come from?

text: Discussing with Mac owners, I got several versions of where Mac OS X comes from. It is known to have some root in BSD, but how much, and where? Some say that Mac OS X has a FreeBSD kernel, with all the utilities above that makes it an OS being Mac specific. (Not speaking about user apps here, only all of the `init`, `ls`, `cd`, and others. _binutils?_ ) Others say Mac OS X is a Darwin kernel, that is pure Mac, and that the OS utilities come from BSD. Where's the truth?


title: print a file in hex using awk

text: I have a file name `x`               $ cat x     1A34532112345      I wants to print in hex using `awk` I written a script (with help from web)               fold -1 /home/cscape/Desktop/x | gawk '{ printf("%s , %X\n",$0, int($0) )}'       But output for each char is `0`               $ fold -1 /home/cscape/Desktop/x | gawk '{ printf("%s , %X\n",$0, int($0) )}'     1 , 1     A , 0     3 , 3     4 , 4     5 , 5     3 , 3     2 , 2     1 , 1     1 , 1     2 , 2     3 , 3     4 , 4     5 , 5      Why `0` for `A`. even with `%d`. I wants to print ASCII value of `A` as `HEX`.


title: Get list of top 10 memory consuming processes with graph using Cacti in Centos 6.3

text: I'm using Cacti in Centos 6.3 and I would like to get the list of the top 10 memory consuming processes, with a memory graph, so that if server fails I can easily find the processes behind that. It is possible with a plugin or template?


title: What editor can be used to provide highlighting for Mallard project files?

text: I normally switch between Geany, vim and Emacs (depending on my mood. LOL) when editing on a linux platform. Recently, I have begun exploring the Mallard Project, but have been unable to find the right tool for editing files to be processed by Mallard. Does such a tool exist? **UPDATE** Shortly after posting my question, I went to the Mallard mailing list to search for an answer... and posted my question there. I share, here, the answer which I received from that list: > > On Thu, Jan 5, 2012 at 8:44 PM, The Geeko wrote: >>   >>   >>     Is there a tool available which properly handles Mallard documents? >>   >>     I normally use Geany, Emacs and Vim... (depending on my mood and the task at >>     hand), but none of these identify Mallard files; therefore, there is no >>     coloring and other assistance. >>   > > gedit recognizes Mallard documents, and even has some handy Mallard code > snippets. > > It does not do code completion like some advanced IDEs, but it does code > coloring. > > Jim I appreciated the answer.


title: Emacs mode in zsh: M-b M-f etc. show weird symbols

text: I have set up zsh to use emacs mode. But typing `Alt+f` or `Alt+b` inserts weird symbols (accented letters and so on), rather than moving around by word in the shell like it should. Since I don't ever want to insert the "ae" symbol into a shell prompt, how can I get zsh to behave? I had the same problem with bash, but now that I'm actually taking the time to customise zsh, I thought I'd ask... `AltGr+b` etc. produces _different_ weird symbols... I'm using Ubuntu 10.4


title: What is in fsck section in fstab?

text: I have a basic understanding of fsck utility but what does "fsck" section in /etc/fstab denote? It has values 0, 1, 2 what are these values? Googling says 0- it wont be checked 1- will be checked on boot 2- Now what is it?


title: Color of the fonts in my remote terminal screen when using VI in linux

text: I notice one of my linux remote login window shows color in VI editor interface but another window doesn't show color. These 2 windows are remotely connected to 2 different server IP addresses. ![Screenshots](http://i.stack.imgur.com/KP0xz.png) May I know why and how to change the color of the VI screen? I am using Putty on Windows 7 to remotely access the linux server.


title: Creating a .sh wrapper in my debian package

text: I'm trying to build a debian package for a program that uses mono. My `make install` target currently puts all of my binaries `/usr/local/lib/mypackage`, then creates a tiny executable script in `/usr/local/bin` that invokes the actual binaries with mono. I use a one-liner to replace the placeholder `PREFIX` with the actual install path:               install: DESTDIR=/usr/local     install: LIBDIR=$(DESTDIR)/lib     install: BINDIR=$(DESTDIR)/bin     install: $(PHONIX) $(ANTLR) doc         install -m 0755 -d $(LIBDIR)/phonix         install -m 0755 -t $(LIBDIR)/phonix $(PHONIX) $(ANTLER)         install -m 0755 -D phonix.sh $(BINDIR)/phonix         sed -i "s!PREFIX!$(LIBDIR)!" $(BINDIR)/phonix      When I'm running under `dh_make`, `$(LIBDIR)` and `$(BINDIR)` point to the packaging directory as desired. Everything gets installed into the right place for the packager, but the `sed` call puts the path of my local packaging directory into the script, which then gets placed verbatim in the package. This obviously doesn't work once I actually install the package on the target system. I think that I need to move the `sed` call into the post-install script, but I'm not sure how to get the local install directory (the moral equivalent of my `$(LIBDIR)` and `$(BINDIR)`) in the post-install step. Or is there a better way altogether to do this? * * * **Edit** : Here's my actual `phonix.sh` file, before sed is called:               #!/usr/bin/sh          exec mono PREFIX/phonix.exe      As you can see, the _only_ purpose of this file is to provide an executable wrapper for the mono-based .exe. The sed call just replaces `PREFIX` with the value of `$(LIBDIR)`. So all I really need to know is _how can I get the actual installed location of my .exe on the target system_ so that the wrapper script works?


title: How to divide a list of values by a number in command line?

text: I am trying to translate a simple program to the command line using unix utilities. For example, if I have a frequency list (after piping through uniq and sort)               5 x     4 y     1 z      I want to print out, instead of the frequencies, the fraction of the times they occur:               0.5 x     0.4 y     0.1 z      (I have a python program that does this, but I wanted to know if this could be done through the command line itself.) So far, I have tried to compute the sum               <...>| awk -F" " '{print $1}' | tr '\n' +; echo 0 | bc      but this is just giving me the output `5+1+4+0` without computing it. EDIT: I got the sum . I modified the above command to               <...>| awk -F" " '{print $1}' | echo $(tr '\n' +; echo 0) | bc > sum       and the correct result is stored in sum. Now I just want to divide the original list by sum and display it.


title: What happens when my internet dies out during the net installation of Debian?

text: So it downloaded all kinds of things (I think GNOME didn't make it, because I'm doing everything in command line atm). My router is so crappy that it loses its internet connection if I surpass 450 kB/s. I usually prevent this with wondershaper (and at the time I didn't figure to install it before installing anything else), but now the installation stopped around 17%. So then I skipped that step and finished my installation. Upon rebooting, all I had was tty's, no sign of GNOME. Now I'm wondering what happened with that 17%. Is it just taking up space somewhere on my hard drive? Or did the installation procedure delete that 17% when it realized that step was cancelled?


title: Force change of a user's cwd as root

text: I'm looking to change a user's process such that I can set it's cwd. Related, and _secondary_ to the question, I have a filesystem I want to unmount but a user is sitting on it with a bash process. I don't want to kill that user's process but I'd like to gently redirect them to say ... /tmp while I unmount the disk. I'm root obviously.


title: Chroot debian squeeze for shell access

text: A user requires shell access to an Ubuntu server from the WAN side. There are many shell accounts with simple passwords. So shell port (port 22) is blocked in the firewall. For my WAN side user I am planning to run a ssh server in a Debian chroot, and open its port in the firewall. If this kind of setup is feasible, what is the best way of achieving it?


title: Find used drivers for printer

text: My printer CANON PIXMA MP170 (usb) doesn't work on Debian 7 amd64 but does work on my Ubuntu 12.04 i386. I've tried a lot of tutorial about this but no success. So for now I'd like to to know more about what driver is used on my Ubuntu 12.04 for this printer. So, i'm searching a way to find what driver CUPS use for my printer on ubuntu and maybe use this information to make work it on my debian.


title: Why doesn't /etc/udev/rules.d/70-persistent-net.rules exist on virtual machines?

text: CENTOS 5.9 I'm curious, why doesn't `/etc/udev/rules.d/70-persistent-net.rules` exist on virtual machines with CentOS 5.9? Is there an alternative file name for this when using a virtual machine?


title: How to test whether the file is crlf or lf without modyfing it?

text: I need to periodically run a command, that ensures that some _text_ files are kept in linux mode. Unfortunately `dos2unix` always modifies file, which would mess file's and folder's timestamp and cause unnecessary writes. The script I write is in Bash, so I'd prefer answers based on Bash.


title: How can I determine the wall clock time of a process?

text: I have found the general Linux program `time`, which times a command. For example, suppose I want to time the execution of `foo`. I can use:               time foo      which gives this sample output:               real    0m8.738s     user    0m5.796s     sys     0m0.576s      However, the man page for `time` seems a bit unclear (although I am a Linux novice): > >     TIME(1)                       Linux User's Manual > TIME(1) >   >   >   >     NAME >            time - time a simple command or give resource usage >   >     SYNOPSIS >            time [options] command [arguments...] >   >     DESCRIPTION >            The  time  command  runs  the  specified program command with the > given >            arguments.  When command finishes, time writes a  message  to > standard >            error  giving  timing statistics about this program run.  These > statis- >            tics consist of (i) the elapsed real time between invocation and > termi- >            nation, (ii) the user CPU time (the sum of the tms_utime and > tms_cutime >            values in a struct tms as returned by times(2)), and (iii)  the > system >            CPU  time  (the  sum of the tms_stime and tms_cstime values in a > struct >            tms as returned by times(2)). >   Does the "real" time refer to the **_wall clock_** time?


title: file still read-only after a mount --bind from a rw partition

text: I use `mount --bind` to "overlay" a file from one `ext4,rw` filesystem onto another file in `ext4,ro` filesystem. For example, `/etc/hosts` is on a read- only `/` partition, but I have another partition where `/rw/etc/hosts` is writable. So when I do               # mount --bind /rw/etc/hosts /etc/hosts      any writes to `/etc/hosts` will go to `/rw/etc/hosts` * * * This worked fine in `CentOS 6.3`.               # mount -o ro /dev/sdc1 /ro     # mount -o rw /dev/sdc2 /rw     # mount --bind rw/test ro/test     # echo 1 > rw/test     # cat ro/test     1     # echo 2 > ro/test                    # [1]     # cat rw/test     2      But I cannot get it to work in `CentOS 6.4` I repeat the steps from above, but I get an error when trying to write to `ro/test`:               # echo 2 > ro/test                    # [1]     -bash: ro/test: Read-only file system      `SELinux` is disabled. Any ideas what could cause this to stop working? CentOS 6.3 kernel: `2.6.32-279.22.1.el6.x86_64`   CentOS 6.4 kernel: `2.6.32-358.el6.x86_64` and `2.6.32-358.2.1.el6.x86_64`


title: What are the characters printed when Alt+Arrow keys are pressed?

text: When I press `Alt``Up`, `A` printed to terminal screen. Same thing happened when I pressed `Alt``Down` but `B` is printed instead. Other characters that I realized; `Alt``Left` = `D` and `Alt``Right` = `C` What is the purpose of these commands?


title: Format the content of the file using Perl

text: I am new to Perl programming and I am stuck with this problem for some time. Can you please help me in solving it? I have a file with the following format:               >Country1      Aus     trali     a          >Country5     Swi     tzer     land          >Country2     Net     herland     s      I want to output a file with the following format:               >Country1 Australia     >Country5 Switzerland     >Country2 Netherlands


title: Unable to start apache

text: I'm running CentOS7 in virtualbox on a mac (osx 10.9.3). Ultimately, I want to acces the website on my Guest VM from my Host. I can Ping and SSH to VM but I can't acces the webpage when entering the VM's IP in Host browser. When running               systemctl status httpd.service       I get 2 errors: 1) "No listening sockets available". Netstat tells me there is no process on port 80. I'm not out of disk space. Error log is empty (for today) In "/etc/httpd/conf/httpd.conf" I put:               Listen 80      2) "Unable to open logs". In "/var/log/httpd" I did               chmod 777 error_log acces_log      I'm stuck, been trying to acces this webpage for a day now. Any help is much appreciated.


title: i3wm : start applications on specific workspaces when i3 starts

text: How can I start applications on specific workspaces in i3 when it starts? Why is this not working in my config file? :               workspace 1; exec firefox; workspace 2; exec chromium; workspace 1


title: Install application to /usr/local

text: Some application that installs automatically such as Netbean, JDK often install to `/usr/local` and I run it by normal user (not root). But another application, just extract `tar.gz` file and run it. Under normal user, I cannot use `cp` command to copy from `Download` directory to `/usr/local` directory, I must use root user (`su` command). But because I copy by root user this directory belongs to root, so I cannot run it under normal user. It makes my headache. How can I run it under normal user, as other application that I list above. Or, is there another way to install it?


title: Flashing rootfs on Embedded Linux with Limited RAM

text: I'm fairly new to the embedded world, so forgive me if this seems obvious. I'm working on a board based off of the AT91SAM9260. I have 256MB of flash and 64MB of RAM. The current setup flashes two uImages. The first if a RAMDISK only recovery image, and the second is the main uImage. The first is used to flash rootfs.ubifs onto /dev/mtd1 for the main uImage. One of the problems I'm encountering is running out of memory while flashing the rootfs from the recovery image. Depending on the size of the rootfs, it runs out of memory while flashing. I'm using TFTP to pull the image over onto the device and flash it. So, it must reside in memory along with the recovery uImage. Is there a more efficient way of doing this perhaps? While the goal is to keep our rootfs small, obviously, given it's going onto an embedded device, some of our customers have different needs and don't mind some more of the flash being taken up by the OS.


title: Getting xmonad and gnome-panel working with Fedora 18

text: I have been using fedora 18 lately and trying to get xmonad working with gnome-panel. On my ubuntu and kali installations this works perfectly fine, but in fedora I have yet to get gnome-panels to show up correctly. Any help as to why the gnome-panels show up the way they do and getting it to work correctly is greatly appreciated. Here is a screenshot. Notice the 2 black panels on the right. I have figured out they are suppose to be the upper and lower gnome-panel menus but obviously they are not working in fedora and xmonad yet.![enter image description here](http://i.stack.imgur.com/AnzIm.png) I have an xmonad desktop file               #/usr/share/applications/xmonad.desktop     [Desktop Entry]     Type=Application     Encoding=UTF-8     Name=Xmonad     Exec=xmonad-start     NoDisplay=true     X-GNOME-WMName=Xmonad     X-GNOME-Autostart-Phase=WindowManager     X-GNOME-Provides=windowmanager     X-GNOME-Autostart-Notify=false      I have a gnome-session file               #/usr/share/gnome-session/sessions/xmonad.session     [GNOME Session]     Name=Xmonad/GNOME     RequiredComponents=gnome-settings-daemon;gnome-panel;     RequiredProviders=windowmanager;notifications;     DefaultProvider-windowmanager=xmonad     DefaultProvider-notifications=notification-daemon      I have an xsessions file               #/usr/share/xsessions/xmonad.desktop     [Desktop Entry]     Encoding=UTF-8     Name=XMonad Gnome     Comment=Lightweight tiling window manager     TryExec=/usr/bin/gnome-session     Exec=gnome-session --session=xmonad     #Icon=xmonad.png     Type=XSession      This works just fine in my other systems but in fedora after logging into xmonad gnome-panel seems to open two panels that are suppose to be the gnome- panels at the top and the bottom but they are blank. Plus you cant close them or anything else with them. Inside my xmonad.hs file a the top I import the GnomeConfig module and the ManageDocks module.               import XMonad.Config.Gnome     import XMonad.Hooks.ManageDocks      I also have added gnome-panel ignore to my configuration, but I don't know for all certainty what it does ( I just know it made my other systems work after adding it)               myManageHook = composeAll     [ manageHook gnomeConfig     , className =? "File Operation Progress"  --> doFloat     , className =? "google-chrome"  --> doShift "4:chrome"     , resource  =? "desktop_window" --> doIgnore     , resource  =? "kdesktop"       --> doIgnore     , resource  =? "gnome-panel"    --> doIgnore ]       And I have changed my defaults to the GnomeConfig that I imported at the top.               main = xmonad defaults          defaults = gnomeConfig {            -- simple stuff         terminal           = myTerminal,         focusFollowsMouse  = myFocusFollowsMouse,         borderWidth        = myBorderWidth,         modMask            = myModMask,         -- numlockMask deprecated in 0.9.1         -- numlockMask        = myNumlockMask,         workspaces         = myWorkspaces,         normalBorderColor  = myNormalBorderColor,         focusedBorderColor = myFocusedBorderColor,            -- key bindings         keys               = myKeys,         mouseBindings      = myMouseBindings,            -- hooks, layouts         layoutHook         = myLayout,         manageHook         = myManageHook,         handleEventHook    = myEventHook,         logHook            = myLogHook,         startupHook        = myStartupHook     }


title: Modifying a BTRFS filesystem UUID

text: I've made backups of my BTRFS filesystem using Clonezilla, and have restored one of those backups to a file named `2013-11-29.sda3.img`. I need to get some files out of this backup, but there's a hitch. Since the backup is of this machine, I cannot mount the backup anywhere on my filesystem, as its UUID matches the UUID of `/`. Is there a way that I can change the UUID of the backup volume? As I understand it, BTRFS stores UUID information in every block on the filesystem, which complicates things for my purposes. However, is there a way that I could modify this? I understand that it'd probably take a long time to do, but that doesn't concern me. My main concern is keeping the server online. The backup is fairly large, so transferring it to another machine would take quite a while. What are my options?


title: wget a file, logging the output and showing the output on prompt

text: In a bash script, I need to download a file from the web, for doing it i use wget command. I would log the output of wget command, and at "the same time" having the output prompting on terminal. I searched in the `man wget` without find the way to achieve that. it seems that if you turn on the log with `-o` or `-a` parameter, then the prompt output is automatically 'redirected' to the log file, and nothing is showed on terminal while executing the script, until it have done to download. > wget -a wget_log --no-check-certificate --auth-no-challenge \--http- > user=$jen_uname --http-password=$jen_psswd link_to_the_file Is it possible to do both? output on prompt and writing on log file? every hint is appreciated


title: How to enable vim addon packages?

text: I have installed `vim-nox` as well as `vim-latexsuite` and `vim-outliner` on Ubuntu 12.10. There's nothing wrong with Vim but neither of the add-on packages does anything. What do I have to do to in order to enable them?


title: Providing the full path doesn't work but calling just the name of the program does, why?

text: What am I missing? I can call "rvm" from the command line but not reference the entire path that `which rvm` says I'm using. Not that it's important, but I stay logged in as "jenkins" the entire time and these commands are executed in succession.               $ whoami     jenkins      RVM is located here               $ which rvm     /home/jenkins/.rvm/bin/rvm      This works               $ rvm use 1.8.7     Using /home/jenkins/.rvm/gems/ruby-1.8.7-p370     Running /home/jenkins/.rvm/hooks/after_use      But this doesn't work               $ /home/jenkins/.rvm/bin/rvm use 1.8.7     RVM is not a function, selecting rubies with 'rvm use ...' will not work.     You need to change your terminal settings to allow shell login.     Please visit https://rvm.io/workflow/screen/ for example.      Yes, I have visited the link that is referenced but I don't see how it applies to me.


title: My echo command doesn't accept switches (echo -n or echo -e)

text: I have an echo statement in my script as below:               echo -ne "Check Script";      I was expecting it to print               Check Script      but I am getting the below output               -ne Check Script      But when I run the same script on some other machine I get the expected output. What could be machine specific variables or properties because of which the script is behaving differently.


title: Why don't /etc/group and /etc/password match?

text: OK this is a basic question showing my ignorance of sysadmin matters... Looking at the UNIX system I work on, my /etc/passwd entry says my_name:x:uid:gid:comments:home directory:login shell Then when I go and look at group 'gid' in /etc/group, I see group_name:x:gid:some_other_name So how come /etc/passwd thinks I am a member of the group, but /etc/group doesn't? Am I a member of the group or aren't I? Is this normal? Your help would be appreciated.


title: Compare 2 tab delimited files and output differences with column header

text: I would like to compare 2 similar files on a common column. The files will have identical headers. `file1.txt`               mem_id      Date    Time    Building         aa          bb      cc      dd     ee          ff      gg      hh     ii          jj      kk      ll      `file2.txt`               mem_id      Date    Time    Building         aa          bb      cc      dd     ee          ff      2g      hh     ii          jj      kk      2l      `Command`               awk 'NR==FNR{for(i=1;i<=NF;i++){A[i,NR]=$i}next} {for(i=1;i<=NF;i++){if(A[i,FNR]!=$i)\      {print "ID#-"$1": Column",i"- File1.txt value=",A[i,FNR]" / File2.txt value= "$i}}}'\      file1.txt file2.txt      `Current Output`               ID#-ee: Column 3- File1.txt value= gg / File2.txt value= 2g     ID#-ii: Column 4- File1.txt value= ll / File2.txt value= 2l      `Desired Output`               mem_id#-ee: Time- file1.txt value= gg / file2.txt value= 2g     mem_id#-ii: Building- file1.txt value= ll / file2.txt value= 2l       I am very close. But I would like help with a few improvements. 1- I would like to replace the “Column 3” and “Column 4” with the actual column header (Time, Building, whatever) 2- I would like to dynamically gather the file names in the output and not have to add it as part of the command (to make it universal) 3- I would like this scriptable. Any help would be appreciated.


title: Why am I getting an InitDevice::CreateDevice error when I try to run "Pirates of the Caribbean" with Wine?

text: I am running Ubuntu 11.04 on a Sony Vaio. I am using wine 1.3 to run a rather complex yet archaic gaming program, "Pirates of the Caribbean" (2003; not based off the movie). I started it up and after five minutes it crashed. I unplugged the computer, and when I tried to run the program it crashed and an error came up saying "runtime error! abnormal program termination". Also I created a link to the executable on my desktop and when I tried to load it that way it crashed loading `PCS_control.dll` and a log file showed up with the content:               Scanning current directory     Loading modules...     Loaded 0      Reset...     Initializing CORE...     User Rised Exception     C:\PROJECTS\DRIVE_V2\ENGINE\SOURCES\Core.cpp line 364     no 'engine.ini' file      I think this report is superficial -- I know that there is an `engine.ini` file and that it is not corrupted because I tried recopying from my other computer. I also happen to know the above directory does not exist. How can I get this game to run? P.P.(post, post) when I run engine.exe on the computer while its not in the directory with all of the program files it still says runtime error, maybe when the program crashed it somehow damaged a driver... P.P.P. sorry I might have made a mistake, it crashes loading directX 8 P.P.P.P. This time I tried running pirates, The Loading screen said "InitDevice::CreateDevice, This Technique is not supported by your device" What does This mean and if possible, how may I fix it? Thanks for your input.


title: Linux kernel: task vs thread

text: When I was reading a book(Linux kernel programming), I got interesting/confusing paragraph about `mm_segment_t addr_limit`(one of the member in `struct_task`) as below: > **mm_segment_t addr_limit;**   >  Unlike the older kernels, since 2.4 tasks (threads) aslo can be within the > kernel. These can access a larger address space than tasks in user space. > _addr_limit_ describes the address space, which it is possible to acess > using the kernel of the task. **Questions** : 1.In first point, "(tasks) threads **also can be** within the kernel" is there. What does it means? So threads not necessarily within the kernel? 2.Second sentence, `These can access a larger address space than tasks in user space`. I don't understand what `these` means? If he is talking about threads, how can a threads have larger address space than tasks?