title: avconv creates creates files whose duration is incorrect

text: I am attempting to create a variable rate mp3 from a flac using the following command:               avconv -i t.flac -id3v2_version 3 -vn -acodec libmp3lame -aq 0 t.mp3      avconv and mediainfo both list the duration of the final mp3 correctly as 2m40s, but every mp3 player (clementine, juk and amarok) I've tried says that the song is 21m15s long. Using clementine and amarok to view details about the file turns up that they think the bitrate is 32kbps while avconv and mediainfo (correctly) list the overall bitrate as 255kbps. (255/32)*2.66 = 21.20, so I'm sure that it's the perceived bitrate that's the problem, but I don't know what to do to fix it. Just for fun, I also tried creating a constant bitrate file with the following command:               avconv -i t.flac -id3v2_version 3 -vn -acodec libmp3lame -ab 320k u.mp3      This has the same problem. Oddly enough, even though the bitrate is specified, mediainfo still reports that the bitrate is variable and mp3 players have the same general problems with the duration. How can I fix this?


title: Script to gracefully kill X server and drop to tty?

text: I use the terminal to do the majority of my day-to-day computing, so I have the default runlevel set to `3` in `/etc/inittab` and I only start the X server when I need to. I currently have the following in my `xorg.conf` in order to make quickly switching to the terminal easier:               Section "ServerFlags"         Option            "DontZap"    "false"     EndSection          Section "InputClass"         Identifier        "Keyboard Defaults"         MatchIsKeyboard   "yes"         Option            "XkbOptions" "terminate:ctrl_alt_bksp"     EndSection      I know this is messy and fraught with security problems, which is why these settings were removed from the default install in the first place. However, it's fast. How can I get this kind of functionality in a safer way using a shell script or something similar that can be attached to an event such as a key combination or to closing the screen of a laptop? What I am after is an immediate killing of the X server process with no output to tty (currently, `Ctrl + Alt + Bksp` fills the terminal with the output from the dying X server, which I have to exit with `Ctrl + C`).


title: Clearing DNS Cache in Linux

text: I work on Linux on my laptop, I could not access a particular website using the URL, so I used `sudo /etc/init.d/nscd restart` in order to clear the DNS cache, but the URL is still throws 'Server Not Found' in Firefox. I have tried also Chrome, it still not working. Other friends can see the web page, but I can not. So what would be the main cause of this? I can surf other sites nicely. Weirdly enough when I even try the IP address of that particular URL, it shows me a different page than what other people see. I appreciate any help on this matter.


title: How could I change Linux command to another key combination?

text: I'm using wmii, so `Alt` key Linux command was disabled. I want to change `Ctrl`+`F` and `Ctrl`+`B` to `Alt`+ `F` and `Alt`+ `B` so that I can use them to jump by word. But I searched on line, and didn't find anything about change Linux Command key bindings. How to do it?


title: dm-crypt and LUKS password rotation

text: How do you protect the master key, and distribute multiple passwords for admin access? Is there a 3rd party user management tool or is this native?


title: How to disable password prompting for automatic updates on Red Hat

text: Basically, I have the opposite problem of this guy. I would like my updates to be installed in a transparent way : I'm tired of entering my password every time. I'm running on Red Hat (6.2 to be precise). I saw a script somewhere saying that you need to edit a line containing "admin" in visudo, but I don't have that line. It was meant for Ubuntu, maybe that's the reason why...


title: How do I enable rsync in libcurl?

text: I'm on Arch. When `pacman` tries to download a package from an `ftp` server, It fails with the error message > Protocol rsync not supported or disabled in libcurl This has been bugging me for a little while now, but I can't remember what I did to cause it (Pacman just downloads from an `http` server instead, so I've been able to ignore it). I have both `rsync` and `libcurl` installed, and they apparently played well together before. I can't find any `libcurl` or `curl` config files and found no mention of `rsync` in the `man` page. How can I go about enabling `rsync`?


title: Why is this flag not working?

text: Ok so i want to view the ram and have it run continuously                    root@another:/etc/mysql/database_backups# free -mt                      total       used       free     shared    buffers     cached         Mem:           998        870        127          0         92        362         -/+ buffers/cache:        415        582         Swap:         2047         31       2016         Total:        3046        902       2144              root@another:/etc/mysql/database_backups# free -mts         free: option requires an argument -- 's'         usage: free [-b|-k|-m|-g] [-l] [-o] [-t] [-s delay] [-c count] [-V]           -b,-k,-m,-g show output in bytes, KB, MB, or GB           -l show detailed low and high memory statistics           -o use old format (no -/+buffers/cache line)           -t display total for RAM + swap           -s update every [delay] seconds           -c update [count] times           -V display version information and exit      the first command works great but adding the s flag gives me an error but i can clearly see that is an available flag....any ideas on what i am doing wrong and if there is a better way of doing this


title: Trying to install Linux Mint 13 via Wubi, throws me into grub prompt

text: I'm trying to install Linux Mint 13 with Cinnamon via the 64 bit DVD image from within Windows. I've tried both installing it to `C:` which is my Windows system disk, but also to `D:` which is another physical disk entirely. The same thing happens on both disks. The Windows part of the installation completes and it tells me to reboot. When I reboot, it tries rebooting into Linux Mint to start the installation, but I only get a prompt saying `grub >`. If I try the `boot` command, it says no kernel is loaded. I've tried looking at the boot record in EasyBCD, and it looks like this:               Entry #1     Name: Windows 7     BCD ID: {current}     Drive: C:\     Bootloader Path: \Windows\system32\winload.exe          Entry #2     Name: Linux Mint     BCD ID: {62256248-e57d-11e1-9eca-d50aae34d088}     Drive: C:\     Bootloader Path: \linuxmint\winboot\wubildr.mbr      Booting Windows 7 works fine obviously, but I'm not sure why Linux Mint fails. The Bootloader Path for the Linux Mint installation checks out. Any ideas why this is happening, and/or what I can do to troubleshoot it? I really want to install this via Wubi, and not have to mess around with partitions.


title: How to  have pam_exec run the script as the current user?

text: I need to run a script, when the session is opened, as the user who's opening the session. I have added in /etc/pam.d/common-session :               session optional        pam_exec.so      log=/tmp/test_pam_foo.log /usr/local/bin/test_pam_foo.sh      I also tried to activate pam_exec's option `seteuid` The basic script /usr/local/bin/test_pam_foo.sh :               #!/bin/sh     id -u >> /tmp/test_pam_foo     id -ru >> /tmp/test_pam_foo      Unfortunately, I get all the time `0` as the effective id and real id. Am I missing something? As alternative, I know the existence of pam_script, not to be confused with pam-script. That pam_script runs by default as the current user and has the option `runas` to force to be run as root. But I'd like to privilege the use of pam libs that are already packaged in my distribution (Ubuntu 12.04).


title: Lost window title bars and everything after selecting bad window theme in Linux Mint

text: I've selected a window theme from the "Advanced Settings" in Linux Mint 12 which seems to be corrupted and I've lost everything on my desktop. I can't start any applications but I can open the terminal by right clicking on the desktop and selecting "Open in Terminal" but I am a Linux newbie and I don't how to use it. It would help me much if you can answer only one of the two questions bellow:   * How to start the "Advanced Settings" from the console?   * How to revert to the default window theme using the console? Please keep in mind that I've got the problem when I changed the "Window Theme" not the "Shell Theme" in the Themes tab in the "Advanced Settings"


title: Could I disable ext4's journaling safely in BBWC?

text: I knew set "nobarrier" flag is safe in BBWC when using ext4,but since "nobarrier" flag couldn't ensure proper order of journal logging and data flushing,then it seems journaling is useless。So is it safe to disable ext4's journaling safely in BBWC?


title: Script that uses MySQL query to automatically remove output

text: I have this query that outputs updates older than 7 days from a database. How would I make a script that takes the MySQL statement and puts it into a script to be executed by cron.               echo "select name, reported_at from nodes where reported_at < curdate() -7;" |     mysql dashboard      Sample output:               name    reported_at     xadf.edu    2012-03-21 14:39:02     xadf.edu    2012-03-22 15:30:01     adsfsadf.edu    2012-03-14 14:40:02     ekdahlj.edu 2012-03-23 03:40:04     adfasdf.net 2012-03-21 14:42:02     eqrsdr.edu  2012-03-15 14:42:02     qwerwfva.edu    2012-03-13 14:42:03     qerqwer.edu 2012-03-23 14:40:01     adfasde.edu 2012-03-05 17:42:03     bsfdgs.edu  2012-03-23 15:20:01     adfadsf.edu 2012-03-23 14:43:01


title: How can I manage puppet.conf with Puppet?

text: I use puppet to manage linux servers and various services. It works well, except for the _puppet_ service itself. My puppet class is like this :               class puppet {       file { "/etc/puppet/puppet.conf":         owner  => 0, group  => 0, mode => 0644,         content => template("${module_name}/puppet.conf.erb"),       }            service { "puppet":         name       => "puppet",         ensure     => running,         enable     => true, hasstatus  => true, hasrestart => true,         require    => File["/etc/puppet/puppet/conf"]         subscribe  => File["/etc/puppet/puppet/conf"]       }     }      } When a change is applied on /etc/puppet/puppet.conf, puppet notices that it needs to restart puppet service and so, crash itself :               Mar 30 17:08:23 XXXX puppet-agent[20172]: (/Stage[main]/Puppet/File[/etc/puppet/puppet.conf]/content) content changed '{md5}eeaf5dfc7d88c8d9c85e6a8cc714d702' to '{md5}ef6ff0e423f4125e24b689980df9f71d'     Mar 30 17:08:23 XXXX puppet-agent[20172]: Caught TERM; calling stop      Do you know how I could update puppet.conf correctly with puppet ?


title: How to change camera info in Exif using command line

text: I have analog camera and I give a film to the lab where they scan it, I wanted to upload it to flickr but want to change info about camera. Right now it's `NORITSU KOKI QSS-32_33` and I wanted it to be `pentax k1000` (I don't want to clear exif data). How can I do this from command line.


title: Using Fedora 19 to burn .iso-image to external HDD

text: Seeing as several google-searches have failed me, I am having a hard time completing this task. I am currently running Fedora 19 on my laptop, and I wish to burn a .iso-image to an external HDD. Seeing as Brasero and several other programs that are seemingly made for this purpose are not recognizing said HDD (looks like they only accept flashdrives?) I am unable to find any way to burn it. The disk is formatted to NTFS. I have also tried with FAT. I am relatively new to Linux and would highly appreciate being spoonfed if anyone would find the time to do so. Some clarification might be needed: I already have Fedora 19 installed. I wish to install Windows XP as well. I have a 500 GB HDD I'd like to install it on. I have tried the following:   * Programs like Brassero etc. Does not recognize the HDD.   * Running the .iso in a VM, but the external HDD is not an alternative as an installation disc.   * Using dd. This did work somewhat, seeing as the disc was renamed to "WINDOWS XP HOME EDITION" blablabla, but when booting it I simply got the message "unable to load operating system." After this, I formatted the disc again. I have successfully installed XP on a VM, so there is nothing wrong with the .iso itself. Please note that my objective is to have XP on the external HDD, if this can be achieved by other means, those answers are naturally accepted.


