create a tunnel to a local server

Using a VPN, I am connected through SSH on a distant Ubuntu Computer. From this computer, I can browse using telnet through a local server (192.168.x.x). Is there any way, from the terminal or Firefox, to configure my browser to create a king of SSH tunnel so then I would be able to browse the 182.168.X.X directly in a GUI browser? **edit:** Example: From my home (`127.0.0.1`), using a VPN, I connect myself through SSH computer: `root@distant-server.com -p 5555`. It's ip is `192.168.151.2` Once connected, I can browse to an intranet server as:               telnet 192.168.151.100 80     GET /index.html HTTP/1.0      What I do, is to configure something in my `127.0.0.1` Firefox GUI, so that I would be able to browse directly to 192.168.151.100. **edit 2:** For a strange reason, The problem has been fixed when I used SOCKS v4 instead of v5.


How can I start the python SimpleHTTPServer on port 80?

I am using this command on Ubuntu but it is starting on port 8080 and I don't have another server running so I'd like it to start on port 80. I saw ways that you could set up a bash script to do something like this, but isn't there a command line flag or something simpler to specify the port?               python -m SimpleHTTPServer


cd ~ works in one terminal session but not another (no error reported)

I have two PuTTy sessions open to the same host. One one `cd ~` gets me back to my home dir fine and on another one it doesn't -- stays in the same dir. I have never seen something like this happen. Any idea why this might be happening? OS: SunOS 5.10


Is it useful to setup RAID0 on laptop?

I have a Dell laptop, which I am going to replace the CD-ROM hub with a HDD. I am thinking if I setup a **RAID0** on my original HDD and the new HDD, would I have some I/O performance improvement? Theoretically, there will be some improvement. But I would like to know how much it will be? If it just _kinda of improved_ , I don't think it worth the effort. Especially, I need to move my data around to do the converting.


How to update kernel without reboot? (ksplice alternative)

How to update running kernel without reboot? I know about Oracle ksplice but it's not free and it supports only distributions that I don't use. Are there alternatives to ksplice?


Cannot upgrade Scientific Linux to version 6.5

I have been trying to figure out a way to get my Scientific Linux box to upgrade to version 6.5. It's currently 6.4 and everytime I perform a yum update I get an error message (see below!). Can anyone tell me what needs to be done to get past this issue? **Some Stats:**   * Scientific Linux 32 bit - running on Lenovo Thinkpad 430 4GB RAM - 320GB HDD   * No extras or addons at all, just plain install via CD/DVD which was done from around Nov. 2012 error message:               [triton@localhost ~]$ su     Password:      [root@localhost triton]# yum update     Loaded plugins: fastestmirror, refresh-packagekit, security     Loading mirror speeds from cached hostfile      * elrepo: mirror.symnds.com      * elrepo-extras: mirror.symnds.com      * elrepo-kernel: mirror.symnds.com      * epel: mirrors.ptd.net      * epel-source: mirror.cogentco.com      * rpmforge: mirror.rit.edu      * rpmforge-extras: mirror.rit.edu      * sl: ftp.scientificlinux.org      * sl-addons: ftp.scientificlinux.org      * sl-security: ftp.scientificlinux.org     http://dl.atrpms.net/src/el6.4-i386/atrpms/stable/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"     Trying other mirror.     Error: Cannot retrieve repository metadata (repomd.xml) for repository: atrpms-source. Please verify its path and try again     [root@localhost triton]#


Sorting columns from two files with awk

I have two input files               28a39a289906c01159f999a68996091a tom@dong.com     274d1d2c7e931fb55ac0c91dd41f2be7 go@far.com     44d25d3b1b70b240d5058f1be1cef576 person@domain.com     2227a768f6d253b7bf81bb4ecb15b52d person@gmail.com      and               28a39a289906c01159f999a68996091a     274d1d2c7e931fb55ac0c91dd41f2be7     44d25d3b1b70b240d5058f1be1cef576     2227a768f6d253b7bf81bb4ecb15b52d      i'm trying to exclude all the rows in file 1 where file2 and file1 have a matching column 1. md5 suppression. What i could find was `awk 'NR==FNR{a[$1]=$0;next}{print a[$2]}' $1 $2` which i know is pretty close just not sure what i did before to do what i want to do now.


Is zswap eligible to reduce swap IO?

Does zswap compress pages, that are written to the swap device? Is it eligible to reduce swap IO?


Bring hidden Gnome 3 notifications back

I was working with Gnome 3 network settings, and accidentally clicked the "Hide" button on a VPN disconnect notification. Unfortunately, this means whenever my VPN gets disconnected, it doesn't say anything. Is there any way to get this back? I'm thinking deleting my configuration folder should work, but presumably there's an easier way (I hope).


How to create an ad-hoc connection?

I need to make an adhoc connection on Archlinux (netbook used as a wifi repeater), I was using this tutorial to do it on Ubuntu : > At the terminal install execute `sudo apt-get install dnsmasq-base` and then > `sudo apt-get remove dnsmasq` > > Restart the NetworkManager by executing `sudo /etc/init.d/network-manager > restart` > > Left-click on the NetworkManager icon and click "Create New Wireless > Network" > > Name it "UbuntuAdhoc" and set the encryption to "WEP40" > > Connect PC2 using Ad-Hoc to the PC1 The main problem is `dnsmasq-mase` is missing but `dnsmasq` is present on Archlinux. Here's what I found that could be helpful: https://wiki.archlinux.org/index.php/Dnsmasq https://bbs.archlinux.org/viewtopic.php?id=6431               pacman -S dnsmasq     mkdir /etc/dnsmasq     mv /etc/resolv.conf /etc/dnsmasq     cd /etc     echo nameserver 127.0.0.1 > resolv.conf     mv rc.conf rc.conf.save      sed  '/DAEMON/s/network/network dnsmasq.local/g' rc.conf.save>rc.conf     cd rc.d     sed  '/-z/s/dnsmasq/dnsmasq -r /etc/dnsmasq/resolv.conf /g' dnsmasq>dnsmasq.local     /etc/rc.d/dnsmasq.local start     /etc/rc.d/network restart      I have a problem with:               sed  '/-z/s/dnsmasq/dnsmasq -r /etc/dnsmasq/resolv.conf /g' dnsmasq>dnsmasq.local      It say that's the `../s/..` is not a known option. It seems to have broken the `networkmanager` applet on xfce4. I blacklisted the dnsmasq stuff in `/etc/rc.conf`, it will be to repair in the progress, I can't use my wifi connection for now but my lan will do for now ... I also checked about various ways of using a adhoc connection, as my girlfriend use my PC and I travel sometimes, I need a graphical way to make the adhoc connection. I checked my favorite software `wicd` but it cannot make multiple connections and adhoc. It said that the version 2.0 maybe would but for now, the only alternative is `networkmanager`. So, how I do it?


Absolutely cannot get FTP access after adding many rules to iptables in CentOS5

I'm a complete noob and am just having the worst time trying to get FTP access to the server. I want to keep the firewall enabled. **Edit** : Updated the iptables information. I have the following rules enabled:               Chain INPUT (policy DROP 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination     58398 7869K RH-Firewall-1-INPUT  all  --  *      *       0.0.0.0/0            0.0.0.0/0         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:22         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:21         0     0 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0         0     0 DROP       tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:!0x17/0x02 state NEW         0     0 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:21 state NEW          Chain FORWARD (policy DROP 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination         0     0 RH-Firewall-1-INPUT  all  --  *      *       0.0.0.0/0            0.0.0.0/0          Chain OUTPUT (policy DROP 5841 packets, 350K bytes)      pkts bytes target     prot opt in     out     source               destination      4046  299K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED         2   114 ACCEPT     all  --  *      lo      0.0.0.0/0            0.0.0.0/0      2935  196K ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:53 state NEW       170 10200 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:21 ctstate NEW,ESTABLISHED         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:20 ctstate NEW,ESTABLISHED          Chain RH-Firewall-1-INPUT (2 references)      pkts bytes target     prot opt in     out     source               destination         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:80         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:3306        26 10260 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0         0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 255         0     0 ACCEPT     esp  --  *      *       0.0.0.0/0            0.0.0.0/0         0     0 ACCEPT     ah   --  *      *       0.0.0.0/0            0.0.0.0/0         0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            224.0.0.251         udp dpt:5353         0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:631         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:631      8465  774K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22     49907 7084K REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpts:30000:35000         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:21         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:20         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:21         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:22         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:21         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:20         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:21 ctstate NEW,ESTABLISHED         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:20 ctstate NEW,ESTABLISHED         0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state ESTABLISHED      I know it's waaaay more than necessary, but I'm at my wits end. I can connect to the server just fine when I disable iptables, so I know it has something to do with the firewall. I'd just like to connect, using port 21 and a passive connection. I'd like to open ports 39000 through 40000 for the passive connection. What do I do? * * * AHA! I fixed it! I took another look at the rules and marked down which number rule that reject one was. I had a hunch it was blocking the rules after it, and it was! So, it was the following rule that was blocking my connections:               49907 7084K REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited      So what I did to fix it, was restart the server which reset the rules, and then added my port 21 rule to be _before_ that reject rule:                sudo iptables -I RH-Firewall-1-INPUT 11 -p tcp -m tcp --dport 21 -m state --state NEW,ESTABLISHED -j ACCEPT      sudo iptables -I RH-Firewall-1-INPUT 11 -p tcp -m tcp --dport 39000:40000 -m state --state RELATED,ESTABLISHED -j ACCEPT      Then, I added the following to my vsftpd.conf:               pasv_enable=YES     pasv_max_port=39000     pasv_min_port=40000      Now I can connect, hooray!


Creating a signed subordinate CA for client certificates

I have a root self-signed CA which I've created for myself. With this CA (we'll call it `country`), I've created a server certificate and key for my webserver, nginx. I now would like to create a second CA, `state` which will be used as my `ssl_client_certificate` CA in nginx. I'd like to keep `state` and `country` separated for various reasons and not use my root CA `country` for directly signing client certificates. How can I generate a certificate authority `state` which is signed by `country` for authenticating client certificates in nginx?


Shell script not executing

Not sure what is happening. Lets call script `a.sh` with the following               /users/guru$ cat a.sh     #! /usr/bin/ksh          echo "Hello"     date      Execute with `ksh`. It gets done.               /users/guru$ ksh a.sh     Hello     Tue Jul 15 15:00:52 EDT 2014      Ensure file permission and `ksh` path.               /users/guru$ ls -l a.sh     -rwxrwxrwx    1 guru  kpc         35 Jul 15 15:00 a.sh     /users/guru$ a.sh     ksh: a.sh:  not found     /users/guru$ which ksh     /usr/bin/ksh


MacBook Pro Retina: huge power consumption

