title: Get Network activity

text: I have an embedded board running Linux with http, ftp and some other servers. I need a way to detect when there is no network activity both http, ftp etc. I will make a linux program, that will run some stuff when there is no network activity for xx minutes.


title: Using huawei e303 on a modified linux machine

text: I am trying to configure a new modem to work on my Linux machine.The machine is based on `debian` (6) without most of the graphical interface.I'm also using a modified kernel based on 2.6.37.Until recently I had `huawei e173` modem on my machine and it worked just fine (The only thing I had to configure was the usb port that was assigned by the OS which is usually `ttyUSB1`). Now since I can't buy the old modem I am trying a new one but it doesn't work.When I use `lsusb` it is recognized but when I'm trying to use `cat /dev/ttyUSB` it doesn't work for any port I tried. When I used to use the `cat /dev/ttyUSB1` command on the old modem I had access to the data that is transferred from the modem (usually `AT` commands etc). I thought that it might be a driver issue but since I'm using a modified system it's a bit harder for me to install new drivers. I would appreciate any suggestions and any help that you can offer in order to get this modem to work.


title: Extract part of string using grep

text: I have 3 files in a directory               MYO144064T     MYO144064TA     MYO144064TX      Where the digits and 11th character will change. In my csh script, I want to extract the letters 'A' and 'X' probably using grep The variable $study equals MYO144064 What I have managed so far is very cumbersome               ls | grep $study | cut -c 11 | sed 's/\///'      Which gives me               A     X      How can I do this with minimal processes and without the additional blank line?


title: How to keep LiveCD settings?

text: As I am now only able to run my machine from liveCD (Fedora XFCE 16 or Xubuntu 11.10), I would like to know if there is a way to keep the current session's settings (keyboard, wifi etc.) for a later session. Can the settings be stored on a USB drive for instance?


title: Case-insensitive file system for production server?

text: The initial situation looks like this:   * The corporate software is PHP-based.   * It is delivered by Apache 2 on a Windows 2003 Server.   * It is **big**.   * It is a legacy of rather unprofessional developers who did not mind about case sensitivity or directory separators. The desired situation looks like that:   * Everything migrated to Apache 2 under a Linux distribution of yet undecided flavor. Problem:   * Endless tons of code without any caring about the case-sensitivity or directory separator character. I did some research already, but unfortunately did not find anything which would be suitable also for a production environment. `CIOPFS` looks nice but is explicitly meant not to be used on production systems. Would you think `mod_spelling` for Apache would be an option? The yet unresolved question for me is, if PHP accesses files with help of that module or directly (which would make it useless). Should we swallow the bitter pill and go through all the code? We would like to avoid that, as we will replace the current software environment piece by piece with new build stuff (in long term).


title: Converting bash script to fish

text: I'm trying to add the following bash scripts to fish, yet am having trouble getting the syntax in fish right. Here is the original script:               export MINION_INSTALL=$HOME/minion     export NOTES_HOME=$HOME/Notes     export INBOX=$NOTES_HOME/inbox          if [ -d "$MINION_INSTALL" ] ; then         export PATH="$MINION_INSTALL:$PATH"     fi          source $MINION_INSTALL/aliases_for_minion      And this is the `aliases_for_minion` file:               alias mn="minion"     alias icannotfind="minion --open --archive --full $@"     alias newnote="minion --new-note $@"     alias open="minion --open $@"     alias remind="minion --new-note --quick $@"     alias summary="minion --count inbox; minion --list --show-tags=False today; \         minion --count next; minion --count soon; minion --count someday"       The minion command works fine if I run fish after starting bash. Any help would be greatly appreciated!


title: Mod, Meta, Super ... keys?

text: In Window Managers circle there are some technical terms; couple of them are `Mod keys` and `Meta keys`. The questions here I am asking are   * What exactly are those and are they universal across different keyboards.   * What `ALT`, `SHIFT` and `CTRL` (both right and left), `Win` and `right click` keys are called? I ask this because I am working on both tilling window managers and stack ones. and there are lots of references to this issue.


title: Log new files in a directory

text: Is there a tool, which lets me know about the last newly created files? The still common way of using a hierarchically file system makes it hard to save files in different places, so sometimes I sort things into general topic folders and sometimes at the place of directly related things, f.e. publications related to a certain tool in the directory of the binaries. Best would be a tool, which I can ask:   * Period of creation / saving   * File type / name / extension   * Black-/Whitelist of directories to exclude/include


title: awk to split the input file into 2 files(one for duplicated values and one for unique values)

text: I have an input file like below.               file.txt     14 2.692022 author1 0     14 2.57826 author2 1     229 2 author3 2     323 2 author4 3     514 2.0625 author5 4      I am trying to split the file with the duplicated values as one file and the rest of values as another file. So, for the above input, I am trying to generate files like,               file1.txt     14 2.692022 author1 0     14 2.57826 author2 1          file2.txt     229 2 author3 2     323 2 author4 3     514 2.0625 author5 4      I am not able to figure out how to use awk for this purpose.               awk '{print $1}' file.txt | uniq -d > file1.txt      The above command gives me only the duplicated values in a file. Also, it gives me only the field1 but not all the 3 fields.


title: Logging into multiple SSH servers as root and create an user with same power as root does

text: I need a script from which I can log into multiple servers as root (but not all root passwords are same;there are 3-4 different root passwords) and make a superuser (user with same access as root) but some of the server already have one (same user:same passwd). And if the server we logged into, got one already, the script just need to skip it and move on to the next server. Please help


title: mutt -- multiaccount support

text: Can anybody help me with mutt configuration? I need to configure mutt to support mutiple accounts the same time. At this moment my config file for personal email looks like this:               ~ $ cat ~/.mutt/personal          set imap_user = «%personal_email%@gmail.com»     set imap_pass = «%personal_email_pass%»     set smtp_url = «smtps://%personal_email%@smtp.gmail.com:465/»     set smtp_pass = «%personal_email_pass%»     set from = «%personal_email%»     set realname = «%username%»     set hostname = gmail.com     set folder = «imaps://%personal_email%@imap.gmail.com:993»     set spoolfile = «imaps://%personal_email%@imap.gmail.com/INBOX»     set postponed = «imaps://%personal_email%@imap.gmail.com/[Gmail]/Drafts»     set record = «imaps://%personal_email%@imap.gmail.com/[Gmail]/Sent Mail»      "~/.mutt/work" looks the same way, except the values of "%personal_email%" and "%personal_email_pass%", of course. "~/.muttrc" looks like this:               ~ $ cat ~/.muttrc          source «~/.mutt/personal»          macro index <f2> '<sync-mailbox><enter-command>source ~/.mutt/personal<enter><change-folder>!<enter>'     macro index <f3> '<sync-mailbox><enter-command>source ~/.mutt/work<enter><change-folder>!<enter>'      When I press F2 or F3 mutt really changes an account, but when I'm trying to change mailbox (via 'c' -> '?') it opens a mailbox of the first account (in my case "personal") even when the current account is "work". Why? What am I doing wrong? How can I fix it?


title: Google App Engine alternative for CentOS, Fedora, Ubuntu?

text: I have written WebRTC Apps which is Python and Google App Engine. Google App Engine is not freely available to use for production release, so I am looking alternative of it for CentOS, Fedora. Can anyone please advise me for working/stable/production use like alternative Google App Engine for CentOS, Fedora.


title: Why is the 'if [ $1="1" ]' branch always selected even if $1 is not 1?

text: I have a shell script named 'teleport.sh' like this:               if [ $1="1" ];         then         shift             mv "$@" ~/lab/Sun     elif [ $1="2" ];         then         shift             mv "$@" ~/lab/Moon     elif [ $1="3" ];         then         shift             mv "$@" ~/lab/Earth     fi      When I execute:               sh teleport.sh 2 testfile      This `testfile` is moved to the `~/lab/Sun` directory, which confuses me a lot as I didn't pass 1 or '1' to that script. What's wrong here?


title: How to make a library linkable with g++ -l argument

text: How can I make a shared library which is in `/usr/lib/some-path` linkable with the g++ `-l` argument when compiling? As far as I know, to do what I want, I need to `chmod 0755` the library `.so` file, create some kind of a link file and I need to update the library cache. I tried using `ldconfig` command and it worked, but not for the subdirectories of `/usr/lib`. I also tried `ln -s /usr/lib/some-path/libmy.so /link/file/output/dir` which created a link file, but g++ still couldn't find the library with the `-lmy`. I tied running `ldconfig` after `ln` but that did not help.