title: Wordpress won't recognize the MySQL database

text: I want to install Wordpress on Archlinux but I have this error: > Your PHP installation appears to be missing the MySQL extension which is > required by WordPress. I un-commented this line in `/etc/php/php.ini`:               ; ... or under UNIX:     ;         extension=msql.so     ;      but this error is not fixed. how can I fix this error?


title: Using tail command to create a file

text: This is what I did using `tail` command. When I try to output the file to screen the file is empty.               ~]$ tail > AFS2F1     PASSES ALL DATA FROM INPUT TO OUTPUT     PASSES ONLY SPECIFIED COLUMNS     PASSES NUMBER OF SPECIFIED LINES AT BEGINNING     COMBINES COLUMNS     ARRANGES DATA IN SEQUENCE     PASSES NUMBER OF SPECIFIED LINES AT THE END OF DATA     TRANSLATES ONE OR MORE CHARACTERS     DELETES DUPLICATE LINES     COUNTS CHARACTERS, WORDS, OR LINES     ABCDEFGHIJKLMNOPQRSTUVWXYZ      Is there anything wrong with the way I'm using tail command?


title: Is /etc/resolv.conf needed when using a static IP address?

text: I am trying to configure the IP address of my embedded device. The device should have a static IP address and I attempt to set this using the `/etc/network/interfaces` file with               iface eth0 inet static        address 192.168.255.212        netmask 255.255.255.0        gateway 192.168.255.1      where I have been given these values by our network technician. My system is a minimal embedded system built with buildroot, uClibc and busybox. With this `interfaces` file, a call to `ifconfig eth0` displays that the above settings have been enabled correctly, but I am unable to ping anything on my network. My question really is this: is the above `interfaces` file sufficient for setting a static IP or is something more necessary? From online tutorials, I see many mention of `/etc/hosts` and `/etc/resolv.conf` files. I don't even have a `/etc/resolv.conf` file on my system. I am having other problems as described here Unable to get embedded device to ping anything on the network so I am asking this question separately to verify that I am setting up the static IP address correctly and rule out an incorrect setup. **EDIT** The output of `route` is               Destination      Gateway     Genmask        Flags   Metric Ref  Use Iface     default      192.268.255.1   0.0.0.0        UG       0      0    0   eth0     192.18.255.0     *           255.255.255.0  U        0      0    0   eth0      but I am unable to even ping the gateway


title: Where to find Terminal in Raspbmc

text: I'm a newbie when it comes to using/setting up a Raspberry Pi. I installed Raspbmc on my Raspberry Pi. It's working fine but I'm not able to find the terminal. How can I go about finding it?


title: Configure distant terminal behaviour

