title: Partitioning disk image file

text: I want to partition raw disk image with the following commands               #creating the blank image     $ dd if=/dev/zero of=example.img bs=1M count=50          #write the partition table     $ parted example.img mktable msdos          #creating partition but not the file system     #creating fat32 primary partition 1 to 15 MB     $ parted example.img mkpart p fat32 1 15     #creating ext3 primary partition 16 to end     $ parted example.img mkpart p ext3 16 -0      These command doesn't create file system. How could I do that? I am trying the `mkfs` command in `parted` but it is showing no command found. How could I create file system externally?


title: tar: Unexpected EOF in archive

text: I am trying extract .tar.gz file it but with no luck               gzip: stdin: unexpected end of file     tar: Unexpected EOF in archive     tar: Unexpected EOF in archive     tar: Error is not recoverable: exiting now      the file tar.gz include another file.tar only which is has the issue when i trying to extract .tar file i got               tar: Unexpected EOF in archive     tar: Unexpected EOF in archive     tar: Error is not recoverable: exiting now      i tried –ignore-zeros –ignore-failed-read with no luck file type tar.gz: gzip compressed data, from Unix how could i extract this file even if it corrupted ?


title: How to tell who is connected via vnc to my machine?

text: How do I check how many vnc connections or different users are currently connected to my machine? Only through wireshark? And how do I kill any other users connected through vnc?


title: How to restart icewm from the command line?

text: I'm looking for a way to bind for example the Ctrl+Alt+Ins key combination to a command line that would restart icewm (just to make it read the configuration files again and be aware of the edits). So what should go into that .icewm/keys file ? `key "Alt+Ctrl+k" <tab> <...> ?`


title: iptables port forwarding

text: I have a CentOS server with Java/J2EE(Tomcat) installed on TCP port 8080. I have two interfaces, eth0 and lo. I need to forward all incoming connection on TCP port 80 to 8080. I tried doing the following which works:               iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j DNAT --to x.x.x.x:8080     iptables -A INPUT -p tcp -m state --state NEW --dport 8080 -i eth0 -j ACCEPT      where x.x.x.x is the ip associated to the eth0 interface. This appears to also open port 8080 to the outside world, which I don't want to do. I only want port 80 exposed to the outside world, forwarding all traffic to 8080. Any help would be appreciated. Update : The iptables -L looks like below               [root@server admin]# iptables -L     Chain INPUT (policy DROP)     target     prot opt source               destination              ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh      ACCEPT     all  --  anywhere             anywhere                 ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED      DROP       tcp  --  anywhere             anywhere            state NEW tcp dpt:http           Chain FORWARD (policy DROP)     target     prot opt source               destination                   Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination              [root@server admin]#       iptables -t nat --list looks like below               [root@server admin]# iptables -t nat --list     Chain PREROUTING (policy ACCEPT)     target     prot opt source               destination              DNAT       tcp  --  anywhere             anywhere            tcp dpt:http to:x.x.x.x:8080           Chain POSTROUTING (policy ACCEPT)     target     prot opt source               destination                   Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination              [root@server admin]# ^C


title: How can I tell if PPP compression is enabled for modem?

text: I'm using Debian Linux on an embedded system, we use ppp to connect to the WAN via a CDMA modem. I want to find out if compression is being used by ppp. In my `/var/log/messages` I see the line:                kernel: [   54.740000] PPP Deflate Compression module registered      but in `/var/log/debug` I see this:               pppd[2433]: Protocol-Reject for 'Compression Control Protocol' (0x80fd) received      The output of pppstats -z is:               root@ts7600-47aad3:~# pppstats -z     IN:  COMPRESSED  INCOMPRESSIBLE   COMP | OUT: COMPRESSED  INCOMPRESSIBLE   COMP         BYTE   PACK     BYTE   PACK  RATIO |     BYTE   PACK     BYTE   PACK  RATIO            0      0        0      0   0.00 |        0      0        0      0   0.00      So does the above mean compression is enabled, or not?


title: How to get the lines that contain -R with grep

text: How can I find "-R" in files with grep? I tried `grep "-R" *.GNU` to get the lines that contain -R, but it returns nothing.


title: Activity Logging Level in SFTP

text: I'm using CentOS, i have already figured out how to enable the SFTP Logging. After that when i test it by using FileZilla (from User-end) and `tail -f /var/log/sftp.log` from the Server, all the activities from the Users are surely logged. Working great! But i still have some important questions related to this, as below:   * In the log file, nothing is mentioned about the USERNAME. The USERNAMES are not logged / mentioned anywhere in the LOGS for every single activities (Only the FTP Login / Logout activities are logged, as a single line among millions of lines. But it is not effective if i have more then 1 user) For example:               Feb 27 02:59:31 myhostname sftp-server[13307]: session opened for local user michael from [10.xxx.xxx.xxx]     Feb 27 03:01:00 myhostname sftp-server[13312]: session opened for local user jimmy from [10.xxx.xxx.xxx]     ...     ...     Feb 27 04:00:34 myhostname sftp-server[13307]: mkdir name "/var/www/html/nnnnn" mode 0777     ...     Feb 27 04:01:30 myhostname sftp-server[13307]: rmdir name "/var/www/html/nnnnn"     Feb 27 04:01:30 myhostname sftp-server[13307]: opendir "/var/www/html"     Feb 27 04:01:30 myhostname sftp-server[13307]: closedir "/var/www/html"      There is NO USERNAME mentioned **in the lines itself**. (Except for the login/logout actions)   And the another question is:   * How long can i keep this logs for? I mean, is it possible if i want the LOG FILE to always keep the lines inside up to the last 6 months? Any idea please?


title: Can't access the directory /etc/ppp/peers?

text: I want to read some configuration file. The problem is that I can't move in the folder `peers` and typing the command _ls -l_ , I see this permission's record:               drwxr-s--- root dip ...      I never seen that `s`, and reading on the web now I know that's the gid bit. Also the name of the group is unusual, normally I read root here. When I try:               sudo cd ./peers      I get an error because the cd command is not found. Why can't I move in this directory as super user? How can I resolve this?


title: Cannot add new partition using fdisk - No free sectors available