I'm currently running Debian/Jessie on a MacBook Pro Retina 10,1 15" (early-2103). Everything is going well (ethernet, WiFi, retina, etc.) but I worry about its power consumption. laptop-mode manages the automatic power management of all my devices, all the tunables of powertop are _Good_ and my i7 is running in _powersave_ mode. The dicrete Nvidia video card isn't even running (Bumblebee/bbswitch turns it off as I don't need it). All bluetooth, card reader and stuff are disabled. However, powertop reports the following with **no X11, keyboard and screen brightness set to 0 and all devices powered off** :               The battery reports a discharge rate of 15.7 W     System baseline power is estimated at 15.0 W          Power est.  Usage   Device name     692 mW  0.3%    CPU core     484 mW  29.9%   Display backlight     299 mW  0.3%    CPU misc     264 mW  0.0 ops/s   GPU core     0 mW    32.9%   USB device: EHCI Host Controller     0 mW    22.9%   USB device: usb-device-8087-0024     0 mW    12.8%   USB device: usb-device-0424-2512     0 mW    2.7%    USB device: Apple Internal Keyboard / Trackpad (Apple Inc.)     0 mW    0.0%    Audio codec hwC0D0: Cirrus Logic     0 mW    0.0%    Display backlight     0 mW    0.0%    USB device: usb-device-8087-0024     0 mW    0.0%    USB device: xHCI Host Controller     0 mW    0.0%    USB device: xHCI Host Controller     0 mW    0.0%    USB device: EHCI Host Controller     0 mW    0.0%    USB device: BRCM20702 Hub (Apple Inc.)     0 mW    0.0%    USB device: usb-device-05ac-820a     0 mW    0.0%    USB device: usb-device-05ac-820b     0 mW    0.0%    USB device: Bluetooth USB Host Controller (Apple Inc.)     0 mW    0.0 ops/s   GPU misc     0 mW    0.0%    USB device: FaceTime HD Camera (Built-in) (Apple Inc.)     100.0%  PCI Device: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1     100.0%  PCI Device: Intel Corporation 3rd Gen Core processor Graphics Controller     100.0%  PCI Device: Broadcom Corporation NetXtreme BCM57765 Memory Card Reader     100.0%  PCI Device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller     100.0%  PCI Device: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port     100.0%  PCI Device: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port     100.0%  PCI Device: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port     100.0%  PCI Device: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode]     100.0%  PCI Device: Intel Corporation HM77 Express Chipset LPC Controller     100.0%  PCI Device: NVIDIA Corporation GK107 HDMI Audio Controller     100.0%  PCI Device: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1     100.0%  PCI Device: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2     33.0%   PCI Device: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1     0.0%    PCI Device: Broadcom Corporation Device 16a3     0.0%    PCI Device: Broadcom Corporation BCM4331 802.11a/b/g/n     0.0%    PCI Device: NVIDIA Corporation GK107M [GeForce GT 650M Mac Edition]     0.0%    PCI Device: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller     0.0%    PCI Device: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2     0.0%    PCI Device: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller     0.0%    PCI Device: Intel Corporation 3rd Gen Core processor DRAM Controller      Manually doing the sum gives a ridiculously low value, but powertop stills report a 15W consumption. However, running powertop in interactive mode in X11 gives me more plausible values:               The battery reports a discharge rate of 29.0 W     System baseline power is estimated at 16.4 W          Power est.    Usage     Device name     12.3 W    100.0%        Display backlight     8.01 W     29.9%        Display backlight     4.61 W     19.4%        CPU core     3.78 W    419.6 ops/s   GPU misc     3.12 W      4.3 pkts/s  Network interface: wlan0 (b43)     2.76 W     19.4%        CPU misc     1.35 W    419.6 ops/s   GPU core     188 mW    100.0%        USB device: Apple Internal Keyboard / Trackpad (Apple Inc.)      What? My retina display is consuming 20W? No way! (actually, with a 50% brightness it gives like 15W, which is _huge_ ). Also, sometimes the Apple Internal Keyboard is consuming 5 W. It's not even a bug in powertop since my battery is indeed discarging very fast (like 2h30 when fully charged with only X11 running).   * Do you guys have an idea of what my problem is? I saw on other sites that some MBPr users report 10 W power consumption, or even less   * Why is there this huge difference between the "battery discharge rate report" and the "system baseline power"?   * Is that normal that my Screen and Keyboard use that much power? I'm running a 3.10-3-amd64 stock kernel.


Screen brightness reverts to max after returning from `xset dpms` display suspend

I'm running the openbox window manager and using this line in my `autostart.sh` to control display power management:               xset dpms 0 60 0      This works nicely, causing the display to suspend after 60 seconds of inactivity. However, when the display reawakens in response to a mouse movement, keypress, etc., the screen is at full brightness. This is wasteful of power and sometimes blinding. If I use the laptop's brightness control keys (`Fn` + `<-`/`->`) to adjust the brightness, the first press will restore the brightness to what it was before the display was suspended. What I'd like is for the screen to be at the pre-suspend brightness as soon as the display is reawakened, i.e. without having to hit one of the brightness control keys. I'm running ubuntu 10.10 on an Acer Aspire 5742.


Replace complex string in several files

A hacker got into a web server and added this string (removed some characters for security purposes and **added line breaks** for readability) in all `index.php` files:               <?php      eval(gzuncompress(base64_decode('eF5Tcffxd3L0CY5WjzcyNDGGMV4+1dSwqSqzU0LQGAJCPCMM=')));      eval(gzuncompress(base64_decode('eF5LK81LLsnMzKx+JjNW0rgUAqDUUxQ==')));       eval(gzuncompress(base64_decode('eF6VlMmy/3sMxOez/iJOojHFT0Ig/8jlTymmN/I=')));      ?>      I have tried using the `sed` command to remove it (replacing it with nothing) but it is nearly impossible to define a working regular expression with such a huge string. Is there another way, maybe reading the string from a .txt file?


Backup Manager and Cron : CentOs and Ubuntu 11.10

I have two dedicated servers: one has CentOS, the other Ubuntu. I installed backup manager on both servers. But I have two different behaviors. On CentOS:   * The backup of my files is "every night". I wish "every week."   * The backup of my DB is "every night" (that's good).   * the action is executed twice each night (once at 2 am, once at 4am ... why??)   * Backup Manager for erase on my FTP files older than 5 days ... So, this morning, my backup server was completely full. On Ubuntu:   * The backup does not start automatically. Why?   * When I start it manually, it seems to work but I get an error. In fact, I use a PHP script that fires when Backup Manager has completed. My script detects file integrity with md5 checksum. But there seems to be an error. Here is my backup-manager.conf on CentOS Here is my post-backup script for CentOS   * It does not use the checksum   * It works   * However, I do not find the hostname: why??   * The mail is sent like this:              Ns390769.ovh.net-sacdunjour.20111115.sql.gz (0.08 GB)     nns390769.ovh.net-www.20111115.tar.gz (0.01 GB)     nns390769.ovh.net-www.20111115.master.tar.gz (1.65 GB)     nns390769.ovh.net-20111115.md5 (0 GB) nns390769.ovh.net-itbag_prestashop.20111115.sql.gz (0 GB)      nTotal: 1.74 Go      Here is my backup-manager.conf on ubuntu Here is my post-backup script on ubuntu   * Use of checksum   * It does not find me the file size   * I find the hostname (not CentOS)   * The mail is sent like this              Files locally:          Ns384990.ovh.net-20111108.md5 (0 B)     Ns384990.ovh.net-all-mysql-databases.20111108.sql.bz2 (0 B)     Ns384990.ovh.netwww.20111108.master.tar.gz (0 B)          TOTAL: 0 B     Integrity problem in the files sent to the FTP server`      It's a real headache for me. Can you help me? Sorry for the length of my message, but I wanted to give you much information.


Count how many elements in the nth column in a whole file

Input file:               A    1,2,3,4      #length($2)=4     B    1,2          #length($2)=2     C    9,8,7,6,5,4  #length($2)=6      Expected output:               12 #4+2+6      A method like: `awk -F '[\t,]' '{print length($2)}'` but working on the whole file.


Is it possible to force a group member to run something allowed by sudoers as himself only?

The sudoers line is               %game_servers   ALL=      NOPASSWD:/usr/bin/renice      which allows group members `renice` any process run by any user without pw, but I'd like to allow group members `renice` their own processes only, to negative value. I couldn't spot the answer from `man sudoers`, from where I got the idea to change `ALL=(root:root)` to `ALL=`, which proved to be bad idea `ALL=()` is syntax error.


Quickly calculate date differences

I often want to make some quick date calculations, such as:   * What is the difference between these two dates?   * What is the date _n_ weeks after this other date? I usually open a calendar and count the days, but I think there should be a program/script that I can use to do these kinds of calculations. Any suggestions?


Linux kernel with absolutely no virtual memory

I am interested in obtaining (or building myself) a version of the Linux kernel that has absolutely no virtual memory and none of its attendant overhead. No swap file, no nothing. What are my options?


Why doesn't PIPESTATUS work on pipelines within a command substitution

Proof below: Bash 4               Prompt> $(echo hello|sed 's/h/m/'|xargs -I{} ls {} 2>/dev/null|sed 's/ /_/')     Prompt> for i in ${PIPESTATUS[@]}; do echo $i;done     Output> 0          Prompt> echo hello|sed 's/h/m/'|xargs -I{} ls {} 2>/dev/null|sed 's/ /_/'     Prompt> for i in ${PIPESTATUS[@]}; do echo $i;done     Output> 0     Output> 0     Output> 123     Output> 0      Is command substitution not considered to be run in a foreground shell? that's my guess.


Generate resource usage report

I'm looking for load/usage data for a server in terms of CPU/RAM/network/Disk from OS perspective. The OS is RHEL5. I know sar is able to report system activity info, but the only commands I know are "sar -r -f sa10" and "sar -q -f sa10", and it's in hourly format. I would like to generate resource (CPU/RAM/network/Disk) usage report over the past month. Is sar able to do this? If yes, how? If no, what tool I can use to generate this quickly. Example:               11/01/11      runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15     11/01/11            0       137      0.00      0.00      0.00     11/02/11            3       139      0.00      0.00      0.00     11/03/11            5       139      0.03      0.01      0.00


How can I disable a part of the screen in X.Org

I'm running a Laptop with Arch Linux, X.org and i3. Due to a broken LCD panel, I would like to disable/ignore the left ~228 Pixels of the screen until I have time to get it repaired. So far, I've tried using a non-standard resolution and then adding an offset, but had no success. Is there any simple solution for this?


Linux Operating System Graphical user interface

So I am currently looking into operating systems at the moment out of interest and have read quite a few articles and guides on making your own, I found Linux and how its possible to create your own from scratch this doesn't appeal to me. So I found that you can get pre-made Linux os's when you can customise your self, however after looking into it further it turns out not what I am looking for. I'm looking to be able to customise the part of the os which the user interacts with (the application?), for instance the task bar (on windows), start button, desktop etc. as I have no interest in changing how to load files and process applications, but where do I start looking?   * also I'm not looking to create a theme which just has some different pretty coloured button i wish to learn the basics and potentially recreate the way it is displayed.  a point in the right direction would be nice, and any things that I might need to learn on the way. (I have no existing knowledge in os's but I do in several higher coding languages)


Fastest and Safest way to increase Swap Space on Scientific Linux

**Memory Swap Ratio Company System** Today, a monitoring system indicated that one of the systems in the company has run out of memory. Executing `htop` on this system indicated that the `Memory` was nearly full `(~8GB)` even as the `Swap Space (~0.5GB)`. Stopping some of the services decreased the `Memory` use, but the `Swap Space` remained fully allocated. According to this documentation it seems that the `Swap Space` of this Company's system does not match the recommended space: `S = M < 2 ? M * 2 : M + 2` **Default Swap Space Test System** Executing `htop` on a test system results in: ![enter image description here](http://i.stack.imgur.com/vJbUg.png) which means a ratio of `~1:1 (1877/1799)`. **Subquestion:** Why does the default `Swap Memory Space Ratio` not equal `2:1`? * * * **Clear and Increase Swap Space on a running system** _Increase Swap Space_ This documentation indicates that several commands should be executed in order to increase the Swap Space. Are all these commands really required? _Clear Swap Space_ According to this documentation the Swap Space could be cleared by executing: `swapoff -a && swapon -a` _Safely increase Swap Space_ This documentation recommends to create a backup before increasing the Swap Space, but it does not indicate the possible impact. As this concerns a production system it is important to know if it is safe to increase the Swap Space on the system while it runs or e.g. should a new system be created and the date subsequently be moved? * * * **Question:** What is the fastest and safest way to increase the Swap Space on Scientific Linux?


How to parse fields out of a text file and write them to another file

I have executed a database command and have generated an output file of the results. Each field name starts with `dbt_xxxxxx` Each field value is the value after the equal sign. how can I parse the file and write out a new file where the field name is in on column and the value is another column and create a header for the file               dbt_dbid=4   dbt_stat=0x0 (0x0000)     dbt_extstat=0x0 (0x0000)     dbt_stat2=0x0 (0x0000)     dbt_stat3=0x20000 (0x00020000 (DBT3_SYSPARTITIONS_EXISTS))     dbt_stat4=0x0 (0x00000000)     dbt_runstat=0x0(0x0000)     dbt_state=0x2(0x0002 (DBST_ACTIVE))   dbt_keep=0  dbt_hdeskeep=0     dbt_next=0x000000002197DE80   dbt_systask_keep=0 dbt_detachxact_keep 0         dbt_dcompver_default=1     dbt_lock=0  dbt_dbaid=1     dbt_verstimestamp= May 15 2012  3:37PM   dbt_dbname=TestDB     dbt_logrows=0     dbt_lastlogbp=0x0000000000000000     dbt_logsema=000000000099EE10      dbt_nextseq=11  dbt_oldseq=11     dbt_dbinfobuf.dbi_logvers=7     dbt_dbinfobuf.dbi_upgdvers=35 ... .dbi_upgd_minor=1720     dbt_dbinfobuf.dbi_dbinfovers=5     dbt_dbinfobuf.dbi_sarg_vers=2  dbt_threshstat=0x0     dbt_thresholds=0x00000000219873B8  dbt_thresh_spin=0x000000002011E300     dbt_maxthresh=256     thc_segment   2 thc_level   664 thc_status 0xf  <-- last chance threshold     dbt_nextid=560001995 dbt_nextidstat=0x0     dbt_dflinfo=0x0000000000000000  dbt_dflstat=0x0     dbt_dumpthreadlock=0     dbt_dbts=0x0000 0x00001492   dbt_xdesqueue   next=0x0000000021986C20


Why flipping is done on data from Big endian before storing in LE?

Simple but confusing question for a beginner. Suppose A is a BE machine and is sending 0x44332211 sending data to B which is LE. By default A will be using htonl of 0x44332211 which is nothing but 0x44332211. Now when 0x44332211 reaches B,B knows that its a BE format, so B will flip by using htonl function and change it to 0x11223344. What does this flipping meeans? I read this concept from internet. Why flipping is required before storing? Because in that case flipped value 0x11223344 will be stored in LE like 0x44332211,which is different from what A send because B interprets it differently though they look alike? /* Conversion from BE to LE */


Can not analyze output from Squid and varnish

I'm using one `Squid` server between tow `cache` server. I get from headers following information:               X-Cache MISS, HIT from cache-zz     X-Cache-Age 515     X-Cache-Control public, max-age=3600     X-Cache-Lookup  HIT from cache-zz     X-Cache-O   MISS     X-Cache-Route   cache-xx/cache-yy      In `cache-zz` I have squid and in `cache-xx` and `cache-yy` I have varnish. I can not analyze that.   * How can we have MISS and HIT from `cache-zz` in the same time?   * And how can we get the HIT from `cache-zz`, which is between two caches?


convert - unrecoverable error when pdf to jpg

When I'm converting pdf to jpg with the following command               $ convert -density 300 file.pdf file.jpg      I'm getting this error. > Last OS error: 2 GPL Ghostscript 8.71: Unrecoverable error, exit code 1 > convert: Postscript delegate failed `file.pdf': No such file or directory @ > pdf.c/ReadPDFImage/634. convert: missing an image filename `file.jpg' @ > convert.c/ConvertImageCommand/2838. Could you help me with this command to work? thank you


How to exclude directories with blanks via locate's PRUNEPATHS?

I would like to exclude some Windows folders on an NTFS mount from being indexed by `locate`. I'm familiar with the `PRUNEPATHS` syntax in `/etc/updatedb.conf`. It is a white-space separated list of directory names. My problem is that I want to exclude directories that contain white space themselves (e.g. `Program Files (x86)`). I tried backslash escapes but that didn't work.


How to set up remote graphical sessions on CentOs?

Trying to set up a Centos 6 server configuration where we can automate the running of an application that uses Selenium. In this case, ideally, we should be able to:   1. Create a graphical session (which should remain open for at least 30 minutes).   2. Run an application that will continue running while the session is active.   3. Have that application, using Selenium, run automated website tests. What sort of installation / configuration do I need to do this? I've already set up `gdm` and a `vnc` server to test it out. I am at a loss, however, on what to do next.


Starting Resque worker with script doesnt work, starting by hand does

I am trying to figure out why my process doesn't work if started via a script, but works fine if started by hand. Here's the details: script is a resque worker start script. The script location is /etc/monit/conf.d/start_resque.sh. Permissions are 755 and owned by ubuntu:ubuntu When I run the script, the log output gets a pid and it says "starting worker ip-xx-xxx-xxx-xx:26732 (or whatever the pid is)", however when I ps aux | grep 26732, nothing is shown as running. When I run the same exact command by hand in my rails project directory, the same "starting worker" output is displayed, and the process is actually started and continues to run. One thing to note, additional output is displayed if started by hand: "nohup: ignoring input" Another question someone might be able to help with, is why does BACKGROUND=yes not actually daemonize my worker...thus I'm resorting to nohup, which seems to work fine. Here's my script (the command I run by hand is after the cd):               #!/bin/bash     echo "starting worker.."     workercount="$(ps aux | grep -c resque)"     currentdir="/var/www/apps/myapp/current"     logdir=$currentdir/log/resque_worker.log     pidfile=$currentdir/tmp/pids/resque_worker_$workercount.pid     cd $currentdir     nohup bundle exec rake environment resque:work RAILS_ENV=production QUEUE='*' VERBOSE=1 PIDFILE=$pidfile >> $logdir 2>&1 &     echo "started worker $workercount! view log at $logdir. view pidfile at $pidfile"      Additional notes: on Ubuntu 12.04 and am connected via `ssh` while running both the script and the manual command.


How to run an app in a framebuffer?

If I can see a movie from the console (like in this post), then how can I use other apps like Firefox from the console? I'm looking for something that works in Ubuntu, Fedora, or OpenBSD.


How do I use curl to download content from sourceforge?

Simply typing http://downloads.sourceforge.net/project/romfs/genromfs/0.5.2/genromfs-0.5.2.tar.gz works fine on a browser, but I'm trying to download from a CLI environment with limited utilities. The following just returns an empty file:               curl http://downloads.sourceforge.net/project/romfs/genromfs/0.5.2/genromfs-0.5.2.tar.gz      How do I get genromfs-0.5.2.tar.gz from sourceforge using curl?


How to change the colour of embedded terminal in linux mint 12 to be able to use `ls` and `byobu`?

I'm using Linux Mint 12 and am having problems with the embedded terminal in gedit. Using the default themes I'm unable to use 'ls' and 'byobu' as in part of their output foreground and background colours are the same. Problems shown in this screenshot. Byobu is running (bottom two lines of terminal) and ls has just been used. http://i.stack.imgur.com/BPboj.png I've followed the instructions in http://askubuntu.com/questions/67593/make- gedit-embedded-terminal-colours-the-same-as-the-default-terminal but have had no luck with that. Any ideas would be very appreciated!


Key-binding to open a terminal running python in ratpoison

In my .ratpoisonrc file I'm failing to write a key-binding to open a terminal running python. I'm running a minimal Debian setup on which I basically just run emacs. Sometimes I want to just get a python shell and I'm not sure how to set up the key binding to get that right.               bind p exec ???? python


How to attach terminal to detached process?

I have detached a process from my terminal, like this:               $ process &      That terminal is now long closed, but process is still running and I want to send some commands to that process's stdin. Is that possible?


How can I exclude proftp authentication failure messages from logwatch?

I use `logwatch` on my server, now I get thousands of these lines in the report email:               --------------------- pam_unix Begin ------------------------            proftpd:         Unknown Entries:            check pass; user unknown: 339 Time(s)            authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=::ffff:62.115.255.98 : 27 Time(s)            authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=::ffff:188.102.152.23 : 7 Time(s)     ...      I already have loglevel Low


Perl only one option at a time

There is a requirement where I can't put two options at the same time. For instance with `-a` option:               file.pl -a file.text        # executes file      But if I write               file.pl -a -a file.text     # it is supposed to print a msg      or               file.pl -a -b file.text     # it is supposed to print a msg      Below is my script:               if ($ARGV[1] eq "-a" or "-b" or "-c" ) {          print "error \n"; }      The problem is even though I just write `file.pl -a file.text`, it still prints the msg.


any feature on linux like Perfermance Counter on Windows servers?

I have a tomcat web application, when invoking an unstable remote API, I want to get realtime http request time at any time. On windows server, I can use Performance Counter, does centos provide someone like that?


apt-get: install modified package with dependencies

I have downloaded a Debian package `lxde`, together with all its dependencies:               apt-get install --no-install-recommends lxde --download-only      So now, I have all packages in my `/var/cache/apt/archives`. I have made modifications to one package `lxde_4+nmu1_all.deb` (removed `galculator` from dependencies) and now I would like to install lxde from my modified package (i.e. with the modified dependencies). `dpkg -i lxde_4+nmu1_all.deb` does not work, because of unmet dependencies. How can I tell `apt-get` to install my modified package `/var/cache/apt/archives/lxde_4+nmu1_all.deb` ?


ls command in ftp> not working!

I was practicing ftp but faced an issue: ls command isn't working on ftp> . Why? I checked on 2 remote servers but ls didn't work on either and gave different output when ls was executed. Please see below for the 2 remote boxes. The below shows my remote server where I installed vsftpd today.               ravbholua@ravbholua-Aspire-5315:~$ ftp rs     Connected to ravi.com.     220 (vsFTPd 3.0.2)     Name (rs:ravbholua):      331 Please specify the password.     Password:     230 Login successful.     Remote system type is UNIX.     Using binary mode to transfer files.     ftp> pwd     257 "/home/ravbholua"     ftp> ls     500 Illegal PORT command.     ftp: bind: Address already in use     ftp>       The below is for a different remote machine where I have to send some files. _But as ls on ftp> isn't working, how will I transfer files from my local box to that box because I can't be confirmed without ls whether the files have been transferred or not._               ravbholua@ravbholua-Aspire-5315:~$ ftp 125.21.153.140     Connected to 125.21.153.140.     220---------- Welcome to Pure-FTPd [TLS] ----------     220-You are user number 1 of 10 allowed.     220-Local time is now 04:34. Server port: 21.     220-This server supports FXP transfers     220 You will be disconnected after 2 minutes of inactivity.     Name (125.21.153.140:ravbholua): peacenews     331 User peacenews OK. Password required     Password:     230 OK. Current restricted directory is /     Remote system type is UNIX.     Using binary mode to transfer files.     ftp> ls     200-FXP transfer: from 123.63.112.168 to 10.215.10.80     200 PORT command successful      Please note that for the above machine, once I ran ls on ftp>, the prompt didn't come back. On both the remote machines, I got different output when executed ls on ftp>


Cannot mount LVM2 partitions

I have a 160GB hard drive here with an LVM2 partition that contains two EXT3 partitions that I'm trying to mount. However, when I try to mount either of those two partitions inside the LVM2, I get the error:               mount: wrong fs type, bad option, bad superblock on /dev/loop0,            missing codepage or helper program, or other error            In some cases useful info is found in syslog - try            dmesg | tail  or so      Also, when I run fdisk, it shows the two partitions as not containing "a valid partition table"               Disk /dev/sdd: 160.0 GB, 16004188696 bytes     255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x0002d815          Device      Boot    Start       End     Blocks      Id  System     /dev/sdd1   *   63      305234      152586      83  Linux     /dev/sdd2       305235      4498199     2096482+    82  Linux swap / Solaris     /dev/sdd3       4498200     312576704   154039252+  8e  Linux LVM          Disk /dev/mapper/VolGroup00-lv_root: 21.5 GB, 21474836480 bytes     255 heads, 63 sectors/track, 2610 cylindars, total 41943040     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000          Disk /dev/mapper/VolGroup00-lv_root doesn't contain a valid partition table          Disk /dev/mapper/VolGroup00-lv_usr2: 136.2 GB, 136197439488 bytes     255 heads, 63 sectors/track, 16558 cylindars, total 266010624 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00000000          Disk /dev/mapper/VolGroup00-lv_usr2 doesn't contain a valid partition table      Here are the contents of lvdisplay:                 --- Logical volume ---       LV Name                /dev/VolGroup00/lv_root       VG Name                VolGroup00       LV UUID                jOeBez-2QxJ-Rwth-ufsK-kohE-dHrW-XwDeEi       LV Write Access        read/write       LV Status              available       # open                 0       LV Size                20.00 GiB       Current LE             640       Segments               1       Allocation             inherit       Read ahead sectors     auto       - currently set to     256       Block device           252:0            --- Logical volume ---       LV Name                /dev/VolGroup00/lv_usr2       VG Name                VolGroup00       LV UUID                YvbvFJ-yq2t-gSoV-6CqL-Imby-qx6E-uNu3Iz       LV Write Access        read/write       LV Status              available       # open                 0       LV Size                126.84 GiB       Current LE             4059       Segments               1       Allocation             inherit       Read ahead sectors     auto       - currently set to     256       Block device           252:1      Do you guys have any advice? I am positive they are ext3 partitions..


Get indication of ssh command

I need to get indication whatever the `ssh` command succeeded or not without it leaving the connected server. I use this command:               ssh -q  user1@server1 "echo 2>&1" && echo SSH_OK || echo SSH_NOK      My problem with that command is that I dont stay in the connected server. I dont wish to add test after the `ssh` command, I wish to do it like how I do it so far - by one command. Here is a sample of how it works now:               [nir@dhcppc4 ~]$ ssh -q  user1@server1 "echo 2>&1" && echo SSH_OK || echo SSH_NOK     SSH_NOK     [nir@dhcppc4 ~]$ hostname     dhcppc4     [nir@dhcppc4 ~]$ ssh -q  user1@server2 "echo 2>&1" && echo SSH_OK || echo SSH_NOK     SSH_OK     [nir@dhcppc4 ~]$ hostname     dhcppc4      And here is a sample of what I want:               [nir@dhcppc4 ~]$ ssh -q  user1@server1 "echo 2>&1" && echo SSH_OK || echo SSH_NOK     SSH_NOK     [nir@dhcppc4 ~]$ hostname     dhcppc4     [nir@dhcppc4 ~]$ ssh -q  user1@server2 "echo 2>&1" && echo SSH_OK || echo SSH_NOK     SSH_OK     [nir@server2 ~]$ hostname     server2


Case insensitive search in man pages

Is there a way to search man pages case-insensitively? Using the '/' search feature matches exact case.


What is the easiest way to draw graphics on Linux framebuffer?

I have some embedded Linux ARM chip with LCD display on frame-buffer. I connect to chip with serial console. I can access frame-buffer directly with low-level commands. However I need to draw some figures or even sprites. I am searching something. Can for example SDL run on frame-buffer without X, or there is similar graphical libraries? High performance video like speed is not needed, because probably animation will not be used, but GUI should be at least usable. Ncurses was useful for text interface, but I need some graphical interface.


Sed: replacing digits

I am trying to write some install scripts for when I install/upgrade Ubuntu. I'm having trouble with fixing `logrotate.d`:               /var/log/ufw.log     {     rotate 7     weekly     missingok     notifempty     compress     delaycompress     sharedscripts     postrotate         reload rsyslog >/dev/null 2>&1 || true     endscript     }      I want to change `rotate nnn` to `rotate 99`. It must work for nnn to be any number of digits (normally 1 or 2), yet not affect the `postrotate` line. I've tried these two but neither does what I need (and I tested with nnn being 1,2 or 3 digits).               sudo sed  's/rotate[0-9]*/rotate 99/' /etc/logrotate.d/ufw     sudo sed  's/^rotate[0-9]/rotate 99/' /etc/logrotate.d/ufw


Remove GNOME and install dwm

I'm currently running Fedora 19 on my PC and I want to remove GNOME and then use dwm. Is it enough when I install dwm and remove GNOME completely?


What doesn't need defragmentation? Linux or the ext2 ext3 FS?

Why don't you have to defrag a Linux system? Because it's using the ext2/ext3 file system or because it's Linux? That's relevant, because a have a double boot system (W7 / Ubuntu) and a common partition (NTFS) that can be accessed by both system. If I'm using this partition with Linux, will it get fragmented? Another issue are the Truecrypt containers. I also access them with Linux and Windows, and they are FAT32. Do they get fragmented by Linux operating on them?


Open program as root, close root session but still program is running

When I run my backup script, first I switch to root, mount a truecrypt partition and then run the script. I've noticed that after run truecrypt as root, I can exit the root session and truecrypt remains opened. Why does it happen? Shouldn't it close as long as I close root session? The commands order is: `su` `truecrypt &` I mount the hidden volume using Truecrypt's UI `./Backup.sh` and then the usual is unmount the Truecrypt's volume, close Truecrypt, exit root session. However, if I only close root session Truecrypt keeps running with root permissions.


Debian: Unable to activate wifi on HP Pavilion Dm1-4055sg (with Broadcom BCM4313)

I just installed Debian Wheezy stable. I am now facing the problem, that I am not able to activate the WiFi. I use a HP-Pavilion DM1 notebook with a button (F12 and wlan button) to activate the WiFi. However pressing it does not cause any reaction. Furthermore `ifconfig -a` does not list `wlan0`. The computer is equipped with a Broadcom BCM4313 Wireless LAN controller, so I installed the `firmware- brcm80211` driver. As a network manager I installed WICD since I use the XFCE desktop. Does anybody have a clue what is going on?


Extend partition size without unmounting it

I would like to create an image of a Linux Mint disc. Then I'd like to copy it to a bigger disc and extend its partition to the full size of the disc. I have already copied the disc using `WinImage` to another PC, wrote the data on a bigger disc and turned it on. I have been searching for some mechanism to extend a partition with Linux without success. With `GParted` it works perfectly, but I would like to do it in a console. I have been trying to do this using `parted`, `GPart` or `lvextend` but I cannot find any option which allows me to extend a partition size without unmounting it. **EDIT** Type of file system is `ext4`, which I checked with `parted` command.


MS Intelli Mouse Optical not working on Mint Linux 15 64-bit

The title tells everything I guess: I have a _MS Intelli Mouse Optical_ with _5 Buttons_ and the side buttons are _not working_. I have searched for a `xorg.conf` file but I couldn't find it. _What can I do to make the mouse work like in Windows 7? (You know the plug & play stuff)_


Specify rows/columns of a fullscreen X terminal?

For presentations it would be convenient to have a X terminal which supports following workflow:   * make it fullscreen   * specify how many columns/rows should be displayed -> the terminal then automatically selects the right font type and size Which X terminal supports this?


How many cores can Linux kernel handle?

I'm interested in theoretical limits, perhaps with examples of systems having huge numbers of CPU's.


Getting visual feedback of workspace switch in xfce

I make heavy use of workspaces, and have a lot of them (a 6x4 grid). I usually run openbox, but am currently using a machine that doesn't have openbox set up, so I'm using xfce because it's already mostly configured to my liking. I've gotten used to getting visual feedback when I switch workspaces, showing me which one I've just moved to, and am finding myself a bit disoriented in xfce. In openbox this is a big heads-up display, which is pretty much ideal. I'm aware that the workspace switcher panel applet will highlight the active workspace, but this only seems to work for workspaces which have some desktop space showing; since I generally have all my windows maximized, this isn't super helpful. Is there a way to enable visual feedback showing the new workspace when switching workspaces in xfce?


How to edit files with VIM through FTP

I'm trying to use: `vim ftp://user@hostname//` - this gives me a correct directory tree, but when I try to open given file, by pressing Enter, at the first time - nothing happens (just cursor jumps to the "control" line at the bottom of the screen), when I'm pressing Enter again, I'm getting:                 1 ftp: username.hostname: Ta nazwa lub usługa jest nieznana // Rough translation: This name or service is not known       2 Not connected.       3 Not connected.       4 Not connected.      I changed username and hostname above. I want to edit file through FTP, what I'm doing wrong?


Identify python script is waiting for a manual input

I'm writing a shell script which executes a Python script. The Python script halts for a manual enter to be provided. However, I don't wan't to have to press enter each time to the script. Instead, I want to pass the manual enter from the executing shell script. Kindly help, if there is a way to do that?


Dual boot Linux / Windows. How to deny completely Windows?

I have a dual boot setup (Debian / Ubuntu and Windows) on my laptop. I would like GRUB to start Linux automatically, without a prompt for Windows. And eventually start Windows only with (for example) a combination of keys. Or have some rows of fake entries installed and at 3rd/4th/nth place Win (with a fake name, eg. "Restart Now"). My goal: if an inexperienced person boots my laptop, he can not boot Windows.


How to use STL in unix and linux?

How to use STL(standard template library) in HP-Unix . How to compile and run the program with STL functions?


/proc/config.gz is of 0 bytes

I have an Android TV stck I compiled Linux for IT from https://github.com/Galland/rk3x_kernel_3.0.36 But when I booted that Image I found /proc/config.gz is of 0 bytes can some please explain how the command line params from .config file in kernel source get mounted to /proc. I mean what goes in the background??


Accessed a TrueCrypt container without TrueCrypt. What dangers await?

I've got a TrueCrypt volume. In light of the unexpected demise of TrueCrypt, I've been trying to figure out what to do (reading lots of HOWTO websites). I'd like something that is simple and can work as simply as truecrypt, but so far as I can tell, no such thing exists. I'm taking baby steps, finding out if I can learn to mount the TrueCrypt container without using TrueCrypt. This is than expected. In case you want to try, here's how. In my case, the container is a file called "container". Create a mountpoint directory `~/TrueMount2` and then:               $ sudo cryptsetup open --type tcrypt ~/container flopper          $ sudo mount -t ext4 /dev/mapper/flopper ~/TrueMount2      I called this one "flopper" because I can! That variable is a placeholder. You can name it anything you want to. Freedom! It is liberating. After that, the contents of the TrueCrypt folder show up under `~/TrueMount2`. The files are there, just as expected. This volume is about 70GB, so I can certify that it works for big encrypted things. I ran find in that directory and it was plenty fast. Also good news, this mount survives a suspend/resume cycle. That's a relief. I suspended the machine before remembering to read a HOWTO about suspending when an encrypted container is mounted :). I also learned that, if I want to disconnect the encrypted drive, I need to take 2 steps:               $ sudo umount TrueMount2          $ sudo cryptsetup close flopper      This works in Ubuntu 14.04. I experimented with some other methods (`tcplay`), but didn't get a good result. I probably need to try harder. I've also found it does work to put the container file inside the directory `~/TrueMount2`. I like that idea because, at least while the thing is mounted, the mountpoint "protects" the container file from accidental deletion. Now, here are the questions for you.   1. Will the container itself be damaged if the machine turns off without unmounting the container? I am absolutely certain I will not remember to umount that thing explicitly every time the machine turns off. What bad thing will happen?   2. Have I made this simpler than it should be? In other instructions, such as this one: How can I create an encrypted, file-system–agnostic, mountable volume? one has to go to the trouble of finding an open loopback device, using it, and then closing it down after. Why don't I have to do that with a TrueCrypt container? Why doesn't it need loopback and losetup and the other confusing bits? I'm experimenting with the storage method described above, but it appears to not be scriptable. I don't manually want to ask the system which loop is free when I start the day. I want the mounter to "just work" on the first free loop. Little details like that made TrueCrypt useful to me and I'm very sorry they are shut down.


Merging folders with practically the same name but different casing

When digging around in the advanced settings in Dropbox I lost a folder. I only discovered this about a month later. I managed to get this folder back from Dropbox however the file structure of the subfolders have changed dramatically. The current folder now contains two versions of each original subfolder. Currently it looks like this:               folder       /folder1         /folder11           /folder111           /Folder111            /file1111            /file1112            /file1113         /Folder11           /file111           /file112         /folder12         /Folder12       /folder2       /folder3        So I have lowercase subfolders and I have BumpyCase subfolders. The lowercase subfolders contain subsubfolders and the BumpyCase subfolders contain files. The subsubfolders again contain a lowercase and a BumpyCase version of their respective subfolders. And this story goes on for several levels deep. Fortunately there is no duplication in files, only in folders (same letters but different casing). So on each level I need to merge folders which differ only in the casing of names. And to do this correctly I need to start at the deepest level and work myself up to the top level folder. I want everything to go into the CamelCase directories. The partition where the data is is an Ext4 partition. I have access to several NTFS partitions. Is there a handy Linux command/tool or someone with an idea for a script which could accomplish this? I'm already very happy that I got my stuff back, but the current structure is a big inconvenience.


smartctl on external hdd inside ide-to-usb enclosure

I have a very old 2.5" IDE drive inside a USB enclosure that gives some buffer I/O error. I tried to use `smartctl` to see what SMART says about it, but I can't manage to make it work. Being `root`, if I just write:               #> smartctl --all /dev/sde      `smartctl` answers:               /dev/sde: Unknown USB bridge [0x14cd:0x6600 (0x201)]     Smartctl: please specify device type with the -d option.      So I've tried every `-d TYPE` available in the help summary, and the best result is achieved with:               #> smartctl --all -d scsi /dev/sde      that outputs:               Vendor:               IC25N030     Product:              ATMR04-0     User Capacity:        30,005,821,440 bytes [30,0 GB]     Logical block size:   512 bytes     scsiModePageOffset: response length too short, resp_len=4 offset=4 bd_len=0     >> Terminate command early due to bad response to IEC mode page     A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.      If I also add `-T permissive` the last line is replaced with:               Error Counter logging not supported     Device does not support Self Test logging      It seems that just a few models of USB enclosures are officially supported by `smartmontools`. Is there something that I'm missing or simply the device implements an archaic version of SMART without any counters (and hence almost useless)?


Which 'smartctl -d' option should I use on this hard-disk: 'scsi' or 'ata'?

On the back of How to repair a corrupted HFS+ partition?, I have separate question. I'd like to run `smartctl` tests on a hard disk, but I'm not sure which option I should use to correctly initialize the tests. The drive in question is a Toshiba MK2555GSXF 250GB SATA/300 5400RPM 8MB 2.5" Hard Drive, and I connect it to the Linux box using an Icy Box IB-AC603A-U3 Adaptor SATA 6.4 cm / 2.5 Inches to USB 3.0 external disk case. Here's relevant output from `lshw`:                *-scsi           physical id: 3           bus info: usb@2:5           logical name: scsi7           capabilities: emulated scsi-host           configuration: driver=usb-storage         *-disk              description: SCSI Disk              product: 2105              vendor: ASMT              physical id: 0.0.0              bus info: scsi@7:0.0.0              logical name: /dev/sdb              version: 0              serial: 00000000000000000000              size: 232GiB (250GB)              capabilities: gpt-1.00 partitioned partitioned:gpt              configuration: ansiversion=6 guid=6b43402b-9887-4a33-a329-9801b59ccdc7            *-volume:0                 description: Windows FAT volume                 vendor: BSD  4.4                 physical id: 1                 bus info: scsi@7:0.0.0,1                 logical name: /dev/sdb1                 version: FAT32                 serial: 70d6-1701                 size: 199MiB                 capacity: 199MiB                 capabilities: boot fat initialized                 configuration: FATs=2 filesystem=fat label=EFI name=EFI System Partition            *-volume:1                 description: Apple HFS partition                 vendor: Mac OS X (fsck)                 physical id: 2                 bus info: scsi@7:0.0.0,2                 logical name: /dev/sdb2                 version: 4                 serial: d9a741cc-8313-cc78-0000-000000800000                 size: 232GiB                 capabilities: journaled bootable osx hfsplus initialized                 configuration: boot=osx checked=2009-09-24 02:29:07 created=2009-09-23 17:29:07 filesystem=hfsplus lastmountedby=fsck modified=2013-11-03 01:02:00 name=Customer state=unclean      When I run a `smartctl` `Self Test`, it seems to fail:               root@liv-HP-Compaq-dc7900:/home/liv# smartctl -i -H -c '/dev/sdb'     smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-57-generic] (local build)     Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net          /dev/sdb: Unknown USB bridge [0x174c:0x5136 (0x001)]     Smartctl: please specify device type with the -d option.          Use smartctl -h to get a usage summary      The trouble is that I'm not sure what to use for the `-d` option. I checked the man page, and the most sensible options seem `ata` or `scsi`. I understand that this particular drive is `SATA`, but for some reason `lshw` identifies it as `SCSI`. So I'm not sure what option is appropriate in this case? * * * **UPDATE1** : As suggested in the answers, I identified the device manufacturer:               root@liv-HP-Compaq-dc7900:/home/liv# lsusb -v     Bus 002 Device 007: ID 174c:5136 ASMedia Technology Inc.      Device Descriptor:       bLength                18       bDescriptorType         1       bcdUSB               2.10       bDeviceClass            0 (Defined at Interface level)       bDeviceSubClass         0        bDeviceProtocol         0        bMaxPacketSize0        64       idVendor           0x174c ASMedia Technology Inc.       idProduct          0x5136        bcdDevice            0.01       iManufacturer           2 ASMedia       iProduct                3 AS2105       iSerial                 1 00000000000000000000       bNumConfigurations      1       Configuration Descriptor:         bLength                 9         bDescriptorType         2         wTotalLength           32         bNumInterfaces          1         bConfigurationValue     1         iConfiguration          0          bmAttributes         0xc0           Self Powered         MaxPower                0mA         Interface Descriptor:           bLength                 9           bDescriptorType         4           bInterfaceNumber        0           bAlternateSetting       0           bNumEndpoints           2           bInterfaceClass         8 Mass Storage           bInterfaceSubClass      6 SCSI           bInterfaceProtocol     80 Bulk-Only           iInterface              0            Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x81  EP 1 IN             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0           Endpoint Descriptor:             bLength                 7             bDescriptorType         5             bEndpointAddress     0x02  EP 2 OUT             bmAttributes            2               Transfer Type            Bulk               Synch Type               None               Usage Type               Data             wMaxPacketSize     0x0200  1x 512 bytes             bInterval               0     Device Status:     0x0001       Self Powered      Then checked whether the device (`ASMedia AS2105` with ID `0x174c:0x5136`) is listed in Smartmontools USB Device Support. There were a couple of very similar matches with successful outcomes, all suggesting the use of `-d sat`. And this seems to work in my case, too:               root@liv-HP-Compaq-dc7900:/home/liv# smartctl -d sat -i -H -c '/dev/sdb'     smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-57-generic] (local build)     Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net          === START OF INFORMATION SECTION ===     Device Model:     TOSHIBA MK2555GSXF     Serial Number:    10J9SA69S     LU WWN Device Id: 5 000039 245a067fd     Firmware Version: FH205B     User Capacity:    250,059,350,016 bytes [250 GB]     Sector Size:      512 bytes logical/physical     Device is:        Not in smartctl database [for details use: -P showall]     ATA Version is:   8     ATA Standard is:  Exact ATA specification draft version not indicated     Local Time is:    Fri Jan 17 16:18:03 2014 CET     SMART support is: Available - device has SMART capability.     SMART support is: Enabled          === START OF READ SMART DATA SECTION ===     SMART overall-health self-assessment test result: PASSED          General SMART Values:     Offline data collection status:  (0x00) Offline data collection activity                         was never started.                         Auto Offline Data Collection: Disabled.     Self-test execution status:      (   0) The previous self-test routine completed                         without error or no self-test has ever                          been run.     Total time to complete Offline      data collection:        (  120) seconds.     Offline data collection     capabilities:            (0x5b) SMART execute Offline immediate.                         Auto Offline data collection on/off support.                         Suspend Offline collection upon new                         command.                         Offline surface scan supported.                         Self-test supported.                         No Conveyance Self-test supported.                         Selective Self-test supported.     SMART capabilities:            (0x0003) Saves SMART data before entering                         power-saving mode.                         Supports SMART auto save timer.     Error logging capability:        (0x01) Error logging supported.                         General Purpose Logging supported.     Short self-test routine      recommended polling time:    (   2) minutes.     Extended self-test routine     recommended polling time:    (  90) minutes.     SCT capabilities:          (0x0039) SCT Status supported.                         SCT Error Recovery Control supported.                         SCT Feature Control supported.                         SCT Data Table supported.      Now to make `gsmartcontrol` recognize the disk, I had to `Device > Add Device`, put `/dev/sdb` in `Name` and select `sat,16` for `Type`. So this pretty much solves this particular question.


Chkrootkit found alot of suspicious files and directories, and /sbin/init INFECTED

I was just running chkrootkit on my Fedora 20 x86_64. Here are some dubious results. Anyone know if these are false positives? Do I have a compromised system? Here are the suspect files and directories:               Searching for suspicious files and dirs, it may take a while...           /usr/lib/.libgcrypt.so.11.hmac /usr/lib/python2.7/site-packages/martian     /testswithbogusmodules/.bogussubpackage /usr/lib/python2.7/site-packages/fail2ban     /tests/files/config/apache-auth/digest_time/.htaccess /usr/lib/python2.7/site-     packages/fail2ban/tests/files/config/apache-auth/digest_time/.htpasswd /usr/lib     /python2.7/site-packages/fail2ban/tests/files/config/apache-auth/noentry     /.htaccess /usr/lib/python2.7/site-packages/fail2ban/tests/files/config/apache-     auth/basic/file/.htaccess /usr/lib/python2.7/site-packages/fail2ban/tests/files     /config/apache-auth/basic/file/.htpasswd /usr/lib/python2.7/site-packages/fail2ban     /tests/files/config/apache-auth/basic/authz_owner/.htaccess /usr/lib/python2.7     /site-packages/fail2ban/tests/files/config/apache-auth/basic/authz_owner     /.htpasswd /usr/lib/python2.7/site-packages/fail2ban/tests/files/config/apache-     auth/digest_anon/.htaccess /usr/lib/python2.7/site-packages/fail2ban/tests/files     /config/apache-auth/digest_anon/.htpasswd /usr/lib/python2.7/site-packages     /fail2ban/tests/files/config/apache-auth/digest_wrongrelm/.htaccess /usr/lib     /python2.7/site-packages/fail2ban/tests/files/config/apache-auth/digest_wrongrelm     /.htpasswd /usr/lib/python2.7/site-packages/fail2ban/tests/files/config/apache-     auth/digest/.htaccess /usr/lib/python2.7/site-packages/fail2ban/tests/files/config     /apache-auth/digest/.htpasswd /usr/lib/python2.7/site-packages/pylons/docs/en     /.gitignore /usr/lib/python2.7/site-packages/pylons/templates/default_project     /+package+/templates/.distutils_placeholder /usr/lib/python2.7/site-packages     /pylons/templates/minimal_project/+package+/templates/.distutils_placeholder      /usr/lib/.libssl.so.1.0.1e.hmac /usr/lib/.libcrypto.so.1.0.1e.hmac /usr/lib     /.libssl.so.10.hmac /usr/lib/debug/.build-id /usr/lib/debug/usr/.dwz /usr/lib     /debug/.dwz /usr/lib/mono/xbuild-frameworks/.NETFramework /usr/lib     /.libcrypto.so.10.hmac              /usr/lib/python2.7/site-packages/martian/tests/withbogusmodules     /.bogussubpackage /usr/lib/debug/.build-id /usr/lib/debug/.dwz /usr/lib     /mono/xbuild-frameworks/.NETFramework      * * * And then there was this:               Searching for Suckit rootkit... Warning: /sbin/init INFECTED      * * * Finally:               Checking `chkutmp'...  The tty of the following user process(es) were not found      in /var/run/utmp !     ! RUID          PID TTY    CMD     ! root         1631 tty1   /usr/bin/X :0 vt1 -background none -nolisten tcp -seat seat0 -auth /var/run/kdm/A:0-EiPPra     chkutmp: nothing deleted     Checking `OSX_RSPLUG'... not infected


Regain access to seemingly frozen Live CD session

A few weeks back I started a machine up with a copy of Parted Magic, and loaded up some webpages in Firefox on it. Just last week, upon getting back to looking at the machine, I noticed that `lxpanel` had grown to a larger than normal memory size, and UI response was sluggish. At that time I set ¿stupidly? `xset s on` & `xset s 1`. Today I go to use the machine and find I cannot use the keyboard or mouse to make the display turn on for 1 second (enough time for me to launch terminal and `xset s off` (My basic attempt to create secure screen saver like functionality)). I am aware I can kill `X`, or launch `oom_kill`, but both of these options will/could loose my unsaved form data that I would prefer not to recreate, even if more time is involved with regaining access to the current session. Does anyone have any other solutions?


X Starting Instead of Openbox (Arch)

I recently installed Arch for the first time in VMWare Workstation 9.0.2, twice (I reinstalled to change some partition sizes). In the first installation I was able to start Openbox instead of X when running startx by copying xinitrc to my /home/user directory, and then simply adding "exec ck- launch-session dbus-launch openbox-session" to the end on both the xinitrc in my user folder as well as the one in /etc/X11/xinit. However, on the second installation, although modifying xinitrc in the same manner as the first time, X starts instead of Openbox after running startx. The end of both xinitrc files look like this:               twm &     xclock -geometry 50x50-1+1 &     xterm -geometry 80x50+494+51 &     xterm -geometry 80x20+494-0 &     exec xterm -geometry 80x66+0+0 -name login     exec ck-launch-session dbus-launch openbox-session      Does anyone know what the issue is?


Copy-paste between Hyper-V guest and host

My computer runs Windows Server 2008 R2. It hosts a Hyper-V virtual machine running Ubuntu 12.04 as the guest OS. I want to copy text from Ubuntu and paste this text in Windows (and copy text in Windows and paste it in Ubuntu). How can I do this?


iptables: what the difference between filter and mangle

I am using iptables to to mark the package and want to route based on the marks. First I added the ip rule:               sudo ip rule add fwmark 1 prohibit      (The "prohibit" is just for test, I will change it to some route table later.) Then I began to mark the packages:               sudo iptables -A OUTPUT -d 192.168.1.0/24 -j MARK --set-mark 1      But the computer can still access the 192.168.1.0/24 networks. After a long time's googling and struggling, I tried:               sudo iptables -t mangle -A OUTPUT -d 192.168.1.0/24 -j MARK --set-mark 1      It works and the connection was blocked. In the first case, the default table of filter is used. So my question is what is the difference between mangle table and filter table? Which one should be used in what cases? As my understanding, all these tables will be consulted before the routing policy, then why the filter table doesn't work properly?


gksu login and groups

After installing Wireshark, I added my user to `wireshark` group. As I didn't want to restart my X session in order to relogin, I tried running it with `gksu -l -u myuser`. As `su - myuser` showed my new group membership (both are login versions of respective commands), I thought it would work - but it didn't. Neither running terminal session with login `gksu` appears with expected result, nor does the Wireshark work (not surprising). It doesn't seem to preserve the parent groups, because it shows the same (old) result after using `newgrp`. What happened and why is that so?


How can I chainload GRUB on another drive?

I have two pen drives. On one I have a full install of Arch GNU/Linux. This install is compatible with both EFI systems and BIOS systems; it has a GPT drive with a BIOS Compatibility Region and an EFI partition. GRUB2 is installed as an EFI application in the EFI partition, and it is also embedded into the BIOS Compatibility Region. On the second pen drive, I have an MBR and a FAT32 partition that fills the entire drive. I have a BIOS computer (an XPS 13 that came preinstalled with Windows 7) that refuses to boot the GPT drive, despite the fact that I have successfully booted using the BIOS Compatibility Region on other computers. The only explanation is that there is a bug in the computer's BIOS; therefore, I've tried updating the BIOS, to no avail. I've also set the bootable flag on the Protective MBR's GPT partition - this did nothing. I've called Dell technical support, and went through 3 departments until they eventually wanted me to pay $60 to have one of their support guys help me work around a bug in their own BIOS. I declined. Because of all this, I've decided that fixing the BIOS is a dead end. What I want to do instead is use the second pen drive to chainload the first, since if a drive has an MBR, the BIOS will boot it just fine. I don't care how this is done. It can be done using Syslinux, GRUB2, or some other specialized tool. I would prefer to not have to create another partition on the drive to house config files, but I doubt this will be possible. I've tried messing around with Syslinux's `chain32` command (IIRC, that's what it's called), but it seems like this can only do stuff on the same drive. Likewise with GRUB's `chainload +1`. I've fiddled with all this endlessly, but with no luck. I've Googled, but haven't found anything useful. So: how can I chainload a GRUB installation that resides on a separate drive?


Prevent dhcpcd from setting hostname

How to prevent dhcpcd from setting hostname got from server? Change of it breaks a lot of things (including X session). My current distribution is Gentoo, init system is systemd and dhcpcd is spawn by networkmanager.


How to compile LXDE on OpenIndiana - how to deal with those AM errors in lxde-common-qt?

OI is latest 151a7. Fresh install, total newbie, installed ss-dev, gcc-dev, sunstudio, a few other packages I thought were relevant based on what I read. Just want to compile LXDE from source because when I look at installing from components ( http://lxde.org/download ) well not all the newer QT based stuff is there plus I get errors configuring so it's not even easier. So I use http://lxde.git.sourceforge.net/git/gitweb-index.cgi instead i.e. let's start with lxde-common-qt. Clone that. autogen.sh complains automake is not there. export AUTOMAKE="automake-1.10" as trying automake+tab yields that (I know this is not the best way of doing this, but using export guarantees I don't screw up in any lasting fashion). This works, as autogen goes further. Here it starts:               + [ x != x ]     + aclocal ./autogen.sh[25]: aclocal: not found [No such file or directory]     + automake-1.10 --add-missing --copy --include-deps configure.ac: no proper invocation of AM_INIT_AUTOMAKE was found. configure.ac: You should verify that configure.ac invokes AM_INIT_AUTOMAKE, configure.ac: that aclocal.m4 is present in the top-level directory, configure.ac: and that aclocal.m4 was recently regenerated (using aclocal). configure.ac:8: installing `./install-sh' man/Makefile.am:5: ENABLE_REGENERATE_MAN does not appear in AM_CONDITIONAL     + autoconf configure.ac:3: error: possibly undefined macro: AM_INIT_AUTOMAKE           If this token and others are legitimate, please use m4_pattern_allow.           See the Autoconf documentation. configure.ac:40: error: possibly undefined macro: AM_CONDITIONAL     + rm -rf autom4te.cache      * * * So let's take a look at configure.ac:               C_PREREQ([2.57])     AC_INIT(lxde-common-qt,[0.5.5], [],lxde-common-qt)     AM_INIT_AUTOMAKE()     dnl  AC_PROG_INTLTOOL(, [no-xml])     dnl AM_MAINTAINER_MODE          Checks for programs. AC_PROG_INSTALL AC_PROG_LN_S          AC_ARG_ENABLE(man,            [AC_HELP_STRING([--enable-man],                    [regenerate roff man pages from Docbook @<:@default=no@:>@])],            [enable_man="${enableval}"],            [enable_man=no] )  xsessions data of path for GDM AC_ARG_WITH([xsession-path],         AS_HELP_STRING(             [--with-xsession-path=PATH],             [set the install path of xsession data [[DATAROOTDIR/xsessions]]]),             [test x$withval != x && xsesspath="$withval"],             [xsesspath="\${datarootdir}/xsessions"]) AC_SUBST(xsesspath)               if test x"$enable_man" = x"yes"; then         AC_PATH_PROG([XSLTPROC], [xsltproc])         if test -z "$XSLTPROC"; then             enable_man=no         fi              dnl check for DocBook DTD and stylesheets in the local catalog.         JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN],             [DocBook XML DTD V4.1.2], [], enable_man=no)         JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release     /xsl/current/manpages/docbook.xsl],             [DocBook XSL Stylesheets >= 1.70.1], [], enable_man=no) fi          AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test "x$enable_man" != "xno")          AC_OUTPUT([   Makefile   startlxde-qt   lxde-logout-qt   LXDE-Qt.desktop   lxde-logout-qt.desktop   lxpanel/panel   openbox/rc.xml   man/Makefile ])          if test x"$sysconfdir" != x'/etc'; then         echo         echo         echo 'Error: sysconfdir is not /etc.'         echo 'Please consider passing --sysconfdir=/etc to configure.';         echo 'Otherwise default config files will be installed to wrong place.'         echo         echo fi      * * * Sure I see AM_INIT_AUTOMAKE is empty, so I tried putting all sorts of variations of "[lxde-common-qt 0.5.5]" but not success... I mean no, nothing has ever been compiled on this and I don't have much experience. Usually I'll try to install missing packages, use export a bit for obvious things, but those automake errors... what is that. There's no aclocal.m4 file in the project folder:               AUTHORS     lxde-logout-qt.desktop.in      autogen.shlxde-logout-qt.in     autostart     LXDE-Qt.desktop.in     ChangeLog     lxpanel config.h.in     Makefile.am configure     man configure.ac     NEWS     COPYING     openbox     desktop.conf     cmanfm-qt     imagesREADME     INSTALL     startlxde-qt.in     install-sh     wallpapers      Do I need to use something like a *m4_pattern_allow([^m4_cv_])* entry in the configure.ac file?


Which set of commands will limit the outgoing data rate to X kbps for traffic to or from port Y?

I have a Raspberry Pi, and I'd like to have bitcoind running on it. This consumes a lot of my outgoing bandwidth at times, so I'd like to make sure it never uses more than 20 KB/s for Bitcoin data. The Bitcoin protocol uses port 8333 for connections, so I figure it should be possible to identify connections easily by just looking at if either the source or destination port equals 8333. On Linux, which set of commands will make sure that data to and from port 8333 will not exceed 20 KB/s?


How to disable receive email at dns level?

I'm completely new to DNS and how it work. Lately I've been getting mail spammed like crazy on one of my domain. I'm not using any mail for this domain and don't need it. I don't want to stop it just locally, is there a way to edit DNS so that this domain won't even receive any email whatsoever? Thanks in advance.


reliable return code of background process

Let's assume the following piece of bash code:               foo > logfile 2>&1 &     foo_pid=$!          while ps -p$foo_pid     do         ping -c 1 localhost     done          wait $foo_pid          if [[ $? == 0 ]]     then         echo "foo success"     fi      Is it safe to assume that `$?` indeed contains the return code of `foo` and not the return code of `ping`? If the answer to that question is: "You cannot assume that." then how can I modify this piece of code to be sure that `$?` always contains the return code of `foo`?


Command substitution vs I/O Redirection?

I am wondered about differences between **I/O Redirection** and **Command substitution**? For example when I want to redirect `which` command output to `cd` command (I know that it's not a directory) then the `cd` command do not use `which` redirection.   For example `which w3af | cd`? I have to use command substitution like `cd $( which w3af )`, why?


Scripting Language Evolution

I have an assignment due Monday and I need some help because I have no knowledge on the subject and can't even understand what to search exactly. I am not waiting for an essay or something just some guidance or some links. "You are to write a paper on the evolution of server-side technologies used for writing Web applications since the early days of the Web to the present day. Your paper is expected to focus on the following areas: How scripting languages have evolved, providing code examples. You should highlight the changes that you consider the most significant for application developers and provide analysis as to why you have selected them." As I understand it, I have to mention shell scripting and its evolution and other languages that have evolve.. I am not sure. Thank you in advance!


mount: / not mounted or bad option

I'm running a custom Raspbmc build on my raspberry pi. On startup, I always see the message               mount: / not mounted or bad option      The filesystem is still mounted, but still want to know whats causing the trouble. my `/etc/fstab` looks like this:               proc            /proc           proc    defaults,noatime,nodiratime         0       0     devpts          /dev/pts        devpts  rw,nosuid,noatime,nodiratime,gid=5,mode=620        0       0     /dev/mmcblk0p1  /boot           vfat    ro,noatime,nosuid,nodiratime         0       0     UUID=7e790ee3-660b-46ab-8378-d8ea91730162  /               ext4    defaults,data=writeback,nobh,nodiratime,noatime 0       0     tmpfs           /home/pi/.xbmc/temp     tmpfs   rw,size=5M,nosuid,noexec,nodev,noatime,nodiratime,gid=1000,uid=1000     0       0     /tmp            /var/tmp                none    rw,noexec,nosuid,nodev,bind     0       0


The key codes for Caps Lock, Shift, Left Control and FN key?

Can somebody please provide the key codes for these keys:   * Caps Lock   * Left Shift   * Left Control   * Option key   * FN The key code I'm talking about is something along the lines of `\<Esc>[200~`, although I have no idea what that outputs. :P Thanks! I need this for remapping some keys in Vim, tmux etc.


How do I show desktop icons in Elementary OS?

How can I show icons on the desktop in Elementary OS Luna? I tried using "gnome-tweak-tool" and "gconf-editor" but they didn't work.


What is the difference between the use of ; and executing a script

I'm using `bash` as my main shell, but it's an open question and responses for shells others than `bash` are very welcome. If I'm typing interactively               #original line      #wget http://something.com && unzip something && mv -f something /home/poney/      #new line     wget http://something.com ; unzip something ; mv -f something /home/poney/      Does it make any difference in term of execution pile, order, memory, interpretation, permission compare to a script that contains those line:               #!/bin/bash     wget http://something.com     unzip something      mv -f something /home/poney/      ### PS: except the fact that executing a script is shorter than typing 3 command in a row obviously.


Limit find results in SSH

I using a line like this to search for a bunch of files:               find . -name "page.php      The results are hundreds of lines and I can't see it all. (I'm trying to just copy/paste it into excel to analyze it). I tried this:               find . -name "index1.php | less      That did something, but I was in this screen that I couldn't figure out how to exit out of. I had to close putty and open it up again. What is the best way to just limit the results to the viewable area so I can copy, then hit return and get the next group. Or, is there a way to make putty not truncate the results? Thanks in advance.


Install a package and all its dependencies without a confirmation prompt with FreeBSD pkg

Is there a way to automatically install packages and their dependencies, like with `apt-get -y` in Debian, without being prompted each and every time? Installing Webmin, NGiNX and nano in 1 step, all their dependancies automatically:               sudo apt-get -y install webmin nginx nano      On FreeBSD 10, _(I'm still getting used to Ports)_ I would type:               pkg install webmin nginx nano      If I append the `-y` switch, it just fails. I looked at the documentation at meBSD and FreeBSD Handbook and there doesn't seem to be an option/switch to use. Any ideas anyone?


Saving source code from the internet

How can I save all the documents from this adress to my PC? https://svn.linuxsampler.org/svn/liblscp/trunk/ This is a package I need to build "Open Octave DAW" from source.


Building Linux from Scratch stuck, incompatible sed version?

I am trying to build Linux from Scratch per LFS website While I was able to install all the packages until 6.7.1 without any error, I am stuck at Installation of Linux API headers (This is after I chroot into the installation) with the error,               /bin/sh: /tools/bin/sed: No such file or directory      Now I checked if, the file exists and I found it does.               ls -all /tools/bin/sed     -rwxr-xr-x 1 root root 260350 Aug  7 20:27 /tools/bin/sed      exists in the installation, and I found it does. If I try executing sed, I get the error.               /bin/sh: /tools/bin/sed: No such file or directory      Trying to find the type of file sed is, I get               file /tools/bin/sed     ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.24       I notice that the for part in sed is different from other files in /tools/bin which have **for GNU/Linux 2.6.25** What am I missing here?


chroot: failed to run command ‘/bin/bash’: No such file or directory

When I run the `chroot` command an error is given:               failed to run command ‘/bin/bash’: No such file or directory


Does the vmlinux header contain the length of the kernel image?

I am trying to disassemble a compound file that consists of several parts, one of which is an uncompressed kernel sandwiched between several other files. I am trying to find the exact length of the kernel part which is proving difficult. Is there some indication in the vmlinux header of how much data the bootloader is supposed to read before executing, or is it assumed that all contents of the vmlinux file are to be loaded at handoff from the bootloader?


Proper syntax for "id -r" command

I'm trying to see if `id -r` will print out the UID or username of the user who logged into the system despite any `su`'s or `sudo`'s. I'm interested in doing this so I can keep people a little more accountable and to tailor script functioning accordingly (i.e: they issue a sudo on a script and it pulls information from the logged in user's home directory). I realize `sudo` sets `SUDO_USER` but I don't want to rely on this because it's a variable that can be modified by the user, and it just has the username of the user who issued the most recent sudo (i.e: `sudo -i ; sudo -iu randomUser ; echo $SUDO_USER` prints out "root" instead of the actual user). Nothing in the man pages or that I can find online seems to indicate what the proper use of this command is and the obvious permutations aren't working:               [root@ditirlns03 ~]# id -r     id: cannot print only names or real IDs in default format     [root@ditirlns03 ~]# id -r jadavis6     id: cannot print only names or real IDs in default format     [root@ditirlns03 ~]# id -r root     id: cannot print only names or real IDs in default format      At this point, I'm still not sure `id -r` is going to print out what I want, mostly because I can't figure out how to get it to print out anything at all.


I can't install Scientific Linux CERN 5.7 on VMware 9 nor 8

After installing VMware I use create the new virtual machine to install SLC 5.7. I choose the installer disk image file(iso) which is the iso file of SLC 5.7 in one of my hard drives. Continue a few more steps it asks me: > What type of media contains the packages to be installed? Local CDROM Hard > drive NFS Image FTP HTTP None of the choices works. Why VMware can't find the iso file? I extracted the iso file and write it on DVD and use the installer disk but this error appears again. I tried everything comes to my mind, but still I can't install it.


Guake transparency Debian

When I open guake in Debian Weezy using lxde its transparency does not work. I'm shown the desktop instead of the window I had been looking at. Is there a fix for this?


Is there any prompt decoration package available for iPython?

One can argue, that IPython can be a productive replacement for bash. I wonder, if anyone here have seen some sort of prompt decoration for IPython, that can be compared to the standard bash prompt, or - ideally - to liquid prompt?


mounting a SD card without a partition

I try to mount a SDHC card under GNU/Linux. Unlike what happens usually, `/var/log/syslog` doesn't mention `sdb1`, just:               Jul 26 16:07:53 xvii kernel: [  159.404842] scsi 6:0:0:0: Direct-Access     Singim   SD Card   MMC/SD 1.4F PQ: 0 ANSI: 0 CCS     Jul 26 16:07:53 xvii kernel: [  159.405115] sd 6:0:0:0: Attached scsi generic sg2 type 0     Jul 26 16:08:01 xvii kernel: [  168.239600] sd 6:0:0:0: [sdb] Attached SCSI removable disk      Moreover `fdisk -l /dev/sdb` outputs nothing. What should I do? **EDIT (2014-07-27):** I could have this SD card again, and it seems to be faulty. Yesterday, I was trying it via a USB card reader. Today, I've tried it directly by putting it in the SD slot of my laptop, and I got thousands of I/O errors:               Jul 27 11:56:35 xvii kernel: [ 8091.317234] mmc0: new high speed SDHC card at address 1234     Jul 27 11:56:35 xvii kernel: [ 8091.317477] mmcblk0: mmc0:1234 SA04G 3.68 GiB     Jul 27 11:56:35 xvii kernel: [ 8091.320119] mmc0: Got data interrupt 0x00200000 even though no data operation was in progress.     Jul 27 11:56:35 xvii kernel: [ 8091.322277] mmcblk0: error -84 transferring data, sector 0, nr 8, cmd response 0x900, card status 0xb00     Jul 27 11:56:35 xvii kernel: [ 8091.322289] mmcblk0: retrying using single block read     Jul 27 11:56:35 xvii kernel: [ 8091.324862] mmcblk0: error -84 transferring data, sector 0, nr 8, cmd response 0x900, card status 0x0     Jul 27 11:56:35 xvii kernel: [ 8091.324872] end_request: I/O error, dev mmcblk0, sector 0     Jul 27 11:56:35 xvii kernel: [ 8091.326398] mmcblk0: error -84 transferring data, sector 1, nr 7, cmd response 0x900, card status 0x0     Jul 27 11:56:35 xvii kernel: [ 8091.326405] end_request: I/O error, dev mmcblk0, sector 1     Jul 27 11:56:35 xvii kernel: [ 8091.329056] mmcblk0: error -84 transferring data, sector 2, nr 6, cmd response 0x900, card status 0x0     [...]      and `gdisk -l` didn't find any partition table, and `lsblk` output about the card:               mmcblk0                  179:0    0   3.7G  0 disk      A bit later I tried again, and the card was recognized:               Jul 27 12:08:00 xvii kernel: [ 8776.617712] mmc0: new high speed SDHC card at address 1234     Jul 27 12:08:00 xvii kernel: [ 8776.618117] mmcblk0: mmc0:1234 SA04G 3.68 GiB     Jul 27 12:08:00 xvii kernel: [ 8776.620324]  mmcblk0: p1      and I could mount it: /dev/mmcblk0p1 on /media/mmc type vfat (rw,nosuid,nodev,noexec,noatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=utf8,shortname=mixed,errors=remount- ro,user=vinc17) `gdisk -l /dev/mmcblk0` found only a MBR partition table, but the second partition table overlaps the last partition.


New menu item called "arch_grub" emerged as a temporary boot device

I have Ubuntu installed along with Arch. I re-installed Arch a few times already. Now it works well. Once when I was re-installing Arch during boot when I chose the "Choose temporary boot devise" option at BIOS and I saw a new menu item (among "Hdd", "Usb", "Dvd") appeared being `arch_grub`. I ran boot- repair utility later but this menu item is still there. How do I get rid of it?               $ sudo fdisk -l     [sudo] password for alex:           Disk /dev/sda: 1000.2 GB, 1000204886016 bytes     255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 4096 bytes     I/O size (minimum/optimal): 4096 bytes / 4096 bytes     Disk identifier: 0x000a1bc4             Device Boot      Start         End      Blocks   Id  System     /dev/sda1          526336   382824447   191149056   83  Linux     /dev/sda2            2048      526335      262144    b  W95 FAT32     /dev/sda3       382826494  1953523711   785348609    5  Extended     Partition 3 does not start on physical sector boundary.     /dev/sda5      1946028032  1953523711     3747840   82  Linux swap / Solaris     /dev/sda6   *   382834688  1946025983   781595648   83  Linux          Partition table entries are not in disk order      and               $ lsblk     NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sda      8:0    0 931.5G  0 disk      ├─sda1   8:1    0 182.3G  0 part /media/alex/arch     ├─sda2   8:2    0   256M  0 part /media/alex/arch_boot     ├─sda3   8:3    0     1K  0 part      ├─sda5   8:5    0   3.6G  0 part [SWAP]     └─sda6   8:6    0 745.4G  0 part /     sr0     11:0    1  1024M  0 rom


How to Print Summary of Packages that Can be Updated?

When I log into Ubuntu Server 12.04 LTS, I'm met with a message that looks something like this:               6 packages can be updated.     6 updates are security updates.      How can I get a detailed summary of the updates above? I don't want to _blindly_ install these updates with `sudo apt-get dist- upgrade`. I'd like to know what I'm installing before I install it, or even pick and choose which updates I want to apply.


Setting nvidia properties during X-server startup

I am using the proprietary nvidia drivers in KDE (Debian Testing) and as many others experience issues with performance. I noticed that it gets a bit better if I run:               nvidia-settings -a InitialPixmapPlacement=0      at least with Google Chrome. How can I add this to the standard start-up configuration? I tried adding an option to `xorg.conf` and I tried adding this line to a newly created `.xinitrc`, but it didn't work. Where should I have it added?


How to list sample of files from a directory

I have a directory that contains hundred thousands of files.   I need to list sample of these files (example 10 files), without processing all the files found in the directory which will take too much processing time.


Gaining root privileges in SCO

I am learning Linux for work, so am still a bit rusty on the edges. I need to change the folder permission of the directory `/opt`, and I know in Linux, you do the following:               chmod 775 /opt      I get a message under that saying:               chmod: WARNING: cannot change /opt/: Operation not permitted (error 1).      Does that mean I need sudo permissions? But the `sudo` command is not recognized. But in SCO, it is different, as SCO is a little older than Ubuntu. I have found this link on the net, but don't quite understand what they mean by "memo": http://osr507doc.sco.com/en/OSUserG/_Changing_file_permissions.html Is there an easier way of doing this, like something similar to Linux?


Find out when the recoll index was last updated

Is there a way to find out, when a recoll-index was last updated?


Black screen after logged in. Xubuntu 12.10

Hi I'm a total noob in Linux/ubuntu. I had Xubuntu 12.10 running for a month or so without major problems. A few days ago after downgrad firefox from 29 to 28 by removing and reinstalling and upgrading system , the system blacked out and can't get into GUI ever again. The symptoms are: log in screen fine, after logged in, a black screen with a white cursor stopped in the middle the screen, unmovable, everything stucked here. I had tried to log in to tty1, and here I tried a few things:   1. run `startx`, a small error window pops out saying "failed to load session "gnome"", and an button "log out", I clicked it and was brought back to tty1 seeing a lot of messages(*1)   2. run `lspci | -i VGA`, it gives "00.02 0 VGA compatible ....Intel..integrated....." which is my integraded intel graphic card.   3. run `sudo apt-get --purge remove nivdia*`, it gives 0 installed package to remove. so nothing to remove here.   4. try to check file /etc/X11/xorg.conf, but no such file, instead there are several named a little bit different like xorg.conf.d*....   5. I send a copy of /var/log/Xorg.0.log to my email and it is attached here http://paste.ubuntu.com/7403846/ Can someone help me trouble shoot this? thanks very much!


No domain defined in /etc/resolv.conf

I see more and more servers that have no **domain** defined in the `/etc/resolv.conf` file. Only a **search** entry.   In what cases is this setup used ?   Are there any cases where it must not be used ?               nameserver xxx.xxx.xxx.xxx     nameserver yyy.yyy.yyy.yyy     nameserver zzz.zzz.zzz.zzz          search domain1 domain2 domain3 ...