title: How do I split the $0 variable to find directory and relative paths in bash?

text: The $0 variable contains the path info of the script.   * How can I change the path info to absolute path? I mean how to process ~, ., .. or similar?   * How can I split the path info into directory and file name? I could use python/perl for this, but I want to use bash if possible.


title: Fedora vs. Ubuntu installation

text: I am using Fedora 13, and it was my friend who did the installation for me. I have used Ubuntu also and I found it more easy to install than fedora. Ubuntu uses a WUBI installer (if I am correct) and its more easy for the users to install and remove Ubuntu. For a person who knows how to install and remove an application in Windows, can they install/remove Ubuntu also. Why is it that its not the same with Fedora. Are there any steps being taken for making it more user-friendly.


title: Why can't the OOM-Killer just kill the process that asks for too much?

text: It is explained here that the OOM-Killer can be configured via `overcommit_memory` and that:   * 1 = no overcommit. Allocations fail if asking too much.   * 0, 2 = overcommit. Kill _some_ process(es) based on some heuristics when too much memory is actually accessed. Now, I may completely misunderstand that, but why isn't there an option (or why isn't it the default) to kill the very process that actually tries to access too much memory it allocated?


title: Is there a way to check which process terminates first during reboot

text: Assuming I have 2 processes running. Is there any way for me to check which process terminates first during reboot/shutdown? From this link, it tells about appending boot to a file. Yet, I still don't know which process is terminated first between my 2 processes. Is there any way for me to do find out? Maybe a bash script or a .conf file. I'm applying this to CentOS, Redhat, Ubuntu, Solaris, HPUX.


title: GNU/Linux distribution for network virus || malware identification

text: I'm looking for a GNU/Linux distro that I can install in transparent setup to look for infected hosts on a LAN. I don't need to stop viruses and malwares but only identify them and the host where they come from. I don't necessarily need fancy graphics but I would like something pre- configured and possibly free. Any suggestions?


title: Where to find source code of Linux NTFS driver?

text: Brief description : Linux driver gives us a chance to interface with an NTFS filesystem. Thanks to this driver, we can use built-in Linux commands on an NTFS filesystem. Ex : ls, chown, chmod, cd, locate, rm, ln etc. Question : Where can I find this source code ? Why : Try to be familiar with NTFS


title: Make error - installing wifi driver offline

text: I need to install Kali Linux updates without Internet access on my laptop. I think I need to do this because I'm trying to install the wifi driver but I get an error when I try to `make`: > make ARCH=x86_64 CROSS COMPILTE= -C /lib/modules/3.7-trunk-amd64/build > M=/root/Desktop/rtl8723A_WiFi_linux_v4.1.3_6044.20121224 modules make: *** > /lib/modules/3.7-trunk-amd64/build: No such file or directory. Stop. make: > *** [modules] Error 2 Can anyone help? Again, no wired or wireless connection available for laptop (Yoga 13). The OS is a fresh install.


title: Immutable bit on AIX?

text: Under Linux I can:               chattr +i SOMEFILE      so that even root can't modify the SOMEFILE. Are there any similar solutions for AIX?


title: Poor random read SSD performance on Linux

text: I recently got an Intel 320-series SSD, and I am having difficulty achieving the advertised 38K IOPS for random 4K reads. Both with `fio` and my own hacked-together program, I am seeing around 6K IOPS. It's almost like the IO depth size does not matter, and the kernel is trying to fetch one block at a time. Example:               $ cat job     [randread]     filename=/dev/sdb2     rw=randread     size=128m     blocksize=4k     ioengine=libaio     iodepth=64     direct=1          $ sudo fio job     randread: (g=0): rw=randread, bs=4K-4K/4K-4K, ioengine=libaio, iodepth=64     Starting 1 process     Jobs: 1 (f=1): [r] [100.0% done] [25423K/0K /s] [6207/0 iops] [eta 00m:00s]     randread: (groupid=0, jobs=1): err= 0: pid=4678       read : io=131072KB, bw=24852KB/s, iops=6213, runt=  5274msec         slat (usec): min=1, max=94, avg= 5.00, stdev= 2.88         clat (usec): min=312, max=13070, avg=10290.25, stdev=1399.78         bw (KB/s) : min=23192, max=24464, per=97.08%, avg=24125.60, stdev=383.70       cpu          : usr=15.74%, sys=22.57%, ctx=31642, majf=0, minf=88       IO depths    : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=99.8%          submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%          complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.1%, >=64=0.0%          issued r/w: total=32768/0, short=0/0          lat (usec): 500=0.01%, 750=0.01%, 1000=0.03%          lat (msec): 2=0.05%, 4=0.10%, 10=20.10%, 20=79.70%          Run status group 0 (all jobs):        READ: io=131072KB, aggrb=24852KB/s, minb=25448KB/s, maxb=25448KB/s, mint=5274msec, maxt=5274msec          Disk stats (read/write):       sdb: ios=30453/0, merge=850/0, ticks=319060/0, in_queue=319060, util=98.09%      The system is `Linux 2.6.35-31-generic #63-Ubuntu SMP Mon Nov 28 19:29:10 UTC 2011 x86_64 GNU/Linux`. `/dev/sdb2` above is a ~10GB partition on an 80GB SSD. `fio` is version 1.38. Would really appreciate thoughts on what might be wrong. PS: The partition in the above test (/dev/sdb2) is aligned on a 4K boundary. Reading from a larger span (size=10g) does not help.


title: Why does btrfs allow to create a raid1 with mismatched drives?

text: I'm creating a btrfs using               sudo mkfs.btrfs -m raid1 -d raid1 <small-disk> <large-disk> or     sudo mkfs.btrfs -m raid1 -d raid1 <large-disk> <small-disk>      it creates the fs with the size of the sum of the two disks/partitions, but                btrfs fi df <mountpoint>      gives me RAID1 for data, system and metadata How can this be correct? Is there some way like mdadm's               cat /proc/mdstat      to see what btrfs is doing and to assure myself my raid1 is secure? It's not terribly important data, hence it's ok to use btrfs, but i don't want to lose it either.


title: Total in `ls -l`

text: When I run `ls -l`, the following is displayed:               >: ls -l     total 320     -rw-r--r--   1 foo  staff    633  5 Apr 13:23 A.class     -rw-r--r--   1 foo  staff    296  5 Apr 13:24 A.java     ...      What does the `total` signify? Size? If so, what size?


title: How do I create new partitions and format my hard drive in parted?

text: I'm somewhat new to working with commandline tools when dealing with partitioning, so you'll have to excuse my newness. I'm basically trying to create a new logical partition on `/dev/sdb` and would like to install `ext3` on it. How would I do this, step by step, in `parted`? It's a brand-new hard drive with absolutely nothing on it.


title: Groups ssh user is apart of don't apply on SSHFS

text: I am connecting to a remote server over SSH but am running into a permissions issue. My remote account is `thelq` and primarily part of the group `thelq`. I'm also part of the generic group `users`. Another remote account called `game` is primarily part of the group `users`. On the remote server I can freely view and edit all of `game`'s files. However on the local server I'm apparently not part of the `users` group. Strangely explicitly specifying the `users` group for the gid option still doesn't allow me access to the `users` group Example of what I tried in command line:               [thelq@quackwall ~]$ sshfs -o idmap=user -o uid=1000 -o gid=1000 -o allow_other -o default_permissions quackgame:/home game-home            thelq@quackgame's password:     [thelq@quackwall ~]$ echo something >> game-home/game/INIT-SETUP     bash: game-game/game/INIT-SETUP: Permission denied      I'm confused on what else to do as Linux permissions are not my strong point. I was thinking that longing in as me on the remote machine would allow me access to everything the groups says I can but apparently not. Any suggestions? * * * As per @penguin359's request               [thelq@quackwall ~]$ ls -ld game-home     drwxr-xr-x 2 thelq allusers 4096 Apr  5 19:06 game-home     [thelq@quackwall ~]$ sshfs quackgame:/home game-home     thelq@quackgame's password:     [thelq@quackwall ~]$ ls -ld game-home     drwxr-xr-x 1 root root 4096 Jan  5 18:20 game-home     [thelq@quackwall ~]$ ssh quackgame id     thelq@quackgame's password:     uid=1000(thelq) gid=1000(thelq) groups=1000(thelq),4(adm),20(dialout),24(cdrom),46(plugdev),100(users),107(sambashare),109(lpadmin),110(admin)     [thelq@quackwall ~]$ ssh quackgame ls -ld /home/game     thelq@quackgame's password:     drwxr-xr-x 11 game users 4096 2011-04-11 21:59 /home/game


