In My server, running Linux Redhat, I have NGINX, PHP Installed already. Now I want to install PHP-FPM, VARNISH, APC, FASTCGI as well Memcache to speed up my server for my wordpress website.. (I am not expert in linux/redhat). I read this and so I want to install it in my server. http://www.danielmiessler.com/blog/optimizing-wordpress-with-nginx- varnish-w3-total-cache-amazon-s3-and-memcached. I have excidently done update and after that I get following error               yum install varnish     Loaded plugins: fastestmirror, priorities, protectbase, replace     Loading mirror speeds from cached hostfile      * base: centos.mirror.secureax.com      * epel: mirror.nus.edu.sg      * extras: centos.mirror.secureax.com      * mratwork-epel: mirror.nus.edu.sg      * remi: mirror.smartmedia.net.id      * updates: centos.mirror.secureax.com     http://centos.alt.ru/repository/centos/6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403 Forbidden"     Trying other mirror.     Error: Cannot retrieve repository metadata (repomd.xml) for repository: mratwork-centalt. Please verify its path and try again      Please help me what should I do now to install varnish?? and other stuff? **Files** **CentOS-Base.repo**               # CentOS-Base.repo     #     # The mirror system uses the connecting IP address of the client and the     # update status of each mirror to pick mirrors that are updated to and     # geographically close to the client.  You should use this for CentOS updates     # unless you are manually picking other mirrors.     #     # If the mirrorlist= does not work for you, as a fall back you can try the      # remarked out baseurl= line instead.     #     #          [base]     name=CentOS-$releasever - Base     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os     #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6          #released updates      [updates]     name=CentOS-$releasever - Updates     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates     #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6          #additional packages that may be useful     [extras]     name=CentOS-$releasever - Extras     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras     #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6          #additional packages that extend functionality of existing packages     [centosplus]     name=CentOS-$releasever - Plus     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus     #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/     gpgcheck=1     enabled=0     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6          #contrib - packages by Centos Users     [contrib]     name=CentOS-$releasever - Contrib     mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib     #baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/     gpgcheck=1     enabled=0     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6      **CentOS-Debuginfo.repo**               # CentOS-Debug.repo     #     # The mirror system uses the connecting IP address of the client and the     # update status of each mirror to pick mirrors that are updated to and     # geographically close to the client.  You should use this for CentOS updates     # unless you are manually picking other mirrors.     #          # All debug packages from all the various CentOS-5 releases     # are merged into a single repo, split by BaseArch     #     # Note: packages in the debuginfo repo are currently not signed     #          [debug]     name=CentOS-6 - Debuginfo     baseurl=http://debuginfo.centos.org/6/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-6     enabled=0      **CentOS-Media.repo**               # CentOS-Media.repo     #     #  This repo can be used with mounted DVD media, verify the mount point for     #  CentOS-6.  You can use this repo and yum to install items directly off the     #  DVD ISO that we release.     #     # To use this repo, put in your DVD and use it with the other repos too:     #  yum --enablerepo=c6-media [command]     #       # or for ONLY the media repo, do this:     #     #  yum --disablerepo=\* --enablerepo=c6-media [command]          [c6-media]     name=CentOS-$releasever - Media     baseurl=file:///media/CentOS/             file:///media/cdrom/             file:///media/cdrecorder/     gpgcheck=1     enabled=0     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6      **CentOS-Vault.repo**               # CentOS-Vault.repo     #     # CentOS Vault holds packages from previous releases within the same CentOS Version     # these are packages obsoleted by the current release and should usually not      # be used in production     #-----------------          [C6.0-base]     name=CentOS-6.0 - Base     baseurl=http://vault.centos.org/6.0/os/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.0-updates]     name=CentOS-6.0 - Updates     baseurl=http://vault.centos.org/6.0/updates/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.0-extras]     name=CentOS-6.0 - Extras     baseurl=http://vault.centos.org/6.0/extras/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.0-contrib]     name=CentOS-6.0 - Contrib     baseurl=http://vault.centos.org/6.0/contrib/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.0-centosplus]     name=CentOS-6.0 - CentOSPlus     baseurl=http://vault.centos.org/6.0/centosplus/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0     #-----------------          [C6.1-base]     name=CentOS-6.1 - Base     baseurl=http://vault.centos.org/6.1/os/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.1-updates]     name=CentOS-6.1 - Updates     baseurl=http://vault.centos.org/6.1/updates/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.1-extras]     name=CentOS-6.1 - Extras     baseurl=http://vault.centos.org/6.1/extras/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.1-contrib]     name=CentOS-6.1 - Contrib     baseurl=http://vault.centos.org/6.1/contrib/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.1-centosplus]     name=CentOS-6.1 - CentOSPlus     baseurl=http://vault.centos.org/6.1/centosplus/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0     #-----------------          [C6.2-base]     name=CentOS-6.2 - Base     baseurl=http://vault.centos.org/6.2/os/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.2-updates]     name=CentOS-6.2 - Updates     baseurl=http://vault.centos.org/6.2/updates/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.2-extras]     name=CentOS-6.2 - Extras     baseurl=http://vault.centos.org/6.2/extras/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.2-contrib]     name=CentOS-6.2 - Contrib     baseurl=http://vault.centos.org/6.2/contrib/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.2-centosplus]     name=CentOS-6.2 - CentOSPlus     baseurl=http://vault.centos.org/6.2/centosplus/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0     #-----------------          [C6.3-base]     name=CentOS-6.3 - Base     baseurl=http://vault.centos.org/6.3/os/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.3-updates]     name=CentOS-6.3 - Updates     baseurl=http://vault.centos.org/6.3/updates/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.3-extras]     name=CentOS-6.3 - Extras     baseurl=http://vault.centos.org/6.3/extras/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.3-contrib]     name=CentOS-6.3 - Contrib     baseurl=http://vault.centos.org/6.3/contrib/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.3-centosplus]     name=CentOS-6.3 - CentOSPlus     baseurl=http://vault.centos.org/6.3/centosplus/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0     #-----------------          [C6.4-base]     name=CentOS-6.4 - Base     baseurl=http://vault.centos.org/6.4/os/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.4-updates]     name=CentOS-6.4 - Updates     baseurl=http://vault.centos.org/6.4/updates/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.4-extras]     name=CentOS-6.4 - Extras     baseurl=http://vault.centos.org/6.4/extras/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.4-contrib]     name=CentOS-6.4 - Contrib     baseurl=http://vault.centos.org/6.4/contrib/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0          [C6.4-centosplus]     name=CentOS-6.4 - CentOSPlus     baseurl=http://vault.centos.org/6.4/centosplus/$basearch/     gpgcheck=1     gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6     enabled=0


md raid1 ext3 and 4k sectors slow with directory operations

I recently moved from a hardware RAID1 enclosure to using two eSATA drives with md. Everything seems to be working fine, except for the fact that directory traversals/listings sometimes crawl (on the order of 10s of seconds). I am using an ext3 filesystem, with the block size set to 4K. Here is some relevant output from commands that should be important: mdadm --detail:               /dev/md127:             Version : 1.2       Creation Time : Sat Nov 16 09:46:52 2013          Raid Level : raid1          Array Size : 976630336 (931.39 GiB 1000.07 GB)       Used Dev Size : 976630336 (931.39 GiB 1000.07 GB)        Raid Devices : 2       Total Devices : 2         Persistence : Superblock is persistent              Update Time : Tue Nov 19 01:07:59 2013               State : clean      Active Devices : 2     Working Devices : 2      Failed Devices : 0       Spare Devices : 0                   Events : 19691              Number   Major   Minor   RaidDevice State            2       8       17        0      active sync   /dev/sdb1            1       8        1        1      active sync   /dev/sda1      fdisk -l /dev/sd{a,b}:               Disk /dev/sda: 1000.2 GB, 1000204886016 bytes, 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: 0xb410a639             Device Boot      Start         End      Blocks   Id  System     /dev/sda1            2048  1953525167   976761560   83  Linux          Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes, 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: 0x261c8b44             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1            2048  1953525167   976761560   83  Linux      time dumpe2fs /dev/md127 |grep size:               dumpe2fs 1.42.7 (21-Jan-2013)     Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file     Block size:               4096     Fragment size:            4096     Inode size:               256     Required extra isize:     28     Desired extra isize:      28     Journal size:             128M          real    2m14.242s     user    0m2.286s     sys     0m0.352s      The way I understand it, I've got 4K sectors on these drives (recent WD reds), but the partitions/filesystems appear to be properly aligned. Since it looks like I'm using md metadata version 1.2, I think I'm also good (based on mdadm raid1 and what chunksize (or blocksize) on 4k drives?). The one thing I haven't found an answer for online is whether or not having an inode size of 256 would cause problems. Not all operations are slow, it seems that the buffer cache does a great job of keeping things zippy (as it should). My kernel version is 3.11.2 **EDIT: new info, 2013-11-19**               mdadm --examine /dev/sd{a,b}1 | grep -i offset         Data Offset : 262144 sectors        Super Offset : 8 sectors         Data Offset : 262144 sectors        Super Offset : 8 sectors      Also, I am mounting the filesystem with `noatime,nodiratime` I'm not really willing to mess with journaling much since if I care enough to have RAID1, it might be self-defeating. I am tempted to turn on directory indexing **EDIT 2013-11-20** Yesterday I tried turning on directory indexing for ext3 and ran `e2fsck -D -f` to see if that would help. Unfortunately, it hasn't. I am starting to suspect it may be a hardware issue (or is md raid1 over eSATA just really dumb to do?). I'm thinking of taking each of the drives offline and seeing how they perform alone. **EDIT 2013-11-21** iostat -kx 10 |grep -P "(sda|sdb|Device)":               Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util     sda               0.37     1.17    0.06    0.11     1.80     5.10    84.44     0.03  165.91   64.66  221.40 100.61   1.64     sdb              13.72     1.17    2.46    0.11   110.89     5.10    90.34     0.08   32.02    6.46  628.90   9.94   2.55     Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await r_await w_await  svctm  %util     sda               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00     sdb               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00    0.00    0.00   0.00   0.00      I truncated the output past this since it was all 0.00% I really feel like it should be irrespective of ext4 vs. ext3 because this isn't just feeling a little slower, it can take on the order of tens of seconds to a minute and some change to tab auto-complete or run an ls **EDIT: Likely a hardware issue, will close question when confirmed** The more I think of it, the more I wonder if it's my eSATA card. I'm currently using this one: http://www.amazon.com/StarTech-PEXESAT32-Express-eSATA- Controller/dp/B003GSGMPU However, I just checked dmesg and it's littered with these messages:               [363802.847117] ata1.00: status: { DRDY }     [363802.847121] ata1: hard resetting link     [363804.979044] ata2: softreset failed (SRST command error)     [363804.979047] ata2: reset failed (errno=-5), retrying in 8 secs     [363804.979059] ata1: softreset failed (SRST command error)     [363804.979064] ata1: reset failed (errno=-5), retrying in 8 secs     [363812.847047] ata1: hard resetting link     [363812.847061] ata2: hard resetting link     [363814.979063] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 10)     [363814.979106] ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 10)     ....     [364598.751086] ata2.00: status: { DRDY }     [364598.751091] ata2: hard resetting link     [364600.883031] ata2: softreset failed (SRST command error)     [364600.883038] ata2: reset failed (errno=-5), retrying in 8 secs     [364608.751043] ata2: hard resetting link     [364610.883050] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 10)     [364610.884328] ata2.00: configured for UDMA/100     [364610.884336] ata2.00: device reported invalid CHS sector 0     [364610.884342] ata2: EH complete      I am also going to buy shorter shielded eSATA cables as I'm wondering if there is some interference going on.