text: I just installed debian 7 on a VPS, created users, configured ssh ..etc The problem is that the terminal application changed its behavior just after connecting with my new username:   * Autocompletion not working (I edited /etc/bash.bashrc for that but it dosen't works)   * I can't use keyboard shortcuts like I always used to : For example CTRL-l, or CTRL-R or even up/down for commands history , left/right to move within the same command and start/end keys. When I use those shortcuts I've got those chars:               $ ^[[C^[[D^[[D^[[D^[[A^[[B^[[A      Well, it not productive at all ! Any suggestions ?


title: Please explain the output of the ls -all command

text: This is one of the many similar lines from the output from ls -all               lrwxrwxrwx  1 subhrcho dba   25 Dec  6 01:36 beam-server.jpr -> .ade_path/beam-server.jpr      What does the above signify ? I am specially interested in `.ade_path` ? What does the dot(.) signify here ?


title: fstab mount drive as my /home

text: I am trying to:   * mount my 2TB external USB hard drive as my home directory at `/home/peter`   * ensure that the home directory is owned by me (not root)   * do all this automatically at bootup Currently:   * my drive is formatted to `ext4`   * my drive is empty   * I am running debian 7 I can reformat to another filesystem type if necessary, but I want to use the full 2TB on the drive. The following `fstab` line mounts the drive incorrectly owned by `root`:               UUID=xxxx /home/peter ext4 nodev,nosuid 0 2      How can I mount the drive so that it is owned by `peter` (that's my login user on the PC)?


title: Standard way to expose device file to userland applications running on an unprivileged user account?

text: I just finished the first version of a Linux kernel module I've written in C. The module creates a device file (`/dev/wn0`) that controls a USB device with three LED lights. For example, running as root, I can do this:               echo "#ff0000" >/dev/wn0      ...and the device will glow bright red. My problem is that I want unprivileged users to be able to access the device (by writing data to `/dev/wn0`). Is there a standard way to do this? Is it as simple as changing the permissions on the `/dev/wn0` file? Does that create security concerns?


title: How to fix the corruption of the tar balls?

text: I was making a complete server backup and tried making the tar balls of each directory structure by using the following commands: `nohup tar -cvf - /etc | gzip -9 -c > /opt/Backup_4_Jan/etc.tgz &` `nohup tar -cvf - /var/opt | gzip -9 -c > /opt/Backup_4_Jan/var_opt.tgz &` `nohup tar -cvf - /usr/opt | gzip -9 -c > /opt/Backup_4_Jan/usr_opt.tgz &` But after transferring these zipped files on the windows machine, extracting it i found some of the tar balls are corrupted. I am sure the transfer was made in the Binary format and i was able to successfully extract /etc.tgz but other two couldn't get extracted due to corruption. I have tried this couple of times and got the same result every time. So, my question is, am i using the commands in the right way? Or do i have mistake in the above commands, or is there any other way i can make the backups using some other commands?


title: Does sysctl kern.bufcachepercent not work in OpenBSD 5.2 above 1.7GB?

text: I run OpenBSD/amd64 5.2 on a system with 12GB of RAM, and I want to use about 6GB to 8GB for filesystem caching. By default, 5.2 amd64 comes with `sysctl kern.bufcachepercent` set to `20` (20%); I've increased it to 50% and then to 60%, and then went through lots of files that definitely total above 10GB, yet, when I go into `top`, I am shown the following line:               Memory: Real: 25M/1978M act/tot Free: 9961M Cache: 1670M Swap: 0K/48G      That's 1.7GB out of 12GB, less than 15%! I've even tried increasing `kern.maxvnodes` from 117091 to 400000 (and `kern.numvnodes` did indicate that all 400k of vnodes got utilised pretty quickly), but I'm still having under 2GB of RAM used for caching. Is it not possible to use 6GB of RAM for disc cache on OpenBSD 5.2 amd64? Is it limited to something around 1.7GB?


title: Can I safely read a file that is appended to by another process?

text: If process A copies files to some location loc and process B regularly copies the files from loc to some other location, can B read a file that is currently in the process of being copied to loc by A? I'm using Ubuntu Linux 12.04 if that's important. * * * Background information: I want to continuously backup a PostgreSQL cluster. PostgreSQL provides WAL archiving for that. It works by having the database call a script that copies a completed WAL file to some backup location. I want another process to regularly copy the backed up WAL files to another server. If a WAL file is currently being copied by the database, can the second process still read the file without running into some EOF condition before the file is copied as a whole? In other words: Can I do the following with no synchronization between A and B?               A                                   B     cp pg_xlog/some_wal_file /backup/   scp /backup/* user@remote-machine:/backups/


title: Redirect packets and save the content to disk

text: I want to reroute a connection just like `rinetd` does but save the client and server messages. Is there any tool like this out there ? I'm using Debian.


title: Using a zsh function in find?

text: I'm on OS X and have defined a function called `finderpackage` that tries to determine if a folder is in fact a "package" (also, somewhat erroneously, known as a "bundle") according to the Finder. My intended use for this was to limit `find` from descending into such folders which is sometimes useful. One application would be finding the size of files in a subtree while treating apps, frameworks, document formats that are really folders, and similar as single "files", just like Finder would: `find . -xdev \\( -exec finderpackage {} \; -exec du -sk {} \; -prune \\) -or \\( -type f -exec du -k {} \; \\)` However, this example does not work as `find` complains: `find: finderpackage: No such file or directory` Can I not use a zsh function in this way? (Of course I can rewrite it as a script, I'm just curious if I have missed something about how functions are used?)


title: Overlapping of cron instance

text: While searching for a solution to synchronize cron (i.e. only one instance of cron run at at time). I found the solution, given below, on StackExchange.               #!/bin/sh     LOCK=/var/tmp/mylock     if [ -f $LOCK ]; then       echo Job is already running\!       exit 6     fi     echo "script started" > $LOCK     wget /url/to/execute/a/script     rm -f $LOCK      I found the solution here:   Correct locking in shell scripts? Can this solution cause problem for a cron running on a single server after an interval of 10 minutes. Can this solution prevent overlapping of crons?


title: IPtables on ubuntu 12.04

text: I've problem with iptables on ubuntu 12.4. I type `ufw status`, it show result `Status: inactive` but I type `iptbles -L -nv`, it still shows many rules, and these rules are running. I can't understand.


title: How can I get the last line number of unique commands when grepping my history file?

text: I rely on my history file for previous commands, especially ones that are long with many parameters. Once I find the command and its line number(`nn`) I use `!nn` to run it. I prefer to see the full output from the search rather than doing an in-line reverse search. To do this I search through it with `history | grep some_text` However I tend to get a lot of output due to duplicate entries (differing only in their line numbers). As my history grows this gets worse over time. How could I get a list of just the unique commands that I could then use with the `!` recall command operator? I tried history | uniq | grep some_text but that doesn't work because of the line numbers. I can do `history | cut -b8- | uniq` and that does show just the commands.   However when I add `sort` I get `$ history | sort sort: string comparison failed: Illegal byte sequence sort: Set LC_ALL='C' to work around the problem. sort: The strings compared were` 5359 \253' and `5360 x'.`   Also the line numbers are gone which I would actually want for the `!line- number` command Ideally I would like this to happen each time I do my `history | grep` - which I do so much I have an alias `hg='history | grep '` so I could add any solution to that. Less ideal, but still of interest would be the ability to run an ad-hoc program which would actually make the history file entries unique (again, dealing with the line numbers issue) so that only the most recent history command of any given command is retained). presumably by deleting the other lines. But would deleting lines in the history file this way mess up the way the file is used by the system?


title: Install "ia32-libs" package on Windows to use in Linux

text: I have recently installed a GCC ARM Embedded toolchain for Linux (to run on a 64-bit machine). However, the pre-built version of Linaro GCC runs on 32 bit machines. The solution is simple: `apt-get install ia32-libs` to install the ia32-libs package. The problem is that the Linux machine which I am working with has no internet connection. Therefore, I cannot do installations through that manner. I am using a Windows machine for internet access (which is how I am able to ask this question). My question is then: is it possible to download the package on a Windows machine, put it on a USB and install it on the Linux machine? If so, where I can download the package manually from (instead of typing `apt-get install ia32-libs`?


title: DHCPv6 prefix delegation server for linux?

text: What linux DHCPv6 client can I set up so it requests a prefix on one interface and then on all the other interfaces it will give out addresses (or if requested, a smaller prefix delegation)? It would also need to set up the routes and router advertisements. If there's not a way to do this, what is the IPv6 version of programming an IPv4 router to do NAT, wherever it is put? Basically, I'm trying to understand how a manufacturer would set up their IPv6 capable routers so a customer can plug them in and they would work. I'm not talking about actual NAT in IPv6, but a way for a router to have a DHCPv6 prefix delegation client which would take the prefix it received and break it into smaller prefixes and addresses and run a DHCPv6 server for each separate downstream link. I added a diagram: ![Diagram with 9 computers. #2, #4, #6, #7, and #9 are DHCPv6 clients. #1 is assigned 2001:db8:1200::/40 and giving out /48 prefix delegations. #3, #5, and #8 are DHCPv6 servers and clients at the same time as they are requesting prefixes.](http://i.stack.imgur.com/iUGvl.png) Is there (a) piece(s) of software I can run on Linux that could be configured once and then put in place number 3, 5, or 8 and it would automatically set itself up depending on the prefix it was delegated?


title: Create a Bootable (UEF GRUB) USB for Ubuntu & Windows 7 Install

text: I want to create a Bootable EFI USB to install Ubuntu & Windows 7 (maybe with utilities like PartedMagic). I did that using MultiSystem previously. However, I am using GPT and Windows install needs to be launched in EFI mode to install on GPT system. I suppose I must use GRUB EFI instead? If theres no app like Multisystem that creates a GRUB EFI Bootable USB, how can I create one myself? I suppose I will format my USB as GPT, and install GRUB EFI on it (how?). Then I need to configure GRUB EFI to load Ubuntu & Windows 7 install in EFI? How can I do these? **UPDATE** Here's what I tried   * Create 2 partitions on my USB (GPT, 100+MB FAT32 (/dev/sdc1, set boot flag), The rest FAT32, /dev/sdc2, for installs)   * Extract Windows 7 & Ubuntu 11.10 iso's into Installer partition, 2 different folders   * Tried using `sudo elilo -b /dev/sdc1` --autoconf --efiboot -v` * * *               jiewmeng@JM:~$ sudo elilo -b /dev/sdc1 --autoconf --efiboot -v     elilo: backing up existing /etc/elilo.conf as /etc/elilo.conf-     Loaded efivars kernel module to enable use of efibootmgr     elilo: Checking filesystem on /dev/sdc1...     elilo: Mounting /dev/sdc1...     e    lilo: 44298KB needed, 78781KB free, 42192KB to reuse     elilo: Installing primary bootstrap /usr/lib/elilo/elilo.efi onto /dev/sdc1...     elilo: Installing /tmp/elilo.k8NWXX on /dev/sdc1...     elilo: Installing /vmlinuz on /dev/sdc1...     elilo: Installing /vmlinuz.old on /dev/sdc1...     elilo: Installing /initrd.img on /dev/sdc1...     elilo: Installing /initrd.img.old on /dev/sdc1...     elilo: Updating EFI boot-device variable...     Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.     Try 'modprobe efivars' as root.     Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.     Try 'modprobe efivars' as root.     elilo: An error occured while updating boot menu, we'll ignore it     Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.     Try 'modprobe efivars' as root.     Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.     Try 'modprobe efivars' as root.     Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.     Try 'modprobe efivars' as root.     elilo: Installation complete.      Did `sudo modprobe efivars` got no output but got the same error, I think its because I am not bootted into EFI Ubuntu? Next, I'll try using USB Startup Disk Creator to boot into a live system in EFI mode to try again **UPDATE** I am so lost, is Windows installed 1st the fault? I formatted & made a bootable USB for Ubuntu Alternate with UNetBootIn, and it failed too with same error of no available kernel. If I made a Ubuntu Desktop I will get cannot configure apt sources ![](http://i.imgur.com/Ih9Qs.png) The syslog for ubuntu desktop install http://pastebin.com/CdbUPXax I feel I better not waste time and revert back to MBR soon ... that will mean I have to somehow backup all my data 1st ... which is why I am delaying it to the last resort ... any ideas? **UPDATE** I tried booting Ubuntu 11.10 Alternate in BIOS mode (Non-EFI), installed fine except I cannot install a boot loader. It says fatal error. I then installed GRUB by booting the USB in recovery mode. Works but it does not boot. Gives a blank screen on boot. If I try to enter recovery mode (on HDD, where ubuntu is installed), keyboard seems to fail, mouse have light though.


title: nohup vs. Screen

text: In the past, I've used nohup to run big background jobs, but I've noticed that a lot of people use Screen in this context. Does Screen provide some kind of functional advantage that I am unaware of, or is it just a matter of preference?


title: How do I disable automatic display search?

text: I have a Mint 10, based on Ubuntu Maverick Meerkat (10.10) installed on a HP nc6120 notebook. The machine is getting tired, so I decided to use it only with the external "monitor", in this case, the TV. I went to the display settings, turned the notebook display off, the TV on, saved it as default and set it. But. Somewhy and somehow (no log, no move, no touch, no nothing), the system restores either mirroring or both screens enabled. The whole thing is a mistery, and I'd really like to disable even the possibility of automatic display settings change. I don't mind digging into config files, just please someone tell me how to kill this feature :)


title: how to make XTerm never use bold characters?

text: I am trying to make XTerm to never use a bold font, and nothing seems to work. I put settings in `~/.Xresources` and then run `xrdb ~/.Xresources` and then start a new XTerm. This is what I try:               XTerm*background: gray90     XTerm*foreground: black     XTerm*highlightColor: yellow     XTerm*pointerColor: red     XTerm*pointerColorBackground: white     XTerm*cursorColor: navy     XTerm*borderColor: black          Xterm*colorBD: black     XTerm*colorBDMode: true          XTerm*boldMode: false     XTerm*alwaysBoldMode: false          XTerm*font:        -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1     XTerm*boldFont:    -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1     XTerm*utf8Fonts.font:        -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1     XTerm*utf8Fonts.boldFont:    -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1      And still for example when I run Midnight Commander all directory names are with thick letters, and I want them the same as normal files, just use a color, but not make them thicker! In VIM everything uses thick letters when syntax highlighting is used (but is OK - thin - when there is no syntax highlighting). I am out of ideas, what to put in my `~/.Xresources` to force XTerm to never use those thick letters?


title: ssh + http proxy (corkscrew) not working

text: I'm trying to get ssh working with an http proxy via corkscrew. Here is the error:               [echox@archbox:~] % ssh somehost.tld     zsh: No such file or directory     ssh_exchange_identification: Connection closed by remote host      Here is the content of ~/.ssh/config               Host *     ProxyCommand /usr/bin/corkscrew http-proxy.some.proxy.tld 8080 %h %p      I would bet the ProxyCommand is not found, but `/usr/bin/corkscrew` is working, its also in my PATH. `corkscrew` without path is also not working. `[echox@archbox:~] % corkscrew http-proxy.some.proxy.tld 8080 some.ssh.host.tld 22` works fine invoked directly. Any idea?


title: How does one add an application to the LXDE Panel?

text: How does one add an application to the **LXDE Panel**? I'm using version 0.5.8 on Lubuntu 11.10


title: Network file sharing with freebsd server

text: I have a freebsd server at home. I also have other OSes like linux and windows connected to the same network via WLAN (wifi). I want to be able to share stuff (what ever I download ;)) on my FreeBSD box to others via wifi. How can I do that? Does difference in underlying filesystems make things hard?


title: How can I determine the page count of djvu documents from the CLI?

text: Finding the page count of a PDF document from the CLI is as simple as:               pdfinfo file.pdf | grep ^Pages:      How can the same be performed with a djvu file? Without converting it to a pdf and then deleting the pdf file after checking the number of pages, pls.


title: rc_status always returns "failed"

text: One of our developers has a service that needs to be started on boot. This script needs to be fired:               /app/bt/preview/apache-tomcat-5.5.27/bin/startup.sh      Here is the startup script I'm working with, called **/etc/init.d/bt** :               #!/bin/sh     #     ### BEGIN INIT INFO     # Provides:          BTServer     # Required-Start:    $local_fs $network $remote_fs     # Required-Stop:     $local_fs $network $remote_fs     # Should-Start:     # Should-Stop:     # Default-Start:     2 3 4 5     # Default-Stop:      0 1 6     # Short-Description: BT Server     # Description:       BT Server     ### END INIT INFO     #     #     # Run BT startup scripts as btu user     #     # Location of startup script     BT_SCR='/app/bt/preview/apache-tomcat-5.5.27/bin/startup.sh'          test -x $BT_SCR || exit 5          # Set up rc_status command     . /etc/rc.status     rc_reset          case "$1" in     start)             echo -n "Starting BT Server"             startproc -u btu $BT_SCR             rc_status -v             ;;             *)             echo "Usage: $0 { start }"             exit 1                  ;;     esac     exit 0      When I run **/etc/init.d/bt start** from the command line, the rc_status is failed every time, even though the script starts up fine. I don't quite understand how rc_status is determined; is it my responsibility to set the rc_status value? I know I'll need to add a symlink to /etc/rc.d/rc3.d, but for now I'm trying to get it working from the command line as root.


title: Linux distributions for ARM processors

text: Are there any Linux distributions (Other than Backtrack and Android) available for ARM processors? specifically ARM 11 (SE Xperia X8)


title: Reserve memory for a program

text: Is it at all possible to set aside say 50MB of memory so that in an emergency where something uses all my memory or loads the CPU I could open a terminal, find the offending process, and kill it?


title: Wait for a network device to come up before bringing another network device up on boot?

text: I'm in the middle of setting up my Raspberry Pi running Raspbian as a bridge between my university's wireless network (which requires WPA2-Enterprise authentication) and my private wireless router (via its WAN port). I've received some amazing help here: How can I most simply transparently bridge traffic between wlan0 and eth0? For the most part my setup is now working as intended. The only problem is that, if I set eth0 to auto or allow-hotplug on my Raspberry Pi (as I'd like to do, so that everything comes up headlessly on boot), it seems as though all internet traffic is routed through eth0. This is incorrect; my internet connection is on wlan0, and eth0 shares that connection out to my private router. I can overcome this issue by not having eth0 come up automatically. If I leave auto or allow-hotplug for eth0 out of /etc/network/interfaces, allow the Raspberry Pi to boot, and then manually run "ifup eth0", I get behaviour as expected. Is there a way to either ensure that wlan0 has been fully brought up before bringing up eth0 on boot (even though eth0 is the faster interface to bring up)? Or, failing that, how can I force internet traffic (noting that this comes from eth0) through wlan0 only? Edit: For now, as a work-around, I'm running a script to bring up eth0 on start-up with a thirty second delay to allow wlan0 to come up first. This solution is neither elegant nor reliable (what if wlan0 authentication takes longer than thirty seconds?), but it does seem to be doing the trick for now. I'm still looking for a better solution, though!


title: Embeded video in PDF

text: I'm creating a presentation that will have embedded video in it (using beamer). The issue is that I can't make this work on Linux. I have downloaded some example presentations that contained video, but it just doesn't seem to work. Acrobat either doesn't do anything, or tries to open some website which only tells me that my system isn't supported. Okular doesn't seem to do anything at all. Are there any viewers that can actually work with embedded videos? I'm fine with re-encoding the video in a different format.


title: Argument list too long for ls

text: I get the following error when trying to `ls *.txt | wc -l` a directory that contains many files:               -bash: /bin/ls: Argument list too long      Does the threshold of this "Argument list" dependent on distro or computer's spec? Usually, I'd pipe the result of such big result to some other commands (`wc -l` for example), so I'm not concerned with limits of the terminal.


title: Mount permissions always blocked

text: How do I authorise my non-root user to manually mount/unmount ALL media on my desktop. I always get denied permission. Media refers to all mountable USB devices and other partitions on my HDD as well.


title: Call man in bash shell for command under cursor

text: In `zsh` I can do `Esc` `h` for any command, get man page for this command, quit from the man pager and get my command back with all arguments. For example in my shell is entered:               zsh# tar -czvf docs.tgz docs      and I can call man for `tar` by pressing `Esc` `h`, with the cursor in any place. Now, I want the same thing, but in bash. One possible solution is shown below, but I want to know if there are others.               bind '"\eh": "\C-a\ef\C-k\C-f\C^Cman \C-y\C-m\C-y\C-y\ey"'


title: Dashes in printf

text: I'm trying to use printf to format some pretty output in a bash script e.g.:   `\-----------------------`   `| This is some output |`   `\-----------------------` But I've stumbled over some behavior I don't understand. `$ printf "--"` gives me the error `printf: usage: printf [-v var] format [arguments]` and `$ printf "-stuff"` results in `-bash: printf: -s: invalid option` So apparently printf thinks I'm trying to pass some arguments while I'm not. Meanwhile, completely by accident, I've found this workaround:   `$ printf -- "--- this works now ----\n"` gives me `\--- this works now ----` Can anyone explain this behavior?


title: bash script not being run by cron

text: I have a very simple bash script that runs flawlessly when I do               ./removeOldBackup.sh      or               sh /home/myusername/backup/removeOldBackup.sh      but when I add it to crontab like               * * * * * sh /home/myusername/backup/removeOldBackup.sh      or               * * * * * /bin/sh /home/myusername/backup/removeOldBackup.sh      it never works... This is my script:               #!/bin/sh          find . -name 'files_20[1-3][0-9]-[0-9][0-9]-[1-2][1-9]--*' -delete     find . -name 'files_20[1-3][0-9]-[0-9][0-9]-0[2-9]--*' -delete          find . -name 'database_20[1-3][0-9]-[0-9][0-9]-[1-2][1-9]--*' -delete     find . -name 'database_20[1-3][0-9]-[0-9][0-9]-0[2-9]--*' -delete      This is my script permissions:               -rwxr-xr-x 1 root root 295 Jul 25 10:07 /home/myusername/backup/removeOldBackup.sh      Crontab is added for user root. This is what I find in `/var/log/syslog`:               Jul 25 10:11:01 myservername /USR/SBIN/CRON[7583]: (root) CMD (sh /home/myusername/backup/removeOldBackup.sh)      So again, when I run the script manually, my backup files get removed correctly. When it is run by cron, they never get removed. I'm using debian-6.0-x86_64.


title: something is terribly wrong with pkg-config

text: I've been having a harrowing time lately just trying to get several C programs compiled because I can't find where the libraries are located and pkg-config seems to be out of order. I installed GNU GSL like this:               wget ftp://ftp.gnu.org/gnu/gsl/gsl-1.15.tar.gz     tar xvzf gsl-*gz     cd gsl-1.15     ./configure     make     sudo make install      Apparently it installed in `/usr/local/lib` which is a non-standard place? (1) What is a standard place? (2) How would I get it to install there? And I can't manage to compile a simple program that uses this library:               $ gcc gsl_erf.c -o gsl -I/usr/local/lib -L/usr/local/lib     /tmp/cc3WD9Zq.o: In function `main':     gsl_erf.c:(.text+0x24): undefined reference to `gsl_cdf_gaussian_P'     collect2: error: ld returned 1 exit status      Now, with pkg-config :               pkg-config --libs --cflags gslPackage gsl was not found in the pkg-config search path.     Perhaps you should add the directory containing `gsl.pc'     to the PKG_CONFIG_PATH environment variable     No package 'gsl' found      So I did add the directory:               PKG_CONFIG_PATH=/usr/local/lib/pkgconfig      But no luck yet! :( pkg-config still gives me the same message as above. (`Perhaps you sh ...`) This is a more general problem I face regularly when I have to compile some C program. I would love a general solution for:   1. Where and how do I install my C libs? (Perhaps the same place yum installs them?)   2. How do I correct/configure and use pkg-config * * * **Update** : I tried one of the answer's suggestions below and running the compiled program gives me this : `./gsl_app: error while loading shared libraries: libgsl.so.0: cannot open shared object`


title: POSIX head and tail not feature equivalent

text: The documentation for POSIX tail's `-n` option says that > The origin for counting shall be 1; that is, -n +1 represents the first line > of the file, -n -1 the last. So `tail -n 10` (used later on the same page) and `tail -n -10` should print the last ten lines, and `tail -n +10` would skip the first nine lines and print all the rest. The documentation for POSIX head's `-n` option says that > The application shall ensure that the number option-argument is a positive > decimal integer. So `head -n -10` and `head -n +10` are not POSIX compatible because the values `-10` and `+10` are not simple integers but rather strings with no special meaning in the shell, and there's no way to print all lines until the Nth last one. Why the discrepancy? PS: `head -n +10` works with GNU coreutils.


title: gunzip multiple compressed files to another directory without deleting the .gz files

text: I have multiple `.gz` file in a folder and I want to unzip it in other folder through `gunzip` without deleting parent file. Please help.


title: Convert SVG to PDF in python

text: I am trying to convert an SVG file to PDF in python using the `svglib` and `reportlab` packages. Here is the SVG file.               <?xml version="1.0" standalone="no"?>     <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"      "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">          <svg xmlns="http://www.w3.org/2000/svg" version="1.1">       <circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="blue" />     </svg>      Here is the code I am using to convert (got this from `svglib` webpage).               >>> from svglib.svglib import svg2rlg     >>> from reportlab.graphics import renderPDF     >>> drawing = svg2rlg("file.svg")     >>> renderPDF.drawToFile(drawing, "file.pdf")      The code runs fine without any error or exception but the `file.pdf` thus generated is a blank file. I mean that when I open this PDF file I see nothing but only white background page with nothing on it. Where am I going wrong ?


title: What stuff can be safely removed for disk space sake?

text: I am using Scientific Linux. So is there any stuff that can be safely removed from disk except `/tmp`?


title: Linux on Lenovo Z575 - no display after installation

text: I am trying to install Linux on Lenovo Ideapad Z575 (AMD). When I run Ubuntu or Fedora from a LiveCD, I got some initial screens (purple screen with small icon for Ubuntu, some information screen from Fedora), and then.... nothing. For Ubuntu, I have a black screen, although I hear the Ubuntish sound when the login screen appears. So it is there, but the display does not work. Any ideas how to make the display working?


title: "nl80211: 'nl80211' generic netlink not found" when starting hostapd

text: I have been trying to get my Ubuntu 11.10 laptop to make an access point to connect my blackberry playbook . hostapd gave error                   Configuration file: ./hostapd-minimal.conf         nl80211: 'nl80211' generic netlink not found         nl80211 driver initialization failed.      Is this a BCM4312 problem? Can madwifi , hostap create wifi acccess point for me? Connectify can do this on windows so is there no equivalent??


title: Find command incorrect results with days filter

text: I am trying to find all files modified before march 6 in a directory with thousands of files. I executed the following commands in the PWD where I want to find files.               find -mtime +47 > /root/file_005.log      or               find -mtime +48 > /root/file_006.log      or               find -mtime +49 > /root/file_007.log      The problem is no matter what date filter(47,48.49.50...) is used in the find command I keep getting files with a modified date between March 8 -12 in the results. This is the output of `stat`on one of the problem files:               Device: 16h/22d Inode: 17 Links: 1      Access: (0666/-rw-rw-rw-) Uid: ( 8506/ UNKNOWN) Gid: ( 5000/ UNKNOWN)      Access: 2013-04-22 10:08:20.000000000 -0500      Modify: 2013-03-10 03:10:20.000000000 -0500      Change: 2013-03-10 03:10:20.000000000 -0500       Does anyone have an idea what may be causing files that were modified after March 6 to appear in the results? **EDIT #1**   * Q: Is this a NTFS mounted filesystem or EXT3/4?   * A: No its not. This is a drive mounted on my UNIX box using sshfs.


title: why is filesystem intensive script not faster on ram disk

text: I have a script which creates a lot of files and directories. The script does black box tests for a program which works with a lot of files and directories. The test count grew and the tests were taking too long (over 2 seconds). I thought I run the tests in a ram disk. I ran the test in `/dev/shm`. Strangely it did not run any faster. Average run time was about the same as on normal harddisk. I also tried in a fuse based ram disk written in perl. The website is gone but I found it in the internet archive. Average run time on the fuse ram disk is even slower. Perhaps because of the suboptimal implementation of the perl code. Here is a simplified version of my script:               #! /bin/sh          preparedir() {       mkdir foo       mkdir bar       touch bar/file       mkdir bar/baz       echo qux > bar/baz/file     }          dostuff() {       mkdir actual       (cd actual; preparedir)       find actual -type f -execdir cat '{}' \; > /dev/null       mkdir expected       (cd expected; preparedir)       diff -qr actual expected     }          dostuffoften() {       while read dirname; do         rm -rf $dirname         mkdir $dirname         (cd $dirname; dostuff)       done     }          seq 100 | dostuffoften      The real script does a bit more error checking and result collecting and a summary. The `find` is a dummy for the actual program I am testing. I wonder why my filesystem intensive script does not run faster on a memory backed filesystem. Is it because the linux kernel handles the filesystem cache so efficiently that it practically is a memory backed filesystem?


title: Why does this awk command not play as well with find as sed does?

text: I am very much a **newbie** at Unix/Linux command line stuff, and mostly get to where I'm going by copying, pasting, and modifying code I find on the internet. Just mentioning that in hopes people will keep answers simple and without assuming I know what's going on. I'm creating a **Bash shell script** to do some file manipulation on some HTML files. Among the many actions I do, I have this `sed` command which works great:               find $DIR -type f -name '*.html' -exec sed -i 's/.*<script type="text\/javascript" charset="utf-8" src="file.js"><\/script>.*/<script type="text\/javascript" charset="utf-8" src="file2.js"><\/script>/g' {} \;      It looks through every HTML file in the directory in question, and replaces one line of text. I wanted to do something similar where I replace multiple lines between two HTML coments. So I want to take this:               <!-- STARTREPLACE1 -->     Blah     Blah     Blah     <!-- ENDREPLACE1 -->      And change it to:               <!-- STARTREPLACE1 -->     A whole new world!     <!-- ENDREPLACE1 -->      I found this `awk` command which seems to work when I run it on one file:               awk '/<!-- STARTREPLACE1 -->/{p=1;print;print "A whole new world!"}/<!-- ENDREPLACE1 -->/{p=0}!p' justonefile.html      So I thought I could do the same `find` function I use with `sed` and apply that method here in order to run this `awk` command on every HTML file in the directory:               find $DIR -type f -name '*.html' -exec awk '/<!-- STARTREPLACE1 -->/{p=1;print;print "A whole new world!"}/<!-- ENDREPLACE1 -->/{p=0}!p'      But when I run it, it says:               find: `-exec' no such parameter      Is there a way I can get my awk command to run on all the HTML files? _**Bonus question:_** Can I also remove the two tags around the text I want to replace? So `<!-- STARTREPLACE1 -->` and `<!-- ENDREPLACE1 -->` are removed and I only end up with:               A whole new world!


title: Jingle CLI client / Jitsi replacement / VOIP

text: I am looking for a Jingle client for the command line. Currently, I use Jitsi, but my dreams of not needing the GUI for more than just web-browsing are not realized due to my reliance on this program. Does anybody know of a CLI client that supports:   * VoIP   * Communication with people on XMPP accounts   * Text chat not necessary, I have IRC for that. And if you want to make my week:   * Full audio controls (Jack, or input/output device selection). The system is Ubuntu 11.04 Server.


title: how to record command which execute a programme suid

text: My question: Is there a way to record all commands who execute a suid programme? Like what .bash_history do, but only the setuid programmes.


title: List of partition labels vs devices using dbus/udisks in bash

text: I have a problem where using dbus and udisks seems to be the best approach. So I invented a problem: create a table of labels and devices for each partition "installed" ala:                 ""      /dev/sda1       "ROOT"   /dev/sda2       "BACKUP" /dev/sdb1        ...      the thing is the more I think about how to approach this the more confused I get. Can someone make some suggestions?


title: openSUSE 12.1 x64: VNC presents "nobody's X11 desktop"

text: I activated VNC using Yast and it works but it only display's "nobody's X11 desktop". I use Apple Remote Desktop to connect and gave it username and password. I also tried with Chicken of the VNC which does not take a username but only a password and it cannot connect at all. Port number is always correct (5901). What's wrong?


title: How to perform GREP on FTP?

text: I tried searching for similar command in `ncftp` (actually this is the only terminal ftp client I used) and I didn't find it. What's the way (if possible at all) to use `grep` command on remote server, to search for strings in files?


title: Sorting with Perl respecting Locale Settings

text: Following data needs to be sorted respecting the locale sort order:               wird     sin     wär     pêche     war     Über     Uber     péché     peach      There was nor problem by using `sort`               $ sort < data     peach     pêche     péché     sin     Uber     Über     war     wär     wird      which respects the locale, and               $ LC_ALL=C sort < data     Uber     peach     péché     pêche     sin     war     wird     wär     Über      without locale. Now I tried to do so with `perl`, but I'm failed:               $ perl -e 'local $/ = undef; print sort <>;' < data     Über     pêche     war     péché     sin     Uber     peach     wär     wird      The result is either the first output of sort, nor the second. Running Ubuntu 12.04 LTS


title: Mac G5 - Nvidia GeForce 5200 FX settings

text: I finally was able to install Debian on my powerpc, but the only way to get a GUI up is by disabling nouveau. I just use Linux `nouveau.modeset=0` at the yaboot prompt. However my color is all messed up like it's been washed in tie- dye. I'm guessing I need to configure an xorg.conf to get the card to work? I have no idea what settings to put in there. Using an Nvidia GeForce 5200 FX with 64mb vram on a MAC G5.


title: Why are background jobs started by my shell living longer than the parent shell and controlling terminals?

text: It is commonly said that "&" puts the process into background execution, but that process would be killed when terminal is closed. But from what I see, everything I sent into background was continuing to be active long after I close the terminal. For example:               $ tail -f /var/log/messages/ &      That process would continue to run, even if there are no other process under the user that launched it, and all terminals are long gone. Why is that?


title: Peculiar issue with mutt & my_hdr From:

text: I've been pulling my hair out for hours trying to figure this out and I'm not entirely sure this is a unix issue (perhaps someone could enlighten me) First off, I started from scratch installing mutt with yum. Mutt works perfectly if I don't use `set`, but instead use `my_hdr` to setup the header. Why? Not sure, but it really doesn't bother me as I prefer `my_hdr` anyhow. If somebody thinks this is relevant to the issue at hand, I'm all ears for a solution :) I am familiar with .muttrc, and this is where I've put the following:               my_hdr From: root <xxx@xxxx>     my_hdr Content-Type: text/html     ....      The above works perfectly. My problem lies with changing "root" to any other value. (ie: "root1", "john doe", etc...) Unless this value is "root", no email. I have a bad feeling that the problem lies with touchy spam filters on the receiving end, but as a last stab I thought I'd post this here for other ideas/views. Perhaps it could help someone else who is going through the same thing.


title: Cannot boot Linux Mint after installing Windows (First) and Linux Mint (Second)

text: I can't boot my Linux Mint after installation of Windows. First I installed Windows and then installed Linux Mint with the option of "Install along with windows". But after I completed the Mint install only Windows is booting. I have done some search on the web and found that installing Grub from the Live CD will help on this issue. I have done that also (but I'm not sure whether I have done this correctly). After that Windows is also not booting and I am stuck on this.