title: Is there a way to demux a h264 video stream from an flv (h264, aac)?

text: Using `ffmpeg` to demux an h264 stream from a .flv video always gives me a stream which I cannot remux into a .mp4 container (using either `MP4Box from package *gpac),` or `ffmpeg`). Here is the demuxing command which produces the "invalid" stream.. ( _Unknown format_ )               ffmpeg -i "(h264-aac).flv"  # get stream info       # Stream #0.0: Video: h264, yuv420p, 320x240 [PAR 1:1 DAR 4:3], 259 kb/s, 29.97 tbr, 1k tbn, 59.94 tbc          ffmpeg -y -map "0.0" -vcodec copy -an -i "(h264-aac).flv" \                                              "(h264-aac).flv.h264"       I've also tried it with: -f h264, but get the same error. The above command works when run against a video in a `.mp4` container, so maybe this is something specific to `flv`(?). The closest I've come to isolating the h264 video stream is with the following command; but it wraps the stream in an `flv` container which has lost its aspect ratio....               ffmpeg -y -map "0.0" -vcodec copy -an -i "(h264-aac).flv" \                                              "(h264-aac).flv.NEW.flv"       Is there some way to grab this video stream? PS. I've treid with several different input .flv vids, ...same error.


title: What is the unit measurement used in edquota?

text: I have the following quota setting for ec2-user:               Disk quotas for user ec2-user (uid 500):           Filesystem  blocks   quota   limit   grace   files   quota   limit   grace           /dev/xvdf      32*      1       1   6days       8       0       0      However, when I donwload files with 3.1 MB it still works, then I try a new file with 1.5Gb and it still works, no warning or error messages show up. What is the unit measurement for the quota soft and hard limit in this case? E.g: bytes or mb or gb?


title: Distro with pip and npm as package managers?

text: Is there an attempt of distro around that for Python and Node code ( and Ruby , Lua ) would use Pip, NPM and rubygems and luarocks respectively ? It could simply work as a passthrough from native package manager. Say, for example, if i did "aptitude install" on a python package, apitude would be smart enough to go and fetch it using pip from pypi.python.org or a distro specific mirror with "stable" versions ( with an option to use the latest )


title: How to match stream against white-list and black-list?

text: How can I duplicate a pipe stream (output from another program) so that for every line, I can check whether it matches independent regular expressions (ideally, reuse a `grep` command with options like `-i` etc.) but process results of each expression separately? I want to define exit code from my `check` function as follows:   * no line in stream matches `blacklist`; AND   * at least one line in stream matches `whitelist` I want to process lines in memory without storing them to file, report exit code and pass original stream to another program using pipes (logging `whitelist` matches to `stderr` or elsewhere would be useful too). Usage would look like:               fetch-big-stream | check whitelist blacklist | cat     exitcode=$?      where `fork` duplicates lines, `whitelist` and `blacklist` are functions and `check` passess copy of stream to each separately and terminates once exitcode can be determined before `EOF`. There is also a problem with `|` implementation that does not propagate non-zero code.


title: Mac 10.9.1 // Gerris installation //

text: I am trying to install Gerris . The website is : http://gfs.sourceforge.net/wiki/index.php/Mac_OSX_Installation I followed the instructions. But I could not install Gerris Dependencies. I installed Xcode, Command line tools, Xquartz as the page suggests, but about brew not quite sure because of what terminal says for the steps below.As page says I make a directory.               % cd     % mkdir soft      As page says :Paths               For installed software to be properly localized, various environment variables have to be set accordingly in ~/.bashrc     % export PATH=$PATH:$HOME/soft/bin     % export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/X11/lib:$HOME/soft/lib     % export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/X11/lib/pkgconfig/:$HOME/soft/lib/pkgconfig     Note: make sure that the file ~/.profile contains the line     source ~/.bashrc     for these changes to be taken into account.      I created `nano ~/.bashrc` and included the lines:                   % export PATH=$PATH:$HOME/soft/bin         % export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/X11/lib:$HOME/soft/lib         % export       and pressed ctrl+X and then I created `nano ~/.profile` and include `source ~/.bashrc` on the last line and pressed ctrl+X. But at this stage below I stuck. Gerris dependencies Now that brew is installed, almost every dependency needed by gerris can be installed in just a single command line:               % brew install gtkglext     % brew install gnuplot     % brew install gawk     % brew install gsl     % brew install gfortran     % brew install open-mpi     % brew install proj     % brew install netcdf     % brew install ode     % brew install fftw     % brew install ffmpeg --with-theora     % brew install coreutils     % brew install autoconf     % brew install libtool     % brew install automake      When I type brew install gtkglext the terminal says               samires-mbp:~ samirebalta$ brew install gtkglext     -bash: brew: command not found      I did `~/.bashrc` and `~/.profile` what is wrong I do not know?


title: sed or tr one-liner to delete all numeric digits

text: So, I have this textfile, and it consists of mostly alphanumeric characters. It's a standard document. But since I copied it and pasted it from a PDF, there are page numbers in there. I don't much care for the occasional number that's not a page, so I figure I'll wipe them all out with `sed` or `tr`. Just marginally faster than find and replacing first zero, then one, then two, etc. in the GUI, after all. So how do I do that?


title: How can I get wireless and ethernet to work with ubuntu?