Is there a web browser for Linux that implements the Trident engine (Internet Explorer)?

Internet Explorer uses the Trident engine for rendering. I have an app that was made for IE only. It is a big application I inherited, and it is JavaScript heavy. It's and older app, and it will not work correctly on newer browsers, even IE, later versions has quirks but it works. The app is not straight text, so I can't get rid of all the images or anything like that. I do not have the luxury of installing Linux and then using a VM like VirtualBox to run Windows. It must be native to Linux (or Linux can run the Windows program, maybe via Wine). It will not work on Windows non-IE browsers either, but that is another matter. It is not a trivial matter to change the code. Is there any browser I can use to emulate IE or that has the Trident engine?


debootstrap fails to download Debian squeeze

I'm trying to use debootstrap to create a debian32 system and compile the kernel there but I'm not capable off.               root@citsnmaiko-deb:~# debootstrap  --verbose --arch i386 squeeze /opt/chroots/debian32/ http://ftp.debian.org/debian/     I: Retrieving Release     E: Failed getting release file http://ftp.debian.org/debian/dists/squeeze/Release     root@citsnmaiko-deb:~#       I'm behind a proxy but apt-get and wget works fine, I already tryied to set the http_proxy var but without success. what else can I do ?


SciTE Auto Save Temporary File

I was running an application that seemingly froze the GUI of my Linux distro. After a `Ctrl``Alt` `Backspace` I got back to a terminal and reloaded the GUI. However, even with the below User Options settings, when I reloaded SciTe, I didn't get my session restored, but more importantly the unsaved data since last save (On account of file being stored on removable storage that was temporarily unplugged) seems to be gone. Is there no temporary file that SciTE maintains in my home directory of unsaved changes??               save.on.timer=30     save.on.deactivate=1     load.on.activate=1     are.you.sure.on.reload=1     reload.preserves.undo=1     top.filters=$(all.files)All Source|$(source.files)     max.file.size=5000000     temp.files.sync.load=1     save.check.modified.time=1     save.session=1     save.recent=1     save.position=1     save.find=1     session.folds=1     session.bookmarks=1     highlight.current.word=1     view.eol=1     toolbar.usestockicons=1     find.close.on.find=0     find.in.files.close.on.find=0


AIX cifs hostname with underscore

I am trying to type this comand but for some reason it takes the first and not the second version. I have entered both the host names in the host file, FYI. This command works (hostname **zq13c1** ):               mkcifsmnt -f /aix_bk5 -d AIX -h zq13c1 -c 'aix_user' -p 'Cognizant123' -u 214 -g 204 -t rw       This command does not work (hostname **zq13c1_bk** ):               mkcifsmnt -f /aix_bk5 -d AIX -h zq13c1_bk -c 'aix_user' -p 'Cognizant123' -u 214 -g 204 -t rw


Hostname and IP address mapping in /etc/hosts

In my linux machine, when I run `hostname`, it shows `mongodb`, but when I run `host mongodb`, it shows:               mongodb@mongodb:/var/hadoop/hadoop-1.2.1/bin$ host mongodb     Host mongodb not found: 2(SERVFAIL)      My `/etc/hosts` file:               192.168.10.10   mongodb     192.168.10.10   localhost     127.0.0.1       localhost     #127.0.0.1 localhost     # The following lines are desirable for IPv6 capable hosts     ::1     ip6-localhost ip6-loopback     fe00::0 ip6-localnet     ff00::0 ip6-mcastprefix     ff02::1 ip6-allnodes     ff02::2 ip6-allrouters        * My first question is: Since `/etc/hosts` is mapping from IP to hostname, why this machine cannot resolve the hostname `mongodb` to IP 192.168.10.10? Instead, when I run `host localhost`, it can be resolved and shows:              localhost has address 127.0.0.1        * My another question: According to the `/etc/hosts` file, the hostname `localhost` should have been resolved to 192.168.10.10 instead of loopback IP address 127.0.0.1. Anybody can explain this to me?


No *shutdown* function in KDE

My base system is Gentoo amd64, up to date. Before the upgrade, I have the _shutdown_ button in the KDE menu. But after the upgrade, this button is gone...I think it is because of the permission settings are wrong. The user account I used is in the _user_ group. But I have no idea how the set the permission. I even tried to delete the KDE configuration files in the user directory and try to re-configure everything, but does not work.


help with truncate \ find

This command won't work:               $ truncate -s 0 $(find . -size +1c type -f -exec grep -LwE 'keyword1|keyword2|keyword3' {} +)          "find: paths must precede expression: type     Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]     truncate: missing file operand     Try `truncate --help' for more information."      Note: I understand whitespace could cause issues.               $ rm $(find . -size +1b -type f -exec grep -LwE 'keyword1|keyword2|keyword3' {} +)       works properly but it's not what I need as well.


Wifi Not Working on Joli OS

I recently installed Joli OS on my netbook because it was far too slow to run Ubuntu without lag and I could not get Chromium OS to work no matter what I did. When I install Joli OS--which went smoothly with no problems--it boots and tells me I have to connect to the Internet to do anything but I cannot connect as my wifi does not work for some reason. I have an Acer Aspire V5-122P-0643 and I must apologize as I am relatively new to Linux so I dont know most things. Any help is appreciated I need the netbook for school and I need Internet and it does not have an ethernet port. Also I dont know if it will help but this is the same reason Chromium OS won't work it also will not allow me to use wifi but on Ubuntu my wifi works.


Why don't I get a Gnome GUI when I install Red Hat?

I'm trying to install Red Hat on my Windows system but Im facing a problem. I get only one option during installation which is "Minimal" and even if I check Gnome desktop in customize options, I only get the command line after installation completes. What am I doing wrong? I'm using a USB stick to install. Also another stange thing is that I get many options alongside Minimal when installing in Virtualbox - like Desktop, Server, etc.


How to print shell variables and values to be able to copy/paste them?

In Bash 4.2.25, the `set` and `env` output is not escaped, so shell escapes and any non-printable characters won't be copy-pasteable. Take for example this shell session:               $ export foo=$'a\nbar=\baz'     $ env | grep -A 1 foo     foo=a     baraz      Ditto for for example colors - They are printed literally, and can mess up the terminal. **How do you print all variables with their values in a way that the output can be copied and pasted to give the same environment?** * * Obviously with the standard caveats about readonly variables, special variables like `$_` and the like.


RHEL:Change Screen Resolution of Virtual Console

I am working on a RHEL 6.3 Workstation. And the monitor is a HD AOC Monitor. Problem I am facing is whenever this machine starts up, it runs with maximum screen resolution. It is a big screen and therefore causing eye-strain while I am working on virtual terminal (accessed by typing ALT+CTRL+(F1-F6)). How can I resolve this issue?               [root@manmatha grub]# uname -a     Linux manmatha 2.6.32-358.2.1.el6.x86_64 #1 SMP Wed Feb 20 12:17:37 EST 2013     x86_64 x86_64 x86_64 GNU/Linux


XFCE or pure X11 commands, toggle compositing immediately without restarting X

How can i disable compositing via the command line? I need to disable temporarily for some games, like Nexuiz, for use in a wrapper script to toggle compositing status.


How can I make sure that eth1 get its fe80 IPv6 address immediately on startup, even if it's not physically connected?

I'm working on an embedded-x86 Linux device that runs Debian (Linux 3.8.13). This device has two Ethernet ports, eth0 and eth1. If I boot up this device with only eth0 connected to a switch, and ssh in to it and do an 'ifconfig', I get this:               root@msli-DCP-11234772:~# ifconfig     eth0      Link encap:Ethernet  HWaddr 00:1c:ab:00:0a:60               inet6 addr: fe80::21c:abff:fe00:a60/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:5659 errors:0 dropped:4102 overruns:0 frame:0               TX packets:1071 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:1313254 (1.2 MiB)  TX bytes:224889 (219.6 KiB)               Interrupt:16 Memory:fc500000-fc520000          eth1      Link encap:Ethernet  HWaddr 00:1c:ab:00:0a:61               UP BROADCAST MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000               RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)               Interrupt:17 Memory:fc520000-fc540000      Note that eth0 has an "inet6 addr" assigned to it, while eth1 does not. If/when I plug eth1 into a network switch, an "inet6 addr" line will appear in ifconfig's output at that time (and it will stay present even if I unplug the Ethernet cable from eth1 again). So it seems that Linux doesn't bother associating an Ethernet device with its IPv6 address until the first time that Ethernet device is actually connected to something. That sort-of-works, but I have some programs that are supposed to send IPv6 multicast packets out of both ports at all times, and they can't do that on a port that doesn't have an IPv6 address assigned to it. So what I'd like to do is find a way to force Linux to associate the device's self-assigned IPv6 address (i.e. fe80::blah, where blah is derived from the MAC address on the Ethernet chip) during startup, rather than waiting until the Ethernet port is actually connected. Is there a way to do that? (The advantage would be that my programs could just scan the list of network devices during launch and use them -- currently they have to set up an AF_NETLINK socket to be notified of network-config changes, which sort-of works but is more complicated than I'd like, and also a bit slow to react)


Split a returned block of text into lines in terminal?