title: Obtaining/Packaging RPM dependencies for Fedora/RHEL linux application -- no network access

text: I currently have an RPM file with 2-3 dependencies specified in the 'Requires' section. When this application is installed using yum, it works fine and the dependencies are installed if they are missing. However, I've learned there may be a need to install this application on machines with no network access. So everything needs to be included in the install package. Am I better off trying to use an off the shelf installer (izPack, etc) or is there a way to bundle everything up and still use RPM/Yum. I'd prefer to stick with the latter solution. I'm assuming just packaging all RPMS in a directory and running rpm -Uhv on them will suit the purpose, but it seems pretty rough and would make for a sloppy uninstall. Is it possible to, in my my RPM spec file, create a temporary yum repo that includes anything that may be required at install time. Then clean up that repo when things are finished? Sounds bizarre, but who knows? Any other obvious solutions I'm missing? Thanks.


title: Split a file by line and have control over resulting files extension

text: There is a standard command for file splitting - split. For example, if I want to split a words file in several chunks of 10000 lines, I can use:               split -dl 10000 words wrd      and it would generate several files of the form wrd.01, wrd.02 and so on. But I want to have a specific extension for those files - for example, I want to get wtd.01.txt, wrd.02.txt files. Is there a way to do it?


title: terminal logging doesn't complete when I close the terminal