text: I have an acer aspire 7551 laptop running windows 7 and I've successfully used wubi to also install ubuntu (the latest release version). Wireless works fine on windows 7, but neither wireless nor ethernet works on ubuntu. In particular, the wireless icon shows up at the top-right (but no available connections show up when I click the icon). When I connect my ethernet cable (which works fine when I plug it into my PC) to my laptop when it's running ubuntu and click the wireless icon, auto-etho shows up as an option but when I click it, it works for a few seconds and then disconnects. (Note - ethernet also doesn't work in windows 7 even though all the latest drivers are installed) How can I get wireless and ethernet to work under ubuntu? **Additional Info** Ubuntu version: "Ubuntu 10.0 - the Maverick Meerkat" lspci output:               00:00.0 Host bridge: Advanced Micro Devices [AMD] RS780 Host Bridge Alternate     00:01.0 PCI bridge: Acer Incorporated [ALI] Device 9602     00:04.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 0)     00:05.0 PCI bridge: Advanced Micro Devices [AMD] RS780 PCI to PCI bridge (PCIE port 1)     00:11.0 SATA controller: ATI Technologies Inc SB700/SB800 SATA Controller [AHCI mode]     00:12.0 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller     00:12.2 USB Controller: ATI Technologies Inc SB700/SB800 USB EHCI Controller     00:13.0 USB Controller: ATI Technologies Inc SB700/SB800 USB OHCI0 Controller     00:13.2 USB Controller: ATI Technologies Inc SB700/SB800 USB EHCI Controller     00:14.0 SMBus: ATI Technologies Inc SBx00 SMBus Controller (rev 41)     00:14.1 IDE interface: ATI Technologies Inc SB700/SB800 IDE Controller (rev 40)     00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia (Intel HDA) (rev 40)     00:14.3 ISA bridge: ATI Technologies Inc SB700/SB800 LPC host controller (rev 40)     00:14.4 PCI bridge: ATI Technologies Inc SBx00 PCI to PCI Bridge (rev 40)     00:18.0 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor HyperTransport Configuration     00:18.1 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Address Map     00:18.2 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor DRAM Controller     00:18.3 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Miscellaneous Control     00:18.4 Host bridge: Advanced Micro Devices [AMD] Family 10h Processor Link Control     01:05.0 VGA compatible controller: ATI Technologies Inc M880G [Mobility Radeon HD 4200]     01:05.1 Audio device: ATI Technologies Inc RS880 Audio Device [Radeon HD 4200]     03:00.0 Ethernet controller: Broadcom Corporation NetLink BCM57780 Gigabit Ethernet PCIe (rev 01)     06:00.0 Network controller: Broadcom Corporation BCM43225 802.11b/g/n (rev 01)      ifconfig -a output:               eth0      Link encap:Ethernet  HWaddr 20:6a:8a:1c:70:0e                 UP BROADCAST MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)               Interrupt:16           lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:76 errors:0 dropped:0 overruns:0 frame:0               TX packets:76 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:5840 (5.8 KB)  TX bytes:5840 (5.8 KB)


title: How does one find out how many bits a file has in one command?

text: I know I can use `ls -lat` to find out how many bytes has a file and then multiply by 8 to find out how many bits. But is this possible in only one command line?


title: Error loading shared library libSDL-1.2

text: I've compile ToME 3 game but I can run it, I've got:               tome3: error while loading shared libraries: libSDL-1.2.so.0: cannot open shared     object file: No such file or directory      I have installed libstd1.2 both devel and runtime packages. I have that library               $ ls /usr/lib/x86_64-linux-gnu/libSDL*     /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0     /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4     /usr/lib/x86_64-linux-gnu/libSDL.a     /usr/lib/x86_64-linux-gnu/libSDL_image-1.2.so.0     /usr/lib/x86_64-linux-gnu/libSDL_image-1.2.so.0.8.4     /usr/lib/x86_64-linux-gnu/libSDLmain.a     /usr/lib/x86_64-linux-gnu/libSDL.so      I've try to put `/usr/lib/x86_64-linux-gnu/` into PATH and also copy libSDL-1.2.so.0 to the directory where I have the game, but it not work. Someone ask the same question on AskUbuntu the solution was to reinstall the lib but it don't work.


title: Calling a script on machine shutdown

text: I want to call a script on machine shutdown and restart. I have written code like               #! /bin/bash     #chkconfig: 0 6 1 1     #description: Description of the script     # processname: killfoo     # this script starts and stops foo          # Some things that run always     LOG_FILE="/tmp/killfoo.log"          log() { while IFS='' read -r line; do echo "$(date) $line" >> "$LOG_FILE"; done; };     exec > >(tee >(log))     # Carry out specific functions when asked to by the system     case "$1" in       start)         echo "Nothing to done"         ;;            stop)         echo "Stopping script killfoo"         pkill   -9 foo >> $LOG_FILE 2>&1              ;;       *)         echo "Usage: /etc/init.d/killfoo {stop}"         exit 1         ;;     esac          exit 0      I created file /etc/init.d/killfoo having executable permission. I have enable this script for run level 0,6.               chkconfig --add killfoo     chkconfig --level 6 killfoo on      But script is not getting executed on machine restart. What could be the problem ?


title: How do I temporarily make Weechat's message area "full width" like irssi?

text: Coming from `irssi`, I'm used to being able to copy and paste messages from the message view of my terminal (PuTTY) running `irssi` with relative ease without having hard wraps on the text. This works when `irssi` is run directly, or when `irssi` is run in a screen session with the current window set to the size of the terminal (i.e. `Ctrl`-`a`, `:fit`). How do I achieve something similar for `weechat`? With the default layout, on the right, `weechat` draws a border and lists the nicks in the channel. On the left, there's a border for the date/time and the message source (the nick, or the event type). Is it possible to temporarily hide all the chrome of the window and present something like what's kept in the logs?


title: Ext4 - How to enable extra sanity, checksums, validations, tests of any kind?

text: I'm running Ext4 on a harddrive, and to be perfectly honest, I don't really trust the drive because it's old and has a few badblocks. I have nonessential data on the drive, so if it died tomorrow, then no big deal. However, I would like to know if/when it starts to die, and remount read only. Are there any options that will enable extra file checks on an Ext4 fs? (I don't care if it makes the filesystem slower.)


title: Trimming Filenames from the end