When I give commands like `echo $PATH` or `which program`, I often get a very large block of text consisting of may directories. This is fairly useless, if I am for example, looking to see if there is or is not one specific path among them. **Is there a way to split these up so that each entry starts on a new line?** The output does not include line breaks, but I can see there are appropriate delimiter characters like `:` that I could use.


Tracking user CPU hours

I am looking to work out which users on our system are using the most CPU resources. to check this? So I would like to find out:   * CPU-hours this month, (and % of total)   * CPU hours this week, (and % of total)   * CPU hours ever, (and % of total) For both real users and system processes


Is there is a PPA-service equivalent in the Fedora world?

For Ubuntu there is this convenient PPA service available where you can get your own package repository. You can put there source packages which are under an open source license, e.g. development snapshots of your software. (The server takes care of creating the right binary package and signs it with the repository key.) Users then only need to add the repository address with one command and can install the packages via apt-get. Since I am looking into Fedora - is there is something like this available for Fedora packages? If yes, what architectures/distribution versions are supported? How much space is available? What is the way to publish packages for multiple rpm distributions via such a service (e.g. current Fedora version and RHEL)?


Video colors reversed (negative) in Ubuntu 12.04 LTS

What's the fix for negative colors in videos (Ubuntu 12.04 LTS)? Pictures or thumbnails are not effected, only videos. It does not seem to be a browser problem as videos viewed offline exhibit the color reversal. I have tried Movie Player and VLC media player, the problem occurs in both. Videos viewed online (youtube) have the color problem AND are compressed horizontally. Videos still working fine in XP (dual-boot). I have tried reinstalling Flash Player but so far any video type is effected. My video driver is correct for my ACER X223w monitor. Note the lovely green skin tone and red leaves! The rest of window is not effected, only the video. ![enter image description here](http://i.stack.imgur.com/RNrzv.png) UPDATE: Installed "YouTube ALL HTML5 2.1.1" per advice on Ubuntuforums.org, chose the option to disable Flash on Youtube, that cleared up the online video problem. Now I need to figure out how to fix the problem when using the offline viewers. UPDATE: Found that the colors while viewing offline were not negative, just too strong giving that "neon" look. Adjusted saturation, etc., and got close to "normal". Hard to do with VLC, every time I move the mouse, the screen goes black. Similar with Movie Player but I'll figure it out. Probably end up uninstalling VLC as it seems to be a lot of trouble to adjust. Might try some other viewers. Cancel red alert!


blank screen after kernel upgrade

I am running ubuntu 10.10 with catalyst ati drivers which I installed from the amd website. Recently I took some updates which included a new kernel. I cannot boot into ubuntu. The screen shows ubuntu 10.10 thing but after that the it goes blank. I am using suse grub loader.


CD into directory from HISTORY in a bash script or alias e.g. $(!!)

I often want to change into the directory of a file on my file system, but I'm not sure where the file is. I search for it like so:               find -type f -name "myfile.txt"      Lets say for the sake of simplicity, that this returns one result, eg. /some/super/long/path/that/i dont/want/to/type/myfile.txt I then usually type this:               cd $(dirname $(!!))      To switch into the directory of the file I was searching for.... **Is there anyway to put this into a shell script or alias, so I can basically type:**               cdlast      and it runs:               cd $(dirname $(!!))      using the shell's HISTORY? I've tried it, and the shell history seems to be missing in bash scripts.


LAMP LiveCD with IDE and xDebug

Does a Linux live-cd exist which has all the following out of the box?               PHP IDE     Line by line PHP debugging via the PHP IDE (xDebug)     LAMP      If yes, please could you let me know what it's called?


Bash, name of the stdin file?

I have to write a bash script which will count symbols like "<" and ">" from stdin. For example:               $ ./myscript.sh <example.html     > - 20     < - 21     Found mismatching brackets!      I did this:               x=`grep -o '>' example.html | wc -l`     y=`grep -o '<' example.html | wc -l`     if [ "$x" -ne "$y" ]; then       echo "Mismatch!"     fi     echo $x     echo $y      Is this good way? I don't know how to get file name "example.html" from stdin.


UNIX: How to extract date from a variable storing a UNIX DATE

I am facing following issue: Input:               F=`date +%Y%m%d`          echo $F      Output:               F=20131231      But when trying this(File Name:A.sh):               C=`date`          G=`$C +%Y%m%d`          echo $C          echo $G          Output:          A.sh[6]: Tue:  not found          Tue Dec 31 06:14:12 EST 2013      I want to pass the date in a variable and then extract only date in a specific format.


resources for linux programming

what are the best books or best websites to learn the linux programming for absolute beginners and for professional programmers? To be more specific topics like, a) forking b) Shared memory c)exec commands d)signals e)scheduling algorithms (round robin,first come first serve,priority scheduling,short job first, multilevel queue scheduling, multilevel feedback queue scheduling)


What does apt need to be healed of a bad setup?

I made a couple of earlier posts regarding a libssl-dev that, it seemed, was not removable. Some of the replies touched on that there was a problem with apt, and now that someone posted the command to force uninstalling a package, I only have an issue with ack:               Setting up apt (0.8.16~exp12ubuntu10.10) ...     gpg: gpg: [don't know]: invalid packet (ctb=03)     Invalid option "--primary-keyring"     gpg: read_keyblock: read error: invalid packet     gpg: enum_keyblocks(read) failed: invalid keyring     gpg: WARNING: nothing exported     dpkg: error processing apt (--configure):      subprocess installed post-installation script returned error exit status 2     No apport report written because MaxReports is reached already                                                                   Errors were encountered while processing:      apt     E: Sub-process /usr/bin/dpkg returned an error code (1)     A package failed to install.  Trying to recover:     Setting up apt (0.8.16~exp12ubuntu10.10) ...     gpg: Invalid option "--primary-keyring"     gpg: [don't know]: invalid packet (ctb=03)     gpg: read_keyblock: read error: invalid packet     gpg: enum_keyblocks(read) failed: invalid keyring     gpg: WARNING: nothing exported     dpkg: error processing apt (--configure):      subprocess installed post-installation script returned error exit status 2     Errors were encountered while processing:      apt      I deleted /etc/apt/trusted.gpg. It didn't work. I copied a trusted.gpg from a machine where it was working as well. Still didn't work. What can I do to satisfy apt configuration so I can get back to updating my software normally?


Django not installing with pip because of mismatched hash

I have a virtual machine set up with a directory created with virtualenv (env2). I am inside this directory and have it activated and want to instal django 1.4. This is my command:               $ pip install django==1.4      But it returns saying that the hashes don't match. The thing is, they do match though. Anyone know my problem?


How to find where I have set "umask 077"?