text: I would like to add new partitions to sda3, but fdisk says "No free sectors available". What can I do? ![enter image description here](http://i.stack.imgur.com/JWrFX.jpg)


title: How do I set the tty that GDM spawns on?

text: On my computer (under Arch Linux), GDM is spawning on tty1 while I would like it to spawn on tty7. Is there any way to do that?


title: Multiple environments - Awesome and Gnome

text: I'm trying to install multiple environments on my Arch Linux system, and since I've never done it before, there are some stupid questions that I must now the answer.   1. If I install Gnome and Awesome WM, should I download the `xfce4-power-manager` package for power management or will it be wiser if I just use the Gnome applet for that job? Are the packages shared between environments? Need to ask this because it seems like a big problem with Gnome applets and their amount of dependencies, but since I will have the whole desktop installed, I guess it should save me some time/space, unless I need to install it again for Awesome.   2. Can I use Slim to manage them, or is GDM better? Note: I will not use Awesome as Gnome WM, it will be different sessions.


title: Accidental chown under / as root

text: I accidentally run the following command as root `chown mike -Rf / backups` the point is that I added a space between / and backups my mistake, I stopped the command after 1-2 seconds, how can I recover from this? I have problems with DirectAdmin right now for example when accessing it I recive the error:               Unable to determine Usertype     user.conf needs to be repaired     http://help.directadmin.com/item.php?id=456      Or I stopped recieving emails, I dont even know what else is messed up right now...


title: ARM LXC Container template

text: I've been trying to run LXC on an ARM architecture (arm6l - Raspberry Pi) but with no luck. After some research, I found that maybe trying to run a x86 template on my ARM was causing the problem (bash causing segfault). Anyone knows where to find container templates for ARM?


title: Why can I access all my files without a password when booting with a Chakra Linux live CD?

text: The other day I burned a Chakra Linux iso on a dvd. When I booted into a live session I was able to access all my regular data. In dolphin when clicking on the icon belonging to my `/home/user` partition a pop-up asked me for my `sudo` password. The password I entered was not my regular `sudo` password, but the password that belongs to the live dvd. By default, this password is always `root`. Using the default password I was granted access to all partitions where I have stored my data, installed Linux Mint and installed Windows 7. I consider this to be a serious security breach. What is the point of having a password-protected account when all data can be accessed without the password by using a live dvd? Is this behaviour normal, or is something messed up on my system or is there something wrong with the Chakra distro?


title: Shaping outgoing traffic with iptables

text: On my laptop, when I run any downloads, torrents, etc, browsing is crippled. I read somewhere that you could configure your iptables powered router to prioritize certain network traffic. Could I do the same on my pc for all network traffic? I would like to prioritize packets in the following order:   1. SSH   2. Gaming    3. Browsing   4. Chat   5. Downloads/Torrents


title: How do I read alternate gnome configuration files

text: I have a number of versions of gnome installed on a number of different hosts. All users have network mounted home directories. In some cases gnome works poorly when reading configuration from the .gnome2 directory. I would like to read config files from version specific directories. Is there any way to specify this when starting gnome? Environment variables perhaps? I know how to move the .gconf directories but this is not sufficient. I need to read the .gnome2 from a different path.


title: How to display the number of lines output by a command in real time?

text: I'm using `svn export` as part of a packager script for my application, and it looks like this command, like many others, doesn't have any kind of progress bar. I have two choices at the moment:   * using it without options, and watch it printing thousands of lines   * using `\--quiet`, and not seing anything until it completes. Is there a way to at least show the number of lines output by the command, in real time? Such as:               Exporting SVN directory ... 1234 files      And see this number `1234` **increment in real time**? I can imagine piping the output to a command that would do just this, but which one?


title: What makes a Linux Distribution "Enterprise"?

text: Well just as the title states, id like to know what makes a Linux Distribution "Enterprise" compared to another Non-Enterprise Distros.


title: How to extract the file size with du

text: I'm using `du` to get the file size of the result archive in a packager script:               > du -smh archive.zip     51M    archive.zip      I'd like to assign just the `51M` part to a variable, to be able to print:               Archive size: 51M      How can I do that?


title: Are the outputs of /proc/meminfo, /proc/cpuinfo etc always in English?

text: I am writing code that relies on the output of /proc/meminfo, /proc/cpuinfo etc. Are the file contents always in English? For example, will `MemTotal` in /proc/meminfo always be `MemTotal` in all locales?


title: Best practices for secure, separated virtualhost LAMP environment

text: What are the best practices for a Debian Squeeze + Grsecurity/PAX based system when multiple, and therefore insecure, websites must run on the same server? I mean how can I mitigate an attack, so that if UserX's website got hacked, the other hosted sites remain intact etc.? Are there any good guides on this topic?


title: Automatically suspend luks volume after delay

text: Anyone have any ideas for how I can automatically do a `luksSuspend` on a luks volume after it's been unused for a certain amount of time. I was thinking of just scheduling a command with `crontab` or something, but I don't want it to suspend if I'm actually using the volume.


title: How do I create a directory in all subdirectories?

text: Suppose I have a directory structure like this:               $ [~/practice] ls     a/ b/ c/ d/      Now I want to create a directory `tmp1` in all sub directories of `practice` and I do this:               $ [~/practice] mkdir */tmp1     mkdir: cannot create directory `*/tmp1': No such file or directory      Then I try the `-p` switch and I endup with a directory named `*` with a sub directory `tmp1`               $ [~/practice] mkdir -p */tmp1          $ [~/practice] ls     */ a/ b/ c/ d/      I know the use of `-p` switch is to create multiple nonexistent directories. I just thought it might help. How do I create `tmp1` in all subdirectories at once? If this can be done, how do I extend it to create `\tmp1`, `\tmp2`, `\tmp3` in `\a`, `\b` and `\c` at once? **Edit:** I missed mentioning that the directories don't have to be simple and in order, like `a`, `b`, `c` etc., and the directory to be created is not necessarily like `tmp1`, `tmp2`.               $ [~/practice] ls     dog/ cat/ rat/      In them, I would like to have something like               $ [~/practice] ls *     dog:     red/ blue/          cat:     red/ blue/          rat:     red/ blue/


title: Loss of disk access on external USB system/boot drive

text: I'm running ubuntu 10.10 on a Dell D400 laptop. I'm booting and running the system from LVM volumes on a WD Scorpio Blue 2.5" drive mounted in a NexStar3 USB enclosure. For the most part, this works great. However, after a few days or so the system will often seem to lose access to the system partition. I'm not sure what exactly happens, and it's difficult to diagnose because I can't access the pertinent system utilities:               $ mount     bash: /bin/mount: Input/output error     $ ls     Bus error     $ tail /var/log/messages     bash: /usr/bin/tail: Input/output error     $ cat /var/log/messages     Segmentation fault      Even shutting down cannot be done cleanly:               $ sudo shutdown -h now     bash: /usr/bin/sudo: Input/output error     $ sudo halt     bash: /usr/bin/sudo: Input/output error      The only recovery procedure I've found is a hard reboot by holding the power button down for a few seconds. When this error state is active, the enclosure light is on steady. Normally it blinks pretty constantly. I migrated the system files over from an internal drive. I was not having these problems prior to the migration. I seem to recall that they started soon afterwards. ## update Following Gilles' suggestion to do remote logging yielded this `syslog` output:               <6>Aug 12 01:00:25 box kernel: [229825.120148] usb 1-5: reset high speed USB device using ehci_hcd and address 2     <3>Aug 12 01:00:26 box kernel: [229825.700267] usb 1-5: device not accepting address 2, error -71     <3>Aug 12 01:00:26 box kernel: [229825.758145] ehci_hcd 0000:00:1d.7: port 5 reset error -110     <3>Aug 12 01:00:26 box kernel: [229825.758160] hub 1-0:1.0: hub_port_status failed (err = -32)     <6>Aug 12 01:00:26 box kernel: [229825.960116] usb 1-5: USB disconnect, address 2     <6>Aug 12 01:00:26 box kernel: [229825.980062] sd 2:0:0:0: Device offlined - not ready after error recovery     <6>Aug 12 01:00:26 box kernel: [229825.980108] sd 2:0:0:0: [sdb] Unhandled error code     <6>Aug 12 01:00:26 box kernel: [229825.980112] sd 2:0:0:0: [sdb] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK     <6>Aug 12 01:00:26 box kernel: [229825.980118] sd 2:0:0:0: [sdb] CDB: Read(10): 28 00 31 b1 a0 35 00 00 20 00     <3>Aug 12 01:00:26 box kernel: [229825.980132] end_request: I/O error, dev sdb, sector 833724469     <3>Aug 12 01:00:26 box kernel: [229825.980167] Buffer I/O error on device dm-1, logical block 44564614     <4>Aug 12 01:00:26 box kernel: [229825.980171] lost page write due to I/O error on dm-1     <3>Aug 12 01:00:26 box kernel: [229825.984068] Aborting journal on device dm-4-8.     <3>Aug 12 01:00:26 box kernel: [229825.984100] Buffer I/O error on device dm-4, logical block 1081344     <4>Aug 12 01:00:26 box kernel: [229825.984104] lost page write due to I/O error on dm-4     <3>Aug 12 01:00:26 box kernel: [229825.984113] JBD2: I/O error detected when updating journal superblock for dm-4-8.     <3>Aug 12 01:00:26 box kernel: [229825.984181] Buffer I/O error on device dm-4, logical block 1675867     <4>Aug 12 01:00:26 box kernel: [229825.984185] lost page write due to I/O error on dm-4     <3>Aug 12 01:00:26 box kernel: [229825.984190] Buffer I/O error on device dm-4, logical block 1675868     <4>Aug 12 01:00:26 box kernel: [229825.984193] lost page write due to I/O error on dm-4     <3>Aug 12 01:00:26 box kernel: [229825.984200] Buffer I/O error on device dm-4, logical block 1684657     <4>Aug 12 01:00:26 box kernel: [229825.984204] lost page write due to I/O error on dm-4     <4>Aug 12 01:00:26 box kernel: [229825.984389] JBD2: Detected IO errors while flushing file data on dm-4-8     <43>Aug 12 01:00:26 box rsyslogd: /var/log/syslog     <43>Aug 12 01:00:26 box rsyslogd: /var/log/kern.log     <43>Aug 12 01:00:26 box rsyslogd: /var/log/messages     <2>Aug 12 01:00:26 box kernel: [229825.991754] EXT4-fs error (device dm-4): ext4_journal_start_sb: Detected aborted journal     <2>Aug 12 01:00:26 box kernel: [229825.991765] EXT4-fs (dm-4): Remounting filesystem read-only     <3>Aug 12 01:00:26 box kernel: [229826.136474] Buffer I/O error on device dm-1, logical block 44726233     <4>Aug 12 01:00:26 box kernel: [229826.136480] lost page write due to I/O error on dm-1     <3>Aug 12 01:00:26 box kernel: [229826.136487] Buffer I/O error on device dm-1, logical block 44726234     <4>Aug 12 01:00:26 box kernel: [229826.136491] lost page write due to I/O error on dm-1     <3>Aug 12 01:00:26 box kernel: [229826.144081] Aborting journal on device dm-1-8.     <3>Aug 12 01:00:26 box kernel: [229826.144099] Buffer I/O error on device dm-1, logical block 13139968     <4>Aug 12 01:00:26 box kernel: [229826.144103] lost page write due to I/O error on dm-1     <3>Aug 12 01:00:26 box kernel: [229826.144110] JBD2: I/O error detected when updating journal superblock for dm-1-8.     <0>Aug 12 01:00:26 box kernel: [229826.144124] journal commit I/O error      The 10th line from the end, at 229825.991765, is where the filesystem is remounted readonly. I scanned through the rest and didn't see anything indicating that it is fully dismounted, so it is a bit of a mystery why the system itself becomes inaccessible. In any case, the USB errors at the beginning seem to be the reason for the crash. Is this likely to be a problem with the laptop's USB controller/drivers? Or more likely with the USB enclosure? How can I tell?


title: Prevent file access from hanging when luks volume is suspended

text: I've got a luks volume setup and mounted, and when not in use I suspend it with `cryptsetup luksSuspend` so it cannot be accessed. But if I forget it's suspended and try to do any kind of file access in the mounted directory, the process just hangs, instead of failing immediately. `CTRl-C` doesn't work to kill it, and `CTRL-Z` doesn't work to put it in the background. Even `sudo kill -9` doesn't help. Is there a way to make these commands fail fast when the volume is suspended? If it's relevant, the volume is setup on a loop device backed by a file.


title: Is it possible to repair Linux system files? Or is reinstall the only option?

text: I've got a question about something that always bothered me about Linux. On Windows, if any of the system files become damaged, you can just reinstall the system files, without having to re-format your disk,which is a great option. Is there anything similar on Linux? I run a Raspbian Distro on my Raspberry Pi, and my system became damaged AGAIN, after another power cut. It was running a Netatalk server working as a TimeMachine for Mac. After a power cut, system would not boot, I had to run fsck.ext4 on the filesystem manually to fix it - and it had a LOT of errors to fix. After running that, the system would boot, but there are strange errors around - it does not know the name of the machine, so it appears as pi@(unknown), some basic system programs like ls or sudo give me "permission denied" errors, I have plugged in the card to another computer and manually set the right permissions on sudo, but now when I run it it gives me "Segmentation Fault" error, so the file is clearly damaged. Now my point is - it would be a lot of pain to reinstall everything again. Is there an option to fix it by reinstalling all system files without breaking all of my custom setup for netatalk?


title: Error while importing Compiz profile from Terminal

text: File name : import.py               #!/usr/bin/python     import sys     import compizconfig          #The last input on the command line will be the path to save the file to.     savefile=sys.argv[-1]          context=compizconfig.Context()     #Change keyword if you want to skip saving entries that are default     context.Import(savefile)      I'm using above python script form importing `compiz` exported profile from `Terminal`.      Like this : `./import.py myCompizProfile.profile`      (I have give all the permission `chmode 777 import.py`)   This program is working perfectly on `Ubuntu 12.04 (Zorin OS)` with      `Compiz(CompizConfig Settings Manager) version 0.9.5.92`   Now my problem :   When I tried this same code in `Ubuntu 12.10 Genome Remix` with      `Compiz(CompizConfig Settings Manager) version 0.9.8.6` its not working.   Getting an error :                 ./import.py myCompizProfile.profile     compizconfig - Info: Backend : gsettings     compizconfig - Info: Integration : true     compizconfig - Info: Profile : default                              (process:11253): GLib-GIO-WARNING **: g_settings_set_value: value for key 'visual-bell-type'        in schema 'org.gnome.desktop.wm.preferences' is outside of valid range       Question : Why I'm getting this error ?   How can I solve this error ?


title: Remove last character from an echo variable

text: This script works great and I modified it to increment by 5. My problem is I do not need the last comma at the end and I'm not sure how to remove this.               for ((i=1, j=0; i <= 12 ; i++, j=j+5))     do      echo -n "$j,"     done


title: change eth0 to eth1 without udev

text: I have very interesting issue, We have `Redhat 4 Linux` and it is has `4` Ethernet interface. `eth0 eth1 eth2 eth3` Now only `eth0` is connected to `LAN` and everything working find. We have special software which need `eth2` to work, without `eth2` interface it won't work, i want to convert `eth0` to `eth2`. I don't have `70-persistent- networking.rules` file in udev, look like we have very old version of `udev` running and it doesn't use that file. /etc/modprobe.conf `alias eth0 bnx2 alias eth1 bnx2 alias eth2 bnx2 alias eth3 bnx2 ` I have tried to swap `MAC` address in `ifcfg-eth` files but still not working. `Note:` we can't swap cable because this server is a blade server inside chassis, and server located in remote datacenter


title: How can I configure NoMachine 4.0.369 for OS X to connect to freenx-server on Fedora 20?

text: On an otherwise untouched installation of Fedora 20 Security Lab, I'm trying to enable NX access so I don't have to use Windows and the vSphere console. I have to use SSH to reach the host, no other ports are open. I'm able to connect to other machines running CentOS and Scientific Linux under the same network conditions. I start by setting sshd to start on boot:               systemctl enable sshd.service      Then I grab freenx:               yum install freenx-server      Then the dependency for nxagent:               yum install nxagent      I then configure the nxserver via /etc/nxserver/node.conf:               SSHD_PORT=22     ENABLE_PASSDB_AUTHENTICATION="1"     ENABLE_SSH_AUTHENTICATION="1"     DISPLAY_BASE=1000     ENABLE_PERSISTENT_SESSION="all"     ENABLE_CLIPBOARD="both"     ENABLE_PULLDOWN_MENU="1"     COMMAND_MD5SUM="md5sum"      Then from the /usr/libexec/nx directory:               ./nxsetup --install --setup-nomachine-key      This returns the following:               Setting up /etc/nxserver ...done     Generating public/private dsa key pair.     Your identification has been saved in /etc/nxserver/users.id_dsa.     Your public key has been saved in /etc/nxserver/users.id_dsa.pub.     The key fingerprint is:     69:ad:50:52:59:d3:9d:93:77:d7:94:68:dc:eb:8b:92 root@localhost.localdomain     The key's randomart image is:     +--[ DSA 1024]----+     |        .oo...o++|     |       ..  ..+=o=|     |      . .   .  o+|     |       o o     . |     |      . S .   .  |     |       o .     . |     |        .   . . .|     |           E . . |     |            .    |     +-----------------+     Setting up /var/lib/nxserver/db ...done     Setting up /var/log/nx/nxserver.log ...done     Adding user "nx" to group "utmp" ...done     Setting up known_hosts and authorized_keys ...done     Setting up permissions ...done          ----> Testing your nxserver configuration ...     Warning: Invalid value "APPLICATION_LIBRARY_PRELOAD=/usr/lib64/nx/libX11.so.6:/usr/lib64/nx/libXext.so.6:/usr/lib64/nx/libXcomp.so.3:/usr/lib64/nx/libXcompext.so.3:/usr/lib64/nx/libXrender.so.1". /usr/lib64/nx/libX11.so.6 could not be found. Users will not be able to run a single application in non-rootless mode.     Warning: Invalid value "COMMAND_START_KDE=startkde"              Users will not be able to request a KDE session.     Warning: Invalid value "COMMAND_START_GNOME=gnome-session"              Users will not be able to request a Gnome session.     Warning: Invalid value "COMMAND_START_CDE=cdwm"              Users will not be able to request a CDE session.     Warning: Invalid value "COMMAND_XTERM=xterm"              Users will not be able to request an xterm session.     Warning: Invalid value "COMMAND_SMBMOUNT=smbmount". You'll not be able to use SAMBA.      Warning: Invalid value "COMMAND_SMBUMOUNT=smbumount". You'll not be able to use SAMBA.     Warning: Invalid cupsd version of "/usr/sbin/cupsd". Need version 1.2.              Users will not be able to enable printing. Ignore if you use cups > 1.2     Error: Could not find 1.5.0 or 2.[01].0 or 3.[012345].0 version string in nxagent. NX 1.5.0 or 2.[01].0 or 3.[012345].0 backend is needed for this version of FreeNX.            Warnings occured during config check.       To enable these features please correct the configuration file.          <---- done          ----> Testing your nxserver connection ...     The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established.     RSA key fingerprint is 1b:2d:0e:72:56:66:1a:f3:b5:97:66:93:c7:c4:e8:93.     Are you sure you want to continue connecting (yes/no)?     Warning: Permanently added '127.0.0.1' (RSA) to the list of known hosts.     HELLO NXSERVER - Version 3.2.0-74-SVN OS (GPL, using backend: not detected)     NX> 105 quit     Quit     NX> 999 Bye     <--- done          Ok, nxserver is ready.          PAM authentication enabled:       All users will be able to login with their normal passwords.            PAM authentication will be done through SSH.       Please ensure that SSHD on localhost accepts password authentication.            You can change this behaviour in the /etc/nxserver/node.conf file.     Have Fun!      I then grab the key from /etc/nxserver/client.id_dsa.key and add a new connection in NoMachine for Mac OS X. I set it as an SSH connection, under Advanced I select "Use the NoMachine login, add my key as the alternate server key, and attempt to connect. Every single time, I get: "The NoMachine service is not available or the access was disabled on host 10.30.5.22" I've been Googling for days, and nothing I try seems to work. Can anybody see if I'm missing something here? I have almost no experience with NX, I'm really just poking away here, so pardon me if this looks like a noob question.


title: Tmux eclipsed colorized output of ls

text: I'm running Xubuntu 12.04, and when I use the Terminal I get colored filenames from `ls`. But inside tmux, everything ls prints is white. I know my tmux supports color, though, because I get color syntax highlighting when I run vim. My ~/.tmux.conf has this line already:               set -g default-terminal "screen-256color"      Here are some environment variables (from within tmux):               $ env | grep COLOR     LS_COLORS=di=34:ow=34     $ echo $TERM     screen-256color      How can I get ls to show me color when inside tmux?


title: intel wireless 1000 bgn not working in debian/ubuntu

text: First, I'm not an expert in Linux but I can fairly move and play around with the OS. The problem in short is, I was able to find wireless networks, but when I try to authenticate it, network-manager keeps on asking me for my password. So it seems like it's not able to authenticate at all. In Windows 7 everything's working OK. So what i've done so far is…   * I have installed firmware-iwlwifi_0.28_all.deb and was able to detect wireless networks   * I reconfigured my wifi to wpa2 personal, it does not work. I reconfigured it to use wep 128, it doesn't work either   * I tried to install ubuntu, and it poses the same problem :( Here's my PC information: Asus K42JA. I used the 64 bit installer of Debian Live 6.0.1 and Ubuntu 10.10 Can you help me with this? I can provide you log information, but I don't know where to find them. :( UPDATE: here's the content of my `/etc/network/interfaces`.               auto lo     iface lo inet loopback      `lsmod` (iw* related information)               iwlagn   73139   0     iwlcore  77810   1   iwlagn      here's what's inside `daemon.log`. Hope you can help me fix this problem. I just bought this laptop :(               Apr  4 18:43:07 sophia NetworkManager[1849]: <info> (wlan0): supplicant connection state:  associating -> disconnected     Apr  4 18:43:07 sophia NetworkManager[1849]: <info> (wlan0): supplicant connection state:  disconnected -> scanning     Apr  4 18:43:08 sophia wpa_supplicant[1879]: Trying to associate with 00:24:01:1a:48:35 (SSID='Funshine' freq=2437 MHz)     Apr  4 18:43:08 sophia NetworkManager[1849]: <info> (wlan0): supplicant connection state:  scanning -> associating     Apr  4 18:43:17 sophia NetworkManager[1849]: <warn> Activation (wlan0/wireless): association took too long.     Apr  4 18:43:17 sophia NetworkManager[1849]: <info> (wlan0): device state change: 5 -> 6 (reason 0)     Apr  4 18:43:17 sophia NetworkManager[1849]: <warn> Activation (wlan0/wireless): asking for new secrets     Apr  4 18:43:17 sophia NetworkManager[1849]: <info> (wlan0): supplicant connection state:  associating -> disconnected     Apr  4 18:43:18 sophia wpa_supplicant[1879]: Authentication with 00:00:00:00:00:00 timed out.


title: How to freeze system clock for a wine application?

text: I have a windows program, that works only to a particular date. It's a legacy application and I can't change the source code. Is there any way to set a specific date in the system clock for the wine instance where I run it, so that the time in this instance is always day X?


title: Change date only for a single non-root user in Linux

text: Is it possible to change date only for a specific user (non-root) in Linux ? If possible, How to do it ? And it would be great if someone can point out the impact of doing so. **EDIT** Putting my question in other words . I want to change the day and time from what it is now to another day and time in Linux without having root privileges.How can I achieve this ?


title: cp /etc/DIR_COLORS ~/.dir_colors not responding

text: I'm using CentOS 6.5 and Putty. My problem is that directory file names are shown in dark blue color which is hard to read. I google searched and found this link; basically it's copying the `DIR_COLORS` file from /etc to the home directory so changes will only affect the user instead of everyone. The real problem is that whenever I run this command `cp /etc/DIR_COLORS ~/.dir_colors`, no .dir_colors file is created. And there is no error message too. I ran it using sudo too but also no file is created. When I named the file dir_colors(without the dot) then the file will be created, but when I changed the color from 1;34 to 1;33 in DIR # directory, the dark blue color doesn't change to the new color. I'm guessing it is because the dot is missing before the file name. Any ideas why no file is created when I used .dir_colors?


title: Merging Two Files columns in order

text: I want to merge two files. Files A.txt               001;abc;def;ghi;jkl;pqr     002;abc;def;ghi;jkl;pqr     003;abc;def;ghi;jkl;pqr     004;abc;def;ghi;jkl;pqr     005;abc;def;ghi;jkl;pqr      . Second File B.txt               001;mno     002;mno     003;mno     004;mno     005;mno      to have atext file C.txt               001;abc;def;ghi;jkl;mno;pqr      I am able to merge these two files but i dont know how to insert the output from file B mno before pqr.Thanks in advance.


title: How to disable inetd and sendmail under OpenBSD 5.1?

text: # grep '^inetd_flags="' /etc/rc.conf     inetd_flags="NO"                # for normal use: ""     # grep -i 'sendmail_flags="NO"' /etc/rc.conf     sendmail_flags="NO"     #          after a reboot..:     two questions:          # ps -aux | egrep -i "inetd|sendmail"     root      4420  0.0  0.1   452   652 ??  Is     8:10PM    0:00.00 /usr/sbin/inetd     #      **QUESTION** : How can I disable inetd, so that it will not start after a reboot? (+how can I disable sendmail correctly?)


title: ALSA: how to temporarily change the output device

text: I want to do a simplest thing possible in ALSA: to have USB-headphones produce sound instead of internal speaker of my tablet. I don't want to change config files such as `asound.rc` or `alsa.conf` or `asound.conf` and permanently set headphones as default output device by changing the order of devices, I want a temporary effect, just until I unplug the headphones. Strangely, I can't google the answer. Is `alsamixer` capable of doing that (seems like no)? In Gnome you can easily select current output device with `PulseAudio`, either in its GUI or CLI interface, but `PulseAudio` itself works on top of ALSA! So I also wonder, how it forces ALSA to change the output device?


title: Disk size management

text: I am using Fedora 16. My /dev/sda2, mounted on / (root) with something like 50G got filled 100%:               [foampile@~ 13:13:39]> df     Filesystem     1K-blocks     Used Available Use% Mounted on     rootfs          51606140 49025452         0 100% /     devtmpfs         2988452        0   2988452   0% /dev     tmpfs            2999424       96   2999328   1% /dev/shm     /dev/sda2       51606140 49025452         0 100% /     tmpfs            2999424    51992   2947432   2% /run     tmpfs            2999424        0   2999424   0% /sys/fs/cgroup     tmpfs            2999424        0   2999424   0% /media     /dev/sda1          99150    79569     14461  85% /boot     /dev/sda5      247972844 10782056 224594412   5% /home      **Q1** : Is there a command, or an option with ls, which will list all the files under a directory recursively and sort them in the descending order by size? I would like to see which files/dirs are hogging the device. **Q2** : My /home is relatively unused. is there a way to repartition the disk and switch some disk space from /dev/sda5 (/home) to /dev/sda2? Thanks


title: How to change the repository settings for yum installer?

text: I am pretty much new to Linux. I am trying to install tint2 on CentOS. When I try to install using the command `yum install tint2`, it gave following error               checking for X11... configure: error: Package requirements (x11 xcomposite xdamage xinerama xrender xrandr) were not met:          No package 'xcomposite' found     No package 'xdamage' found     No package 'xinerama' found     No package 'xrandr' found          Consider adjusting the PKG_CONFIG_PATH environment variable if you     installed software in a non-standard prefix.          Alternatively, you may set the environment variables X11_CFLAGS     and X11_LIBS to avoid the need to call pkg-config.     See the pkg-config man page for more details.`      When I try to install those packages which I belive should be done using               $>yum install xinerama     Failed to set locale, defaulting to C     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile      * base: mirrors.lga7.us.voxel.net      * extras: mirror.rackspace.com      * updates: mirror.atlanticmetro.net     Setting up Install Process     No package xinerama available.     Nothing to do      I am bit unclear here. How can I change the yum settings to look for x* packages at the different repository where packages are available? What does it mean when it says               "Alternatively, you may set the environment variables X11_CFLAGS     and X11_LIBS to avoid the need to call pkg-config.


title: What command should I run after making changes to /etc/passwd file

text: I have made some changes to /etc/passwd file ,now I wanted to see if the effect of changes taken place or not .What command should I run for that. For example after making change to /etc/ssh/ssh_config file ,I run /etc/init.d/sshd command.


title: What does "Do you expect to run the X Windows System?" do when installing OpenBSD?

text: When installing OpenBSD 5.1, I got the question:               Do you expect to run the X Windows System?      What change does the installer make to my system if I say "yes"? I know what X Windows is, but I don't know why the installer wants to know if I plan to use it. Does it enable/disable X somehow based on my answer?


title: How do I use which(1) with the system's default $PATH?

text: I would like to use `which` with the system's default path, ignoring any embellishments from the user's shell configuration files. ### Motivation I am attempting to write a script to find the system's Ruby binary. Many Ruby developers use a Ruby version manager, which adds something like `~/.rvm/bin` to the start of their `$PATH`. I want to bypass this and use the version of Ruby that came with the system, or was installed via the system's package manager. ### Current solution Here's what I've tried so far:               $ env -i sh -c "which ruby"      This gives no output, and exits with 1. I would expect it to work though, because the path includes `/usr/bin`, and my system came with a Ruby binary at `/usr/bin/ruby`:               $ env -i sh -c "echo \$PATH"     /usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:.     $ which -a ruby     # ...     /usr/bin/ruby      A few additional details:   * `env -s bash -c "which ruby"` also doesn't find anything.   * `env -i zsh -c "which ruby"` does find `/usr/bin/ruby`, but I can't depend on `zsh`.   * Using the full path to `which` (to make sure I'm using the binary, not the shell built-in) doesn't make any difference. ### My environment I'm writing this in Bash on OS X, but would like it to be portable to other shells and operating systems.


title: Resizing Cloud Harddrive

text: I recently upgraded the harddrive from 20GB to 50Gb using the web interface of my cloud service. But df -h:                 Filesystem      Size  Used Avail Use% Mounted on       /dev/vda1        20G   19G   47M 100% /       udev            488M  4.0K  488M   1% /dev       tmpfs           200M  264K  199M   1% /run       none            5.0M     0  5.0M   0% /run/lock       none            498M     0  498M   0% /run/shm       none            100M     0  100M   0% /run/user      Clearly not a 50 GB partition. fdisk -l gives:               Disk /dev/vda: 53.7 GB, 53687091200 bytes     255 heads, 63 sectors/track, 6527 cylinders, total 104857600 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00064eed           Device Boot      Start         End      Blocks   Id  System     /dev/vda1   *        2048    41940991    20969472   83  Linux          Disk /dev/sda: 53.7 GB, 53687091200 bytes     255 heads, 63 sectors/track, 6527 cylinders, total 104857600 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x00064eed      Device Boot Start End Blocks Id System /dev/sda1 * 2048 41940991 20969472 83 Linux How do i proceed from here to make the partition a 50GB without loosing data. OS is Ubuntu 12.10. **Update and "solution"** After some help from the accepted solution i created mounted a new partition in the remaining 30GB free space and mounted it as my biggest subdirectory, /var:               Filesystem      Size  Used Avail Use% Mounted on     /dev/vda1        20G  7.7G   12G  42% /     udev            487M  4.0K  487M   1% /dev     tmpfs           200M  268K  199M   1% /run     none            5.0M     0  5.0M   0% /run/lock     none            498M     0  498M   0% /run/shm     none            100M     0  100M   0% /run/user     /dev/vda2        30G   13G   17G  43% /var


title: I am failing to build gudev with JHBuild

text: When I run `jhbuild buildone gudev` I get:               <SNIP>     Making all in .       CC     extras/gudev/extras_gudev_libgudev_1_0_la-gudevclient.lo       CC     extras/gudev/extras_gudev_libgudev_1_0_la-gudevdevice.lo       CC     extras/gudev/extras_gudev_libgudev_1_0_la-gudevmarshal.lo       CC     extras/gudev/extras_gudev_libgudev_1_0_la-gudevenumtypes.lo       CCLD   extras/gudev/libgudev-1.0.la       GEN    extras/gudev/GUdev-1.0.gir     /opt/gnome/bin/python: error while loading shared libraries: libpython2.5.so.1.0: cannot open shared object file: No such file or directory     make[2]: *** [extras/gudev/GUdev-1.0.gir] Error 127     make[1]: *** [all-recursive] Error 1     make: *** [all] Error 2     *** Error during phase build of gudev: ########## Error running make   *** [1/1]      **NOTES** :   * I verified that I do have **/opt/gnome/lib/libpython2.5.so.1.0**.   * At time of writing, I'm running latest JHBuild.   * I used `jhbuild bootstrap --ignore-system` to avoid any incompatibilities that may arise from my Debian packages. Note that the Python 2.5 so file is built and installed by this command.


title: USB_HID is not working

text: How do I get a usb keyboard to work? I have already selected and compiled the USB HID transport layer and I don't know what else to do.


title: Why does dhclient fail with my ISP's DHCP server on a virtual interface?

text: Recently I switched from a T1 to a residential cable service (Comcast). I have a virtual machine (XenServer 5.6) running Debian 6.0.6 that is acting as the default gateway for my home network, but for some reason it looks like the upstream DHCP server is ignoring my `DHCPDISCOVER` requests completely.               Feb  1 20:58:34 myhost dhclient: Internet Systems Consortium DHCP Client 4.1.1-P1     Feb  1 20:58:34 myhost dhclient: Copyright 2004-2010 Internet Systems Consortium.     Feb  1 20:58:34 myhost dhclient: All rights reserved.     Feb  1 20:58:34 myhost dhclient: For info, please visit https://www.isc.org/software/dhcp/     Feb  1 20:58:34 myhost dhclient:     Feb  1 20:58:34 myhost dhclient: Listening on LPF/eth1/26:ac:40:50:5b:c7     Feb  1 20:58:34 myhost dhclient: Sending on   LPF/eth1/26:ac:40:50:5b:c7     Feb  1 20:58:34 myhost dhclient: Sending on   Socket/fallback     Feb  1 20:58:38 myhost dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 4     Feb  1 20:58:42 myhost dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 5     Feb  1 20:58:47 myhost dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 9     Feb  1 20:58:56 myhost dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 14     Feb  1 20:59:10 myhost dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 8     Feb  1 20:59:18 myhost dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 8     Feb  1 20:59:26 myhost dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 9     Feb  1 20:59:35 myhost dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 4     Feb  1 20:59:39 myhost dhclient: No DHCPOFFERS received.     Feb  1 20:59:39 myhost dhclient: No working leases in persistent database - sleeping.        * Everything is cabled correctly, and the traffic is being bridged to the correct interface on the virtual machine. If I listen for all traffic using `tcpdump`, I can see lots of ARP traffic as well as my ISP's DHCP server responding to other customers who are requesting IP addresses. My DHCP packets are being broadcast but answers do not come back.   * If I start `dhclient` before the modem has finished completely initializing, it serves a private IP address in the `192.168.100.0/24` network range with a low refresh interval so that `dhclient` will pick up the public IP address when it is ready to be served. It continues to send `DHCPACK` responses for the private network until it is ready to bridge the networks, at which point I stop getting responses from a DHCP server again.               Feb  1 21:16:02 myhost dhclient: Listening on LPF/eth1/26:ac:40:50:5b:c7     Feb  1 21:16:02 myhost dhclient: Sending on   LPF/eth1/26:ac:40:50:5b:c7     Feb  1 21:16:02 myhost dhclient: Sending on   Socket/fallback     Feb  1 21:16:04 myhost dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 8     Feb  1 21:16:04 myhost dhclient: DHCPOFFER from 192.168.100.1     Feb  1 21:16:04 myhost dhclient: DHCPREQUEST on eth1 to 255.255.255.255 port 67     Feb  1 21:16:05 myhost dhclient: DHCPACK from 192.168.100.1     Feb  1 21:16:05 myhost dhclient: bound to 192.168.100.10 -- renewal in 14 seconds.     Feb  1 21:16:19 myhost dhclient: DHCPREQUEST on eth1 to 192.168.100.1 port 67     Feb  1 21:16:20 myhost dhclient: DHCPACK from 192.168.100.1     Feb  1 21:16:20 myhost dhclient: bound to 192.168.100.10 -- renewal in 13 seconds.     Feb  1 21:16:33 myhost dhclient: DHCPREQUEST on eth1 to 192.168.100.1 port 67     Feb  1 21:16:36 myhost dhclient: DHCPREQUEST on eth1 to 192.168.100.1 port 67     Feb  1 21:16:43 myhost dhclient: DHCPREQUEST on eth1 to 192.168.100.1 port 67     Feb  1 21:16:50 myhost dhclient: DHCPREQUEST on eth1 to 255.255.255.255 port 67     Feb  1 21:16:51 myhost dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 7     Feb  1 21:16:58 myhost dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 15     Feb  1 21:17:13 myhost dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 7     Feb  1 21:17:20 myhost dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 10     Feb  1 21:17:30 myhost dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 10     Feb  1 21:17:40 myhost dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 12     Feb  1 21:17:52 myhost dhclient: No DHCPOFFERS received.     Feb  1 21:17:52 myhost dhclient: No working leases in persistent database - sleeping.        * In my particular case, this is an EMTA modem that also provides phone service to my house. My phone service is working, I just can't get an IP address.   * I have tried calling in to my ISP and using the phone menu to send a reset signal to my modem, as well holding down the reset button to trigger a factory reset and re-download of firmware. Neither of these solved the problem.   * I have a spare DOCSIS 3.0 cable modem. I worked with a technician to temporarily whitelist its MAC address, but I'm having the exact same problem with not seeing DHCP responses. I tried calling Comcast to ask them if my MAC address has been blacklisted somehow, but they are refusing to escalate my call without adding a premium technical support service to my account. (including a one-time activation fee to discourage me from immediately unsubscribing when my problem is solved) **Why can't my VM get a DHCP response?**


title: How can I compile and install the latest FFmpeg on Linux?

text: I want to install the latest version of ffmpeg on Linux (Ubuntu/Debian). It should meet requirements to stream via rtmp, convert streams with x264, create segment files to stream to IOS devices. How would I go about doing that?


title: What is the proper way to manage multiple python versions?

text: I have a machine with Python 2.6 installed as the default Python. Then, I installed Python 2.7, and manually created /usr/bin/python as a symlink to the new installation. Then, I was running into problems with command-not-found. I'm trying to reinstall it:               sudo apt-get remove command-not-found      and I get this error:               /usr/bin/python does not match the     python default version. It must be     reset to point to python2.6      But I really want Python 2.7 to be the default. How do I fix this mess?


title: What is the need for `fakeroot` command in linux

text: Why do we need `fakeroot` command at all? Can't we simply use the `sudo` or `su` commands? The man page says: > fakeroot - run a command in an environment faking root privileges for **file > manipulation** About.com says: > Gives a fake root environment. This package is intended to enable something > like: `dpkg-buildpackage -rfakeroot` i.e. to remove the need to become root > for a package build. This is done by setting `LD_PRELOAD` to > `libfakeroot.so`, which provides wrappers around `getuid`, `chown`, `chmod`, > `mknod`, `stat`, ..., thereby creating a fake root environment. If you don't > understand any of this, you do not need `fakeroot`! My question is, what special purpose does it solve that a simple `su` or `sudo` don't? For example, for repacking all installed packages in ubuntu we give following command:               $ fakeroot -u dpkg-repack `dpkg --get-selections | grep install | cut -f1`      Can we do the above command with sudo or su instead of fakeroot like this:               $ sudo dpkg-repack `dpkg --get-selections | grep install | cut -f1`      **EDIT:** Running:               $ sudo dpkg-repack `dpkg --get-selections | grep install | cut -f1`      gives me this error: > control directory has bad permissions 700 (must be >=0755 and <=0775) Any reason why?


title: rpc.statd and avahi-daemon listening on all networks?

text: Background:   - I'm running a home Debian GNOME desktop connected to the internet through an ethernet cable to an ethernet router.   - I have a printer connected directly to my PC with a USB cable.   - My PC has 2 hard drives.   - I occasionally copy pictures from my camera to my PC using a USB cable.   rpc.statd and avahi-daemon are listening on all networks and not only on 127.0.0.1 like cupsd and portmap. I've read their man pages and various forums but I can't figure out if they are actually really needed. I mean, does GNOME need them ? Is portmap needed ? Is it possible to make them listen to 127.0.0.1 only ?               root@debian:/# netstat -nap | grep -v "unix"     Active Internet connections (servers and established)     Proto Recv-Q Send-Q Local Address  Foreign Address State   PID/Program name     tcp        0      0 127.0.0.1:111  0.0.0.0:*       LISTEN  168/portmap         tcp        0      0 127.0.0.1:631  0.0.0.0:*       LISTEN  1594/cupsd           tcp        0      0 0.0.0.0:42469  0.0.0.0:*       LISTEN  1180/rpc.statd       tcp6       0      0 ::1:631        :::*            LISTEN  1594/cupsd           udp        0      0 0.0.0.0:34406  0.0.0.0:*               1180/rpc.statd       udp        0      0 0.0.0.0:5353   0.0.0.0:*               1536/avahi-daemon:      udp        0      0 127.0.0.1:111  0.0.0.0:*               1168/portmap         udp        0      0 0.0.0.0:42397  0.0.0.0:*               1536/avahi-daemon:      udp        0      0 0.0.0.0:932    0.0.0.0:*               1180/rpc.statd       udp        0      0 0.0.0.0:68     0.0.0.0:*               16068/dhclient       udp6       0      0 :::5353        :::*                    1536/avahi-daemon:      udp6       0      0 :::59211       :::*                    1536/avahi-daemon:


title: How to really security a linux-mint-desktop?

text: I'm installing some security software in my mint9Gnome. I first went to Firestarter and looks like a pretty start. Now I'm going to OSSEC and want some good tools to search my logs too. Thinking about Harden too. Could you please tell me if these tools are enough for me? And if it's another good software to use too. Thanks in any advice about using this tools too.


title: Amazon EC2: Giving Permanent Permission To A Sepecific Directory In Amazon Linux AMI

text: I have a Symfony2 project that needs full read write permissions to three directories: app/cache, app/logs, and few other directories which are used for uploading. The problem is everytime I push an update via git these libraries lose their permissions and I have to runa chmod 777 on them. I'd like to not have to do this everytime. I could just write this in the hooks/post-receive but I'd like to know if there's a better way to do it and if giving 777 permissions is ok. It is the only way the project works. Please advise.


title: How to limit the number of lines a command's output has available in bash?

text: I started downloading a big file in the background using               $ nohup wget http://example.tld/big.iso &      which also gives me a `nohup.out` file that includes the output of `wget`. Now, if I later want to watch the downloading process, I _could_ use `$ tail -f nohup.out` but that fills up my terminal window faster than I'd wish for. What I'd like to see is the last line constantly updating (just like when using `wget` alone). I tried `$ tail -n 1 -f nohup.out` but it seems to affect only the initial tailin'. Generally speaking, if it is possible to limit (in this case to 1) the number of lines a command's output has available/visible it would solve this problem. Sort of having the output in a Circular buffer — just think of the normal progress bar `$ wget example.tld/big.iso` would print. Is there such a solution? Or am I climbing the tree wrong way? (Meaning, would it be easier to limit `nohup`'s output or do something else?)


title: How to check who is logged in on the currently active virtual terminal?

text: I want to collect statistics about who is using a computer and for how much time. I can use the `users` command to see who is logged in but I want to know who is on the currently active VT. I don't care about people who's logged in through SSH or who leaves a download running in a locked session. I only care about who actually sits in front of the machine. I need information on X and console sessions. Getting the time of the last activity (moving the mouse, etc) would be also useful but I can live without it. How can I do this?


title: Is there a way to see the permissions of all the intermediate directories of a path..?

text: I have a file path.. Is there any single command to see the file/directory permissions of all the intermediate directories in the path..?


title: How can i colorize cat output including unknown filetypes in b&w?

text: I like the colors I have in `vim`. Can I get my output similarly colorized when I do a `cat`? I like that I can use the colorize tool as in Colorized `cat` for source and script files?. I would like that to be my standard for `cat`, e.g. I create an alias:               alias cat="source-highlight --out-format=esc -o STDOUT -i"      However if the file type is unknown, say `.gitignore` then this will return:               $ cat .gitignore_global     source-highlight: could not find a language definition for input file .gitignore      How could I have the command do a `source-highlight` `cat` version if it is a recognized file type and otherwise just do a standard black and white `cat` of the file? One option is to have the alias be `ccat` but I'd prefer to have it replace `cat` itself if possible. It would also be nice to be able to use wildcards, e.g. `cat *.rb` (or even `ccat *.rb`)? Currently that gives:               $ ccat *.rb     Please, use one of the two syntaxes for invocation:      source-highlight [OPTIONS]... -i input_file -o output_file     source-highlight [OPTIONS]... [FILES]...      and it would be great to be able to do:               ls *.rb | xargs ccat # (or cat)      the same way I can do:               ls *.rb | xargs cat      Currently I get:               $ ls *.rb | xargs ccat     xargs: ccat: No such file or directory


title: How to debug smb public share not working?

text: I'm trying to set up a pulic anonymous user login smb share. Even though my settings are nearly identical to previous successful setups I've made, I still get permission denied. Here is the share section in my smb.conf file:               [test]             comment = test             path = /root/test             guest ok = yes             readonly = no             browsable = yes             public = yes      I've tailed the following files and seen nothing when trying to access the share:   1. /var/log/samba/log.smbd   2. /var/log/samba/log.nmbd   3. /var/log/samba/log.192.168.1.2


title: What kind of installation should I choose from CentOS to have it as dom0 xen host?

text: I want to have CentOS 6.0 x86_64 as a dom0 xen host. During the installation of CentOS there are many options for installation: "minimal" "Basic Server"... "Virtual Host".. The question is: which one should I select? Is it "virtual host" or can I go with "Basic server" or "minimal" (which is the default)?


title: How do I dereference links when extracting from a tar file?

text: If I have a tar file, `bob.tar`, which contains `real_file` and `link_to_real_file`, in which the latter is a symlink, is there a way to extract the contents of `bob.tar` so that `link_to_real_file` will not be a symlink, but be a copy of `real_file`. I know this is indeed possible on the creation side, if I use the `-h` flag. The command `tar -cvhf bob.tar real_file link_to_real_file` will dereference `link_to_real_file`, but I want to do this on the extraction side regardless of how the tar file was created.


title: Which of the following files are true orphan (lost) files and can be safely removed?

text: I am using a script called lostfiles to list all orphaned (lost) files which do not belong to any package on my Arch Linux system. Whilst for most files I am fairly sure that I can safely delete them or at least know where they come from, for the following files I am not sure if it is safe to remove them.               # It is not maintained by any package but can I safely delete it?     /core           # still used by gtk2?     /etc/gtk-2.0/gdk-pixbuf.loaders           /etc/pango/pango.modules     /etc/pango/pango.modules-32          /etc/.pwd.lock          # Not owned by udev?     /etc/udev/hwdb.bin           /etc/xdg/gtk-2.0          /etc/xml/catalog          # not owned by ruby?     /usr/bin/update_rubygems           # Can I safely delete these cache files?     /usr/lib32/gdk-pixbuf-2.0/2.10.0/loaders.cache     /usr/lib32/gtk-2.0/2.10.0/immodules.cache     /usr/lib32/libffi-3.0.12     /usr/lib32/libffi-3.0.12/include     /usr/lib32/libffi-3.0.12/include/ffi.h     /usr/lib32/libffi-3.0.12/include/ffitarget.h     /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache     /usr/lib/gio/modules/giomodule.cache     /usr/lib/gtk-2.0/2.10.0/immodules.cache     /usr/lib/gtk-3.0/3.0.0/immodules.cache          # Generated by locale-gen?     /usr/lib/locale/locale-archive          # I can safely remove the cache file?     /usr/share/applications/mimeinfo.cache          /usr/share/glib-2.0/schemas/gschemas.compiled     /usr/share/gtk-doc/html/gtk2/AbstractObje....html          /usr/share/info/dir     /usr/share/libgphoto2     /usr/share/libgphoto2/asus_oled.ko.gz          # Am I safe to delete the timestamp history?     /var/db/sudo/orschiro     /var/db/sudo/orschiro/0     /var/db/sudo/orschiro/1     /var/db/sudo/orschiro/2     /var/db/sudo/orschiro/3     /var/db/sudo/orschiro/4     /var/db/sudo/orschiro/5     /var/db/sudo/orschiro/6     /var/db/sudo/orschiro/7     /var/db/sudo/orschiro/8     /var/db/sudo/orschiro/pid12778     /var/db/sudo/orschiro/pid14461     /var/db/sudo/orschiro/tty1     /var/db/sudo/orschiro/tty2     /var/db/sudo/orschiro/tty4     /var/db/sudo/test


title: Removing failed disk from raid 1

text: my server (Debian Wheezy) has a failed disk. I have sda and sdb and according to the support of my hoster, sdb needs a replacement. I send them this information with the mdstat: http://pastebin.com/GrzECixk So they took the server down, checked the disks, said sdb is defect and I need to manually stop the software raid. I tried to use my hosters tutorial for that: http://wiki.hetzner.de/index.php/Festplattenaustausch_im_Software- RAID/en (I am not sure if that is the English version) But the catch is that mdstat has changed since the technician is done:               # cat /proc/mdstat     Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]     md125 : active raid1 sdb1[1]           2096064 blocks [2/1] [_U]          md126 : active (auto-read-only) raid1 sdb2[1]           524224 blocks [2/1] [_U]          md127 : active (auto-read-only) raid1 sdb3[1]           1462516672 blocks [2/1] [_U]          md2 : active raid1 sda3[0]           1462516672 blocks [2/1] [U_]          md1 : active raid1 sda2[0]           524224 blocks [2/1] [U_]          md0 : active raid1 sda1[0]           2096064 blocks [2/1] [U_]      I tried removing md125, it said the device or resource is busy, so I set it to failed and tried again, still busy. So what do I need to do now? How can I disable sdb first and give the technician the go to replace the disk? Additional mdadm -E output for each sda partition: pastebin .com/J8ytbVgt (not enough reputation to post 2 links...) for sdb partitions: pastebin .com/RFyDygZj


title: Why does my Emacs toolbar look different over ssh w/ X forwarding on Cygwin vs CentOS?

text: I'm using Emacs 24.2.1 installed on a CentOS 5 server, which I ssh into with X forwarding (using `-Y`). I have both a Windows laptop with Cygwin/X installed, as well as a desktop running CentOS 6. When I ssh into this server using my Windows laptop, Emacs looks fine: ![Emacs on Windows](http://i.stack.imgur.com/esSd9.png) However, when I ssh into this server using my CentOS 6 desktop, the toolbar buttons render oddly (ignore the lack of a window border--it's there, just not in the screenshot): ![Emacs on Linux](http://i.stack.imgur.com/cbc38.png) Does anyone know what might be causing this difference? I've tried going through the list of package dependencies but didn't come up with anything. I'm wondering if it's because I'm lacking some library package that it uses to render the toolbar on my CentOS 6 machine, but exists in Cygwin, but I thought since this is a remote X session, it should be picking them up from the server? I'm absolutely stumped as to what I can do to fix it. It isn't a problem that prevents me from working. It's just annoying to look at day in and day out. I will note that when I use NX, the windows render properly. I just don't use it as much because the NX client on Linux is glitchy when it comes to floating window support, which I prefer to use. Any help would be greatly appreciated!


title: Horizontal Scrolling in Terminal

text: So there are I believe 2 questions on this already. All of them to do with `tail -f` and hence people give the tangent answer of "use less". I need it for everything, every command, etc. The problem is I need to run a lot of console windows and even with multiple monitors still need to shrink them down. As a consequence just about every output is butchered by line wrapping and awkward to read. One suggested solution is `echo -ne '\e[?7l'`, which works, somewhat. The problem now, is there any way to get scroll bars on a console? **Ubuntu 12.10, Terminal**


title: Change file type association in Fedora/KDE

text: Can anybody explain how to change file extension associations with applications to open them with in Fedora/KDE ? E.g. my PDFs open with Okular and I would like to change the default to Adobe.


title: LVM keeping harddisk awake?

text: I have a Lenovo W530 running Arch with kernel 3.79 (for bumblebee) and laptop- mode is configured properly and running. It has one SSD (sdb) and one harddisk (sdb). The sdb disk has two lvm-volumes: one is storage and one is swap. The problem is that **the harddisk keeps getting polled** and lsof outputs nothing regarding the lvm volumes when these are mounted. When I mount sdb2 (a NTFS partition) the hd spins down correctly; It seems to have something to do with LVM. All worked fine (i.e. the harddisk spinned down properly) just before **I removed two lvm volumes and replaced them with a single volume** (lv_storage). I removed them using lvremove and added one using lvcreate. The harddisk-activity-indication light blinks every second or so. Hdparm can spindown the harddisk (until it gets polled again). EDIT: problem seems to be the **jdb2 journaling service**. IOtop reveals that the process ([jdb2/dm-1-8]) is keeping the hd awake. However I only have dm-0(lv_swap) and dm-1 (lv_filestorage) and there are no files residing on the lv_storage volume. Data: lsblck ->               NAME                             MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT     sda                                8:0    0  59.6G  0 disk      |-sda1                             8:1    0   300M  0 part      |-sda2                             8:2    0   100M  0 part /boot/efi     |-sda3                             8:3    0   128M  0 part      |-sda4                             8:4    0  28.8G  0 part      `-sda5                             8:5    0  30.3G  0 part /     sdb                                8:16   0 465.8G  0 disk      |-sdb1                             8:17   0 195.3G  0 part      | |-VolGroup01-lv_swap (dm-0)    254:0    0     8G  0 lvm  [SWAP]     | |-VolGroup01-lv_storage (dm-1) 254:1    0   150G  0 lvm       | `-VolGroup01-lv_test (dm-2)    254:2    0     1G  0 lvm       `-sdb2                             8:18   0 270.5G  0 part        uname -a ->               Linux w530 3.7.9-2-ARCH #1 SMP PREEMPT Mon Feb 25 12:04:25 CET 2013 x86_64 GNU/Linux      lvdisplay ->               --- Logical volume ---     LV Path                /dev/VolGroup01/lv_swap     LV Name                lv_swap     VG Name                VolGroup01     LV UUID                HoElDQ-OZ3z-XkGX-dBE1-qVnD-NEgB-4G7D7S     LV Write Access        read/write     LV Creation host, time archiso, 2013-02-27 20:17:33 +0000     LV Status              available     # open                 2     LV Size                8.00 GiB     Current LE             2048     Segments               1     Allocation             contiguous     Read ahead sectors     auto     - currently set to     256     Block device           254:0          --- Logical volume ---     LV Path                /dev/VolGroup01/lv_storage     LV Name                lv_storage     VG Name                VolGroup01     LV UUID                iIvwkz-1bph-pCHs-8QOw-F0J9-0RRA-ea783w     LV Write Access        read/write     LV Creation host, time archiso, 2013-03-06 03:10:55 +0000     LV Status              available     # open                 0     LV Size                150.00 GiB     Current LE             38400     Segments               1     Allocation             inherit     Read ahead sectors     auto     - currently set to     256     Block device           254:1      /etc/fstab ->               # /dev/mapper/VolGroup01-lv_storage     UUID=1b01a1dd-6ea9-484c-933c-e581767ad4b9      /mnt/storage    ext4            rw,relatime,data=ordered        0 2          # /dev/mapper/VolGroup01-lv_swap     UUID=66afafb1-5f90-41c0-967e-343a8d269581       none            swap     defaults        0 0


title: KSH : cp only based on file size

text: I would like to write a small script copying from a directory A to directory B all the files with the `.log` extension. So in my directory A, I've :               ls :      a.log     b.log     c.log      Here is the pseudo-code I would like to implement :               foreach *.log x do :         if [stat -c %s pk_copylogs < 10485760]; then                cp  A/x  B/x                else               read vANSWER?" >> File x is bigger than 10 MB, would you like to copy it anyway ? Type YES or NO : "               if [ $vANSWER = "YES"]; then                   cp A/x B/x               fi         fi      My main problem here, is to find a way to implement my `foreach *.log`. How can I do that ?


title: Webcam on Openbsd

text: # dmesg     ...     uaudio0 at uhub1 port 2 configuration 1 interface 1 "vendor 0x093a product 0x2622" rev 1.10/1.00 addr 2     uaudio0: audio rev 1.00, 2 mixer controls     audio1 at uaudio0     ugen0 at uhub1 port 2 configuration 1 "vendor 0x093a product 0x2622" rev 1.10/1.00 addr 2     #       #               # usbdevs -v      Controller /dev/usb0:     addr 1: high speed, self powered, config 1, EHCI root hub(0x0000), Intel(0x8086), rev 1.00      port 1 powered      port 2 powered      port 3 powered      port 4 powered      port 5 addr 2: high speed, power 498 mA, config 1, UB6225(0x1606), ENE(0x0951), rev 1.00, iSerialNumber 146030377350      port 6 powered      port 7 powered      port 8 powered     Controller /dev/usb1:     addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x8086), rev 1.00      port 1 powered      port 2 addr 2: full speed, power 100 mA, config 1, product 0x2622(0x2622), vendor 0x093a(0x093a), rev 1.00     Controller /dev/usb2:     addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x8086), rev 1.00      port 1 powered      port 2 powered     Controller /dev/usb3:     addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x8086), rev 1.00      port 1 powered      port 2 powered     Controller /dev/usb4:     addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x8086), rev 1.00      port 1 powered      port 2 powered     #       #               # fswebcam                    --- Opening /dev/video0...     Trying source module v4l2...     Error opening device: /dev/video0     open: Device not configured     Unable to find a source module that can read /dev/video0.     #       # What am I missing? How can I configure the webcam so that we can export images from it with fswebcam on OpenBSD 5.1? The webcam is an eye312.


title: How do I get a field in bash's job list using awk?

text: I wanted to write a function to retrieve a field from the list of background jobs in bash. For example to get a specific argument. Let's say I send vim to the background, so "jobs" displays this list:               [1]+  Stopped                 vim ~/.bashrc      My function looks like this:               function jf {         echo `jobs | awk 'NR==$1{print $$2}'`;     }      I then call it like this:               jf 1 4      I would want it to return the 4th column of the 1st line, which would be "~/.bashrc", but it doesn't. What Am I doing wrong?


title: Where does sudo get the currently logged in username from?

text: When I tried to "sudo su" instead of "sudo su -" after having been logged in as root and su-ing to another user, it tries to sudo me as the new user, but via root... When I type `env`, it shows still username=root in the environment. Is sudo not looking at the currently logged in user, but at the enviroment parameters?               [oracle@tst-01]$ sudo su grid     Sorry, user oracle is not allowed to execute '/bin/su grid' as root on tst-01.testdomain.com.     [oracle@tst-01]$ env     HOSTNAME=tst-01.testdomain.com     TERM=xterm     SHELL=/bin/bash     HISTSIZE=1000     QTDIR=/usr/lib64/qt-3.3     USER=oracle     SUDO_USER=ujjain     USERNAME=root     MAIL=/var/spool/mail/ujjain     PATH=/usr/lib/oracle/10.2.0.4/client64/bin:/usr/lib/oracle/10.2.0.4/client64/bin:/sbin:/bin:/usr/sbin:/usr/bin     PWD=/home/ujjain     LANG=en_US.utf8     HOME=/opt/apps/oracle     SUDO_COMMAND=/bin/su     SHLVL=2     LOGNAME=oracle     CVS_RSH=ssh     LESSOPEN=|/usr/bin/lesspipe.sh %s     SUDO_GID=3000     ORACLE_HOME=/usr/lib/oracle/10.2.0.4/client64     G_BROKEN_FILENAMES=1     _=/bin/env     [oracle@tst-01 ujjain]$ sudo su - grid     [grid@tst-01 ~]$       It seems that sudo su newuser should also work if sudo would only be looking if the currently logged in user has sudo rights to sudo to the new user. What is sudo su doing and why is it important for non-root users to use sudo su - newuser with the hyphen?


title: Trouble getting menu to work

text: Currently I’m trying to get a menu working for my Into to Unix class. The problem I’m getting right now is that when I input something into the script my input appears instead of the script responding as how it should base on the input. But base on the book I should be doing it right since I followed the format that case is used, or so I think? What would I need to modify in order to make this work? Also the shell I'm using is bash. This is the assignment I’m working on:   1. Write a case script that will give the choices to do the following: a. List the users of the /etc/passwd file that have a four digit ID number greater than 999. b. Show only the month, day, and year from the date command. c. Take the file of the user’s choosing and show all the letters in uppercase. Here is the code I'm using at the moment               clear     if [ "$#" -ne 1 ]; then         echo Press 1 for a list of users with the UID greater than 999         echo Press 2 for the Day, Month, and Year         echo Press 3 to show a file name from lower case to upper case         read a         exit     fi          case "$1" in         1) awk -F: '($3>=999)  && ($3!=9999)' /etc/passwd ;;         2) echo Todays date is: ; date | awk '{print $2, $3, $6}' ; sleep 1 ;;         3) ls -aC | more ; echo What file would you like to change from lower case to uppercase?  ;read y ;sleep 1 ; clear ; echo $y | tr '[:lower:]' '[:upper:]' ; sleep 1 ;;         *) echo Invalid input     esac


title: Setting up Intel Giga PHY I217V on Debian 2.6.32 kernel

text: Trying to getting the Intel integrated network card driver (Giga PHY Intel I217V) working on Debian (kernel 2.6.32) but I'm having issues. I've downloaded the driver from the Intel website and completed the following: Downloaded the source e1000e driver from the Intel Driver Site               $ cd ~/e1000e     $ sudo make     $ sudo make install     $ rmmod e1000e; modprobe e1000e      `lspci`, `dmesg` and `lsmod` shows that the Intel Ethernet is there but it is not showing up in `ifconfig -a`. There is no `eth0` I have tried restarting; resetting the bios but still no network connection. NB: This is a USB bootable drive; I have a Ubuntu 13.10 bootable driver (kernel version 3.11) that works fine (network card is picked up without having to install Intel drivers). I wanted to know how to fix this in Debian kernel 2.6.32 (32bit)


title: How do I determine ZCACHE works on my box?

text: I have an Marwell Kirkwood ARM-based NAS server Zyxel NSA 310. I compiled my own 3.8 kernel and enabled ZCACHE, but I still see 256 MB of RAM. I am not sure if GNU free utility should show extra amount of RAM. How do I find out it is really working? Do I need to do some extra steps to make use of it? I have added "zcache" to the command line.               root@nas:~# free -m                  total       used       free     shared    buffers     cached     Mem:           247        218         29          0          7        166     -/+ buffers/cache:         43        203     Swap:         1427          0       1427          root@nas:~# zgrep CACHE /proc/config.gz      CONFIG_CLEANCACHE=y     CONFIG_ZCACHE=y          root@nas:~# dmesg | grep zcache     Kernel command line: console=ttyS0,115200 root=/dev/sda3 zcache     zcache: using lzo compressor     zcache: cleancache enabled using kernel transcendent memory and compression buddies     zcache: cleancache: ignorenonactive = 1     zcache: frontswap enabled using kernel transcendent memory and compression buddies     zcache: frontswap: excl gets = 1 active only = 1     zcache: created ephemeral local tmem pool, id=0     zcache: created persistent local tmem pool, id=1     zcache: created ephemeral local tmem pool, id=2     zcache: created ephemeral local tmem pool, id=3     zcache: created ephemeral local tmem pool, id=4          root@nas:~# cat /proc/cmdline      console=ttyS0,115200 root=/dev/sda3 zcache      I know it is "merging" pages compressing them, but how to see the compression ratio or something like that.


title: How do I get my mouse back from qemu/kvm?

text: I'm running qemu/kvm on Debian testing x64 with this command:               kvm -m 1024 -hda win7.img -cdrom win7x86.iso -boot d -net user      but when I click inside the virtual machine, qemu captures my mouse and won't let it go. I thought the key combination to free the mouse was right ctrl, but nothing happens when I do that. I also tried appending the `-usbdevice tablet` or `-usbdevice mouse` options               kvm -m 1024 -hda win7.img -cdrom win7x86.iso -boot d -net user -usbdevice tablet      or               kvm -m 1024 -hda win7.img -cdrom win7x86.iso -boot d -net user -usbdevice mouse      but the situation is the same. I'm using QEMU emulator version 1.7.0 (Debian 1.7.0+dfsg-2).


title: Qt based apps have unreadable, tiny font sizes

text: I'm running debian squeeze with Xfce 4.6. Today I logged onto my machine and all Qt-based apps have really tiny font sizes. I took a screenshot with Kile, skype 2.6, Kate and gedit for comparison: ![screenshot](http://i.stack.imgur.com/IN11u.png) The version of my KDE platform is something about 4.3. Any ideas how to reset to normal sizes? Thank you very much! Edit: KDE system settings: ![KDE system settings](http://i.stack.imgur.com/3GJFe.png) Some ways to set it via terminal?


title: Why is eth0 starts only manually in new Suse 12.3?

text: I have upgraded from 12.2 to 12.3 but my eth0 device starts only manually with ifconfig eth0 192.168.92.11 and route add default gw 192.168.1.1. I have networkmanager installed but I cannot find it. How can I fix this?


title: Grsecurity subject mode x

text: I am conducting some research on Grsecurity on Hardened Gentoo, see http://en.wikibooks.org/wiki/Grsecurity. To be more specific, I am trying to find an example where subject mode x makes a difference. As said in the wiki: subject mode x: Allows executable anonymous shared memory for this subject. Now, the kernel rejects               mem = mmap(NULL, MAP_SIZE, PROT_WRITE|PROT_EXEC, MAP_ANONYMOUS | MAP_SHARED, -1, 0);      as well as               mem = mmap(NULL, MAP_SIZE, PROT_WRITE, MAP_ANONYMOUS | MAP_SHARED, -1, 0);     mprotect(mem, MAP_SIZE, PROT_EXEC);      or vice versa. On the other hand               mem = mmap(NULL, MAP_SIZE, PROT_READ|PROT_EXEC, MAP_ANONYMOUS | MAP_SHARED, -1, 0);      works fine. For all of the above it does not matter whether grsec is active or not, and if it is, it does not matter wether subject mode x is set or not - the kernel simply does not allow shared memory that is (or was) writable and executable. Therefore: what is subject mode x good for, and for what piece of code would it make a difference?


title: caps lock led not working on Linux console

text: When I switch to a TTY and turn on the caps lock, the caps lock LED on my keyboard isn't turning on. On X it works fine. When I activate caps lock and then switch to a TTY and then press caps lock (on the TTY) the LED stays on (Even though the TTY keeps it's own track of the caps lock). So it seems the TTYs don't care about the LED at all. Can I somehow enable the LED on TTYs? It's very annoying to be forced to type something whilst not knowing if caps lock is activated. I'm using Debian jessie (frequently updated) arch: amd64


title: Achieving hexdump-like format, that includes binary strings, on the command line?

text: I really like `hexdump`, especially because you can define a custom format; say:               $ echo -e '\x00\x01\x02\x03' | hexdump -v -e '1/1 "%_ad: "' -e '4/1 "%02X "' -e '1/1 " : "' -e '4/1 "%_p"' -e '1/1 "\n"'     0: 00 01 02 03 : ....     4: 0A          : .      So, I can choose to have, say, 4 bytes per line, written as hexadecimal first, then as characters. But, what I'm missing here, is a "binary string" (or "bit string") formatting character; e.g. I'd like to write something like `-e '4/1 "%08b "'` somewhere in that command line, and get, e.g.:               0: 00 01 02 03 : 00000000 00000001 00000010 00000011 : ....     4: 0A          : 00001010 : .      Of course, then probably one would have to specify endianness (if groups of more than one byte should be formatted) etc... But in any case, this kind of formatting doesn't exist, as far as I can see in the `hexdump` manual. So my question is - what alternatives do I have on a Linux command line, so that I could obtain a formatted dump that includes binary strings as above, and yet to the greatest extent possible preserves the customizability of the `hexdump` program (in terms of byte grouping) when using its `-e` option?


title: Escaping * with Regular Expressions and Grep

text: I have a file that has unique lines that start with 2 stars (**). However when I run a grep command for               grep \*\* fileName       I get all of the lines in the file. This is very unusual, and what I see as non-matching lines do not contain **. How would I escape the ** for the correct lines to be found?


title: What languages are used to build Unix commands?

text: Examples of commands I'm referring to are `ls`, `pwd`, and `cd`. Also, how are these built? Do you have an example?


title: How to install libc6 from unstable on Debian

text: This is my server: Linux nn15.project.org 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux Debian GNU/Linux 7.1 (wheezy) Release: 7.1 I have sudo permissions. How can I install libc6 from unstable? The motivation behind is that right now I have missing GLIBC_2.14 and GLIBC_2.15.


title: Reserve fixed RAM memory region as a block device ( with a given start physical address)

text: There have been a lot of questions about RAM Disks and I am aware of ramfs and tmpfs which allow the use of ram as a block device. However my interest is in using a fixed memory address range as a block device. This arises from the necessity to use non-volatile RAM available in my system. I have 6GB of RAM available, and 8GB of non-volatile RAM present. The output of /proc/iomem gives me the following 100000000-17fffffff : System RAM 180000000-37fffffff : reserved Here the region from 6GB to 14GB corresponds to the Non-volatile RAM region which is marked by the E820 BIOS memory map as reserved. My main intention is to use this NVRAM as a block device in linux. This is useful for testing NVRAM systems. Is there any linux command already present which would allow me to use this region as a block device, or do I have to write my own kernel device driver to facilitate the same?


title: Install Debian alongside Ubuntu without BIOS setup access or removable media boot possibility

text: The typical steps for installing involves using a USB-bootable version of Debian and then partitioning the hard-drive for the new OS. Unfortunately, my BIOS has been locked and for various reasons, I can't get the password. The current OSs on the system are: 1. Windows XP 2. Ubuntu 11.10 Someone told me that I could install Debian from within Ubuntu 11.10 but that would be "risky". Could someone please help me with detailed step-by-step instructions on how to install Debian alongside Ubuntu when the only boot option is from the Hard- Drive, and not from USB or CD media? More details about the system will be provided on asking.


title: Load shared objects relative to executable path

text: I'm trying to get a C application to load shared objects from a relative directory regardless of where I call it from. So far it only works if I'm in the same directory as the executable when I call it:               ~/prog$ ./my_program     Success     ~/prog$ cd ..     ~$ ./prog/my_program     ./prog/my_program: error while loading shared libraries: libs/libmysharedobject.so: cannot open shared object file: No such file or directory      As you can guess from the output above, the shared object is stored under the `~/prog/libs/` directory. Here's what the relevant gcc calls look like:               gcc -std=c99 -ggdb -Wall -pedantic -Isrc         -fPIC -shared -Wl,-soname,libs/libmysharedogbject.so         -o libs/libmysharedobject.so libs/mysharedobject.c     [...]     gcc [CFLAGS omitted] -o my_program main.c         build/src/my_program.o build/src/common.o         -lm -Llibs -lmysharedobject      Here's the top of the output from `readelf -d my_program`:               Dynamic section at offset 0x6660 contains 26 entries:       Tag        Type                         Name/Value      0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]      0x0000000000000001 (NEEDED)             Shared library: [libs/libmysharedobject.so]      0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]      I have tried adding `-Wl,-z,origin,-rpath='$ORIGIN'`, which causes the following lines to show up in `readelf`'s output:                0x000000000000000f (RPATH)              Library rpath: [$ORIGIN]     [...]      0x000000006ffffffb (FLAGS_1)            Flags: ORIGIN      But it doesn't seem to solve my problem. I've also tried setting `rpath` to `$ORIGIN/libs`, `.`, and `./libs`, all to no avail. (UPDATE: `$(CURDIR)` doesn't have any effect either. This surprises me, since it's expanded to an absolute path.) Is there a way to get my executable to find its shared objects regardless of the directory from which it's invoked, preferably without having the end user set `LD_LIBRARY_PATH` every time? Or am I trying to do something that Linux doesn't support?


title: Does PHP exec() store the executed command anywhere?

text: Suppose I have the following code in a PHP web application.               $encrypt ? $password = generatePassword($passwordstrength): $password="";     $estring = "7z a -p$password -mx0 packFoo.aes.7z mydir/foo";     if($encrypt) {         exec($estring);     }     mailuser($password);//uses standard PHP mail function      The password is generated at random by a function that uses PHP rand(). I have not found the password in /var/logs and not in .bash_history. I need to know if the value of $password can be recovered from the server in the event that the server is compromised. Ultimately, **can I claim that the value of $password is not stored on the server?**


Im trying to run a `yum update` but getting stopped by dependencies. I have installed rpmforge el6 which i need for other packages.               Error: Package: perl-IO-Compress-2.052-1.el6.rfx.noarch (rpmforge-extras)                Requires: perl(Compress::Raw::Zlib) = 2.052                Installed: 1:perl-Compress-Raw-Zlib-2.020-127.el6.i686 (@base)                    perl(Compress::Raw::Zlib) = 2.020                Available: perl-Compress-Raw-Zlib-2.030-1.el6.rfx.i686 (rpmforge-extras)                    perl(Compress::Raw::Zlib) = 2.030                Available: perl-Compress-Raw-Zlib-2.033-1.el6.rfx.i686 (rpmforge-extras)                    perl(Compress::Raw::Zlib) = 2.033                Available: perl-Compress-Raw-Zlib-2.034-1.el6.rfx.i686 (rpmforge-extras)                    perl(Compress::Raw::Zlib) = 2.034                Available: perl-Compress-Raw-Zlib-2.035-1.el6.rfx.i686 (rpmforge-extras)                    perl(Compress::Raw::Zlib) = 2.035                Available: perl-Compress-Raw-Zlib-2.037-1.el6.rfx.i686 (rpmforge-extras)                    perl(Compress::Raw::Zlib) = 2.037                Available: perl-Compress-Raw-Zlib-2.051-1.el6.rfx.i686 (rpmforge-extras)                    perl(Compress::Raw::Zlib) = 2.051                Available: perl-Compress-Raw-Zlib-2.052-1.el6.rfx.i686 (rpmforge-extras)                    perl(Compress::Raw::Zlib) = 2.052      You could try using --skip-broken to work around the problem      You could try running: rpm -Va --nofiles --nodigest          [root@mx2 ~]# yum install perl-Compress-Raw-Zlib-2.052-1.el6.rfx.i686     Loaded plugins: fastestmirror     Loading mirror speeds from cached hostfile      * base: centosn4.centos.org      * extras: mirror.nsc.liu.se      * rpmforge: mirror.nl.leaseweb.net      * rpmforge-extras: mirror.nl.leaseweb.net      * updates: centoss5.centos.org     Setting up Install Process     Package matching perl-Compress-Raw-Zlib-2.052-1.el6.rfx.i686 already installed. Checking for update.     Nothing to do          [root@mx2 ~]# perl -MCPAN -e shell     Terminal does not support AddHistory.          cpan shell -- CPAN exploration and modules installation (v1.9800)     Enter 'h' for help.          cpan[1]> install Compress::Raw::Zlib     CPAN: Storable loaded ok (v2.20)     Reading '/root/.cpan/Metadata'       Database was generated on Tue, 05 Feb 2013 10:41:03 GMT     Compress::Raw::Zlib is up to date (2.060).


title: Change multiple monitors location gnome shell

text: I connect my laptop to my PC monitor and I use multiple screens with the laptop screen as the primary one. When I move the mouse to the right of my laptop screen it goes to my PC monitor and when I move it to the left from mi PC monitor it goes to my laptop screen. How can I change this to be that when I move the mouse up from my laptop screen it goes to my PC monitor, and when I move the mouse down from the PC monitor it goes to my laptop screen in gnome shell? I know that in kde this is configurable. I don't mind to have this tied to some script if it needs to


title: What does the 'a' attribute in lsattr mean?

text: I was trying to remove some old history from my `.bash_history` file, but I was receiving this message:               [john ~] /home/john $ mv .bash_history .bas     mv: impossible to move `.bash_history' to `.bas': Operation not permited      I suspected the file/directory permission:               [john ~] /home/john $ ls -ld .bash_history .     drwxrwx--T+ 5 root       john 4096 Out 11 19:45 .     -rw-r--r--  1 john john 2977 Out 10 14:36 .bash_history     [john ~] /home/john $      Then I tried:               [john ~] /home/john $ lsattr .bash*     -----a------- .bash_history     ------------- .bash_logout     ------------- .bash_profile     ------------- .bashrc     [john ~] /home/john $      Probably it is this `a` attribute; what does it mean?


title: What is the Linux equivalent of the Windows registry?

text: I have a DVD+-RW drive that has quit working. Apparently many users of this laptop model experience the same problem under windows and are required to edit the registry to correct the problem. So where should I look to make a similar edit?


title: Is it possible to use multiple branch of the same library to make multiple sofware which require different version of this Library work?

text: Newbie question, I know, but I can't find any acceptable answer on the internet. I was wondering if it's possible to have multiple instances of a library in Linux. Example :   * Software A need the 1.0, 1.1 or 1.2 branch or older of Library X to work   * Software B need the 1.4 branch or any newer 1.x of Library X to work   * Software C need the 2.0 branch or newer of Library X to work Is it possible to install the 1.2, 1.8 and 2.3 of Library X to make all this 3 software work?


title: linux: How to determine the best filesystem format?

text: About a year ago I changed from running Windows as dual boot to very rarely running Windows as a VM. As a result most of my partitions are in ntfs ( so I had access on both sides of the boot ). I have decided to reformat all these partitions to ... Looking for the best first class filesystem format, I am using a desktop with 1T-2T storage. So how do I determine which one best serves my needs?


title: Why does each process folder under /proc contain the same information?

text: Under `/proc/<PID>/net` pseudo-file system each process seems to have files with the same content. For example I use `cat /proc/<PID>/net/ip_tables_names` to list iptables tables under the system and content of this file is same for all the processes. Same is true for other files in `/proc/<PID>/net` directory. Why is this so?


title: How to send the email which is sleeping in my queue list?

text: When i send email it sleep in my queue list. How can i send them out? (Fedora 15 distro).               # mailq             /var/spool/mqueue (2 requests)     -----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------     pBMNMDA1009288*    2100 Fri Dec 23 00:22 <apache@example>                          <b@a.com>     pBMNIjU5009236     2100 Fri Dec 23 00:18 <apache@example>                      (Deferred: Connection timed out with aspmx3.googlemail.com.)                          <b@a.com>


title: Middle click with two-finger tap on touchpad

text: In Linux Mint the default action when tapping the touchpad with two fingers is a right click. How can I change this to middle click?


title: Which Linux distributions have good screen magnifier software, either freely available, or preinstalled?

text: Which linux distributions have good screen magnifier software, either freely available, or preinstalled with the OS? Being a visually impaired nerd, I'd like to gain experience on as many platforms as possible. I've gotten accustomed to the smooth magnifying experience with the zoom functionality that comes with every Mac, so it would be nice if there is some software package available which gives me comparable results. This would greatly help me to get started with linux.


title: Disable CPU scaling with U 1404

text: I know there are a lot of things about this topic but I couldn't find anything not older than 4 years. As the stuff develops so fast I hope it is fine to ask again a few years later. What is currently a good way to disable the CPU throttling on Ubuntu and Debian systems? A few old ways I found (are they still recommended, is it done differently today): http://askubuntu.com/questions/3924/disable-ondemand-cpu-scaling- daemon http://jahanzebnotes.blogspot.de/2013/02/turn-off-cpu-throttling- ubuntu.html http://superuser.com/questions/179329/disable-frequency-scaling- ondemand-daemon-on-ubuntu-10-04 https://endless-turtles.com/2012/06/disabling- cpu-frequency-scaling-in-ubuntu/


title: Grub2 network-based boot choice

text: Sorry for the stupid title, I didn't know how else to phrase it. I run a computer-science lab at a university with about 50 workstations that dual boot Debian and Windows XP. Obviously the grub default is Windows but there are times where it would be extra useful if we could boot the machines straight to Linux, like when there is a Linux related class or we want to access the Linux partition when we boot them remotely. So what I'm basically asking is   1. Does GRUB have basic script capabilities like "if var=true boot 1 else boot 2"?   2. Is GRUB network-aware?


title: Help renaming folder according to date

text: I have the folder "Backup yzT Jan-01-2013". I've made also a script for do a backup everyday. The problem I'm facing is how to rename the folder day by day according to date? Get the new name is easy, it's just               "/home/yzT/Backup yzT `date '+%b-%d-%Y'`"      However how can I select the folder "Backup yzT Jan-01-2013" exactly? Because every day it will be different. I've tried               mv "/home/yzT/Backup yzT *" "/home/yzT/Backup yzT `date '+%b-%d-%Y'`      hoping that the mv path works like a regular expression, but sadly, it doesn't. So how can I rename the folder?


title: Launch a GUI browser on server without a GUI?

text: What's a simple way to launch a browser on an server that doesn't have a GUI, but needs a GUI-like browser? Something like Firefox or Chrome. I need to trigger a page load but it needs full javascript support. Once the page is loaded it can close out. But otherwise I have no need for a full graphical interface.


title: Background execution in parallel

text: I have a program `./pgm` taking some arguments (say `-a file1 -b val`), which requires 2 seconds to execute. I would like to use all the processors on my machine to run this program on all the input files in parallel (about 1000). What I do now, is put all the commands               ./pgm -a file1 -b 12 > out1.txt &     ./pgm -a file2 -b 14 > out2.txt &     ./pgm -a file3 -b 16 > out3.txt &     ./pgm -a file4 -b 18 > out4.txt &     ...      in a file, and execute this file. I thought this would use all the available processors, but the number of parallel execution is very limited. How can I achieve this? Note that `parallel` command is not an option.


title: Difficulty making a regular expression to find at least 2 occurrences of a character in a file

text: I have a file containing random codes. Each code has ten characters in it, and I am trying to grep codes in the file that have at least 2 occurrences of a character. I am doing this:               grep DD* [filename]      This finds codes with 2 occurrences of the character 'D', but it also shows codes that have just 1 occurrence of 'D'. How can I change my regular expression to only show codes with 2 occurrences?