text: This is the last line in my `.bashrc` (lines breaks inserted for readability):               STARTTIME=`date +%F-%Hh-%Mm-%Ss-%N`; \     script -q -t 2> /home/USER/logs/$STARTTIME-timing.txt \            -c 'bash --rcfile /home/USER/.bashrc-cp' \            -f /home/USER/logs/$STARTTIME-log.txt; \     gzip -9 /home/USER/logs/$STARTTIME-timing.txt /home/USER/logs/$STARTTIME-log.txt; \     exit 0      There is a `/home/USER/.bashrc-cp` without this mentioned last line (but it's an exact copy of my `.bashrc`). This terminal logging solution works great. There are only two problems: **Q1:** If I exit the gnome-terminal with `Alt`+`F4` then the logs aren't gzipped. Why? How can I gzip them in that case? **Q2:** I don't want to use a `.bashrc-cp` file. Are there any solutions for it?


title: what is stored in /dev/pts files and Can we open those?

text: I am curious to know that what is stored in `/dev/pts/` files . Can we open those files ? According to my knowledge `/dev/pts` files are created for ssh or telnet session .


title: Portable software for the Posix world

text: Is there any "portable" software for Linux (i.e., Ones that can just be un- tar'd and used, instead of in `rpm`, or similar format. to be used in conjunction with a package manager)? Also, are there any caveats to this that don't exist for Windows portable programs?         P.S Not sure what the community thinks about adding the tags like portable or no-install to this site is. I realise that Portable is likely to be considered more of a Windows feature, but would think that software that doesn't come in a `rpm` format, or via a repository, may be loosely considered as such in the Posix world.


title: Capture Screen-shots of Kick Start Provisioning

text: Is there a way to capture the screen-shots of kickstart provisioning? I tried to capture it using `autostep --autoscreenshot` , however it's not working even after switching from text mode to graphical mode installation. I'm not sure if it's possible to capture the installation if I install CentOS server.


title: Exporting a variable with dot (.) in it

text: How to export a variable which has dot in it. I get 'invalid variable name' when I tried :                export my.home=/tmp/someDir     -ksh: my.home=/tmp/someDir: invalid variable name      Even escaping metacharacter dot (.) din't helped either               $ export my\.home=/tmp/someDir     export: my.home=/tmp/someDir: is not an identifier


title: Are there issues concerning trustworthyness of selinux?

text: Since selinux is/was? developed by the NSA, and with the current noise around privacy etc concerning said agency, should I be concerned about compromised security on my system?


title: Excessive retransmissions on Ethernet

text: The CSMA/CA variants of Ethernet handle excessive failed transmissions due to repeated collisions by dropping the current frame and relying on upper layers for retransmissions: > After 16 attempts station B will reset its collision counter allowing it to > compete more aggressively again. But it also discards the frame it was > attempting to transmit, requiring that it be queued for transmission again > by software. I realize that on modern (i.e. switched) Ethernet networks, CSMA/CA isn't used anymore, and the channel capture effect mentioned in the source doesn't occur, but I'm trying to understand the network layer separation and interaction as implemented by the Linux kernel in that situation. On Linux, at which layers are those retransmissions handled? Will it be done at the IP layer, or does the dropped Ethernet frame also result in a dropped network layer packet and a dropped TCP segment or UDP datagram? The difference between the two approaches would seem to be that in the second case, the excessive retry would be interpreted as congestion and lead to a decrease of the TCP congestion window size. Does that happen, or is the dropped frame transparent to TCP?


title: Remap select window 2 in tmux

text: In _tmux_ you can switch to window 2 with `prefix_key + 2`. I'd like to press rather `prefix_key + u`. I tried in _.tmux.conf_ this:               bind-key u 2      and this:               bind-key u select-window -t 2      Which doesn't work. Is it possible to create such mapping?


title: Do I have to list modules in both `/etc/mkinitcpio.conf` and `/etc/rc.conf`?

text: I've added few modules into `mkinitcpio.conf`. Are they automatically loaded at kernel boot or with `udev` if I don't specify them in modules list in `rc.conf`?


title: tmux after start

text: Can I configure _tmux_ so it will after running _tmux_ automatically opens two windows named _src_ and _cmd_? I always type after starting it: `prefix + c`, `prefix + ,`src`ENTER` `prefix + c`, `prefix + ,`cmd`ENTER` I'd like to automate this. thanks


title: How to kill the (last - 1) PID with bash

text: I know how to kill the last process with                kill $!      However I would like to kill the last−1 process, i.e. not the last one, but the one before the last one. I tried                kill $$(($! -1))      but that didn't work.


title: Why do I have to re-set env vars in tmux when I re-attach?

text: I mainly work on a mac and ssh/tmux attach to a Linux machine to do my work. I have ssh-agent running on the Linux machine. I have `set -g update-environment "SSH_AUTH_SOCK SSH_ASKPASS WINDOWID SSH_CONNECTION XAUTHORITY"` in my `.tmux.conf`. Yet, whenever I re-attach to this session, I have to run `tmux setenv SSH_AUTH_SOCK $SSH_AUTH_SOCK` in order for new tmux windows to have `$SSH_AUTH_SOCK` set correctly. I would prefer to not have to do this. Any ideas? ### Update I think I'm not explaining this well. Here's my shell function to open a shell on a remote machine: ` sshh () { tmux -u neww -n ${host} "ssh -Xt ${host} $*" } ` When tmux runs this ssh command, `$SSH_AUTH_SOCK` is **not** set, even though it **is** set in my local environment. If I put this in tmux's environment with the `setenv` command above, everything works fine. My question is, why do I have to run the setenv command at all? ### Update 2 More information: When I attach to an existing session, `$SSH_AUTH_SOCK` is not set in the tmux environment (or global environment).               % tmux showenv | grep -i auth_sock     -SSH_AUTH_SOCK      If I set it manually, things work:               % tmux setenv SSH_AUTH_SOCK $SSH_AUTH_SOCK      If I detach and re-attach, `$SSH_AUTH_SOCK` goes back to not being set.


title: How often is the /etc/shadow file backed up?

text: From man 5 shadow: /etc/shadow-                  Backup file for /etc/shadow.             Note that this file is used by the tools of the shadow toolsuite,        but not by all user and password management tools.      What I would like to know is, when this file is backed up? Is there a configuration file in which change the frequency of, or even disable, this backups?


title: What is the prefered way of updating all software in a Fedora installation?

text: When I install some system, I usually look for a bulk update method, one that will update my recently-installed software. For example, in Debian, that would be changing the `sources.list` to point to what I want, and executing `# apt-get update && apt-get dist-upgrade`. Is there an equivalent to this in Fedora (18)? Is there a GUI upgrade manager that I am missing? A message in Gnome popped up that my system requires important updates. I dismissed it, as the only option it had presented me with was "Install updates", and I wasn't quite sure what would that do. Now, the message has disappeared, and I cannot find it, not any software it might have been connected with. What am I missing here?


title: Learning Unix with video lessons

text: Is there any web site where I can learn Linux or Unix with video lessons? Of course, there should be many of them, but I think there is one most popular like, let's say, Coursera.


title: advantages and disadvantages of manually un/mounting drives.

text: What are the advantages or disadvantages of manually un/mounting internal drives? I've never really bothered un-mounting internal HDDs after mounting them the first time around but would like to know if there are any advantages/disadvantages of doing so - for the home *nix user.


title: Copy text from one terminal into another

text: I am logged into ssh to a university account from my home computer. Then I find a file that I want to copy onto my local system. So I open a new shell terminal and am about to use `scp` to copy that file onto my system. But the path to the file on the system I am `ssh`'ed into is long so I select it with the mouse and then paste it with the mouse into the other locally connected terminal. What I would like to do is something along the lines of: feed the output of `pwd` into a variable that is temporary and visible to all terminals even though I made it under the `ssh`'ed terminal, or some other way that I can't think of.


title: My Fedora 13 crashes several times a day

text: Reported bugs through bugzilla, anything else I can do? I'm actually a bit disappointed as a friend of mine is a network admin and he told me they have a linux server that has not been rebooted for a few years now, so why is mine crashing so often? I'm a big fun of Debian and Fedora, but Fedora latest release keeps annoying me. Is the only solution to switch to something more stable, like Debian Lenny or hopefully Fedora 11 or 12? UPDATE: here is the error message:               Dec  4 15:09:33 julia kernel: [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung     Dec  4 15:09:33 julia kernel: [drm:i915_do_wait_request] *ERROR* i915_do_wait_request returns -5 (awaiting 230713 at 230710)      I'm still not convinced that the crashes are caused by faulty cdrom drive. Have added my vote on the launchpad bug issue hoping someone is going to fix it soon. UPDATE2: Memory has been tested thoroughly and no errors were detected during the test


title: Setting DISPLAY in systemd service file

text: Im trying to learn systemd services by trying to start xclock as a service, the service file is below               [Unit]     Description=clock          [Service]     Environment=DISPLAY=:0     ExecStart=/usr/bin/xclock          [Install]     WantedBy=graphical.target      Any ideas whats wrong here? I'm getting an error saying cannot connect to display.


title: Grub 'incompatible license' error

text: The other day, I was using a laptop for general desktop use when its keyboard began to act up. Most of the keys on the keyboard's right side stopped working entirely and key combinations such as `Ctrl``u` made characters appear that should not have appeared. The backspace key exhibited the strangest behavior; it was somehow able to cause the deletion characters in the shell prompt. I was unable to reboot the computer cleanly so I did a hard shutdown. When I turned the computer on again, I received this message from Grub:               GRUB loading.     Welcome to GRUB!          incompatible license     Aborted. Press any key to exit.      I pressed the any key and Grub responded with               Operating System Not Found.      Pressing another key causes the first message to appear again. Pressing another key after that causes the second message to appear... and so on. If I leave the laptop on for a few minutes, its fan speeds up significantly as if the laptop is running a CPU-intensive program. I took the hard drive out of the laptop, mounted it on a server, and looked around. I saw nothing strange in `/boot`. The laptop is running Arch Linux. The drive is partitioned with GPT. The laptop works fine with a hard drive from another machine. And other machines do not work with the laptop's hard drive. I am not certain that the keyboard issues are directly related to the Grub issues. What could be causing the problems that I am having? Or, what should I do to find out or narrow down the list of potential causes? Just in case it's relevant, here _(removed)_ is a tarball with `/boot` and `/etc/grub.d` and here is my Grub configuration:               #     # DO NOT EDIT THIS FILE     #     # It is automatically generated by grub-mkconfig using templates     # from /etc/grub.d and settings from /etc/default/grub     #          ### BEGIN /etc/grub.d/00_header ###     insmod part_gpt     insmod part_msdos     if [ -s $prefix/grubenv ]; then       load_env     fi     set default="0"          if [ x"${feature_menuentry_id}" = xy ]; then       menuentry_id_option="--id"     else       menuentry_id_option=""     fi          export menuentry_id_option          if [ "${prev_saved_entry}" ]; then       set saved_entry="${prev_saved_entry}"       save_env saved_entry       set prev_saved_entry=       save_env prev_saved_entry       set boot_once=true     fi          function savedefault {       if [ -z "${boot_once}" ]; then         saved_entry="${chosen}"         save_env saved_entry       fi     }          function load_video {       if [ x$feature_all_video_module = xy ]; then         insmod all_video       else         insmod efi_gop         insmod efi_uga         insmod ieee1275_fb         insmod vbe         insmod vga         insmod video_bochs         insmod video_cirrus       fi     }          if [ x$feature_default_font_path = xy ] ; then        font=unicode     else     insmod part_gpt     insmod ext2     set root='hd0,gpt1'     if [ x$feature_platform_search_hint = xy ]; then       search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  d44f2a2f-c369-456b-81f1-efa13f9caae2     else       search --no-floppy --fs-uuid --set=root d44f2a2f-c369-456b-81f1-efa13f9caae2     fi         font="/usr/share/grub/unicode.pf2"     fi          if loadfont $font ; then       set gfxmode=auto       load_video       insmod gfxterm       set locale_dir=$prefix/locale       set lang=en_US       insmod gettext     fi     terminal_input console     terminal_output gfxterm     set timeout=5     ### END /etc/grub.d/00_header ###          ### BEGIN /etc/grub.d/10_linux ###     menuentry 'Arch GNU/Linux, with Linux PARA kernel' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-PARA kernel-true-d44f2a2f-c369-456b-81f1-efa13f9caae2' {         load_video         set gfxpayload=keep         insmod gzio         insmod part_gpt         insmod ext2         set root='hd1,gpt1'         if [ x$feature_platform_search_hint = xy ]; then           search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  b4fbf4f8-303c-49bd-a52f-6049e1623a26         else           search --no-floppy --fs-uuid --set=root b4fbf4f8-303c-49bd-a52f-6049e1623a26         fi         echo    'Loading Linux PARA kernel ...'         linux   /boot/vmlinuz-linux-PARA root=UUID=d44f2a2f-c369-456b-81f1-efa13f9caae2 ro  quiet         echo    'Loading initial ramdisk ...'         initrd  /boot/initramfs-linux-PARA.img     }     menuentry 'Arch GNU/Linux, with Linux core repo kernel' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-true-d44f2a2f-c369-456b-81f1-efa13f9caae2' {         load_video         set gfxpayload=keep         insmod gzio         insmod part_gpt         insmod ext2         set root='hd1,gpt1'         if [ x$feature_platform_search_hint = xy ]; then           search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  b4fbf4f8-303c-49bd-a52f-6049e1623a26         else           search --no-floppy --fs-uuid --set=root b4fbf4f8-303c-49bd-a52f-6049e1623a26         fi         echo    'Loading Linux core repo kernel ...'         linux   /boot/vmlinuz-linux root=UUID=d44f2a2f-c369-456b-81f1-efa13f9caae2 ro  quiet         echo    'Loading initial ramdisk ...'         initrd  /boot/initramfs-linux.img     }     menuentry 'Arch GNU/Linux, with Linux core repo kernel (Fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-fallback-d44f2a2f-c369-456b-81f1-efa13f9caae2' {         load_video         set gfxpayload=keep         insmod gzio         insmod part_gpt         insmod ext2         set root='hd1,gpt1'         if [ x$feature_platform_search_hint = xy ]; then           search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  b4fbf4f8-303c-49bd-a52f-6049e1623a26         else           search --no-floppy --fs-uuid --set=root b4fbf4f8-303c-49bd-a52f-6049e1623a26         fi         echo    'Loading Linux core repo kernel ...'         linux   /boot/vmlinuz-linux root=UUID=d44f2a2f-c369-456b-81f1-efa13f9caae2 ro  quiet         echo    'Loading initial ramdisk ...'         initrd  /boot/initramfs-linux-fallback.img     }          ### END /etc/grub.d/10_linux ###          ### BEGIN /etc/grub.d/20_linux_xen ###     ### END /etc/grub.d/20_linux_xen ###          ### BEGIN /etc/grub.d/20_memtest86+ ###     menuentry "Memory test (memtest86+)" --class memtest86 --class gnu --class tool {       insmod part_gpt       insmod ext2       set root='hd1,gpt1'       if [ x$feature_platform_search_hint = xy ]; then         search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  b4fbf4f8-303c-49bd-a52f-6049e1623a26       else         search --no-floppy --fs-uuid --set=root b4fbf4f8-303c-49bd-a52f-6049e1623a26       fi       linux16 ($root)/boot/memtest86+/memtest.bin     }     ### END /etc/grub.d/20_memtest86+ ###          ### BEGIN /etc/grub.d/30_os-prober ###     ### END /etc/grub.d/30_os-prober ###          ### BEGIN /etc/grub.d/40_custom ###     # This file provides an easy way to add custom menu entries.  Simply type the     # menu entries you want to add after this comment.  Be careful not to change     # the 'exec tail' line above.     ### END /etc/grub.d/40_custom ###          ### BEGIN /etc/grub.d/41_custom ###     if [ -f  ${config_directory}/custom.cfg ]; then       source ${config_directory}/custom.cfg     elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then       source $prefix/custom.cfg;     fi     ### END /etc/grub.d/41_custom ###      * * * **Update** After installing LILO last night, the computer booted just fine at least once. When I booted the computer this morning, I was faced with a kernel panic:               Initramfs unpacking failed: junk in compressed archive     Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,1)     Pid: 1, comm: swapper/0 Not tainted 3.8.7-1-ARCH #1     Call Trace:     ...      Here is a picture of the kernel panic. **Update 2** I reinstalled LILO and no longer receive the kernel panic on boot.


title: bash script - supervisor program

text: I have to write a shell-script that have to do the following tasks:   -in every 5 seconds it saves:       -how many users are using joe and/or vi;       -if someone was using vi at the last examination, but now he isn't using it anymore, the program should print something about that user and if he is your group that you should send him a mail;      -in every minute it prints:       -the last minute`s statistics about the usage of joe and vi;       -the change by the average of usage (increased or decreased); Any suggestions?


title: How do I get systemd to start my ZFS mount script before doing anything else?

text: Right now I'm using zfsonlinux on Fedora 19, and it works excellently. Mounting works at bootup as planned using the initscript (included with zfs) that systemd calls, but there's a pretty significant flaw: ZFS is mounted way, WAY too late during boot, to the point that transmission and other services get very lost without /zfs mounted and can't recover, hence failing them. What I'm after is a way to get systemd to fire up the script before doing anything else. I know how to do it using initscripts (just set it to a lower runlevel, say 2), but I haven't the foggiest when it comes to doing it with systemd's target system. I've tried setting things in the services that require zfs to be up, but it doesn't work, barring Type=idle (but there must be a better way of doing it regardless):               Requires=network.target     After=zfs     Type=idle      And for reference's sake, here's the initscript provided by Fedora. Due to the nature of how ZFS mounts on linux (?), I can't just plop an entry into fstab and be done with it, it has to be mounted using commands.


title: dpkg won't install package with dependencies that have newer version

text: Please someone explain to me this, because it makes no sense:               $ dpkg -i freeling-3.1-quantal-x86_64.deb     Selecting previously unselected package freeling.     (Reading database ... 283003 files and directories currently installed.)     Preparing to unpack freeling-3.1-quantal-x86_64.deb ...     Unpacking freeling (3.1) ...     dpkg: dependency problems prevent configuration of freeling:      freeling depends on libboost-program-options1.49.0 (>= 1.49); however:       Package libboost-program-options1.49.0 is not installed.      freeling depends on libboost-regex1.49.0 (>= 1.49); however:       Package libboost-regex1.49.0 is not installed.      freeling depends on libboost-system1.49.0 (>= 1.49); however:       Package libboost-system1.49.0 is not installed.      freeling depends on libicu48 (>= 4.8.1); however:       Package libicu48:amd64 is not installed.      But I have liboost 1.54 !!! (ALL packages)               $ apt-cache policy libboost-program-options1.54.0     libboost-program-options1.54.0:       Installed: 1.54.0-5       Candidate: 1.54.0-5          $ apt-cache policy libboost-program-options-dev     libboost-program-options-dev:       Installed: 1.54.0.1       Candidate: 1.54.0.1      And so on for all of the dependencies. Is this package broken, or am I looking at a problem with my settings? As far as I understand,               (>= 1.49)      means greater or equal to 1.49, right?


title: Print a message from the left-hand side of a pipe

text: I want to use a variable from the main shell in a sub shell. I did:               export mysql_root_password="test"     (         echo $mysql_root_password     ) | dialog --gauge "Working hard..." 6 50      But it does not work. There is no output. What did i wrong? # Edit: I am dumb. Of course it does not "work" since i send the output to dialog. Is there a way to output specific variables still the normal way without removing the dialog part?


title: Wireless driver crashes when I'm too close to Access Point

text: This is the opposite of your usual WiFi problem: my signal strength is too high, now too low. Ever since I upgraded my access point to an Asus RT-AC66U, the WiFi driver for my Lenovo Y480 crashes after 5-10 min of 'net surfing when I sit too close to the access point, say between 3 and 7 ft. This doesn't happen on my wife's Macbook; it doesn't happen if I move to the next room, another 10 ft from the AP; and lowering the AP output from 80mw to 20mw fixes the problem, at the cost of making the connection unusable from the next room. I'm getting desperate; I even tried wrapping the laptop screen in aluminum foil to no effect. Reloading the driver (`sudo rmmod iwlwifi iwldvm; modprobe ...`) fixes the problem temporarily, and, again, it doesn't seem to be a problem on a Macbook. Can anyone suggest any fixes? I'm running Ubuntu 13.04, and the card is an Intel Corporation Centrino Wireless-N 2200 (rev c4).


title: Installing tigervnc in ArchLinux

text: Could anybody please assist me in installing TigerVNC in ArchLinux?


title: What does chmod stand for?

text: In order to memorize a command, it is usually a good idea to learn where it's name comes from. For example, `cp` comes from copy. `usermod` means "User Modifiy" (at least I guess so). Where does chmod come from, what does it mean?


title: How do i execute a remote script with 'screens'?

text: I need to execute a script locally. The problem is, it needs to use `screen` and send the ctrl d command. How would i do this? The script will be on my local windows machine. i can use winscp, putty, mingw and other apps.


title: How to restore accidentaly removed file of FreeBSD base system?

text: I accidentally removed `/etc/rc.d/rtadvd` from my FreeBSD system (8.2-RELEASE) What is the best way of getting such system file restored?


title: Virtualbox delete vm ram

text: If I delete a VM in VirtualBox, what happens with the RAM I used to create that VM? Is it freed?


title: Solaris JRE Mozilla

text: In an thin client setup where Solaris 10 is being used on client and server side. Java based web apps are opened in Mozilla web browser 1.7. JRE version 1.4.2.6 is installed for Mozilla. On a few thin clients, it works fine. However, on opening multiple sessions, it gets stuck with a dull green window left and requires force quit. Why does it behave like that?


title: Can I safely resize my partition from its beginning?

text: Currently dual booting Windows 8 and Linux Mint 14, sooner or later I will give more space to my Linux system. Is resizing my Linux partition from the beginning a safe operation ? If yes, could you provide the name of an utility that would help me achieve this ? I am asking this because systematically when I did that under Windows using Acronis Disk Director the system was broken, I couldn't boot to Windows anymore because of an NTLDR missing. So unless I thought in advance to make a recovery disk I was unable to use it again !


title: How do I have Linux boot with a rootfs in RAM?

text: The rootfs is a squashfs image and my bootloader is loading it into some address in SDRAM. What parameters do I need to pass to the kernel so It can mount the rootfs from there? Squashfs support is built-in and it already works with               root=/dev/mtdblock2 rootfstype=squashfs        for booting from the flash. EDIT: This is a MIPS based embedded device, using a custom bootloader. Normally, the bootloader extracts the compressed kernel from the flash into the SDRAM, and then kernel mounts /dev/mtdblock2 as the rootfs. I am trying to improve the bootloader so it can download an image to its RAM and boot without writing to the flash. I cannot figure out how to make Linux mount a filesystem image in the RAM as the rootfs.


title: write a line before it is executed without writing it twice

text: I write a bash script with a `\--verbose` option, where I want to write most lines before I execute them               xinput --set-prop "$TP" "Device Accel Constant Deceleration" $TOUCHPAD_DECELERATION      I would like to have exactly that output with quotes but the variables execuded, so the user can copy and paste that command to execute it again. This would be the (more and more complicated, if there are a lot of quotes in the command) workaround with writing the line twice:               echo 'xinput --set-prop "'"$TP"'" "Device Accel Constant Deceleration" '"$TOUCHPAD_DECELERATION"     xinput --set-prop "$TP" "Device Accel Constant Deceleration" $TOUCHPAD_DECELERATION      How can I write the outcome ot this line with echo without having to write twice?


title: How to ensure that string interpolated into `sed` substitution escapes all metachars

text: I have a script that reads a text stream and generates a file of sed commands that is later run with `sed -f`. The generated sed commands are like:               s/cid:image002\.gif@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1922/g     s/cid:image003\.gif@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1923/g     s/cid:image004\.jpg@01CC3D46\.926E77E0/https:\/\/mysite.com\/files\/1924/g      Assume the script which generates the `sed` commands is something like:               while read cid fileid     do         cidpat="$(echo $cid | sed -e s/\\./\\\\./g)"         echo 's/'"$cidpat"'/https:\/\/mysite.com\/files\/'"$fileid"'/g' >> sedscr     done      How can I improve the script to ensure all regex metacharacters in the `cid` string are escaped and interpolated properly?


title: Move files and change ownership at the sametime

text: On Linux (Debian, Ubuntu Mint...),   Is there any option command or something that I can use to transfer files to another user without having to do :               sudo mv /home/poney/folderfulloffiles /home/unicorn/     sudo chown -R unicorn:unicorn /home/unicorn/folderfulloffiles


title: Delete all lines containing ".." and "@"

text: I have a long text file from a `tcpdump`. I need some of the information but most lines are just like this:               .....@isa..g..3..2..2.@...3.3.2.1.12..      I want to use sed to search and replace all lines containing `@` and `..` I have tried this               sed -i '/foo\../foo_/d' ./file\ 2.txt     sed '/@/d' ./file\ 2.txt     awk '!/@/' file\ 2.txt      And the file is on the desktop and its called `file 2` and I have done `cd Desktop`. That doesn't matter since the error code I get is not a "directory not found".


title: Is there a way of copying only directories and not files in bash?

text: I want to copy only directories from a folder on a remote server to my server. Is that possible? Here is the code I have so far but it copies files and folders:               scp -rq username@192.168.78.331:/copy/from/ /copy/it/here/      I also have an alternative for the code above:               ssh -q username@192.168.78.331 "cp -r /copy/from/ /copy/it/here/"      The problem is that both are copying the entire folder (including all folders and directories) from /copy/from/. Is there a way of only copying directories?


title: Find out if CPU supports dynamic speed setting

text: I need to find out in my script if a (potentially legacy) CPU supports dynamic speed setting, and eventually get value of maximum and current speed. What makes it more complicated is that I need to support RHEL5 (kernel 2.6.18-371) as well, where tools like lscpu are not available, and also less common architectures like PowerPC or S390. For example, I know that for x86 architectures, some features can be read from "flags" in /proc/cpuinfo, but how do I know what to search for?. Also on a ppc64 machine I have for testing, this flags field is missing, instead there is a similar looking field "features". So what is the (most) universal approach? Is there a way that would work even on less common architectures like s390 or ppc? What I tried (on Pentium III) was to just load all modules that have something to do with cpufreq (i.e. grepping through modules folder) and look if /sys/devices/system/cpu/cpu0/cpufreq exists after that. However, I wonder if this is all I can do before saying it's not supported.


title: what happens during nic master failover?

text: During NIC master failover, will the mac address of bond0 change?


title: Is there a way to check for a working polkit agent without checking for running process?

text: I need to check if I have an usable polkit agent in a desktop-environment agnostic way. Right now, what I'm doing is to check if a polkit agent is running, using a code like this:               ps aux | grep some-polkit-agent      where `some-polkit-agent` may be:   * `polkit-gnome-authentication-agent-1` (for gnome2 and gnome3-fallback)   * `polkit-kde-authentication-agent-1` (for kde)   * `polkit-mate-authentication-agent-1` (for mate)   * `lxpolkit` (for lxde) The "no-fallback" gnome3 (gnome-shell) has its own polkit agent within the gnome-shell process itself, so I can't ps-grep it. What I assume is that if `gnome-shell` is running then the polkit agent is in place. The problem comes when a system has `hidepid` enabled (see http://www.linux- dev.org/2012/09/hide-process-information-for-other-users/). This security measure makes that a `ps` doesn't show me any polkit agent running even if there is one. Is there any better way that I can check for an usable polkit agent?


title: Redhat / Centos 7 Firewalld best practice for pptp or L2TP/IPsec rules

text: Having a quick look at Centos 7, and though I'd spin up a VPN daemon or 3, but immediately discovered the usual packages aren't yet in the core repositories, so had to dig around and found the necessary bits in the likes of the EPEL beta tree. Anyway on to the primary issue, the switch from _iptables_ to _firewalld_. I know I could revert my play box to _iptables_ and not trouble my betters, but it's a new toy so must play. Started to RTFM and had a quick look and spotted _openvpn_ and _ipsec_ have service definitions, for this new toy, but there is nothing for the likes of _pptp_ , _l2tp_ , _NAT-T_....so started to spend a few min's creating the likes of a: /etc/firewalld/services/pptp.xml               <?xml version="1.0" encoding="utf-8"?>       <service>         <short>pptp</short>         <description>Point-to-Point Tunneling Protocol (PPTP)</description>         <port protocol="tcp" port="1723"/>       </service>      Or: /etc/firewalld/services/l2tp.xml               <?xml version="1.0" encoding="utf-8"?>       <service>         <short>L2TP</short>         <description>Layer 2 Tunneling Protocol (L2TP)</description>         <port protocol="udp" port="1701"/>       </service>      Or: /etc/firewalld/services/nat-t.xml               <?xml version="1.0" encoding="utf-8"?>       <service>         <short>NAT-T</short>         <description>Network Address Translation (NAT-T)</description>         <port protocol="udp" port="4500"/>       </service>      etc.....               chmod 640 /etc/firewalld/services/*.xml     restorecon /etc/firewalld/services/*.xml      Then a few rules:               firewall-cmd --zone=external --add-interface=ip_vti0 --permanent     firewall-cmd --zone=external --add-interface=ppp0 --permanent     firewall-cmd --reload     firewall-cmd --get-services          firewall-cmd --zone=external --add-service=l2tp --permanent     firewall-cmd --zone=external --add-service=pptp --permanent     firewall-cmd --zone=external --add-service=nat-t --permanent     ....     firewall-cmd --reload      etc..... But am wondering if I should persist with this approach and get my head around the zones, or simply replicate the standard iptables rules with a firewalld direct rule frig e.g.               iptables -A INPUT -i enp3s0 -p tcp --dport pptp-j ACCEPT     iptables -A INPUT -i enp3s0 -p tcp --dport l2tp -j ACCEPT     iptables -A INPUT -i enp3s0 -p tcp --dport ipsec-nat-t -j ACCEPT     iptables -A INPUT -i enp3s0 -p gre -j ACCEPT     ....     iptables -t nat -A POSTROUTING -o enp3s0 -j MASQUERADE     iptables -t nat -A POSTROUTING -s 192.168.0.0/28 -o enp3s0 -j MASQUERADE     iptables-save      with:               firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -i enp3s0 -p tcp --dport pptp-j ACCEPT     firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -i enp3s0 -p tcp --dport l2tp -j ACCEPT     firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0T -i enp3s0 -p tcp --dport ipsec-nat-t -j ACCEPT     firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -i enp3s0 -p gre -j ACCEPT     ....     firewall-cmd --permanent --direct --add-rule ipv4 filter POSTROUTING 0 -t nat -o enp3s0 -j MASQUERADE      firewall-cmd --permanent --direct --add-rule ipv4 filter POSTROUTING 0 -t nat -s 192.168.0.0/28 -o enp3s0 -j MASQUERADE -t nat     firewall-cmd --reload      What's the general school of thought (replicate iptables rule sets / do the new service + zone thing), and are there any published / recommended masqueraded and nat'ed rule sets out there on the web.


title: How to turn off internal laptop speakers when external speakers / headphones are connected in Elementary OS?

text: In the eOS settings I see no option to make internal speakers turn off when the external jack is connected.


title: Vlan not connected to one network virtual machine to another network virtual machine

text: I created two ubuntu vm and I installed dhcp server on both the vm's. I configured the interfaces file and geting the ip address for vm1:10.192.1.2 and vm2:10.192.2.3 I have 24ports Switch. Now I want to create a common vlan id to both the vm's. I want to communicate this two vm's using same Vlan id How can I do it simply ?


title: advance strategy to interrupt a linux application that has "hung" and made X desktop unresponsive

text: When an application (thunderbird) has a problem, sometimes it goes into an unresponsive state where it has blocked the UI, is blocking login processes (at tty terminals) and also is preventing a restart of the X session using Ctrl-Alt-Backspace. Normally on a *nix box, sending a signal to the process is enough to give me back enough access to regain control, however in this case everything was borked, even though it was only a single application using a great deal of RAM and swap. Using Ctrl-Alt-F1 gave me a console and a login prompt, and I could enter the root username, but it wouldn't return the password prompt, so I was stuck. Ctrl-Alt-Backspace caused a restart of the X session, but it didn't give me a login prompt and a power-cycle was necessary. Is there some way to bind a keystroke to some sort of low level "interrupt function" (I mean that in the general sense) to suspend the bothersome hung process so I can see what it is trying to do using `strace`? I am vaguely aware that some blocked processes can't be suspended until they have returned, but in this case there is no indication that the blocking process is being prevented from accessing any IO resources, it just appears to be doing something dumb. I was originally thinking of some bash script to ionice and renice any process associated with thunderbird to the lowest priority, but I imagine that if things are as bad as they seem, then the new process would not be able to get on the CPU. I would like to use the Ctrl-Break key for this, as it isn't used for anything else during desktop sessions on my machine. Basically, the desktop is (slowly) responding to key and mouse, so there is some scope to get commands run to cause the bad process to suspend, I just don't know what sort of commands are available in this scenario.


title: Increasing Screen Size/Resolution on a VirtualBox Instance of Centos

text: I have VirtualBox instance of Centos 5. The screen size is quite small (800*600) and I'd like to increase it to 1280*1080. Under the Gnome preferences for "Screen Resolution" I only get the option for 600*800 or 640*480. I've tried editing my xorg.conf (based on this tutorial http://paulsiu.wordpress.com/2008/09/08/creating-and-managing-centos-virtual- machine-under-virtualbox/) but it doesn't seem to have made a difference. Here is a snippet from the edited section:               Section "Screen"         Identifier "Screen0"         Device     "Card0"         Monitor    "Monitor0"         DefaultDepth     24         SubSection "Display"             Viewport   0 0             Depth     24             Modes   "1280x800"         EndSubSection     EndSection      Does anyone know how to do this?


title: centos locale utf-8

text: This is my linux box:   * CentOS Linux release 6.0 (Final)   * x86_64 Using a text editor (vi, or pico...) I see strange characters for accented letters (è, ì, à, ù) This is my locale:               LANG=en_US.UTF-8     LC_CTYPE="en_US.UTF-8"     LC_NUMERIC="en_US.UTF-8"     LC_TIME="en_US.UTF-8"     LC_COLLATE="en_US.UTF-8"     LC_MONETARY="en_US.UTF-8"     LC_MESSAGES="en_US.UTF-8"     LC_PAPER="en_US.UTF-8"     LC_NAME="en_US.UTF-8"     LC_ADDRESS="en_US.UTF-8"     LC_TELEPHONE="en_US.UTF-8"     LC_MEASUREMENT="en_US.UTF-8"     LC_IDENTIFICATION="en_US.UTF-8"     LC_ALL=      If I switch to `iso-8859-9` like this:               export LANG="en_US.ISO-8859-1"      I see the characters correctly, but I must use utf-8 on this server. Any idea?


title: Why am I getting btx halted trying to install FreeBSD?

text: When trying to install FreeBSD 8 off a USB Drive (UNetBootin loaded) I receive > BTX Halted when choosing any of the Boot options.   1. Boot FreeBSD [default]   2. Boot FreeBSD width ACPI disabled   3. Boot FreeBSD in Safe Mode   4. Boot FreeBSD in single user mode   5. Boot FreeBSD with verbose logging Here is my system I have 256meg of ram on it, and a Transcend CF 133x 4GB for its drive. I searched the FreeBSD supported hardware and It says AMD Geode LX is supported.. I have also read a post by someone who suggested: > My solution to the BTX halted was to turn of the BIOS IDE DMA Transfers > option in the DeviceOptions menu in the BIOS. but that also did nothing. Am I missing something? Any help would be greatly appreciated. * * * 11/24 - I just had luck installed FreeBSD 7.4 .. strange that my hardware is listed as supported in the newer versions yet I cannot load the bootloader... I would still like to be able to use the newest version.