When logged in as `root`, I have `umask` set to `077` which causes problems (such as `/etc/resolv.conf` being unreadable for non-root and thus `DNS` not working. I don't know where I have set the umask `077`. It is not set in `.bashrc` or in `.profile` or in `/etc/profile`. Any suggestions where `077` might come from? I am using Debian Wheezy


Linux lock down route to avoid changes to the default route

I have a problem that every time I connect my Android phone with USB tethering it hijacks my computer's internet connection. Even if the phone's WIFI is off. I try to manually remove the default route with               sudo route del default enp0s29u1u4      but it finds its way back after a few minutes. Is there a way to get this interface to permanently get the fuck off? Or alternatively, is there a way to set my desired interface to be permanent no matter what?


how to add curlcpp to the library/include path?

I'm using Arch Linux and have successfully built https://github.com/JosephP91/curlcpp However, I have no idea how to build the example program. I keep getting               fatal error: curl_easy.h: No such file or directory      Of course, this is because I don't know how to add it to the `library/include` path. In the `<curlcpp root>/build/src/` folder, I have a `libcurlcpp.a` file, which has all the `.o` files, and `<curlcpp root>/include/` has all the `.h` files needed. I've tried commands specified in the README, trying `-I library/include`, and other combinations. Do I need to manually copy the file somewhere or run some command line app to make it system wide? I don't think `ldconfig` is the right program since that's for dynamic libraries.


change regular user's password with root access

I have Ubuntu installed on a Raspberry pi. I have a normal user `pi`, but I forgot the password. However, I do have root access. How would I change pi's password using root?


configure web server in RHEL

I have installed Request tracker in my RHEL 5.6 system. The RT installation succeeded and I have also installed apache web server, mysql, phpmyadmin that is required for running the request tracker tool. However, in the final step, it is mentioned as, for opening RT we have to enter `http://serveripaddress/rt`. I have apache web server installed in my system. So, I am just typing `http://localhost/rt` in my system. However, it gives me a 404 page not found error. I believe it has something to do with the **rt_siteconfig.pm** file. The file's contents are as below.               # Any configuration directives you include  here will override     # RT's default configuration file, RT_Config.pm     #     # To include a directive here, just copy the equivalent statement     # from RT_Config.pm and change the value. We've included a single     # sample value below.     #     # This file is actually a perl module, so you can include valid     # perl code, as well.     #     # The converse is also true, if this file isn't valid perl, you're     # going to run into trouble. To check your SiteConfig file, use     # this comamnd:     #     #   perl -c /path/to/your/etc/RT_SiteConfig.pm          Set($rtname , 'test');          Set($Organization , "www.uta.edu");     Set($Timezone , 'US/Central');               Set($WebPath , "/rt");     Set($WebPort , 80);# + ($< * 7274) % 32766 + ($< && 1024));          Set($DatabaseUser , 'rtuser');     Set($DatabasePassword , 'rtuser');     Set($DatabaseName , 'rtdb');               1;      I believe the webPath parameter has to be modified. But am not sure what to edit in it. Can someone please guide me in the right direction? Update: There is a file as **rt.conf** which sets the RT script path as below in this file.               AddDefaultCharset UTF-8     Alias /rt/NoAuth/images /usr/local/rt/share/html/NoAuth/images/     ScriptAlias /rt /usr/local/rt/sbin/rt-server.fcgi/          DocumentRoot /usr/local/rt/share/html     <location /rt>            Order allow,deny            Allow from all            Options +ExecCGI            AddHandler fcgid-script fcgi     </Location>      When I just run `localhost` I am getting the test page successfully and it specifies the **welcome.conf** file needs to be disabled, in case I do not want the test page. The **welcome.conf** file is present in the same path as the above **rt.conf** file. The path is `/etc/httpd/conf.d/` **Update 2:** The **error_log** file inside `/var/log/httpd` has the below line.               [error] [client 127.0.0.1] File does not exist: /usr/local/rt/sbin/rt-server.fcgi/      However, I do have the file rt-server.fcgi inside the above path. **Update 3:** The rt.conf file which is a configuration file for starting the RT is as below.               AddDefaultCharset UTF-8     #Alias /rt/NoAuth/images /usr/local/rt/share/html/NoAuth/images/     ScriptAlias /rt /usr/local/rt/sbin/rt-server.fcgi/          DocumentRoot "/usr/local/rt/share/html"     <Location /rt>            Order allow,deny            Allow from all            Options +ExecCGI            AddHandler fcgid-script fcgi     </Location>


How to uninstall omniORB 4.1.7 after installing from make?

I'd like to uninstall a copy of omniORB which I installed by running               make install      Any tips on how to do this operation? I tried               make uninstall      but the project does not have such a target. I googled for an answer and searched through the omniORB user's mailing list. The closest search results are               [omniORB] make clean     http://www.omniorb-support.com/pipermail/omniorb-list/2001-July/018714.html      in which David Byron (dbyron at coactive.com) in 2001 asked if anyone would be interested in a 'make uninstall' target.               [omniORB] omniORBpy-2.7 AttributeError     http://www.omniorb-support.com/pipermail/omniorb-list/2006-November/028191.html      in which the omniORB project maintainer Duncan Grisby (duncan at grisby.org) in 2006 had this interaction               > Would it be a good idea to add an 'uninstall' option to the Makefile?     Yes, but the makefiles are hairy and complex, and it's not trivial to     add an uninstall. If you want to produce a patch, I'll happily accept     it.


How to send command output to GNU Screen's copy mode buffer

Is there a way to send the output of a command to a GNU Screen's copy mode buffer. I'd like to type something like this:               $ echo 'this is an example' | screen_send_to_copy_mode      or, maybe `C`-`a` `Some key` and then, after that, when I pressed `C`-`]` I would get `this is an example` as an output. Is it even possible?


How to install Okular under SUSE (on a server)?

I would like to install the pdf viewer Okular on a SUSE Linux Enterprise Server 11. I am familiar with `apt` under Ubuntu, but on SUSE, I only found `rpm` to install `.rpm` files. I am wondering how Okular (or essentially any other program) can be installed? I know Okular is KDE, but I saw it here so I hope it is possible to install it (I hope this is not a ridiculous question).


Unable to get Gnome desktop after installing from CentOS 6.5 minimal

I have just installed CentOS 6.5 minimal. The reason I installed the minimal version is that the full version had ISOs of over 3GB each and my CD-RWs can only told about 750 MB. I would like a graphical desktop. I tried               sudo yum update     sudo yum groupinstall basic-desktop desktop-platform x11 fonts      and they both ran without any errors. However, when I tried to run the desktop using               sudo gdm      and it just hung in the command line. When I tried               gdm      I got               ** (gdm-binary:2164): WARNING **: Failed to acquire org.gnome.DisplayManager: Connection "1.37" is not allowed to own the service "org.gnome.DisplayManager" due to security policies in the configuration file           ** (gdm-binary:2164): WARNING **: Could not acquire name; bailing out


GNU Stow: How to stow only selected files/folders?

Let's assume the following structure of a folder called `scripts`.               ├── scripts     │   └── .scripts     │       ├── script1     │       ├── script2     │       └── script3     │   └── .config     │       ├── script4     │       ├── script5     │       └── script6      When using `stow scripts`, both folders within `scripts` will be symlinked to `~/.scripts` and `~/.config`. Can I use stow to only symlink `.scripts` without having to remove `.config` from the folder but just basically ignoring it?


Check compatibility with Linux before installing

I have a new computer, more precisely an _Asus N750J_ , and I would like to check the compatibility of the hardware with Linux before installing (dual boot is the plan), to be prepared and prevent problems and disappointments. I have already seen that I'll probably need to install _Bumblebee_ , but I don't have a specific checklist so that I can be sure I'm ready to go for the installation. I'd like to do this as fast and painlessly as possible. The plan is to install _Debian_ , I don't have a strong preference on _Debian Stable_ or _Testing_ (probably _testing_ will be a better option). The details in italics are specific for my case, but I think this is probably a fairly general question. Detailing the answer may be unfeasible for a site of short answers as SE, if so, please provide references or pointers to general guidelines. If there are details missing or the question has to be modified to suit better the format please tell me and I'll change whatever needs to be changed.


Ubuntu 14.04 login into desktop by single user mode

My OS is Ubuntu 14.04 64-bit, and kernel is 3.13.0-30-generic. I forget my user account password and now want to get into GUI desktop. I know from the Internet that we can reset password by single user mode. Usually this is done by editing grub2 items, like this "How do I boot into single-user mode from GRUB?", and this "Ubuntu 12.04 Grub to boot into single user mode " From the links, I can renew account password under shell, reboot, and login into desktop with the new password. But I don't want to renew the password, I simply want to login to the desktop. I have tried the command `startx` but it failed giving the following error:               error in locking authority file .Xauthority      I have searched the directory "root" and found no such file. How can I achieve my goal? Is it possible? * * * EDIT: Single user mode runs at level 1 which is text mode. If I need X window, Linux must run at level 5. So I cannot get into GUI desktop at single user mode. But why I cannot use command startx at single user mode, remains to be solved. * * * EDIT: I am at root text mode (at runlevel 1 of course) now through the reference link above. I can change any password now and reboot into GUI. But I would like to get into GUI by a "GEEK" way. That is bypassing the login screen of GUI and get there directly without password.


remove special character from files in directory

I need to remove special characters from all .htm files in a directory. Ideally I need to keep the file name but if I have to I can copy each file to 1 or something like that.   Here is the command I need to run on each file: tr '\015' '\n' < $filename > $filename.1


How to prevent users from renaming files while providing write permissions on Linux

For some special purpose, I want to prevent non-root users of the Linux Server from changing or renaming the filenames. However, they can modify and write to the contents of the file. How to do this from command line.


rsync on a very large directory

I'm trying to rsync a partial clone of mavencentral using rsync. The problem is, due to ridiculous network policies, I can only have the copy running during business hours. The process will be cut off before it has a chance to finish. When I run the same rsync command again, it will start from the top, looking for diff'd files, and never get to the end and actually start transferring files.               rsync -avP -e ssh user@server:/directory/for/maven .      It will start going through the tree no problem, but not transfer any files past the first attempt. It's just very slow to catch up to where it was. Any suggestions for resuming an rsync after it has closed?


How can I rewrite with apache mode_rewrite an entire directory?

I need this URL/directory `make/lores/some/` to point/map to `login/` I also need to rewrite `.php` extensions to `.html` ### Example When the client types in `example.com/make/lores/some/login.html` the server should `process example.com/login/login.php`. I have rule below but the issue is that the other files under the login directory ( e.g. `/login/images/one.png` etc.) are not handled/rewritten so I end-up with a 404 error.               RewriteRule     ^(.*)\.htm$     login/index.php [NC]


How do I start all shell sessions in a directory other than $HOME?

When I open my non-login shell in Ubuntu, my present working directory is `/home/user_name` (my `$HOME` environment variable), but I want to change this such that when I start my terminal I am in some other directory. I have read that when I start my terminal in Ubuntu a `.bashrc` file is sourced. So I added               export HOME=/home/user_name/Documents       to my `.bashrc` file. Now, when I open my terminal I am still in `/home/user_name` directory. How can I change this?


.profile is not sourced in Debian Wheezy LXDE

I add `$HOME/bin` to `$PATH` from `~/.profile`. However, it seems it is not sourced during login. I use a login manager - `lxdm` I think, and not `startx`. I know this matters as to which scripts are executed. To illustrate, see how the `$HOME/bin` is added after I explicitly source `~/.profile`. But shouldn't it have been sourced during the graphical login?               sashoalm@aspire:~$ echo $PATH      /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games     sashoalm@aspire:~$ source ~/.profile      sashoalm@aspire:~$ echo $PATH      /home/sashoalm/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games     sashoalm@aspire:~$


Why whould xterm behave differently than x-terminal-emulator when it points to the same executable?

> lrwxrwxrwx 1 root root 14 Apr 19 14:36 /etc/alternatives/x-terminal-emulator > -> /usr/bin/xterm Running it using these 2 calls:   * `/usr/bin/xterm`   * `/etc/alternatives/x-terminal-emulator` First starts with black background and other starts with white. What are possible reasons that is it not the same configuration? How to debug it?


Find out a package's configure/compile options in Gentoo

On a Gentoo Linux box which I'm not administering (and to which I don't have root access), how can I find out the options which were used to compile the package? (Please note I've never worked with Gentoo before, but have good working knowledge of Debian-based distros)


python xml parsing

I have to delete particular tags from an xml file. Sample xml below.                      <data>               <tag:action/>             </data>      I want to delete all contents between data and /data. The XML tags are not displayed in the question after posting. I am able to do this by using remove() method in Python ElementTree xml parser. I am writing the modified contents to a new after the deletion of the element.               tree.write('new.xml');      The problem is that all the tag names in the original xml file are renamed to `ns0`, `ns1` and so on in `new.xml`. Is there any way to modify the XML file keeping all other contents in tact?


Encrypt multiple files at once

I'm writing a script which creates project archives and then creates 7z archives of them to make it easier on me to save specific versions and keep encrypted backups. After I've generated the archives and I get to the encryption phase, I'd like to encrypt the files with one call to `gpg` if possible, so as to only have the user input their passphrase once. Otherwise, we'd either have to cache the user's passphrase in memory (which I'd really like not to do) or have them input and confirm their passphrase for every single project that is archived (which is worse). Is there a way to pass multiple filenames to `gpg` to have it encrypt all of them in one go? If I try this:               $ gpg --cipher-algo AES256 --compression-algo BZIP2 -c project1.7z project2.7z      ...I see the following error in the shell:               usage: gpg [options] --symmetric [filename]      Is there a way to do what I'm looking to accomplish?


How to prevent atd from running past jobs?

The at daemon is a great tool! However, if a job is scheduled for 8:00 am and the machine is off at that time, at will run the job whenever the machine is booted. What I would like to do is stop it from running the job if the time is past. I have searched the man pages, and online, but either there is not an answer or I could not find one. I am using Arch, but as far as I know at is very similar across distributions. Any help is much appreciated!


Preparing USB drive for Kali Linux