text: I have a folder with following mp4 file which are needed to be renamed               for filename in /media/usama/CRUNCH/RO_Plant/RO_Videos/*; do         File1=$filename         echo $File1     done     /media/usama/CRUNCH/RO_Plant/RO_Videos/Desal RO 16' Desalination Plants-JdN_Yx_5HzI.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/How Desalination Works-_H8EDLFNDtI.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/how membrane filter works with water-M3mpJysa6zQ.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Hydranautics - Spiral Wound Reverse Osmosis Elements-YlMGZWmh_Mw.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Industrial Reverse Osmosis Startup Part 1 of 3-6xD9FhbAIvY.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Industrial Reverse Osmosis Startup Part 2 of 3-Dt23yzCXaVA.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Industrial Reverse Osmosis Startup Part 3 of 3-VXyK20P6HD4.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/MED Desalination Process-5nDcxhkq8Js.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Reverse Osmosis Membrane Replacement Procedure-zNXYkH3uj-I.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Reverse Osmosis or RO System-BeXHKpuHVZg.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Reverse Osmosis Pressure Vessel-BeXHKpuHVZg.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/RO Process Equipments by R S Engineering, Mumbai-ijJ6QyaQ-Bk.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/The BioSand Water Filter-SlqAitfBbdQ.mp4      Now I want to trim the random words starting from **-** till **.mp4** such that this filename is converted from `The BioSand Water Filter- SlqAitfBbdQ.mp4` to `The BioSand Water Filter.mp4` for this I got partial success as is shown below               for filename in /media/usama/CRUNCH/RO_Plant/RO_Videos/*; do         File1=$filename         Out=${File1:0:${#File1}-16}".mp4"         echo $Out     done     /media/usama/CRUNCH/RO_Plant/RO_Videos/Desal RO 16' Desalination Plants.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/How Desalination Works.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/how membrane filter works with water.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Hydranautics - Spiral Wound Reverse Osmosis Elements.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Industrial Reverse Osmosis Startup Part 1 of 3.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Industrial Reverse Osmosis Startup Part 2 of 3.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Industrial Reverse Osmosis Startup Part 3 of 3.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/MED Desalination Process.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Reverse Osmosis Membrane Replacement Procedure.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Reverse Osmosis or RO System.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/Reverse Osmosis Pressure Vessel.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/RO Process Equipments by R S Engineering, Mumbai.mp4     /media/usama/CRUNCH/RO_Plant/RO_Videos/The BioSand Water Filter.mp4      Now when I add the last piece, it boils down to nothing?               for filename in /media/usama/CRUNCH/RO_Plant/RO_Videos/*; do         File1=$filename         Out=${File1:0:${#File1}-16}".mp4"         echo $Out         mv $filename $Out     done     /media/usama/CRUNCH/RO_Plant/RO_Videos/Desal RO 16' Desalination Plants.mp4     mv: target ‘Plants.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/How Desalination Works.mp4     mv: target ‘Works.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/how membrane filter works with water.mp4     mv: target ‘water.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/Hydranautics - Spiral Wound Reverse Osmosis Elements.mp4     mv: target ‘Elements.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/Industrial Reverse Osmosis Startup Part 1 of 3.mp4     mv: target ‘3.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/Industrial Reverse Osmosis Startup Part 2 of 3.mp4     mv: target ‘3.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/Industrial Reverse Osmosis Startup Part 3 of 3.mp4     mv: target ‘3.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/MED Desalination Process.mp4     mv: target ‘Process.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/Reverse Osmosis Membrane Replacement Procedure.mp4     mv: target ‘Procedure.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/Reverse Osmosis or RO System.mp4     mv: target ‘System.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/Reverse Osmosis Pressure Vessel.mp4     mv: target ‘Vessel.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/RO Process Equipments by R S Engineering, Mumbai.mp4     mv: target ‘Mumbai.mp4’ is not a directory     /media/usama/CRUNCH/RO_Plant/RO_Videos/The BioSand Water Filter.mp4     mv: target ‘Filter.mp4’ is not a directory


title: Problems installing Oracle 11g XE in Fedora 20 - No apex access, not network access

text: I need to setup a temporary Oracle XE database on a virtual machine to work as a server, so I choose Feroda as Oracle mainly support RedHat. So, this is what I did: a) Downloaded newest version of Fedora and installed it. Now I have Fedora 20 installed. b) Once in Fedora, I had downloaded `oracle-xe-11.2.0-1.0.x86_64.rpm.zip` and unzipped it. c) I had added my node to `/etc/hosts` (as `127.0.0.1` `oracleserver`) d) Run `# rpm -ivh downloads/oracle-xe-11.2.0-1.0.x86_64.rpm` e) Executed `/etc/init.d/oracle-xe configure` f) Choose all default (`8080` as HTTP port, `1521` for listener, my password and start on boot) g) Run `. ./u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh` h) Then sqlplus system and them `EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);` Sqlplus is running fine, but I have 2 problems: 1) When I go in Firefox and run "`localhost:8080`", it asks for the login for XDE and APEX. After I enter the login credentials (SYSTEM + password) the browser keeps loading indefenetely the page showing a blank page. So no access do APEX at all. 2) I cannot access Oracle from other nodes on network, either by the browser (like `192.168.0.174:8080` or `192.168.0.174:8080/apex` doesn´t work), or by SQLPLUS `(sqlplus SYS/pass@192.168.0.174)` I have triple checked the listener and it´s up and running. Also the database. I had tried several stuff, and had to reinstall it all 3 times, but until now no solution at all. I´m fighting that for 2 days now. So, how can I make ORACLE live to my network/browsers ? **[SOLVED]** Problem ALL related to firewall settings. No Oracle issue at all. I was using the wrong firewall profile. Opened 8080 and 1521 ports and all fine now.


title: Patching linux kernel fails?

text: From what I understand, I can easily upgrade my kernel by applying patches to it, opposed to recompiling the kernel every time. I'm trying to go from kernel 3.2.51 to 3.2.54 by applying all the patches in between. I'm trying to patch my 3.2.51 kernel (I downloaded it from `www.kernel.org` and compiled it myself) to 3.2.52. When I run this command (in the source directory `/usr/src/linux-3.2.51`):               $ gzip -dc /root/patch-3.2.52.gz | patch -p1      I get this error:               patching file Documentation/HOWTO     Reversed (or previously applied) patch detected!  Assume -R? [n]           Apply anyway? [n]      And it rejects all the changes. Can someone explain what I'm doing wrong?


title: Open window maximised on X startup

text: I have a .xsession script. I am opening a gnome-terminal in background. I would like to open it maximised. I use Cinnamon as window manager. I do understand usually window manager is responsible for resizing client X applications when maximise button is clicked. I want to know whether there is any way to achieve this.               ~$ cat .xsession     google-chrome > /dev/null 2>&1 &     gnome-terminal &     gnome-session --session cinnamon


title: Difference between two types of shell arithmetic

text: What is the difference between the following two shell arithmetic commands:               echo $[ $var1 - 1 ]     echo $(( $var1 - 1 ))      Assuming var1 = 5 for example.


title: tshark dump only when string is matched

text: I'm working on a web capture script where I only want to dump the traffic if the HTML body or URL contains a string defined in a .txt file. Here is my tshark command which dumps `src ip dest url` (HTTP host) which works like a charm.               tshark -i eth1 'port 80' -R 'http.request' -T fields \        -e frame.number -e frame.time -e ip.src  -e http.host \        -e http.request.uri -E header=y -E separator=, \        -E quote=d -E occurrence=f       Now here is where im stuck. How do I go about only triggering this dump when a user browses to lets say hidemyass or the HTML body contains key words like porn?


title: How do I set my monitor to widescreen mode in Mint when it doesn't recognize widescreen capability?

text: My computer is a former laptop from which I removed the screen. The graphics card is an ATI Radeon of some kind. I have it plugged into a small TV via VGA cable, but Mint still thinks I have the original laptop screen too. The external monitor displays in 1024x768 resolution, but when I use game consoles, and the two times I tested Mageia Linux, it displays in 1280x800 **[EDIT: I forgot, it was only the first time with Mageia 1, Mageia 2 didn't suport it]**. This resolution is also available for the laptop screen. I want to get the widescreen display to work for the computer, but Mint isn't allowing it. I've been looking at this page: https://wiki.ubuntu.com/X/Config/Resolution xrandr -q outputs this (not including the part below about the laptop monitor):               $ xrandr -q     Screen 0: minimum 320 x 200, current 1024 x 768, maximum 8192 x 8192     VGA-0 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm        1024x768       60.0*         800x600        60.3     56.2          848x480        60.0          640x480        59.9        I ran `cvt`               $ cvt 1280 800 60     # 1280x800 59.81 Hz (CVT 1.02MA) hsync: 49.70 kHz; pclk: 83.50 MHz     Modeline "1280x800_60.00"   83.50  1280 1352 1480 1680  800 803 809 831 -hsync +vsync      Then I copied that to xrandr, but xrandr didn't like it. When I sudo tried again it gave me this:               X Error of failed request:  BadName (named color or font does not exist)       Major opcode of failed request:  140 (RANDR)       Minor opcode of failed request:  16 (RRCreateMode)       Serial number of failed request:  25       Current serial number in output stream:  25      Does anybody know how to fix this?


title: When does the order of arguments matter?

text: In bash, I am not sure if my observation is correct. For most commands, option-like arguments, i.e. arguments that begin with `\--abc` or `-a`, can be anywhere in the list of arguments to the command, while other arguments have some fixed position in the list of arguments. I was wondering if there are some written/unwritten rules about this? Thanks!


title: Have to run Repair-Boot after booting windows

text: I have grub installed as my boot loader for dual booting windows 8 and Ubuntu. It works fine as long as I'm only booting Ubuntu but as soon as I boot windows, something stops working. The next time I reboot my machine, there is no grub menu, nothing. My BIOS seems to think there is no operating systems installed. I am working around this using the bootable USB I used to install Ubuntu to run repair-boot. After running it, I have the grub menu back and I'm back at the start. I know very very little about anything Linux so please keep it simple.


title: Installing different distro without losing /home

text: I have a 2 year old laptop with Linux Mint 13 on it. Recently I've been having some problems with it (computer freezing, my settings suddenly disappearing and more) so I've been thinking about installing a new distro. I was recommended Xubuntu and I want to try it. Is is possible to install it instead of my Mint, but keeping (it becoming my new /home) /home directory? I have lots of files in there, including various IDEs for various programming languages (my /home takes about 100 GB) and I'm 100% sure that if I decided to back up everything I would sooner or later realize that I forgot to backup something.


title: How to install drivers for intel GMA 3600 intergrated graphics system?

text: I am currently using crunchbang 11 32bit, on a laptop with Atom D2500/GMA3600. Does anyone know how to install a more modern driver - rather than the gma500? Is this even possible?


title: Debian/kfreebsd VirtualBox guest additions

text: I'm trying and failing to install the virtualbox guest additions for a unstable Debian/kfreebsd virtual machine running in VirtualBox. Without the guest additions, the idle process pegs one of my CPU cores. I've tried to install the `virtualbox-guest-additions-dkms` package, but that depends on `virtualbox-guest-utils` which apparently isn't packaged for Debian/kfreebsd. I've grabbed the `virtualbox-guest-additions-iso` package and tried to compile that but no luck there either, even with the kernel-headers installed. I've also tried install `kfreebsd-9.2-source` and compile the iso package and the source package that way but I only get "no targets found". VirtualBox does not come with FreeBSD guest additions, but there are guest additions for FreeBSD in the `emulators/virtualbox-ose-additions` port on FreeBSD. I'm looking for the equivalent of this port on Debian. Anyone have any thoughts?


title: Ubuntu use compiled package instead of apt-get

text: I have a compiled binary specifically sun Oracle java that I am using instead of Ubuntu`s apt-get version of java ( what ever it may be ). I am installing an apt-get package ( maven ) and would like apt-get to use the version of java I have manually installed I can not install any more packages or tools on the system. I have what ever Ubuntu LTS 12.04 comes with.


title: Setting programming font in RHEL 5 + gvim

text: I am working on RedHat RHEL5. I want to change the font in GVIM. The only font format that my GVIM accepts is               *-courier-medium-r-normal-*-*-140-*-*-m-*-*      It refuses to use `Courier\ New` or `Courier_New` names. The default font is ugly and I wanted to change it to something prettier, like `monospace` font that I use in my terminal, but `xfontsel` does not show his font. `set guifont=*` neither works. My questions are:   1. How to "convince" GVIM to accept other system fonts   2. Or, how to install additional fonts so they can be delivered to GVIM in `-*-*-*-` Morse code format **Edit** `:set guifont=*` gives error:               Font "*" is not fixed-width     Invalid font(s): guifont=*      To make the font selectable with `xfontsel`, additionally I had to use this trick:               xset fp+ ~/.fonts/  # maybe unnecessary     xset fp rehash     fc-cache


title: Path independent shebangs

text: I have a script that I want to be able to run in two machines. These two machines get copies of the script from the same git repository. The script needs to run with the right interpreter (e.g. `zsh`). Unfortunately, **both** `env` and `zsh` live in different locations in the local and remote machines: ### Remote machine               $ which env     /bin/env          $ which zsh     /some/long/path/to/the/right/zsh      ### Local machine               $ which env     /usr/bin/env          $which zsh     /usr/local/bin/zsh      How can I set up the shebang so that running the script as `/path/to/script.sh` always uses the `Zsh` available in `PATH`?


title: Booting Fedora in rescue mode

text: I have created a new Fedora live USB with the intention of booting into rescue mode and fixing the bootloader, so that I can dualboot win7 and Fedora 20. However, I do not understand how I am to boot into rescue mode, seeing as the installation boot prompt is not shown as described by the guide, I am taken directly to the installation process. Pressing tab when given the option to run Fedora Live allows me write stuff in a terminalish thingy, but writing               linux rescue      simply starts the Fedora Live as usual. Some sources claim that I need the DVD, not the LiveUSB. I will try this shortly.


title: Extract specific folder from a tar.gz

text: I know this question was previously asked on this site before like here 1 and here 2 but no success for me. I want to extract the `Measures` folder from my S012011_csv.tar.gz zipped file. If I do `tar -ztvf file.tar.gz` to see the content, you can see the folder directory structure: `global//scratch//chamar//data//S012011_csv/Measures/file1.csv` `global//scratch//chamar//data//S012011_csv/Measures/file2.csv` and so on (yes there are `//` and may be the real issue here). I only want to extract the subfolder `Measures` under folder `S012011_csv` in the current directory of the `.tar.gz` folder. I have tried all these options but no success:               tar -xvzf S012011-v41_csv.tar.gz --strip=6 ./global//scratch//chamar//book//S012011-v41_csv/Mearsures/*          tar -xvzf S012011-v41_csv.tar.gz --strip=6 global//scratch//chamar//book//S012011-v41_csv/Mearsures/*          tar -xvzf S012011-v41_csv.tar.gz --strip=6 global/scratch/chamar/book/S012011-v41_csv/Mearsures/*          tar -xvzf S012011-v41_csv.tar.gz global/scratch/chamar/book/S012011-v41_csv/Mearsures/*      What am I doing wrong? (I've asked this question on SuperUser.com but I think this site is more appropriate)


title: Dropbox on both Windows and Ubuntu 12.04.3 LTS

text: I have Dropbox installed on both Windows 7 and Ubuntu 12.04.3 LTS and there are two separate folders that are being synchronized so there is some waste of disk space.   I would like to have only one Dropbox folder to be synchronized and would like to see a link to this particular folder both on Windows and Ubuntu desktops. The problem is that my original Dropbox folder (the larger and complete one) is on a separate partition that is not mounted by Ubuntu at startup. How can I have this partition automatically mounted without me interfering ? Furthermore, if the Dropbox folder on Ubuntu is deleted will it be reflected to my Dropbox account and the online synchronized files? How could this be prevented? I would like to get help on this matter.


title: Strange message at Debian login. What does it mean?

text: In an attempt to learn more on the command-line I added Debian-7.4-Standard to my Acer-Aspire-One laptop. I am not sure as to what I did exactly, but after I managed to install the non-free firmware and manually installed network- manager to get a wired connection that worked well enough to use `apt-get update` and `apt-get dist-upgrade`, I started to see a strange message on my login prompt after I had booted into my Debian OS. I wrote out a copy of it and it looks like this on my login prompt:               Debian GNU/Linux 7 debian tty1          debian login: [   17.63024] ieee80211 phy0: brcm_ops_config: change monitor mode: false (implement)     [   17.630399] ieee80211 phy0: brcms_ops_config: change power-save mode: false (implement)     [   17.631562] ieee80211 phy0: brcms_ops_bss_info_changed: qos enabled: false (implement)      What does this mean? Is this a problem I need to worry about? If I hit enter the login prompt returns to just the usual `debian login:` prompt and I can login normally. * * * **Update:** I just noticed that when there is no WiFi signal my login prompt acts in the normal way. I am only seeing these messages when a WiFi signal is available.


title: Is installing Kali on LiveDVD advisable?

text: I want to install the Kali penetration testing software on a DVD or a CD as a LiveDVD / LiveCD. Google turned up results on installation for a Usb and hard drive / disk installation, but nothing for LiveCD/DVD. One site said that LiveDVD installation isn't suggested for Kali, because of installation problems. Will installing Kali on a DVD or CD give me anything serious to worry about? What about installing the image on a DVD / CD and booting from that (not sure of that's similar or different from LiveCD/DVD)? And if I do install it, what problems will it give me?


title: Tricks for avoiding bash history logging?

text: What are some tricks for avoiding bash history being logged in a fascist logging environment that does not involve modifying `.bash_rc` or deleting content from within the history file?


title: Temporarily suspend bash_history on a given shell?

text: Is there a way to temporarily suspend history tracking in bash, so as to enter a sort of "incognito" mode? I'm entering stuff into my terminal that I don't want recorded, sensitive financial info.


title: How to Lookup the values of an index values from a big data file?

text: I have a data file (data_array.txt in the example) and index file, index.txt, at which I want to extract the data from the data file that have the same ID in the index file and store in to a new file, Out.txt. I also want to put NA ,in the Out.txt, for those ID's that have no value in the data file. I know how to do it for one column. But my data has more than 1000 columns (from 1 to 1344). I want you help me with a script that can do it faster. My data file, index id and proposed out put as follows. data_array.txt               Id  1   2   3   .   .   1344     1   10  20  30  .   .   -1     2   20  30  40  .   .   -2     3   30  40  50  .   .   -3     4   40  50  60  .   .   -4     6   60  60  70  .   .   -5     8   80  70  80  .   .   -6     10  100 80  90  .   .   -7      index.txt               Id     1     2     8     9     10      Required Output is Out.txt               Id  1   2   3   .   .   1344     1   10  20  30  .   .   -1     2   20  30  40  .   .   -2     8   80  70  80  .   .   -6     9   NA  NA  NA          NA     10  100 80  90  .   .   -7


title: What is this .gtkrc file?

text: I was going through Tim Pope's dotfiles and I happened to notice that he had a `.gtkrc` file. What does this configuration file do? And how can I make one of those?


title: Thunar using no thumbnailers except built in fonts and images

text: Linux From Scratch SVN-20111010 Beyond Linux From Scratch Version 2011-11-16 Xfce4 4.8.0 I can't get any thumbnails in Thunar beyond fonts and basic images. After fighting with this I've gone back and recompiled what seems to be the critical bits. In this order... **Tumbler-0.1.22** :               $> ./configure --prefix=/usr       <snip>       * GdkPixbuf thumbnailer plugin:                     yes       * FreeType font thumbnailer plugin:                 yes       * JPEG thumbnailer plugin with EXIF support:        yes       * Video thumbnailer plugin using ffmpegthumbnailer: yes       * Video thumbnailer plugin using GStreamer:         yes       * PDF/PS thumbnailer plugin using poppler:          yes       * Freedesktop.org cache plugin:                     yes     $> make && make install      **thunar-volman-0.6.0** :               $> ./configure --prefix=/usr       <snip>       * Mount notifications: yes       * Debug Support:       minimum     $> make && make install      **thunar-vfs-1.2.0** :               $> ./configure --prefix=/usr       <snip>       * Operating system support:  generic       * D-BUS support:             yes       * File System Monitor:       none (???)       * GNOME Thumbnailers:        yes       * Startup Notification:      yes       * Volume Manager:            none (???)       * Debug Support:             minimum     $> make && make install      **thunar-thumbnailers-0.4.1** :               $> ./configure --prefix=/usr       <snip>       config.status: creating eps-thumbnailer/Makefile       config.status: creating tex-thumbnailer/Makefile       config.status: creating ps-thumbnailer/Makefile       config.status: creating raw-thumbnailer/Makefile       config.status: creating fig-thumbnailer/Makefile       config.status: creating agr-thumbnailer/Makefile       config.status: creating ffmpeg-thumbnailer/Makefile       config.status: creating ogg-thumbnailer/Makefile       config.status: creating svgz-thumbnailer/Makefile       config.status: creating pdf-thumbnailer/Makefile       config.status: creating dvi-thumbnailer/Makefile       config.status: creating odf-thumbnailer/Makefile       config.status: creating xcf-thumbnailer/Makefile       config.status: creating psd-thumbnailer/Makefile       config.status: creating mime/Makefile     $> make && make install      **Thunar-1.3.0.tar.bz2** :               $> ./configure --prefix=/usr       <snip>       Build Configuration:       * D-BUS support:                      yes       * GIO UNIX features:                  yes       * Startup Notification:               yes       * GUDev (required for thunar-volman): yes       * Mount notification support:         yes       * Debug Support:                      minimum       * Documentation:                      yes (in tarball)       Additional Plugins:       * Advanced Properties:                yes       * Simple Builtin Renamers:            yes       * Trash Panel Applet:                 yes       * User Customizable Actions:          yes       * Wallpaper support:                  yes     $> make && make install      **REBOOT!** Then I do...               $> rm ~/.cache/Thunar/thumbnailers.cache     $> rm -r ~/.thumbnails     $> Thunar -q     $> /usr/lib/thunar-vfs-1/thunar-vfs-update-thumbnailers-cache-1      The thumbnailers.cache is rebuilt, but still no thumbnails beyond fonts and basic images. Let's look at GIMP .xcf files...               $> cat /usr/share/thumbnailers/xcf-thumbnailer.desktop           [Desktop Entry]     Version=1.0     Encoding=UTF-8     Type=X-Thumbnailer     Name=XCF Thumbnailer     MimeType=image/x-xcf;     X-Thumbnailer-Exec=/usr/libexec/xcf-thumbnailer %i %o %s               $> strings .cache/Thunar/thumbnailers.cache | grep xcf     image/x-xcf     /usr/libexec/xcf-thumbnailer %i %o %s      If I remove the xcf thumbnailer desktop file and rebuild the cache the xcf entries disappear from the thumbnailers cache file, so it is seeing the thumbnailers in `/usr/share/thumbnailers`. In a terminal I can call the X-Thumbnailers-Exec line directly...               $> /usr/libexec/xcf-thumbnailer test.xcf test.png 100      ...It calls convert, and I get a 100px thumbnail image output into the current directory. All the pieces seem to be in place, but Thunar doesn't seem interested in using any of the installed thumbnailers, except it's native support for basic images and fonts. What am I missing? **UPDATE 15:15 Nov. 23, 2011:** I've made some progress. This is definitely an LFS configuration issue. Firstly, it seems XDG directories plays a part. Make sure that the XDG user directories are configured and working properly. Second DBUS sessions need to be working and started properly with `SESSION_MANAGER`, `DBUS_SESSION_BUS_ADDRESS` and `DBUS_SESSION_BUS_PID` exported to the environment. Third, and this is probably specific to my install, I rebuilt tumbler with `\--disable-gstreamer-thumbnailer`. At least in my case this forces tumbler to use the ffmpegthumbnailer. I won't say that this is an issue with tumbler because I know my gstreamer is flaky, and needs further attention. This is where I'm at... tumbler is working. I'm getting thumbnails for fonts and basic images, plus videos and PDFs, using ffmpegthumbnailer and poppler respectively, I believe. I now need to either get tumbler to recognize the thumbnailers from thunar-thumbnailers, or find out how to otherwise add support for XCF and PSD files to tumbler, since that was what I was initially seeking.


title: Delete zsh auto completion suggestion

text: When I use tab-completion in zsh, the shell suggests me files and I discover that I'm in the wrong directory. How can I just delete the suggestion instead of backspace'ing it?


title: How do we know what applications are installed in Linux?

text: I'm trying to understand the following in Linux. In windows we have the services that run or "startup". When we install an application it could be installed as a service so that it starts automatically. But if an application is not installed as a service we usually can see it in the _Start_ -> _Programs menu_. So we know what applications are installed. In Linux what is the equivalent? I understand that the equivalent services are in `/etc/init` where the services start/stop. But I assume that if I install a package it does not necessarily create a startup script in `/etc/init` right? So how does one know what has been installed and is available in Linux (like we can in Windows from _Start_ -> _Programs_ )? **Note:** I'm asking about CLI mode. I guess in a desktop version one can see the relevant icons in the various menus (e.g in Kubuntu from _Application_ -> _Internet_ -> _Firefox_ ).


title: Is there a system call to bind a file descriptor directly into another?

text: A read() & write() loop would probably be as good as what I'm looking for, but nevertheless is anything like that around or is it impossible because of an obstacle I didn't envisage ? I'm curious


title: How to get system to shutdown when Xorg is quit?

text: I installed `nodm`, so that Debian starts Xorg and a window manager immediately after booting, without requesting any password and without a login. How can I similarly setup Debian to shutdown the system automatically, without password prompt, whenever the window manager and Xorg are quit?


title: Help compiling a Linux driver for a TV card stack

text: I've been trying to get my Raspberry Pi to work with one of two TV Cards that I have available on me. Unfortunately I live in Hong Kong where due to the digital broadcast standard, leaves me with few choices of devices. Neither of which seem to want to play ball. For obvious reasons, both are USB. I have "determined" that one uses a RTL2836U chipset. Whilst the other is using a LME 2510C with a Maxim 2165E tuner and 8G75-A1 demoduator. I had been focusing my efforts to efforts on the RTL2836U and I just compiled some drivers (with the VID/PID added) and Linux seemed to load the modules, but then unloaded it due to an error. Any help would be appreciated. dmesg                   dvb_hdhomerun: disagrees about version of symbol dvb_dmxdev_init         dvb_hdhomerun: Unknown symbol dvb_dmxdev_init (err -22)         dvb_hdhomerun: disagrees about version of symbol dvb_register_adapter         dvb_hdhomerun: Unknown symbol dvb_register_adapter (err -22)         dvb_hdhomerun: disagrees about version of symbol dvb_dmxdev_release         dvb_hdhomerun: Unknown symbol dvb_dmxdev_release (err -22)         dvb_hdhomerun: disagrees about version of symbol dvb_frontend_detach         dvb_hdhomerun: Unknown symbol dvb_frontend_detach (err -22)         dvb_hdhomerun: disagrees about version of symbol dvb_unregister_frontend         dvb_hdhomerun: Unknown symbol dvb_unregister_frontend (err -22)         dvb_hdhomerun: disagrees about version of symbol dvb_register_frontend         dvb_hdhomerun: Unknown symbol dvb_register_frontend (err -22)         dvb_hdhomerun: disagrees about version of symbol dvb_unregister_adapter         dvb_hdhomerun: Unknown symbol dvb_unregister_adapter (err -22)         bcm2708 watchdog, heartbeat=10 sec (nowayout=0)      tail -f /var/log/kern.log               Mar  1 03:14:06 raspbmc kernel: dvb_hdhomerun: Unknown symbol dvb_dmxdev_release (err -22)     Mar  1 03:14:06 raspbmc kernel: dvb_hdhomerun: disagrees about version of symbol dvb_frontend_detach     Mar  1 03:14:06 raspbmc kernel: dvb_hdhomerun: Unknown symbol dvb_frontend_detach (err -22)     Mar  1 03:14:06 raspbmc kernel: dvb_hdhomerun: disagrees about version of symbol dvb_unregister_frontend     Mar  1 03:14:06 raspbmc kernel: dvb_hdhomerun: Unknown symbol dvb_unregister_frontend (err -22)     Mar  1 03:14:06 raspbmc kernel: dvb_hdhomerun: disagrees about version of symbol dvb_register_frontend     Mar  1 03:14:06 raspbmc kernel: dvb_hdhomerun: Unknown symbol dvb_register_frontend (err -22)     Mar  1 03:14:06 raspbmc kernel: dvb_hdhomerun: disagrees about version of symbol dvb_unregister_adapter     Mar  1 03:14:06 raspbmc kernel: dvb_hdhomerun: Unknown symbol dvb_unregister_adapter (err -22)     Mar  1 03:14:18 raspbmc kernel: bcm2708 watchdog, heartbeat=10 sec (nowayout=0)      Then on insert of the dongle               Mar  1 03:21:07 raspbmc kernel: usb 1-1.3: new high-speed USB device number 5 using dwc_otg     Mar  1 03:21:07 raspbmc kernel: usb 1-1.3: New USB device found, idVendor=1f4d,idProduct=689b     Mar  1 03:21:07 raspbmc kernel: usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3     Mar  1 03:21:07 raspbmc kernel: usb 1-1.3: Product: USB Device     Mar  1 03:21:07 raspbmc kernel: usb 1-1.3: Manufacturer: realtek     Mar  1 03:21:07 raspbmc kernel: usb 1-1.3: SerialNumber: 00000005     Mar  1 03:21:07 raspbmc kernel: WARNING: You are using an experimental version of the media stack.     Mar  1 03:21:07 raspbmc kernel:         As the driver is backported to an olderkernel, it doesn't offer     Mar  1 03:21:07 raspbmc kernel:         enough quality for its usage in production.     Mar  1 03:21:07 raspbmc kernel:         Use it with care.     Mar  1 03:21:07 raspbmc kernel: Latest git patches (needed if you report a bug to linux-media@vger.kernel.org):     Mar  1 03:21:07 raspbmc kernel:         ed72d37a33fdf43dc47787fe220532cdec9da528 [media] media: Add 0x3009 USB PID to ttusb2 driver (fixed diff)     Mar  1 03:21:07 raspbmc kernel:         b9e2afff1e6b36d05a0e12b6114eb0aaf8949c09 [media] rtl28xxu: Add USB IDs for Compro VideoMate U620F     Mar  1 03:21:07 raspbmc kernel:         676fa7d4c9fd141a31cba2870e592a597c0bb07f [media] em28xx: add usb id for terratec h5 rev. 3     Mar  1 03:21:07 raspbmc kernel: usb 1-1.3: dvb_usb_v2: found a 'MYGICA D690U' in warm state     Mar  1 03:21:07 raspbmc kernel: usbcore: registered new interface driver dvb_usb_rtl28xxu     Mar  1 03:21:10 raspbmc kernel: usb 1-1.3: dvb_usb_v2: 'MYGICA D690U' error while loading driver (-110)     Mar  1 03:21:10 raspbmc kernel: usb 1-1.3: dvb_usb_v2: 'MYGICA D690U' successfully deinitialized and disconnected      I don't know...does any of that help? Aptitude is showing me these modules               v   linux-headers     p   linux-headers-2.6-mx5     p   linux-headers-2.6-omap     p   linux-headers-3.2.0-4-all     p   linux-headers-3.2.0-4-all-armhf     p   linux-headers-3.2.0-4-common     p   linux-headers-3.2.0-4-rpi     i   linux-headers-generic     p   linux-headers-mx5     p   linux-headers-omap     p   linux-headers-vexpress     v   linux-kernel-headers


title: How to create a patch file for new source code

text: I am trying to do a mini code review for _new_ source code that I have in a folder. The code is not in any kind of version control. Is it possible to create a patch file from this so I can post it for review? Every incantation of patch I've seen fits an oldCode/newCode pattern.


title: Job IDs and their meaning/reference

text: Using Red Hat, I sent few jobs to a cluster and got "job IDs" in return. Using `qstat` I can see only one is running, one was canceled and the rest are still in the queue. I wrote something like this:               echo "sh blahblahblah.sh" ǀ walltime=12:00:00, mem=4gb      and got something like this: `1234567.someletters` I can remove a job by `qdel` and type the number. Shouldn't I be able to know what each ID refers to? How can I see the command I typed for each job?


title: How can I get vsftpd version into shell variable?

text: I want to get vsftpd version into shell variable. I can get it to console with ease:               # vsftpd -version     vsftpd: version 2.2.2      Also I can get a lot of other info into variable:               # i=`bash --version 2>&1 | head -n1`; echo "=$i=";     =GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)=      (please note output is between "=" signs). This simple way does not work with vsftpd:               # i=`vsftpd -version 2>&1`; echo "=$i=";     vsftpd: version 2.2.2     ==      Please note $i is "" here. What am I doing wrong?


title: Would you say FreeBSD is more stable than Linux?

text: This question is a sequel or a parallel question to my previous one: Unity problems & Searching for a good WM I am wondering whether my personal assumptions that FreeBSD is indeed more stable and more tightly controlled, less chaotic, more organized than Linux is actually true. (I don't want to cause a debate, only if its a healthy one) I'm a front-end developer wanting a STABLE, COHERENT and mature environment working mostly with:   1. browsers   2. fancy editors (IDEs) (aptana?)   3. other local dev tools such as a webserver, a DB, a deployment tool and so on.. The thing is I am mostly using *nix in order to experiment/learn about stuff that I might use in a professional level such as the deployment of Versioning systems, the customization of web servers and so on... Would using FreeBSD for all that limit me, in the sense that it doesn't enjoy the popularity of Linux/Ubuntu therefore there might be less packages (ports?) available, or the versions of these apps would be less cutting-edge than the Linux ones?


title: What is the resolution of a scanned pdf file?

text: 1. I scanned some documents using a Canon scanner, with resolution specified to be 300.  I saved it into a pdf file Then I checked the resolution of the pdf file, by ImageMagick              identify -verbose my.pdf      In the output it returns, for every page it says              Resolution: 72x72      which is not 300 which i specified with the scanner earlier. Why is it different? Note: The same problem if I saved it as a jpg file, and if I use a Xerox workCenter.   2. When I use Adobe Premium Pro to OCR my pdf file, it lets me specify which resolution that it will downsample the pdf file to from several options (72, 300, 600). If I don't want the OCRed pdf file to have less resolution than the original pdf file, how shall I find out the resolution of the pdf file, and which resolution option shall I choose for OCR in Adobe Premium Pro? Thanks.


title: Allow non-superusers to mount any filesystem

text: Is it possible to allow some particular users (e.g. members of a group) to mount **any** filesystem without superuser privileges on Linux? (Another question might have been "in what ways a user can harm a system by mounting filesystems?")


title: What is the difference between a tar of a complete filesystem and an image?

text: I can create an image of a filesystem, or I can create a tar-file containing all of it. Is an image therefore something like a tar-archive? Or do these two types differ in more ways?


title: How can I force the use of a specific binary when running a script

text: How can I force a specific binary to be used when executing a bash script? I have a bash script which uses the "php" binary. There are several php versions on my computer. The main php binary, as configured via the PATH variable, is not the one to be used in this case. Normally the script will be executed like this:               ./script.sh      I need something like this:               php=/usr/bin/php ./script.sh      NOTE: It is not an option to temporary change the PATH variable just for this command, because this will affect other dependencies. Hardcoding it in the script is also not an option, because the script is used by multiple people. So when other people execute the script it should just use the main php binary as specified in the PATH variable. I don't want it to be accessible via a variable. I actually want to specify the exact location to look for the binary. Just like it would normally do by using PATH, only now for one single binary with the absolute path to it. If this script calls another script, that second script also needs to use that php version. –


title: Setting up a LAN on CentOS

text: The instructions for setting up a LAN, which I assume would allow me to create a sub-domain on my VPS, are the following using the command-line on CentOS: > Using sudo, create the configuration file /etc/sysconfig/network- > scripts/ifcfg-eth0:0 with the following: >   >   >     DEVICE=eth0:0 >     BOOTPROTO=none >     ONPARENT=yes >     TYPE=Ethernet >     IPADDR=$ADDITIONAL_IP$ >     NETMASK=255.255.255.0 >     GATEWAY=XXX.XXX.XXX.1 >     NAME=eth0:0 >   If you are using a LAN address, it doesn't require a gateway address and would use 255.255.0.0 for the netmask and then you would restart apache. So for LAN IP insert `IPADDR=$some ip$`? Is `GATEWAY` left as is or deleted? How do I state the name of my subdomain? After restart I am getting this :                -bash-4.1# /etc/init.d/network restart     Shutting down interface eth0:                              [  OK  ]     Shutting down loopback interface:                          [  OK  ]     Bringing up loopback interface:                            [  OK  ]     Bringing up interface eth0:  /etc/sysconfig/network-scripts/ifup-aliases: line 174: ipseen_eth0myLAN_IP$=ifcfg-eth0:0: command not found     error in ifcfg-eth0:0: already seen ipaddr eth0myLAN_IP$ in $


title: iptables doesn't forward from WAN to virtual machines

text: I have a machine working like gateway and have two network interfaces:   * `eth0` LAN : 192.168.1.0/24   * `eth1` WAN : `XXX.XXX.XXX.XXX` (my public ip) This machine has 3 VM guest over virtualbox. All have bridged network and have static IP given by our DNS. I have the following iptables               *filter         -A FORWARD -i eth1 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT         -A FORWARD -i eth0 -o eth1 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT          # Rules a webserver VM     *nat         -A POSTROUTING -o eth1 -j MASQUERADE         -A PREROUTING -d XXX.XXX.XXX.XXX/32 -i eth1 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.1.100         -A POSTROUTING -s 192.168.1.100/32  -j SNAT --to-source XXX.XXX.XXX.XXX      I can access the VMs from my LAN, but when I try to access them from the WAN it doesn't work. What is wrong?