I'm new to Kali Linux. I want to install it on my PC which is already running windows 8. I know how to dual boot a PC. I'll be booting Linux from a USB device, but while creating a bootable USB drive, which file system should I choose? NTFS or FAT32 for the Kali Linux ISO file?


How to create a "Turn Off Screen" Action?

I recently moved to Elementary OS Luna. I especially use the Synapse Indicator launcher, because I like to work with my keyboard for everything. In Synapse and in the Synapse Indicator (and I believe, generally, in the Gnome dekstop and I'll dare saying in all Linux DEs) there are "actions". Among actions there is _Shut Down_ , _Restart_ , _Lock Screen_ etc. which can be run with Synapse and probably too from the command line. I would like to create an action for _Turn Off Screen_ (which is different from _Lock Screen_ ). How can I create this action and be able to launch it from Synapse?


How can I find out what options sudo is configured with?

Often when debugging issues with `sudo` I'll look at the options in the configuration file `/etc/sudoers`. However it can be difficult to know what options are enabled by default, since they're built into the executable, so they're typically absent from `sudo`'s config. How can I get a exhaustive list of all the options that `sudo` is going to use on a given system?


why cpulimit makes process STOPPED?

I'm running a python script which uses networkx package to run some algorithms on graphs. the script is               import networkx as nx     from networkx.algorithms.approximation import clique          G = nx.read_adjlist("newman_one_mode.adj")     print "the number of nodes in the graph is: " + str(G.number_of_nodes())     max_clique_nodes = clique.max_clique(G)     print "the clique nodes are: " + str(max_clique_nodes)      It takes a long time and has high cpu usage (99%), so I want to limit its cpu usage. I used cpulimit on this process to limit the cpu usage to 60%               cpulimit -p 29780 -l 60      however, when I use it, the process got STOPPED, as below               [lily@geland academic]$ python run.py     the number of nodes in the graph is: 16264          [1]+  Stopped                 python run.py      what is wrong and how to deal with such situations? thanks! **side information:** if I don't run cpulimit, the process runs for a long time and then got killed, I don't know why, maybe it is due to resource being used up.               [lily@geland academic]$ python run.py     the number of nodes in the graph is: 16264     [1]+  Terminated              python run.py     Killed


Using bash "double paren" arithmetic expansion, math fails with leading zero

I have a simple script that deals with hours and minutes. If I want to calculate number of minutes since midnight having a string s `hh:mm` I tried splitting string then doing `hh * 60 + mm` My problem is, while               $ (( tot = 12 * 60 + 30 ))     $ echo $tot     750      instead               $ (( tot = 09 * 60 + 30 ))     bash: ((: tot = 09: value too great for base (error token is "09")      As far as I understand string `09` is not to be intended as a base 10 number. Is there a better way than simply removing leading zeros in string?


US International Keyboard Layout not behaving as expected?

Perhaps my question is related to this one. I use to use the English US International Keyboard with Alt-Gr Dead Keys (as far as I remember. This layout allowed me to write _é_ by pressing _R-Alt+'_ and then _e_. I migrated to EOS Luna and now, no matter what English US International keyboard I may use, _R-Alt+'_ prints _'_ and to get _é_ I need to press _R- Alt+e_. Has the layout changed? Is it a bug in EOS? Or do I need another layout? Here below are the various layouts under English US available on eOS: ![enter image description here](http://i.stack.imgur.com/11HsZ.png) `xev`, on pressing AltGr+ ' returns:               KeyPress event, serial 29, synthetic NO, window 0x3600001,         root 0xac, subw 0x0, time 22275171, (752,335), root:(753,407),         state 0x0, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,         XKeysymToKeycode returns keycode: 92         XLookupString gives 0 bytes:          XmbLookupString gives 0 bytes:          XFilterEvent returns: False          KeyPress event, serial 32, synthetic NO, window 0x3600001,         root 0xac, subw 0x0, time 22275456, (752,335), root:(753,407),         state 0x80, keycode 48 (keysym 0x27, apostrophe), same_screen YES,         XLookupString gives 1 bytes: (27) "'"         XmbLookupString gives 1 bytes: (27) "'"         XFilterEvent returns: False          KeyRelease event, serial 32, synthetic NO, window 0x3600001,         root 0xac, subw 0x0, time 22275527, (752,335), root:(753,407),         state 0x80, keycode 48 (keysym 0x27, apostrophe), same_screen YES,         XLookupString gives 1 bytes: (27) "'"         XFilterEvent returns: False          KeyRelease event, serial 32, synthetic NO, window 0x3600001,         root 0xac, subw 0x0, time 22275566, (752,335), root:(753,407),         state 0x80, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,         XKeysymToKeycode returns keycode: 92         XLookupString gives 0 bytes:          XFilterEvent returns: False


NAS OS that will sync to MS Sharepoint?

Right now I'm using FreeNAS for my NAS, but I want it to sync with Microsoft Sharepoint so that there are multiple points of access for my users. Is there an operating system I can put on my NAS that will sync nicely this way?


Is there any equivalent to the atempo ffmpeg audio filter but for avconv to speed up video(and audio)?

As noted here, we could speedup audio with `ffmpeg` using               ffmpeg -i input.mkv -filter:a "atempo=2.0" -vn output.mkv      But on `Ubuntu`, `ffmpeg` is replaced by `avconv`, and the `atempo` filter is not available in `avconv`. My question is:   1. Are there any alternatives to the `atempo` filter to use with `avconv`, or how to speed up audio AND video using `avconv`?   2. How to speed up a video file (if you have better ideas)?


Which filter configuration in kernel rate limit the outgoing packets to 1packet/sec?

Which net filter in kernel configuration other than iptables enable rate limiting on the outgoing packets on ethernet port?


Incorrect output from cp, rm, and so on

When I run, say, `cp`, I get output like the following:               # cp -v Foo Bar     âFooâ -> âBarâ      What's up with the weird `â` characters? Why is the shell doing this? It looks like some kind of strange encoding issue. When I use PuTTY, I get `â`. When I log into the actual machine locally, I get `?` in inverse-video. If I redirect `stdout` to a file, copy that to my Windows machine, and open it, I get some random combination of characters until I tell me text editor to pretend the file is UTF-8. And then I get propper open- and close-quotes.


Linux memory usage?

We have 1TB of memory on a server which hosts an SAP application. When the app is running the memory usage shown in `top` is around 700GB. When the app is stopped the memory usage shown in `top` comes down to 10GB. A reboot of the server gets the memory usage to 1GB.   * Even though no application is running, why does `top` show 10GB used and gains 9GB after reboot?   * Is it possible to gain that 9GB without a reboot? Output of `free -g`:               free -g                       total used   free shared buffers cached      Mem:              1009  567   442    0      0     152      -/+ buffers/cache:      415   594      Swap:              1     0     1


Background selection menu crashes in GNOME 3

I'm using Debian Jessie with GNOME 3. When I started using GNOME 3 I had no problem changing the background image, and I did it a few times. But one day the menu started crashing. When I open the menu (through the system settings or through right click on the desktop) it appears for about half a second and then it disappears again. No matter how I do it, the menu crashes. How can I fix it or change my background image?


Configuring VMware 7 Workstation on Fedora 20 x86_64 KDE

When I first time around installed VMware, it Installed successfully and when I ran the program it got me to where you have a dialog box to select the kernel module, now when I install it the program doesn't get past "Sorry - KDE su": ![enter image description here](http://i.stack.imgur.com/S6zZU.png) The error is:               Cannot execute command ' ''\''/usr/bin/vmware-modconfig'\'' --icon='\''vmware-workstation'\'' --appname='\''VMware'\'' --gcc='\''/usr/lib64/ccache/gcc'\'' --headers='\''/lib/modules/3.13.6-200.fc20.x86_64/build/include'\'' --gcc-ignore-minor ''.      ![enter image description here](http://i.stack.imgur.com/Py68c.png) I tried to take the extra symbols out and run the command in the Terminal but it didn't build. Here is the kernel:               ~]$ uname -r     3.13.6-200.fc20.x86_64      Here is kernel-devel               Installed Packages     kernel-devel.x86_64                   3.13.6-200.fc20                   @updates      ![enter image description here](http://i.stack.imgur.com/OVDsz.png) Anyone got any idea what to do, is there a patch that I am suppose to install?


What's the easiest way to set up a 2-hour alarm?

I want my computer to play some given .mp3 every 2 hours. I want it to run at startup, and be modifiable with a given .conf file. The choice of .mp3 will also be in the .conf file. The reason is, I need this to remind me to eat regularly. Now, I'm familiar with C, but I don't know anything about daemonising C programs. I'm also not very familiar with CRON, so if that's an option, I'd need further instruction. What is the easiest way to do this?


Rename multiples files using Bash scripting

I want to rename multiple files in the same directory using Bash scripting. Names of the files are as follows:               file2602201409853.p     file0901201437404.p       file0901201438761.p       file1003201410069.p       file2602201410180.p      I want to rename to the following format:               file2503201409853.p     file2503201437404.p       file2503201438761.p       file2503201410069.p       file2503201410180.p      I was reading about the rename command, and try to do it this way, but it does nothing, I think I have questions about the syntax. Then I read that you can make a loop using the mv command as follows:               for file in cmpsms*2014*.p; do         mv "$file" "${file/cmpsms*2014*.p/cmpsms25032014*.p}"     done      But I can not rename the files. What am I doing wrong?


Sanity check/cleanup for swap -- essentially mkfs.swap

Occasionally I'll have a system crash or be forced to do a cold reboot. Upon rebooting I will get a kernel crash. Get out a rescue disk, rebuild swap, then everything boots fine. The thing is that I use `mkswap` to to rebuild swap, which I feel makes my job so much harder and more dangerous. Is there a way to run a sanity check on swap space and clean it up similar to what `mkfs` does?


Export format of gpg

What is the binary _export / import_ format used by`gpg` for **public** and **private keys**?


Fedora "disk full", df, du (gui) confirm but gparted shows the partition is big enough

I am running a fedora Virtual machine and after much pain I managed to extend my virtual machines .vdi, from 20gb to 40gb. However it appears my pain is not over. The machine still complains of low disk space, still has many errors and the gui disk usage analyzer shows I am full and so does df. However gparted tells me I have 40gb on that partition. is it Virtual box weirdness? do i need to kick fedora in some way to refresh its known capacity? Please find attached a screen grab of all the relevant applications, let me know if you need more info. Thank you ![Sceengrab of info](http://i.stack.imgur.com/rMv7g.png)


Studio 12.3: language optional software package not installed

I installed the Solaris Studio 12.3 on Solaris 10 OS but when I check the version but it is showing below result. It is installed under `/opt/SolarisStudio12.3/bin` so why wrong path is coming. I defined the path in `.profile` after that I can see now the correct path when I check `$PATH` `/opt/SolarisStudio12.3/bin` but still it is showing same path for which `cc` and `cc -V` as below. Can anyone please tell me?               which cc     /usr/ucb/cc          cc -V     /usr/ucb/cc: language optional software package not installed


Debian user is not in the sudoers file

Accidentally removed my gnome desktop and am stuck in tty1. Trying to reinstall the desktop and keep getting the error "user is not in the sudoers file". Having trouble adding my user, new to debian and am not sure how to correctly open/edit sudoers from tty1 (or really how to edit files from cmd line for that matter if someone could please lend some specifics)!


sed couldn't flush stdout no space left on device?

What could be the reason for this error :               sed couldn't flush stdout no space left on device      This is come of the stuff that i am doing at last in my code               sed -n '/.*needs to be executed manually.*/{n;p}' "$ERR_LOG"*          sed -n '/.*have.*latest.*/{n;p}' "$ERR_LOG"* >> "$ERR_LOG"final.log               sed -n '/.*Phone type not recognised.*/p' "$ERR_LOG"* >> "$ERR_LOG"final.log               sed '/.*#/!{H;d;}     x;/\n.*Error/!d' "$ERR_LOG"* >> "$ERR_LOG"final.log               sed '/.*#/!{H;d;}     x;/\n%/!d' "$ERR_LOG"* >> "$ERR_LOG"final.log      sed is seraching through around 10 - 15 files of size=50-69 kb (approx) **EDIT 1** : This is the exact error :               sed: couldn't write 166 items to stdout: No space left on device     sed: couldn't write 201 items to stdout: No space left on device     All the hostnames processed     sed: couldn't flush /home/gocs1/LOG//sed6hkHBu: No space left on device     sed: couldn't flush /home/gocs1/LOG//sedM2dr4u: No space left on device     sed: couldn't flush /home/gocs1/LOG//sed6A8NWu: No space left on device     sed: couldn't flush /home/gocs1/LOG//sedbmkv3x: No space left on device     sed: couldn't flush /home/gocs1/LOG//sed42pjSx: No space left on device     sed: couldn't flush /home/gocs1/LOG//sedMKxrHy: No space left on device     Time Taken :     0 hour(s) 58 minute(s) 33 second(s)      what does this mean.                 /home/gocs1/LOG//sed6hkHBu      i have created the directory upto `/home/gocs1/LOG/` but the rest(`/sed6hkHBu`) is not created by me. **EDIT 2** : does `sed` or `sed -i` option creates files in tmp directory i had many files created in `/tmp/LOG` directory with one file of huge size(800 MB) also while the script was running.


Using kornshell or Perl to circumvent permissions needed by root

I have a problem where I need to change the ownership and permissions of one file that exists on more than 200 servers. I belong to 2 different groups and need to change the ownership from one group to another. I also need the permissions to be 644. This could be easily done if I had root access, but I don't. So instead I need to copy the file as one user and then remove the old file and then rename the recently copied file to the name of the old file. This becomes rather tedious, so I wanted to create a script to automate these tasks. I thought kornshell would do the trick but my script doesn't seem to be doing anything. Here is what I have so far: **lockhosts.sh**               #!/usr/bin/ksh     sudo su - oradba     cd config     chmod 644 hostenv.cfg     chown orainst hostenv.cfg     exit     sudo su - orainst     cd config     cp -p hostenv.cfg hostenv.cfgnew     rm hostenv.cfg     mv hostenv.cfgnew hostenv.cfg      I figured this would work because those are all the commands I need to run to successfully change the ownership/permissions of the file. All I need to do is change the hostenv.cfg file **from this** :               -rwxrw---- 1 oradba  dba  4433 May  1 21:43 hostenv.cfg      **To this** :               -rw-r--r-- 1 orainst dba  4433 May  1 21:43 hostenv.cfg      What can I do to fix my script? Also, if I need to build user prompts into my script to ask for passwords that is fine, but I thought the system would ask for me. Here is what happens when I try to run my script:               lockhost.sh      **My user is changed to oradba and nothing else happens...** Until I type exit...               exit          logout     chmod: changing permissions of `hostenv.cfg': Operation not permitted     chown: changing ownership of `hostenv.cfg': Operation not permitted


How do I create a RAM disk on Linux Mint?

I am running a package that adds data to the end of 140–300 files each time through the process. I'm thinking of moving the process to a RAM disk, and using `rsync` to copy it back when done. My goal is to reduce wear by eliminating disk head seeks. Will this work? If so, how do I go about creating the RAM disk?


avconv: converting raw mjpeg video to a viewable format

I'm using a Beaglebone Black (BBB) with a USB Webcam attached to it. The BBB is running the latest Angstrom release. At the moment, it is proving difficult for me to convert video that I capture to some playable video format (like mp4). My raw video is "output.raw", my command is:               avconv -f mjpeg -i output.raw -vcodec copy output.mp4      However I get an error:               output.raw: could not find codec parameters      I've tried other approaches, like using a raw YUV stream to convert but it fails on me as well.


Return to directory location prior to cd-ing to home directory

As is well known, `cd` without an argument changes one's current directory to their home directory. I am wondering if there is any way, after using the `cd` command like this, to return to the directory location one was at prior to running `cd`? Generalizing, is there any way of returning to a previous directory after one has `cd`-ed to another directory? It seems very possible that the answer to these two questions will be the same but in case it isn't I kept them both separate, because the first question is the main one I would like answered.


Remove only given strings from given column?

INPUT:
FOOBAAR	FOOO	BAAR	2014-02-14 13:34	2014-02-17 13:34	2014-03-07 13:34
      OUTPUT:
FOOBAAR	FOOO	BAAR	2014-02-14 13:34	2014-02-17 13:34	2014-03-07 13:34
      Difference: the:                     and                     was removed only from the fourth column. **My question:** How can I remove only given strings from given column?               	      is the delimiter


OS X/Linux one-liner/script to find the largest recurring group of lines in a text file?

I have a log containing an execution trace where there is infinite recursion eventually terminating when the stack is too deep. There are enough lines and valid included recursion within the larger block of lines that it is difficult to identify the largest block that is recurring. There is nothing unique that would require me to filter out part of the line to make this determination. What is a good one-liner/script (in POSIX/OS X, but best if it can work in Linux and OS X) that, given a filename/pathname, could output only the largest set of lines that recur sequentially more than once? _Clarification: in my case the log file is 432003 lines and 80M:_               $ wc -l long_log.txt      432003 long_log.txt     $ du -sm long_log.txt     80  long_log.txt      _To create a similar input file, try this, thanks to the posthere for the method to create a file containing random words._               ruby -e 'a=STDIN.readlines;200000.times do;b=[];22.times do; b << a[rand(a.size)].chomp end; puts b.join(" "); end' < /usr/share/dict/words > head.txt     ruby -e 'a=STDIN.readlines;2.times do;b=[];22.times do; b << a[rand(a.size)].chomp end; puts b.join(" "); end' < /usr/share/dict/words > recurrence1.txt     ruby -e 'a=STDIN.readlines;20.times do;b=[];22.times do; b << a[rand(a.size)].chomp end; puts b.join(" "); end' < /usr/share/dict/words > recurrence2.txt     ruby -e 'a=STDIN.readlines;200000.times do;b=[];22.times do; b << a[rand(a.size)].chomp end; puts b.join(" "); end' < /usr/share/dict/words > tail.txt     cat head.txt recurrence1.txt recurrence1.txt recurrence2.txt recurrence1.txt recurrence1.txt recurrence2.txt recurrence1.txt tail.txt > log.txt     cat recurrence1.txt recurrence1.txt recurrence2.txt > expected.txt      _To result in:_               $ wc -l log.txt      400050 log.txt     $ du -sm log.txt     89  log.txt      _Then you should be able to do:_               $ recurrence log.txt > actual.txt     $ diff actual.txt expected.txt     $      _It is also ok if it recognizes the other same-length block instead, i.e._               $ cat recurrence1.txt recurrence2.txt recurrence1.txt recurrence1.txt recurrence2.txt recurrence1.txt > expected2.txt     $ diff actual.txt expected2.txt     $      _Would really like it to find the expected result in < 10 sec in OS X/Linux w/ a 2.6GHz quad-core Intel Core i7 and 16 GB memory._


Set a screen session name at the command prompt

I am trying to create a simple alias that will allow me to create a new screen and set its name simple by typing `newscreen {screenname}` where `{screenname}` is set at the prompt. For example, I would like to be able to create the following alias: `alias newscreen='screen -D -R -S {screenname}'` Then at the command prompt, type: `$ newscreen client` This would then start a new screen for me, and give it a name of `client` That way, I could resume the screen with `screen -r client`. Can someone point out to me the best way to do that. Thanks.


log file: only process entries older than "MMM DD HH:MM:SS"

I need to process my logfile `/var/log/mylogs.log`. I am only interested in the new entries, lets say, since `Jul 20 15:00:00` but the log contains older entries as well. Is there any simple way, how I could `cat` only entries older than certain date?


scp and file owner

What are the reasons that could make a change in a file ownership after `scp`'ing it from one server to another? The file ownership changed from ' _owner_ ' to ' _apache_ '. I used `scp -p` . The user ' _owner_ ' exists on both servers and has the same UID.


How to properly automatically/manually rotate log files for production Rails App

I am taking over administration for a server which has a custom made 3rd party Rails app. The app developer informed me that the ruby log files are getting large and pointed me to the following link: - http://stackoverflow.com/questions/4883891/ruby-on-rails-production-log- rotation The logs are located in /root/production/app/log. This folder contains several files which end in .log. The current log files are about 2GB in size and the folder also has archived log files with the format of "logname.log.2013_01_18.bz2". I tried searching the ssh command history to see if I can see which command was used to create the archive files, but the commands don't go back that far. I also ran "cat /var/lib/logrotate/status" but it doesn't look like logrotate did not rotate any logs from the above folder. Basically:   1. I would like to be able to run a command to rotate the logs manually and/or have the logs rotate automatically every Sunday night.    2. If I need to shutdown my rails app to rotate the logs, I have no problem with this as I have a maintenance window every Sunday night to perform this.    3. Finally, I am not sure if I should compress the log files weekly into bz2 or only compress the logs on a monthly basis for any rotated logs related to the previous month. This is mainly because I am not sure exactly how this app utilizes the logs and I have never utilized rails apps nor have I had to configure log rotation manually. At this moment I do need to keep all log files and not discard any. Any information on concerns related to rotating logs, such as backing up logs before attempting to rotate are welcome.


Poweroff or Reboot as normal User

To run the command `poweroff` or `reboot` one needs to be super user. Is there anyway I can run this as a normal user? I just don't want to `sudo` and enter my password every time I reboot or power off.


Automatically insert fold tags around visually selected text in vim

I have started to use `set foldmethod=marker`, because I find it more convenient to use rather than `syntax`. But it has the disadvantage of needing to write `// {{{ my title` and `// }}}` around any folding code candidate. It would be nice if I could select a part of code in visual mode, and call a command ( or some commands) that would insert the two markers before and after the selected code. Are there any way to do that in vim ?


Having Wirless adapter problems in BackTrack 5 R3

I am trying to get a wireless connection on BackTrack 5 R3, but as soon as I boot up the BackTrack VM, the light on the adapter turns off. Drivers are installed and the VM detects the USB device. I am using an Asus N-13 wireless adapter to connect. It works fine on Ubuntu 12.10 (my host), and Windows 7. However, when I boot the BackTrack VM the adapter light goes off. Here is proof of drivers and USB detection. lsusb               Bus 002 Device 002: ID 80ee:0021 VirtualBox USB Tablet     Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub     Bus 001 Device 002: ID 0b05:17ab ASUSTek Computer, Inc.      Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root h      ifconfig               eth0      Link encap:Ethernet  HWaddr 08:00:27:9c:d5:dc                 inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0               inet6 addr: fe80::a00:27ff:fe9c:d5dc/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:758 errors:0 dropped:0 overruns:0 frame:0               TX packets:609 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:381917 (381.9 KB)  TX bytes:159317 (159.3 KB)               Interrupt:10 Base address:0xd020           lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               inet6 addr: ::1/128 Scope:Host               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:853 errors:0 dropped:0 overruns:0 frame:0               TX packets:853 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:299027 (299.0 KB)  TX bytes:299027 (299.0 KB)          wlan0     Link encap:Ethernet  HWaddr 08:60:6e:cd:f8:2c                 UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)      lsmod               Module                  Size  Used by     nls_utf8               12493  1      isofs                  39187  1      vboxvideo              12511  1      drm                   183453  2 vboxvideo     vboxsf                 38096  0      dm_crypt               22236  0      snd_intel8x0           33017  0      8192cu                503302  0      snd_ac97_codec        104623  1 snd_intel8x0     ac97_bus               12602  1 snd_ac97_codec     snd_pcm                72878  2 snd_intel8x0,snd_ac97_codec     snd_seq_midi           13132  0      i2c_piix4              12983  0      snd_rawmidi            24215  1 snd_seq_midi     snd_seq_midi_event     14076  1 snd_seq_midi     snd_seq                50403  2 snd_seq_midi,snd_seq_midi_event     snd_timer              23911  2 snd_pcm,snd_seq     snd_seq_device         13817  3 snd_seq_midi,snd_rawmidi,snd_seq     ppdev                  12840  0      snd                    52787  7 snd_intel8x0,snd_ac97_codec,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device     psmouse                72465  0      serio_raw              13027  0      joydev                 17161  0      lp                     13321  0      parport_pc             31867  0      soundcore              12534  1 snd     snd_page_alloc         13709  2 snd_intel8x0,snd_pcm     vboxguest             190596  5 vboxsf     mac_hid                13037  0      parport                34960  3 ppdev,lp,parport_pc     dm_mirror              21585  0      dm_region_hash         15035  1 dm_mirror     dm_log                 17871  2 dm_mirror,dm_region_hash     aufs                  162169  0      usbhid                 41119  0      hid                    79842  1 usbhid     pcnet32                40553  0       iwconfig               lo        no wireless extensions.          wlan0     unassociated  Nickname:"<WIFI@REALTEK>"               Mode:Auto  Frequency=2.412 GHz  Access Point: Not-Associated                  Sensitivity:0/0                 Retry:off   RTS thr:off   Fragment thr:off               Encryption key:off               Power Management:off               Link Quality:0  Signal level:0  Noise level:0               Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0               Tx excessive retries:0  Invalid misc:0   Missed beacon:0          eth0      no wireless extensions.


enable/disable NTP service on Ubuntu 12.04

Our application runs on Ubuntu 12.04 precise. On this server, we have both `ntpdate` and `ntp`. How to enable and disable `ntp` service on-demand? I tried               sudo update-rc.d -f ntp remove/default      and               sudo update-rc.d ntp enable/disable      , but when I reboot the server the `ntp` service starts running! I suspect `ntpdate` to start the `ntp` service on reboot. I removed the `ntpdate` package from one of my experimental server- then `ntp` didn't starts on reboot after issuing the command `update-rc.d ntp disable`. Is there a way to control this or is there way to permanently disable `ntpdate`?


Remote syslog command line Client

I use `logger` pretty regularly, but is there a FOSS command line tool for remote submission of syslog messages over the network? Right now, I have to configure a facility/priority pair to submit to a remote server on the `rsyslogd` side. I'd like to cut out the middleman and not have to modify my local syslog daemon's configuration. Does such a tool exist?


Openvpn clients can not access to LAN

Openvpn: clients connected to server = firewall; but can not access database in LAN I have 5 vlan:               vlan 2: 192.168.12.0/24     vlan 3: 192.168.13.0/24     vlan 4: 192.168.14.0/24     vlan 5: 192.168.15.0/24     vlan 6: 192.168.100.0/24 All are LAN had been connected to Switch cisco 3650 layer3. Switch Layer3 is connected to Firewall (CentOS 6.2 installed squid and shorewall 4); Firewall have eth0: 172.16.1.101 connected to modem:172.16.1.1; eth1: 192.168.99.99 connect to switch layer 3: 192.168.99.100 no switchport. VPN client connect and have IP class: 192.168.10.0/24. Now all traffic from LAN to Internet is normal, no trouble. When clients use openvpn connect to server successfull but cannot ping or access any computers in LAN. What have I done wrong?


Non-English Font

After changing keyboard layout by `setxkbmap`,If I typing something in an GUI apps, then it results in blank squares or dotted circle. Is there anything I am missing in LFS OS


Best way to upgrade vim/gvim to 7.3 in Ubuntu 10.04?

I have to use Ubuntu 10.04 at work, and cant upgrade it. I'm using Vim/gVim 7.2. I want to upgrade it to 7.3 (with Python and Ruby extension support). Which is the best way? Add an entry in `sources.lists` and install a 7.3 vim/gvim package from it, or build from source? What disadvantages would I have from each approach?


extracting "tag" information from git with a shell script

The vc bundle is a neat little package that extracts information about a git repo for easy insertion into a LaTeX document. It doesn't currently extract information about whether the current commit is tagged and what the tag name is. How would I edit the `vc` script to do this? And then how would I edit the `vc-git.awk` script to add an extra line to the generated vc.tex file? Presumably I want a line that looks like:               print "\\gdef\\GITTag{" Tag "}%"      but I need an earlier line that tells awk what `" Tag "` means? This isn't a question about LaTeX, it is about git, awk and bash...


Why doesn't dm-crypt handle write barriers properly?

One of the well-known properties of `dm-crypt` is that it does not handle write barriers properly and hence it requires turning off on-drive write cache to prevent corruption of filesystems. As far as I understand it is not shared by all other dm devices (like LVM w/out snapshoting). My question is whether it is an inherent property of `dm-crypt` for any reason (I cannot find any but it is possible) or is it simply not implemented (yet)?


How to change file permissions for newly generated files in largefiles directory of Mercurial?

I got some Mercurial repositories which are served by Apache over HTTP. But there is a dedicated user performing some automated tests, which needs to check out the repositories locally. Recently this started to fail, seemingly due to lacking rights for files in the largefiles subdirectory in `.hg`:               -rw------- 2 www-data www-data 6.3M 2012-01-02 17:23 9358b828fb64feb37d3599a8735320687fa8a3b2      Default umask should be 022. And I used the setgid settings for the directories in `.hg` according to the multiple committers wiki page, which does not cover `.hg/largefiles` though. However, as far as I understand it, setting the gid for this directory wouldn't solve the problem, that `hg` sets such restrictive rights on those files. My other user trying to access this repositories via the filesystem is also in the `www-data` group, thus an additional read right for group would be sufficient to solve my problem. How can I convince Mercurial, or the system to grant this right properly for new files? I am using: Mercurial Distributed SCM (version 2.1)


Gentoo default application for opening files

On my Gentoo box running without a desktop environment, every time I try to open a file the system tries to open it with Firefox. I understand that without a desktop environment "open file" cannot function correctly, but why is everything opened with Firefox? If I want to, can I change it to something else?


keyboard shortcuts only work with left super-key

I recently had to change the keyboard-shortcuts after updating my system. I had to use `dconf-editor` to manually set the shortcut from `<Super>+R` to `<Mod4>+R` in order to get them to work (see here). This does work when I press the right super-key together with the specified alphabetic key, but it does not work when using the left super-key. Also, the gnome-shell menu is set to show up when I press just the super-key, but it only shows up when pressing the left one. I'd like to have gnome-shell accept both the left and the right super-key for the shortcut, but I don't want to remap the menu-key (which is `<Super>` by default).


Unicode characters in uxterm and dwm statusbar

I would like to display Chinese characters in dwm's status bar. More specifically I would like the symbols to represent the different tags in dwm. Using an online converter, I found that the unicode representation for the symbols I want is:               憤怒     unicode: 憤怒      Putting the unicode characters directly into my `config.h` doesn't work, they don't even show up in `vim`. My locale is set to `ISO-8859-1` and I'm using the Liberation Mono font for dwm. What can I do to get those symbols up there? **EDIT** Following Mat's instructions and patching dwm, the patch command hangs. Running `strace`:               [max@prometheus dwm-6.0]$ strace patch -Np1 ../dwm-pango/dwm-pango/dwm-6.0-pango.patch      execve("/usr/bin/patch", ["patch", "-Np1", "../dwm-pango/dwm-pango/dwm-6.0-p"...], [/* 30 vars */]) = 0     brk(0)                                  = 0x1d52000     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9dc4713000     access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)     open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=92801, ...}) = 0     mmap(NULL, 92801, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f9dc46fc000     close(3)                                = 0     open("/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3     read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\25\2\0\0\0\0\0"..., 832) = 832     fstat(3, {st_mode=S_IFREG|0755, st_size=1983446, ...}) = 0     mmap(NULL, 3804112, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f9dc4152000     mprotect(0x7f9dc42e9000, 2097152, PROT_NONE) = 0     mmap(0x7f9dc44e9000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x197000) = 0x7f9dc44e9000     mmap(0x7f9dc44ef000, 15312, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f9dc44ef000     close(3)                                = 0     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9dc46fb000     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9dc46fa000     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9dc46f9000     arch_prctl(ARCH_SET_FS, 0x7f9dc46fa700) = 0     mprotect(0x7f9dc44e9000, 16384, PROT_READ) = 0     mprotect(0x61a000, 4096, PROT_READ)     = 0     mprotect(0x7f9dc4714000, 4096, PROT_READ) = 0     munmap(0x7f9dc46fc000, 92801)           = 0     brk(0)                                  = 0x1d52000     brk(0x1d75000)                          = 0x1d75000     getpid()                                = 10412     lstat("/tmp/po8GP02f", 0x7fffdc075210)  = -1 ENOENT (No such file or directory)     lstat("/tmp/pikSWXEs", 0x7fffdc075210)  = -1 ENOENT (No such file or directory)     lstat("/tmp/prB1wVgF", 0x7fffdc075210)  = -1 ENOENT (No such file or directory)     lstat("/tmp/pp27ATSR", 0x7fffdc075210)  = -1 ENOENT (No such file or directory)     rt_sigaction(SIGCHLD, {SIG_DFL, [CHLD], SA_RESTORER|SA_RESTART, 0x7f9dc4186cb0}, {SIG_DFL, [], 0}, 8) = 0     rt_sigaction(SIGHUP, NULL, {SIG_DFL, [], 0}, 8) = 0     rt_sigaction(SIGHUP, {0x40cd90, [], SA_RESTORER, 0x7f9dc4186cb0}, NULL, 8) = 0     rt_sigaction(SIGPIPE, NULL, {SIG_DFL, [], 0}, 8) = 0     rt_sigaction(SIGPIPE, {0x40cd90, [], SA_RESTORER, 0x7f9dc4186cb0}, NULL, 8) = 0     rt_sigaction(SIGTERM, NULL, {SIG_DFL, [], 0}, 8) = 0     rt_sigaction(SIGTERM, {0x40cd90, [], SA_RESTORER, 0x7f9dc4186cb0}, NULL, 8) = 0     rt_sigaction(SIGXCPU, NULL, {SIG_DFL, [], 0}, 8) = 0     rt_sigaction(SIGXCPU, {0x40cd90, [], SA_RESTORER, 0x7f9dc4186cb0}, NULL, 8) = 0     rt_sigaction(SIGXFSZ, NULL, {SIG_DFL, [], 0}, 8) = 0     rt_sigaction(SIGXFSZ, {0x40cd90, [], SA_RESTORER, 0x7f9dc4186cb0}, NULL, 8) = 0     rt_sigaction(SIGINT, NULL, {SIG_DFL, [], 0}, 8) = 0     rt_sigaction(SIGINT, {0x40cd90, [], SA_RESTORER, 0x7f9dc4186cb0}, NULL, 8) = 0     fstat(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0     open("/tmp/pp27ATSR", O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0600) = 3     fcntl(3, F_GETFL)                       = 0x8002 (flags O_RDWR|O_LARGEFILE)     fstat(3, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9dc4712000     lseek(3, 0, SEEK_CUR)                   = 0     fstat(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 2), ...}) = 0     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9dc4711000     read(0,       Could I be missing something?


Locked out by pamd. Help!

I recently changed some `pamd` settings because I wanted my ssh keys unlocked at login. I followed the instructions at this wiki page. Ignoring the warning, I have become locked out (cannot log in with user account or even root also in safe mode). How can this be fixed? I have a live CD for arch linux, but I`m hoping a reinstall is not necessary.


Using google DNS in netcfg

how can I set up my netcfg profiles to use the google DNS servers? I've tried               IP = 'dhcp'     DNS = '8.8.8.8'      but that didn't cut it.


How to execute applications in existing X window from virtual console?

I run Debian Wheezy and have Xfce as my X-Window Manager on virtual console 7, which starts up automatically. Once I've logged on and I'm using the xfce interface, is it possible for me to press `Ctrl`+`Alt`+`F2` and move to another virtual console (non-X, console 2), and start an application in my, already running, x-session on console 7? Also, can I do this remotely: say I have a laptop running Linux with Xfce running at home. Can I start an application on that instance of Xfce over `ssh` from work?


Convert numeric string from file to exit code in shell

I'd like to grep /etc/password for a username and return the last two digits of a user-id number as the return code. This is because I have an application whose main way of interacting with other programs is something like `integer_variable = run("some command")` which picks up the byte value of the exit code of the command. I can do this using something like the following command               perl -n -e 'exit $1%100 if /^username:x:(\d+):/' /etc/passwd      Is there an equivalent using `awk` or some other standard utility?


Using a variable inside a sequence of commands in bash to supplement an existing string - syntax error or flawed design?

I'm using the following sequence of commands in my .bashrc file to alter the appearance of my linux terminal. It fills the screen line by line with a pattern made out of characters. There is no abstraction, the characters are from a **set** within the command itself:               for i in $(seq 1 $(expr $(tput lines))); do echo -en '\E[0;32m'$(tr -dc '",.o;:~' < /dev/urandom | head -c $(tput cols)); done; tput cup 1                                                                            -->the set      The main idea is to read 80 cols (bytes) from some random characters from the set, and to print that * number of lines. Now, I've run the following contributed script in order to explore adding new characters to the set. To maintain compatibility with the linux terminal I'm using, I've run this outside of X etc, with the following result: ![enter image description here](http://i.stack.imgur.com/QhKAm.jpg) I'd like to to use the available characters in the sequence above. So I took many of them and did the following, for instance with ◘:               echo -n ◘ | hexdump     0000000 97e2 0098     0000003     so the UTF-8 sequence is \xE2\x97\x98     I build all the sequences I need: \xE2\x95\x99, \xE2\x95\x9a to f, \xE2\x96\x90 to 93      So I simply add to my .bashrc file `A=$(echo -e '\xE2\x97\x98')` and `B=$(echo -e ',.o;:~')` and I modify my command sequence like this (i.e. `echo $A$B`):               for i in $(seq 1 $(expr $(tput lines))); do echo -en '\E[0;32m'$(tr -dc $(echo $A$B) < /dev/urandom | head -c $(tput cols)); done; tput cup 1       If I `echo` $A or $B at the prompt, it prints the char(s). But when the sequence is called in .bashrc this mostly doesn't work at all. On an entire screen ◘ appears 3-5 times total along with many placeholder chars meaning the output is not supported by the term. The other characters from the set are there. Of interest is that if I kept the original syntax with no $B variable and simply tried to add $A to the set i.e. `tr -dc '",.o'$A';:~'` I get the exact same sort of output, suggesting it's something else than syntax - because of /dev/urandom. Other variations on the syntax using quotations introduce more unrelated echo. As a side note, in xterm, the result is similar with different placeholder chars, and a few ☗ and ◗. Is there a way to bring the variable in the set like that or does this need to be redesigned from scratch to account for this case?


Software RAID 1 with dissimilar size and performance drives

_Background_ I was experimenting with a home server setup in a small box I had that was supposed to be a media centre but never found much use. I installed CentOS 6.5 in a software RAID1 configuration accross two similarly specced laptop hard drives I had salvaged from an old device. Both are 320GB and both run at 7200rpm with the same sized cache. The install went ahead perfectly and I was happy with everything however now one of the drives is reporting S.M.A.R.T errors. The only spare drive I have is a 5400rpm 1TB laptop drive. I dont need to rebuild the array and I will happily reinstall from scratch as the system hasnt been put to use yet but I dont wish to purchase a relatively expensive replacement 7200rpm 320GB drive. _Question_ Is there anything inherently wrong/dangerous/unreliable about setting up software RAID 1 across the non-faulty 320GB drive and a 320GB partition of the 1TB drive then using the remainder of the 1TB drive as an additional non- redundant storage partition, bearing in mind the different sizes and spindle speeds? Will the partioner let me do this? Note: I have browsed https://raid.wiki.kernel.org/index.php and it constantly refers to devices "of roughly the same size."


Install php_http on Arch Linux

First I installed the curl extension for PHP:               $ sudo pacman -S php-curl      and               $ grep curl /etc/php/php.ini     extension=curl.so      Then I installed the PHP PEAR               $ sudo pacman -S php-pear      Having now installed pear, I have also installed PECL, and should now be able to install the php_http extension.               $ pecl install php_http      and               $ grep http.so /etc/php/php.ini     extension=http.so      The http.so is found in the folder /usr/lib/php/moduels/ and latter copied to the folder /usr/lib/http/modules/ . Now, as far as I know, this should have installed the php_http extension, but when I try to               $req = new HttpRequest();      I get the error               Fatal error: Class 'HttpRequest' not found in /srv/http/webcrawler/nettocrawl.php on line 4


Why is `while IFS= read` used so often, instead of `IFS=; while read..`?

It seems that normal practice would put the setting of IFS outside the while loop in order to not repeat setting it for each iteration... Is this just a habitual "monkey see, monkey do" style, as it has been for this monkey until I read _man read_ , or am I missing some subtle (or blatantly obvious) trap here?


How can I print out information about a Wireless Access Point in range? Can I for example get the MAC address?


How to prevent my screens from dimming (going black) from the command line

In KDE, there was a system setting where you could specifically set the monitors to never go black. Now I've switched to dwm and (it might not be related) my screens dim after about 10 minutes. How do I change this setting directly from the command line? I'm guessing this has to do with X?


Grub not starting on recently Debian install

i recently install Debian 7.4.0 on my laptop. The problem is when i reboot my system it start on Windows 7 by default, i tried to boot again the Debian installer and my surprise was the boot USB load the grub screen, with the option to load Debian and Windows 7. But if i try without the USB it starts on Windows 7. What could i do here? Thanks!