title: SSH + Certificate Authority server?

text: Is it possible to setup SSH (via pam for instance) to check the public key of the connecting client against a CA server? I've tried with gnupg (via `gpg- agent --daemon --enable-ssh-support`) and also tried working with OpenCA which prooved to be a challenge just to install. Also the documentation is horrific when it comes to both of these. What i'd like to accomplish is something along the lines of:   [Client] --SSH--> "Server" <---> [CA Server] The entire platform is *nix based and i'm open to suggestions right about now cause i've been stuck on this for a while now. ## GnuPG I've set it up in a as basic mode as possible following these guides:   * http://www.bootc.net/archives/2013/06/09/my-perfect-gnupg-ssh-agent-setup/   * https://wiki.archlinux.org/index.php/GnuPG My initial thought was to set up my own "key-server" which `gpg` can send and check for keys, but there's no information about this what so ever (or at least none that i could find). And from what i understand i should be able to do `ssh-add -l` to list all my keys, but this gives me: `The agent has no identities.` which is not so odd because i've never specified where to fetch them but "it should just work"(...?). The **gpg.conf** looks like:               ... lots of default ...     personal-digest-preferences SHA512     cert-digest-algo SHA512     default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed     homedir /etc/gnupg     use-agent      and my **gpg-agent.conf** :               pinentry-program /usr/bin/pinentry-curses     default-cache-ttl 10800     default-cache-ttl-ssh 10800     write-env-file /etc/gnupg/.gpg-agent-info     enable-ssh-support      And just to verify that i actually have a key and gpg is responding:               ~]# gpg --list-keys     /etc/gnupg/pubring.gpg     ----------------------     pub    4096R/#######2 2013-12-10 [expired: 2014-12-10]     uid                   Anton (...) <mail>     sub    4096R/#######5 2013-12-10 [expires: 2014-12-10]      ## OpenCA When finally everything was in place and started, I get to a website that says my "symetric keylength is to short" and I can't get past that.


title: get free string genre id3-tag and not only genre number in bash script

text: I'd like to read the id3-genre tag within a bash script. I tried id3tool, eyeD3, etc -- but these tools just support the genre number. How to get the free string genre tag? My music players (Amarok, VLC, Banshee) and the Android player show the full genre tag, so the tag itself seems intact.


title: How to know which is the default script shell in Centos?

text: I'm using Centos 6 and after reading about different shells and dash implementasion as sh replacement in Debian, Ubuntu and Fedora, made up my mind to replace sh with dash as the script shell in Centos. I have no idea how to see if this is already done, because I have both sh and dash in my system, so how do I know which is my default script shell?


title: Why do some open-source Linux software packages costs?

text: I've been researching on Internet that open-source are free, but I found a bit contradicting fact that there are some packages which are commercial like this. I too have used some tools like Metasploit which ask for license. Is a product developed by modification of a open-source can be commercial? I'm totally confused!


title: Efficient todo / project / task manager application?

text: I am looking at a todo / project/ task management application for Linux that goes beyond making a simple list of tasks with check boxes. What I'm looking for is an application that will also help me follow up on tasks (for examples task T = "send an email to John", when complete it should also help me follow up on a response from John. It should also help me organising tasks in different projects. The only applications I found so far are so so and do not really improve upon the simple pen and paper list. Do you have any suggestions?


title: Why PowerVM LPAR CPU utilization is negative

text: For a specific case I compute an PowerVM LPAR CPU utilization to be a large number less than zero. I am fetching the lpar sample event using:               lslparutil -r lpar -m P750 --filter "lpar_names=i5lp5" -n 2      The output is:               time=12/11/2013 14:05:19,event_type=sample,resource_type=lpar,sys_time=12/11/2013 02:06:18,time_cycles=1972174181699073,lpar_name=i5lp5,lpar_id=16,curr_proc_mode=ded,curr_procs=1,curr_sharing_mode=share_idle_procs,curr_5250_cpw_percent=0.0,mem_mode=ded,curr_mem=2048,entitled_cycles=850096297330210,capped_cycles=850096297330210,uncapped_cycles=0,shared_cycles_while_active=0,idle_cycles=847094465568064,run_latch_instructions=761582721233,run_latch_cycles=1504048749490     time=12/11/2013 14:04:19,event_type=sample,resource_type=lpar,sys_time=12/11/2013 02:05:18,time_cycles=1972143333868079,lpar_name=i5lp5,lpar_id=16,curr_proc_mode=ded,curr_procs=1,curr_sharing_mode=share_idle_procs,curr_5250_cpw_percent=0.0,mem_mode=ded,curr_mem=2048,entitled_cycles=850065449497618,capped_cycles=850065449497618,uncapped_cycles=0,shared_cycles_while_active=0,idle_cycles=839855392690628,run_latch_instructions=761562942327,run_latch_cycles=1503980657960      As per the lslparutil manual the formula to compute processor utilization for dedicated partitions is               Processor utilization % = ((capped_cycles - idle_cycles) / capped_cycles) * 100       The relevant information from the above output are:               time=12/11/2013 14:05:19, capped_cycles=850096297330210, idle_cycles=847094465568064     time=12/11/2013 14:04:19, capped_cycles=850065449497618, idle_cycles=839855392690628      Therefore the result will be as follows:               (((850096297330210 - 850065449497618) - (847094465568064 - 839855392690628))/(850096297330210 - 850065449497618))*100      equals to: `−23367.038910583` Why the percentage value is negative. Note the idle cycle difference is `(847094465568064 - 839855392690628) = 7.239072877×10¹²` which is much much higher than the capped cycle difference. Where as the time cycle difference is `(1972174181699073−1972143333868079) = 30847830994` The lpar is in Running state:               lssyscfg -r lpar -m P750 --filter "lpar_names=i5lp5" -F name state          i5lp5 Running      Can anyone help me with this, what is wrong? This formula works for other LPARs in the system. Is the computation process has an error or is it something else I am missing?


title: Cinnamon (Petra) crashed. Opens in fallback mode

text: I'm not an expert on linux. My cinnamon (petra) just started to chrash on logons and I have no opinion for what did I do wrong. I have found a set of errors on my .xsession-errors. The below one is the first of a set.               /etc/mdm/Xsession: Beginning session setup...     localuser:attila being added to access control list     Script for cjkv started at run_im.     Script for default started at run_im.     Failed to connect to the VirtualBox kernel service     Failed to connect to the VirtualBox kernel service     Failed to connect to the VirtualBox kernel service     Failed to connect to the VirtualBox kernel service     Failed to connect to the VirtualBox kernel service     Script for cjkv started at run_im.     Script for default started at run_im.     GNOME_KEYRING_CONTROL=/run/user/1000/keyring-9rBZgc     GNOME_KEYRING_CONTROL=/run/user/1000/keyring-9rBZgc     GPG_AGENT_INFO=/run/user/1000/keyring-9rBZgc/gpg:0:1     GNOME_KEYRING_CONTROL=/run/user/1000/keyring-9rBZgc     GPG_AGENT_INFO=/run/user/1000/keyring-9rBZgc/gpg:0:1     SSH_AUTH_SOCK=/run/user/1000/keyring-9rBZgc/ssh     GNOME_KEYRING_CONTROL=/run/user/1000/keyring-9rBZgc     GPG_AGENT_INFO=/run/user/1000/keyring-9rBZgc/gpg:0:1     === xinerama setup Configuration ===       Clone: false       Output: Dizüstü attached to LVDS1          status: on          width: 1366          height: 768          rate: 60          primary: true          position: 0 0       Output: (null) attached to VGA1          status: off          width: -1          height: -1          rate: -1          primary: false          position: -1 -1       Output: (null) attached to HDMI1          status: off          width: -1          height: -1          rate: -1          primary: false          position: -1 -1       Output: (null) attached to DP1          status: off          width: -1          height: -1          rate: -1          primary: false          position: -1 -1       Output: (null) attached to VIRTUAL1          status: off          width: -1          height: -1          rate: -1          primary: false          position: -1 -1     === auto-configure - xinerama mode Configuration ===       Clone: false       Output: Dizüstü attached to LVDS1          status: on          width: 1366          height: 768          rate: 60          primary: true          position: 0 0       Output: (null) attached to VGA1          status: off          width: -1          height: -1          rate: -1          primary: false          position: -1 -1       Output: (null) attached to HDMI1          status: off          width: -1          height: -1          rate: -1          primary: false          position: -1 -1       Output: (null) attached to DP1          status: off          width: -1          height: -1          rate: -1          primary: false          position: -1 -1       Output: (null) attached to VIRTUAL1          status: off          width: -1          height: -1          rate: -1          primary: false          position: -1 -1     === Applying Configuration Configuration ===       Clone: false       Output: Dizüstü attached to LVDS1          status: on          width: 1366          height: 768          rate: 60          primary: true          position: 0 0       Output: (null) attached to VGA1          status: off          width: -1          height: -1          rate: -1          primary: false          position: -1 -1       Output: (null) attached to HDMI1          status: off          width: -1          height: -1          rate: -1          primary: false          position: -1 -1       Output: (null) attached to DP1          status: off          width: -1          height: -1          rate: -1          primary: false          position: -1 -1       Output: (null) attached to VIRTUAL1          status: off          width: -1          height: -1          rate: -1          primary: false          position: -1 -1          (cinnamon:4650): Gdk-ERROR **: The program 'cinnamon' received an X Window System error.     This probably reflects a bug in the program.     The error was 'BadRequest (invalid request code or no such operation)'.       (Details: serial 141 error_code 1 request_code 153 minor_code 19)       (Note to programmers: normally, X errors are reported asynchronously;        that is, you will receive the error a while after causing it.        To debug your program, run it with the GDK_SYNCHRONIZE environment        variable to change this behavior. You can then get a meaningful        backtrace from your debugger if you break on the gdk_x_error() function.)          (gnome-panel:4654): Gtk-CRITICAL **: gtk_accelerator_parse_with_keycode: assertion 'accelerator != NULL'     failed          ** (gnome-panel:4654): WARNING **: Unable to parse mouse modifier '(null)'          Starting Dropbox...Initializing nemo-dropbox 2.0.1     ** Message: applet now removed from the notification area          (gnome-panel:4654): Gtk-CRITICAL **: gtk_accelerator_parse_with_keycode: assertion 'accelerator != NULL'     failed          ** (gnome-panel:4654): WARNING **: Unable to parse mouse modifier '(null)'               (gnome-panel:4654): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0'     failed          (gnome-panel:4654): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0'     failed          (gnome-panel:4654): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0'     failed          (gnome-panel:4654): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0'     failed          (gnome-panel:4654): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0'     failed          (gnome-panel:4654): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0'     failed          (gnome-panel:4654): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -1     and height 24          (gnome-panel:4654): Gtk-CRITICAL **: gtk_widget_get_preferred_height_for_width: assertion 'width >= 0'     failed     ** Message: using fallback from indicator to GtkStatusIcon     Done!          (nemo:4668): Gtk-WARNING **: Refusing to add non-unique action 'NemoDropbox::move' to action group     'DirExtensionsMenuGroup'          (nemo:4668): Gtk-CRITICAL **: gtk_action_get_name: assertion 'GTK_IS_ACTION (action)' failed          (nemo:4668): Gtk-CRITICAL **: gtk_action_get_name: assertion 'GTK_IS_ACTION (action)' failed          (nemo:4668): Gtk-CRITICAL **: gtk_ui_manager_add_ui: assertion 'name != NULL || type ==     GTK_UI_MANAGER_SEPARATOR' failed          (nemo:4668): Gtk-CRITICAL **: gtk_action_get_name: assertion 'GTK_IS_ACTION (action)' failed          (nemo:4668): Gtk-CRITICAL **: gtk_action_get_name: assertion 'GTK_IS_ACTION (action)' failed          (nemo:4668): Gtk-CRITICAL **: gtk_ui_manager_add_ui: assertion 'name != NULL || type == GTK_UI_MANAGER_SEPARATOR' failed


title: Translate GNU ps flags to standard flags

text: I'm using `oh-my-zsh` and its `ssh-agent` plugin on OSX, but lately somebody upstream decided to use `ps x`. I'm not entirely sure what that even does, since I haven't used a GNU userland in something close to a decade. The goal appears to be finding out whether `ssh-agent` is already running, so I'm not sure why any flags to `ps` are even needed. Can somebody help me cook up a cross-platform-friendly alternative? UPDATE: If you want to take a look for yourself, here's the source for the `ssh-agent` plugin


title: How to move a file to /usr/local in Ubuntu?

text: I am working in the most recent Ubuntu in a 64 bit machine. I am currently on the Gnome command prompt and I am trying to move a file under the Downloads directory to `/usr/local`. However, it gives me a permission denied message even though I typed in `chmod 777 filename` and I am the administrator. What should I do?


title: Mouse clicks won't work (Linux Mint KDE)

text: I'm using linux mint 15 with KDE and today I realized my mouse clicks on Google Chrome often don't work and it only throws out the messages:               (google-chrome:2971): GLib-GObject-CRITICAL **: g_object_unref: assertion G_IS_OBJECT (object)' failed     [2971:2971:1216/170258:ERROR:browser_main_loop.cc(228)] Gdk:IA__gdk_window_get_events: assertion `GDK_IS_WINDOW (window)' failed      I don't know what triggered this error but I can see these logs when starting the browser through the terminal and when I'm trying to click it. I already reset my KDE Settings, but that wasn't the problem. EDIT: I just installed Ubuntu 13.10 to work again with the computer but it seems the same problem occurs... I can start a program and afterwards I can't click anywhere. The programs I have installed are only a few:   Chrome   Fbmessenger   Skype   PyCharm   Django   Mysql-Workbench   FileZilla   Could this be caused by some kind of malware? I only installed Ubuntu on my second partition.


title: Touchpad not detected

text: Some days ago I received a LDLC Iris FB2-I5-8-S2 notebook and installed Linux on it (Linux Mint 16 Cinnamon 32bit, Kernel 3.11.0-12-generic). Everything except the TouchPad works out of box (even the touch screen). I searched a lot but not found any solution. Its not a problem of having disabled the device using Fn+F* Here is some output from various commands: lsusb:               Bus 001 Device 002: ID 8087:8000 Intel Corp.      Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub     Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub     Bus 002 Device 007: ID 2808:5001       Bus 002 Device 005: ID 294e:1001       Bus 002 Device 004: ID 1532:000d Razer USA, Ltd      Bus 002 Device 003: ID 8087:07dc Intel Corp.      Bus 002 Device 002: ID 0489:d616 Foxconn / Hon Hai      Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub      lspci:               00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 09)     00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)     00:03.0 Audio device: Intel Corporation Device 0a0c (rev 09)     00:14.0 USB controller: Intel Corporation Lynx Point-LP USB xHCI HC (rev 04)     00:16.0 Communication controller: Intel Corporation Lynx Point-LP HECI #0 (rev 04)     00:1b.0 Audio device: Intel Corporation Lynx Point-LP HD Audio Controller (rev 04)     00:1c.0 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 1 (rev e4)     00:1c.2 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 3 (rev e4)     00:1c.3 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 4 (rev e4)     00:1d.0 USB controller: Intel Corporation Lynx Point-LP USB EHCI #1 (rev 04)     00:1f.0 ISA bridge: Intel Corporation Lynx Point-LP LPC Controller (rev 04)     00:1f.2 SATA controller: Intel Corporation Lynx Point-LP SATA Controller 1 [AHCI mode] (rev 04)     00:1f.3 SMBus: Intel Corporation Lynx Point-LP SMBus Controller (rev 04)     02:00.0 Network controller: Intel Corporation Wireless 7260 (rev 73)     03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5229 PCI Express Card Reader (rev 01)      lsmod               Module                  Size  Used by     parport_pc             31981  0      ppdev                  17391  0      arc4                   12536  2      rfcomm                 53664  0      x86_pkg_temp_thermal    13810  0      coretemp               13195  0      bnep                   18893  2      kvm                   364766  0      crc32_pclmul           12967  0      aesni_intel            18156  1      aes_i586               16995  1 aesni_intel     xts                    12749  1 aesni_intel     lrw                    13057  1 aesni_intel     gf128mul               14503  2 lrw,xts     ablk_helper            13357  1 aesni_intel     cryptd                 15577  1 ablk_helper     iwlmvm                149128  0      mac80211              513247  1 iwlmvm     binfmt_misc            13140  1      microcode              18830  0      snd_hda_codec_realtek    45473  1      snd_hda_codec_hdmi     40508  1      snd_seq_midi           13132  0      snd_seq_midi_event     14475  1 snd_seq_midi     snd_rawmidi            25094  1 snd_seq_midi     rtsx_pci_ms            17807  0      iwlwifi               143578  1 iwlmvm     serio_raw              13189  0      memstick               16008  1 rtsx_pci_ms     snd_hda_intel          42658  5      snd_seq                55383  2 snd_seq_midi_event,snd_seq_midi     lpc_ich                16864  0      uvcvideo               71309  0      cfg80211              401436  3 iwlwifi,mac80211,iwlmvm     snd_hda_codec         164003  3 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_intel     videobuf2_vmalloc      13048  1 uvcvideo     btusb                  23443  0      videobuf2_memops       13170  1 videobuf2_vmalloc     snd_hwdep              13272  1 snd_hda_codec     mei_me                 13933  0      snd_pcm                89488  3 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel     videobuf2_core         39125  1 uvcvideo     bluetooth             323534  12 bnep,btusb,rfcomm     videodev              107508  2 uvcvideo,videobuf2_core     joydev                 17097  0      hid_multitouch         17191  0      snd_page_alloc         14230  2 snd_pcm,snd_hda_intel     mei                    66411  1 mei_me     snd_seq_device         14137  3 snd_seq,snd_rawmidi,snd_seq_midi     snd_timer              24447  2 snd_pcm,snd_seq     snd                    60790  21 snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_seq,snd_rawmidi,snd_hda_codec,snd_hda_intel,snd_seq_device,snd_seq_midi     dm_multipath           22402  0      scsi_dh                14458  1 dm_multipath     soundcore              12600  1 snd     intel_smartconnect     12610  0      mac_hid                13037  0      lp                     13299  0      parport                40795  3 lp,ppdev,parport_pc     dm_mirror              21715  0      dm_region_hash         15984  1 dm_mirror     dm_log                 18072  2 dm_region_hash,dm_mirror     hid_generic            12492  0      usbhid                 47361  0      hid                    87192  3 hid_multitouch,hid_generic,usbhid     i915                  589697  5      rtsx_pci_sdmmc         22898  0      i2c_algo_bit           13197  1 i915     drm_kms_helper         46867  1 i915     drm                   242354  4 i915,drm_kms_helper     rtsx_pci               43458  2 rtsx_pci_ms,rtsx_pci_sdmmc     ahci                   25579  2      libahci                26554  1 ahci     wmi                    18590  0      video                  18777  1 i915      Output of `xinput` can be found in a Pastebin. Do you have an idea how to enable the touchpad?


title: Wget download file ( do not overwrite ) auto update script

text: I want to write auto update script for my embedded device, which can check and download newer version of my program and extract the files on the device. The download center is hosted on remote web server . Script checks the hosted file on web site and if the new version is there then download it to the embedded device and extract the files in the dirs. But if the test.tar.gz is already downloaded and the files are already extracted then do nothing. The embedded device runs Linux. Example, this script actually does the work, but It replace the files all the time. I don't want to overwrite the files.               #!/bin/sh     wget http:xxx.myftp.org:2322/add/test.tar.gz     tar -zxvf test.tar.gz -C /     rm test.tar.gz


title: Which Gentoo should I download?

text: I am looking for the most compatibility in a Gentoo download. When I go to the download page, I am greeted by this: >   * install-x86-minimal-20120306.iso 07-Mar-2012 08:50 135M >   * install-x86-minimal-20120306.iso.CONTENTS 07-Mar-2012 08:50 3.2K >   * install-x86-minimal-20120306.iso.DIGESTS 07-Mar-2012 08:50 348 >   * install-x86-minimal-20120306.iso.DIGESTS.asc 07-Mar-2012 13:27 1.2K >   * stage3-i486-20120306.tar.bz2 07-Mar-2012 08:50 135M >   * stage3-i486-20120306.tar.bz2.CONTENTS 07-Mar-2012 08:50 2.9M >   * stage3-i486-20120306.tar.bz2.DIGESTS 07-Mar-2012 08:50 332 >   * stage3-i486-20120306.tar.bz2.DIGESTS.asc 07-Mar-2012 13:27 1.2K >   * stage3-i686-20120306.tar.bz2 07-Mar-2012 08:50 135M >   * stage3-i686-20120306.tar.bz2.CONTENTS 07-Mar-2012 08:50 2.9M >   * stage3-i686-20120306.tar.bz2.DIGESTS 07-Mar-2012 08:50 332 >   * stage3-i686-20120306.tar.bz2.DIGESTS.asc 07-Mar-2012 13:27 1.2K > I can narrow it down though. I don't need the contents, or the digests. I want i486 instead of i686, this has the most compatibility. So should I choose >   * install-x86-minimal-20120306.iso 07-Mar-2012 08:50 135M > or >   * stage3-i486-20120306.tar.bz2 07-Mar-2012 08:50 135M > * * * What does stage3 mean? Which one will get the most compatibility? Which one is easiest? I notice the stage3 one is a tar.bz2 and the other one is an iso.


title: Outputting to the screen on an ARM Mini2440. Currently just has a login prompt

text: I have a mini2440 ARM computer with a small screen and currently have it booting Debian Squeeze. I'm communicating with it over a serial connection using `minicom`. When the thing boots it gives me a login prompt over the serial, and on the small screen. If I plug in a USB keyboard I'm able to log in and use the small screen terminal. I'm trying to understand the idea of terminals or consoles in Linux. How does the system know to give me a login prompt over the serial connection? Can I redirect a program's output called from the serial session to the screen? Can I make the screen mirror what I see over serial? I'm just very confused about what processes handle this and why the login system was designed like this. I'd greatly appreciate any overview or useful references. Thanks


title: Second field in /etc/shadow

text: If the second field of the `/etc/shadow` file is set to `!!`, does it mean that the account is disabled? Or does it mean that the account is active with no password assigned?


title: How to set global environment variables at boot through a script, and have them available for an application that runs before login?

text: I have a service that runs at boot, and in that service it calls a bash script in the background that exports some environment variables. The problem I'm having is that those environment variables are not being sent to the parent of the background process so as soon as my script is done executing, they are gone. In addition, after the script is run the service then calls another script that starts an application that I have. This application needs access to those environment variables. The RHEL system I run it on is meant to never be logged in to by the user, it only boots up and starts the application. I know that environment variables for a parent process/shell can't _really_ be set by a child background process shell though. I need a way to do this through a script that gets called by my service (not necessarily in the background though), not by adding them in my service (which didn't work either for me) and not by storing them in an `/etc/environment` or `.profile` or anything such as that. In my service I tried adding the environment variables (not what I want to do though):                   export TEST=192.168.1.1      I also tried this in my service:                   TEST=192.168.1.1         export TEST=${TEST}      I tried changing how my service calls the bash script:                   /bin/asdf/script &      I also tried sourcing the script so that it runs in the same shell (which I got from this):                   . ./bin/asdf/script         #I'm very confused why this didn't work      I also found this which looked interesting but it didn't really pan out in my case.


title: zip command is failing during high memory usage

text: We have several perl scripts, which generates and emails reports. The script that emails the files expects a `.zip` extension. The report scripts generates a `.txt` or `.xls` file and then runs the following `zip` command:               print `zip -m $zip_filename $output_filename`;      What's happening is that in some cases (typically, when the perl script uses a lot of memory), the above command fails. From what I gathered the script fails, because there is not enough memory to run the `zip` command. This is a sporadic problem, and a bit hard to pin-down. I have to generate `.zip` files and cannot use a different compression method. I was hoping that someone could tell me whats going on here. I am suspecting that the `-m` flag might be causing this. What's weird to me is that I have manually ran the `zip` command from `bash` several times, and never had it fail, even while using a lot of memory. Here's the result of a `free` command to give you an idea of how much memory I am talking about. The report scripts can occasionally use more than 10GB of Memory:               -bash-4.1$ free                  total       used       free     shared    buffers     cached     Mem:      49409336   48948192     461144          0    1184716    8147564     -/+ buffers/cache:   39615912    9793424     Swap:      2047992    2047988          4      `$output_filename` could be a pattern matching more than one file.


title: Building HDF5 with GCC 4.7 and OpenMPI

text: I am trying to install hdf5 with GCC 4.7 from binary, because I do not have root permissions, using following script on a machine using CentOS release 5.6(AMD64bit):               module purge     module unload Parallel/openmpi-1.4.3     module load Compilateurs/gnu     module load Compilateurs/gnu-4.7     module load Parallel/openmpi-1.6.5          export  CC=/share/apps/openmpi/1.6.5/gnu-4.7/bin/mpicc     export  FC=/share/apps/openmpi/1.6.5/gnu-4.7/bin/mpif90     export CXX=/share/apps/openmpi/1.6.5/gnu-4.7/bin/mpicxx          export MPICC="/share/apps/gcc/bin/gcc"     export MPIF90="/share/apps/gcc/bin/gfortran"     export MPICCC="/share/apps/gcc/bin/gc++"          export   CFLAGS="-O3 -march=native -funroll-loops -I$MPIHOME/include"     export  FCFLAGS="-O3 -march=native -funroll-loops -I$MPIHOME/include"     export CXXFLAGS="-O3 -march=native -funroll-loops -I$MPIHOME/include"     export   CFLAGS="-O3 -march=native -funroll-loops -I$MPIHOME/include"     export LDFLAGS=""     export LD_LIBRARY_PATH="/share/apps/gcc/4.7/lib64:$MPIHOME/lib:$LD_LIBRARY_PATH"          mkdir -p hdf5/build     mkdir -p hdf5/bin     cp hdf5-1.8.12.tar.gz hdf5/build     cd hdf5/build     rm -r hdf5-1.8.12     tar -xf hdf5-1.8.12.tar.gz     cd hdf5-1.8.12     mkdir build     cd build     ../configure --prefix='/home/isolak01/hdf5/bin' --enable-static --disable-shared --enable-fortran --enable-parallel     make -j8     make install      **But I am getting following error:**               checking for a BSD-compatible install... /usr/bin/install -c     checking whether build environment is sane... yes     checking for a thread-safe mkdir -p... /bin/mkdir -p     checking for gawk... gawk     checking whether make sets $(MAKE)... yes     checking whether make supports nested variables... yes     checking whether to enable maintainer-specific portions of Makefiles... no     checking build system type... x86_64-unknown-linux-gnu     checking host system type... x86_64-unknown-linux-gnu     checking shell variables initial values... done     checking if basename works... yes     checking if xargs works... yes     checking for cached host... none     checking for config x86_64-unknown-linux-gnu... no     checking for config x86_64-unknown-linux-gnu... no     checking for config unknown-linux-gnu... no     checking for config unknown-linux-gnu... no     checking for config x86_64-linux-gnu... no     checking for config x86_64-linux-gnu... no     checking for config x86_64-unknown... no     checking for config linux-gnu... found     compiler '/share/apps/openmpi/1.6.5/gnu-4.7/bin/mpicc' is GNU gcc-4.7.3     CC_BASENAME is mpicc.     No match to get fc_version_info for /share/apps/openmpi/1.6.5/gnu-4.7/bin/mpif90     No match to get cxx_version_info for /share/apps/openmpi/1.6.5/gnu-4.7/bin/mpicxx     checking for config ../config/site-specific/host-mc2p-login0.local... no     checking for config ../config/site-specific/host-local... no     checking for gcc... /share/apps/openmpi/1.6.5/gnu-4.7/bin/mpicc     checking whether the C compiler works... yes     checking for C compiler default output file name... a.out     checking for suffix of executables...      checking whether we are cross compiling... no     checking for suffix of object files... o     checking whether we are using the GNU C compiler... yes     checking whether /share/apps/openmpi/1.6.5/gnu-4.7/bin/mpicc accepts -g... yes     checking for /share/apps/openmpi/1.6.5/gnu-4.7/bin/mpicc option to accept ISO C89... none needed     checking for style of include used by make... GNU     checking dependency style of /share/apps/openmpi/1.6.5/gnu-4.7/bin/mpicc... gcc3     checking if unsupported combinations of configure options are allowed... no     checking if Fortran interface enabled... yes     checking if Fortran 2003 interface enabled... yes     checking whether we are using the GNU Fortran compiler... no     checking whether /share/apps/openmpi/1.6.5/gnu-4.7/bin/mpif90 accepts -g... yes     checking for Fortran flag to compile .f90 files... unknown     configure: error: Fortran could not compile .f90 files     make: *** No targets specified and no makefile found.  Stop.     make: *** No rule to make target `install'.  Stop.      Where I am making a mistake? **Is there any mistake in Fortran flags?** Is there any documentation like this for (GNU) GCC 4.7 instead of Intel?


title: Pass list of folders to zip command

text: I have a folder which contains lot's of folders in it. I don't need to zip all of them and I have a list of folders that need to be zipped in a separate file The folder list is in the following format:               folder1 folder2 folder3...      Can I do something like this (this doesn't work, but I don't know how to pass arguments properly):               zip -r backup1.zip < listOfFolders.txt


title: Debian file's permissions for secondary's group of user

text: I am installing a proftpd server on a debian dedicated server, In order to be able to update some website files in this folder : `/var/www/website` I have added a new user : my-ftp-user This user's root is `/var/www/website`, but the owner HAS TO be apache2 (www-data). So I changed the user's groups :               usermod -a -G ftpuser my-ftp-user     usermod -a -G www-data my-ftp-user      The permissions of folder `/var/www/website` are currently 755. The subfolders are also in 755 mode, but the subfiles are in 644 mode. If I am right, my-ftp-user should now be able to add, edit, remove files in `/var/www/website`, am I not ?               $ su my-ftp-user          $ cd /var/www/website          $ ls -la          drwxr-xr-x  5 www-data www-data  4096 juil. 30 13:47 .     drwxr-xr-x 22 root   www-data  4096 juil. 30 13:36 ..     -rw-r--r--  1 www-data www-data   418 juil. 28 18:39 index.php          $ cat index.php // WORKS          $ touch test.txt // DOESN'T WORK : permission denied, why ?


title: Creating a public document directory for a normal user

text: We usually see personal web pages like http://a-site.com/~someone/, in this case, "someone" is a user of "a-site". How to enable this by default, so whenever we add a new user "foo", then http://a-site.com/~foo/ is created automatically? Is the tilde in "~someone" optional, customizable? **Software environment:** Webserver: Apache or Yaws (Erlang based webserver)


title: creating a sequence of numbers, one per line in a file

text: Is there a way to create out of thin air, a file that is a sequence of numbers, starting at a given number, one per line? something like               magic_command start 100 lines 5 > b.txt      and then, `b.txt` would be               100     101     102     103     104


title: killing a process on a remote machine when the machine is stuck

text: I started a very resources-consuming process on a remote server via ssh. It is an optimization problem run in MATLAB. It takes full memory and CPU. In fact, I am not even able to ssh to the machine, which doesn't reply at all. How do I kill that process? I don't have root access.


title: -bash: yum: command not found

text: I have one server with Red Hat Enterprise Linux AS release 4 (Nahant Update 3) installed. And I tried to add the online repo using this link: Centos Wiki: RPMForge And everything goes smooth. But when I tried to install any package it replies:               [root@Backup yum.repos.d]# yum -v install httpd     -bash: yum: command not found      There are some repos in `/etc/yum.repo.d/`:               mirrors-rpmforge  mirrors-rpmforge-extras  mirrors-rpmforge-testing  rpmforge.repo The content of `rpmforge.repo` is:               [root@Backup yum.repos.d]# cat rpmforge.repo     ### Name: RPMforge RPM Repository for RHEL 4 - dag     ### URL: http://rpmforge.net/     [rpmforge]     name = RHEL $releasever - RPMforge.net - dag     baseurl = http://apt.sw.be/redhat/el4/en/$basearch/rpmforge     mirrorlist = http://apt.sw.be/redhat/el4/en/mirrors-rpmforge     #mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge     enabled = 1     protect = 0     gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag     gpgcheck = 1          [rpmforge-extras]     name = RHEL $releasever - RPMforge.net - extras     baseurl = http://apt.sw.be/redhat/el4/en/$basearch/extras     mirrorlist = http://apt.sw.be/redhat/el4/en/mirrors-rpmforge-extras     #mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-extras     enabled = 0     protect = 0     gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag     gpgcheck = 1          [rpmforge-testing]     name = RHEL $releasever - RPMforge.net - testing     baseurl = http://apt.sw.be/redhat/el4/en/$basearch/testing     mirrorlist = http://apt.sw.be/redhat/el4/en/mirrors-rpmforge-testing     #mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-testing     enabled = 0     protect = 0     gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag     gpgcheck = 1      # Command Results               [root@Backup yum.repos.d]# yum     -bash: yum: command not found     [root@Backup yum.repos.d]# which yum     /usr/bin/which: no yum in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin)     [root@Backup yum.repos.d]# echo $PATH     /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin     [root@Backup yum.repos.d]# rpm -q yum     package yum is not installed     [root@Backup yum.repos.d]# find /bin/ /usr/bin -name yum     [root@Backup yum.repos.d]# find /bin/ /usr/bin -name yum*     [root@Backup yum.repos.d]# ls -l /etc/yum.comf     ls: /etc/yum.comf: No such file or directory     [root@Backup yum.repos.d]# ls -l /etc/yum.conf     ls: /etc/yum.conf: No such file or directory


title: Discovering metadata about a PDF

text: Suppose I have a PDF and I want to obtain whatever metadata is available for that PDF. What utility should I use? I find the piece of information I am usually most interested in knowing is the paper size, something that PDf viewers usually don't report. E.g. is the PDF size letter, legal, A4 or something else? But the other information available may be of interest too. EDIT: Here is a handy guide to paper sizes, thanks to @terdon.


title: How do I get a Ralink RT3290 wireless card working on Debian Jessie?

text: I have an HP Pavillion Touch 14-N009LA with a Ralink RT3290 wireless card running Debian Jessie with kernel 3.12.9-1. This distro looks as if the wireless drivers were included, and from another post here it would look like it should work with the rt2800pci module, which is listed by lsmod and loads fine. However, whenever I issue `ifconfig wlan0 up`, I get `SIOCSIFFLAGS: No such file or directory`. I tried using the kernel.org compatibility sources from the previously linked post and they didn't work, after installing them I can't load the module and I must uninstall them and use the Debian-bundled module. I tried compiling the driver's sources from this other thread and they don't compile. I'm not sure if downloading the binary archive linked on that thread will be a good idea given that that one is for Ubuntu and I'm running Debian Testing. I tried to apply this fix here for Arch/Gentoo but couldn't find the right file. Following the third link I managed to diagnose this situation a little, this is what I get from running `dmesg` right after attempting to bring up `wlan0`:               [ 4374.981101] ieee80211 phy1: rt2x00lib_request_firmware: Info - Loading firmware file 'rt3290.bin'     [ 4374.981132] rt2800pci 0000:02:00.0: firmware: failed to load rt3290.bin (-2)      So basically, it looks like I _have to_ get the drivers to compile. I have `build-essential` and `linux-headers-amd64` for my running version of the kernel, tried with `HAS_WPA_SUPPLICANT=y` and `HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y` as well as with only `HAS_NATIVE_WPA_SUPPLICANT_SUPPORT` on, and this is what I get:               black@rockshooter:~/WA/DPO_RT3290_LinuxSTA_V2600_20120508$ make     make -C tools     make[1]: Entering directory `/home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/tools'     gcc -g bin2h.c -o bin2h     make[1]: Leaving directory `/home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/tools'     /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/tools/bin2h     cp -f os/linux/Makefile.6 /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/Makefile     make -C /lib/modules/3.12-1-amd64/build SUBDIRS=/home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux modules     make[1]: Entering directory `/usr/src/linux-headers-3.12-1-amd64'       CC [M]  /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/rt_linux.o     /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/rt_linux.c: In function ‘duplicate_pkt’:     /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/rt_linux.c:508:3: warning: passing argument 1 of ‘memmove’ makes pointer from integer without a cast [enabled by default]        NdisMoveMemory(skb->tail, pHeader802_3, HdrLen);        ^     In file included from /usr/src/linux-headers-3.12-1-common/arch/x86/include/asm/string.h:4:0,                      from /usr/src/linux-headers-3.12-1-common/include/linux/string.h:17,                      from /usr/src/linux-headers-3.12-1-common/include/linux/dynamic_debug.h:111,                      from /usr/src/linux-headers-3.12-1-common/include/linux/kernel.h:14,                      from /usr/src/linux-headers-3.12-1-common/include/linux/cache.h:4,                      from /usr/src/linux-headers-3.12-1-common/include/linux/time.h:4,                      from /usr/src/linux-headers-3.12-1-common/include/linux/stat.h:18,                      from /usr/src/linux-headers-3.12-1-common/include/linux/module.h:10,                      from /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/include/os/rt_linux.h:18,                      from /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/include/rtmp_os.h:42,                      from /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/include/rtmp_comm.h:56,                      from /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/rt_linux.c:35:     /usr/src/linux-headers-3.12-1-common/arch/x86/include/asm/string_64.h:58:7: note: expected ‘void *’ but argument is of type ‘sk_buff_data_t’      void *memmove(void *dest, const void *src, size_t count);            ^     /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/rt_linux.c:510:3: warning: passing argument 1 of ‘memmove’ makes pointer from integer without a cast [enabled by default]        NdisMoveMemory(skb->tail, pData, DataSize);        ^     In file included from /usr/src/linux-headers-3.12-1-common/arch/x86/include/asm/string.h:4:0,                      from /usr/src/linux-headers-3.12-1-common/include/linux/string.h:17,                      from /usr/src/linux-headers-3.12-1-common/include/linux/dynamic_debug.h:111,                      from /usr/src/linux-headers-3.12-1-common/include/linux/kernel.h:14,                      from /usr/src/linux-headers-3.12-1-common/include/linux/cache.h:4,                      from /usr/src/linux-headers-3.12-1-common/include/linux/time.h:4,                      from /usr/src/linux-headers-3.12-1-common/include/linux/stat.h:18,                      from /usr/src/linux-headers-3.12-1-common/include/linux/module.h:10,                      from /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/include/os/rt_linux.h:18,                      from /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/include/rtmp_os.h:42,                      from /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/include/rtmp_comm.h:56,                      from /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/rt_linux.c:35:     /usr/src/linux-headers-3.12-1-common/arch/x86/include/asm/string_64.h:58:7: note: expected ‘void *’ but argument is of type ‘sk_buff_data_t’      void *memmove(void *dest, const void *src, size_t count);            ^     /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/rt_linux.c: In function ‘ClonePacket’:     /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/rt_linux.c:662:20: warning: assignment makes integer from pointer without a cast [enabled by default]        pClonedPkt->tail = pClonedPkt->data + pClonedPkt->len;                         ^     In file included from /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/include/rtmp_os.h:42:0,                      from /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/include/rtmp_comm.h:56,                      from /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/rt_linux.c:35:     /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/rt_linux.c: In function ‘RtmpOsPktInit’:     /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/include/os/rt_linux.h:992:34: warning: assignment makes integer from pointer without a cast [enabled by default]        ((RTPKT_TO_OSPKT(_pkt))->tail) = (PUCHAR)((_start) + (_len))                                       ^     /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/rt_linux.c:681:2: note: in expansion of macro ‘SET_OS_PKT_DATATAIL’       SET_OS_PKT_DATATAIL(pRxPkt, pData, DataSize);       ^     /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/rt_linux.c: In function ‘wlan_802_11_to_802_3_packet’:     /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/rt_linux.c:708:15: warning: assignment makes integer from pointer without a cast [enabled by default]       pOSPkt->tail = pOSPkt->data + pOSPkt->len;                    ^     /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/rt_linux.c: In function ‘__RtmpOSFSInfoChange’:     /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/rt_linux.c:1136:20: error: incompatible types when assigning to type ‘int’ from type ‘kuid_t’        pOSFSInfo->fsuid = current_fsuid();                         ^     /home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/rt_linux.c:1137:20: error: incompatible types when assigning to type ‘int’ from type ‘kgid_t’        pOSFSInfo->fsgid = current_fsgid();                         ^     make[4]: *** [/home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux/../../os/linux/rt_linux.o] Error 1     make[3]: *** [_module_/home/black/WA/DPO_RT3290_LinuxSTA_V2600_20120508/os/linux] Error 2     make[2]: *** [sub-make] Error 2     make[1]: *** [all] Error 2     make[1]: Leaving directory `/usr/src/linux-headers-3.12-1-amd64'     make: *** [LINUX] Error 2


title: How to modify huge patch file properly?

text: I have this patch. I want to disable patching of `Makefile` and `drivers/video/logo/logo_linux`. What is best way of doing this?   Do I edit it, and delete that specific entries? If so, is there a tool that will do it properly while keeping correct structure of the file.


title: Mount windows share

text: I've just literally spent about 2 hours trying to simply mount a windows share on linux. Mounting with `cifs` causes deadly hangs as discussed here. So I tried to mount via `nfs` as discussed in this page. I spent a few minutes searching the `nfsshare` program, until I realized I had to install Unix Services for Windows. After downloading the huge file, I was deterred by Microsoft's scare tactic: `this program has known compatibility issues`, and the subsequent, `setup has detected that a required System Service (TCP/IP) is not currently installed...` This is even after I enabled the Simple TCP/IP services from `Turn Windows features on or off`. Running               $ sudo mount -t nfs 192.168.1.76:myshare ~/mount3/      on Debian unfailingly gives me:               mount.nfs: access denied by server while mounting 192.168.1.76:myshare      Even though I've opened read, write, full to everyone under windows for the share in question.               $ sudo showmount -e 192.168.1.76      usually gives me:               rpc mount export: RPC: Procedure unavailable      or sometimes:               clnt_create: RPC: Unable to send      I tried using `freeNFS.exe`, while still getting the access permission error on Debian. I tried using `haneWIN`, which fails with `Failed to start PortMapper`.


title: sort by hex value

text: Using coreutils `sort`, how can I sort numerically by a hexadecimal value (field)? I was expecting something along the lines of               sort -k3,3x file_to_sort      however, such an `x` does not exist. Edit: Best solution I came up with so far is:               { echo ibase=16; cut -d' ' -f3 file_to_sort; } |       bc | paste -d: - file_to_sort | sort -t: -k1,1n | cut -d: -f2-      where the `cut -d' ' -f3` isolates the search field (this is `-k3,3` — this may vary, of course), and `bc` does conversion to decimal (requires upper-case hex, without `0x` prefix, matching my case). Then I join, sort, and split columns.


title: What permissions should I set if I'm the only user?

text: I'm the only user on a OS X machine and am wondering what the best practice is for setting permissions on my sensitive files. Specifically, are there reasons to prefer one of the following               -rw-------   1 MyName  staff   ... File1      -rw-rw----   1 MyName  MyName  ... File2     -rw-rw----   1 MyName  admin   ... File3      or perhaps even — what seems the most natural to me — no group at all with               -rw-------   1 MyName  MyName  ... File4      On OS X (10.8.2), the "default" is               -rw-r--r--   1 MyName  staff   ... FileA      but, until I, perhaps mistakenly, "reset permissions", most of my files had               -rw-r-----   1 MyName  MyName  ... FileB       so one reason I'm asking is that I'm wondering what the consequences of my "reset" are.


title: Killing a tree of processes in top/htop

text: htop allows me to nicely see trees of processes within the shell. I can kill processes by pressing `F9 (KILL)` and then selecting which signal (e.g. `15 SIGTERM`) I want to send to a job to kill. However, this only allows me to kill one process at a time. Is there a way to kill a full tree of processes using `htop`?


title: How much RAM does the kernel use?

text: This question is motivated by my shock when I discovered that Mac OS X kernel uses **750MB** of RAM. I have been using Linux for 20 years, and I always "knew" that the kernel RAM usage is dwarfed by X (is it true? has it ever been true?). So, after some googling, I tried `slabtop` which told me:               Active / Total Size (% used)       : 68112.73K / 72009.73K (94.6%)      **Does this mean that my kernel is using ~72MB of RAM now?** (Given that `top` reports `Xorg`'s RSS as 17M, the kernel now dwarfs X, not the other way around). **What is the "normal" kernel RAM usage (range) for a laptop?** **Why does MacOS use an order of magnitude more RAM than Linux?** PS. No answer here addressed the last question, so please see related questions:   * Is it a problem if kernel_task is routinely above 130MB on mid 2007 white MacBook?   * kernel_task using _way_ too much memory   * What is included under `kernel_task` in Activity Monitor?


title: How can I pass output of one command as an argument to another

text: A similar question has been asked, but since I am new to `Unix` the answer was not clear to me due to the context. What I want to do is to pass the output of one command as an argument to another. I am using git for source control and working on three different branches. Whenever I need to commit I have to check my branch and then give the corresponding command as               git pull --rebase origin <branch-name>      I wanted to write an alias as `git-rebase` and what it would do is that first it will execute `git branch`. The output of git branch look like this               experiment     *master     new feature      So if we have two branches in addition to the master branch then it will show all the branches and the current branch will be star marked. I want to extract the star marked line and then pass the output of this to the above command. Also I would like to suppress the output of the command `git branch`. I am not doing this because I am too lazy to type the whole command, but because I would like to learn more about the power of unix bash. Hoping to learn something from it


title: Before logging in my system, any way to make a key simulate another key?

text: In my keyboard `I` button doesn't work. I had earlier asked a Q on how to make a key simulate another key. That Q solved the issue only after I logged in my system. I'm working on Ubuntu 13.04. But how to solve the same issue that I'm facing before logging in my system? Take the below example: While logging, in GRUB 2 boot menu, I press "c" & enter command line. Now here how to make a key simulate `I`? It would solve my issue completely if the change incorporated to achieve this is permanent in effect (whether I login or not; even if I boot into a different software, etc)


title: Lock screen after blanking with gnome-screensaver and XFCE

text: I'm using XFCE4 with Fedora 18 and replaced `xscreensaver` with `gnome- screensaver`. I have `gnome-screensaver` checked in session and startup and `xscreensaver` unchecked. By using power manager, I have configured my machine to blank screen after a few minutes. What I want to accomplish is lock the screen after waking up from these blank screens, and that is currently not working with my setup. The problem with gnome-screensaver is that it lacks tools to configure basic things like how long it should wait to fire screensaver. `xscreensaver` can be configured to 'go screensaver after x minutes and turn lock screen on', but `gnome-screensaver` has to equivalent configuration tool. what I have is 'Session and Startup' and 'power manager' tools, and they don't have an option to 'lock screen after waking back from blank screen'(they do have one for suspend/hibernation though.). What should I do? I don't really go with `xscreensaver`.


title: mkinitcpio did not include modules.devname in cpio image

text: I'm running Arch Linux with a customized kernel. I modified the PKGBUILD from abs, and renamed the package to `linux-custom`. The PKGBUILD is fine, after installation I could see the `modules.devname` in the `/lib/modules/$(uname -r)/` folder But that file is not included while creating the initrd image. Perhaps there's something wrong with my mkinitcpio profile?               %> cat /etc/mkinitcpio.d/linux-custom.preset      # mkinitcpio preset file for the 'linux-custom' package          ALL_config="/etc/mkinitcpio.conf"     ALL_kver="/boot/vmlinuz-linux-custom"          PRESETS=('default' 'fallback')          #default_config="/etc/mkinitcpio.conf"     default_image="/boot/initramfs-linux-custom.img"     #default_options=""          #fallback_config="/etc/mkinitcpio.conf"     fallback_image="/boot/initramfs-linux-custom-fallback.img"     fallback_options="-S autodetect"


title: Getting wireless card to work in Debian with wpa_supplicant

text: I'm having difficulty getting a Netgear WG311 network card to work with Debian. Here is a screenshot showing `ifconfig wlan0`, `iwconfig`, network interface cards, and `wpa_supplicant` configs: I understand that the wpa doesn't work with third-party drivers and ndiswrapper; I've been told to use wpa_supplicant instead. How can I get my windows driver to work with the Netgear WG311 wireless card? UPDATE ok had a look at the resource that Macieg gave me. Finally got a connection but after restart it is gone. the output of this command. wpa_supplicant -i wlan0 -D wext just shows wpa_supplicant help commands. UPDATE2 Ok the connection comes up after restart, but only 5 minutes after i do this command               wpa_supplicant -B -c/etc/wpa_supplicant.conf -iwlan0 -Dwext      Anyone know how to fix this?


title: Customised vimrc for subfolders and projects

text: I use vim in many different contexts ... actually, probably most people do: There is the editing of configuration files, programming, documenting, email and so forth. I very frequently found myself wishing for a facility that lets me put a vimrc into a directory and whenever I start vim from within that directory a local vimrc gets read as well to make context specific adaptions. For instance:   * a vimrc in etc to implicitly set/release locks and create backups before/on write   * a vimrc for each of my programming projects for (for example) project-specific indentation and frequently used macros, e.g. Debian patch signature   * a vimrc in every documentation directory for the docs language specific settings (spellcheck!) This would not only help me myself, but also enable me/us to share project and task specific settings among many users in each of the described situations and ahve the configuration with the context where we want it applied. This seems very sensible to me and not too difficult to have/implement. Does anybody know of a vim plugin or have a config that honors vimrc files found within working directories?


title: Is it possible to make a Microsoft LifeCam HD-5000 work under linux?

text: I am trying to set up a virtual machine which will act as a home security system. (If you've chatted with me in The Tavern, you may know why...) I purchased two USB webcams (Microsoft LifeCam HD-5000) and am trying to get them to work with Motion. However when I connected them to my Ubuntu 10.10 VM, no `/dev/video` devices were created. `dmesg` said:               jnet@sharon:~$ dmesg|tail     [  558.421978] uvcvideo: Failed to initialize the device (-5).     [  558.423487] usbcore: registered new interface driver uvcvideo     [  558.423492] USB Video Class driver (v0.1.0)     [  569.042808] usbcore: deregistering interface driver uvcvideo     [  570.840343] uvcvideo: Found UVC 1.00 device Microsoft® LifeCam HD-5000 (045e:076d)     [  585.801811] uvcvideo: UVC non compliance - GET_DEF(PROBE) not supported. Enabling workaround.     [  595.775370] uvcvideo: Failed to query (129) UVC probe control : -110 (exp. 26).     [  595.775592] uvcvideo: Failed to initialize the device (-5).     [  595.777012] usbcore: registered new interface driver uvcvideo     [  595.777018] USB Video Class driver (v0.1.0)      There's **a lot** of results on Google for "uvcvideo: Failed to query (129) UVC probe control : -110 (exp. 26).". many people were saying to unload the `uvcvideo` module and reload it, because it loads before the `usbaudio` module. But no amount of unloading and reloading worked. A custom compile of the `uvcvideo.ko` module was suggested but the link to the source was dead. Is there any way to make these webcams work under a *nix-like system? **Please note it does not have to be Ubuntu** , I was setting up a brand new VM for this purpose so I am open to any unix-like OS, be it Fedora, CentOS, a BSD flavor or even Open Solaris or similar.


title: Why does `man -k cron` say `vixie-cron (rpm)` for some results, and how do I read those pages?

text: I'm trying to find out some details regarding cron and /etc/cron.d/ on a RedHat system. Ironically, my answer is viewable within the vixie- cron-*.src.rpm for this package, but the the man pages for `cron` don't match the text which is provided by the `vixie-cron` RPM. If I search my MANPATH for the keyword `cron`, it shows me some results like `vixie-cron (rpm)`. What does this `(rpm)` tag mean, why are these manpages not installed on the system and can I view those manpages?               $ man -k cron     /etc/anacrontab [anacrontab] (5)  - configuration file for anacron     anacron              (8)  - runs commands periodically     anacron             (rpm) - A cron-like program that can run jobs lost during downtime.     cron                 (8)  - daemon to execute scheduled commands (ISC Cron V4.1)     crontab              (1)  - maintain crontab files for individual users (ISC Cron V4.1)     crontab              (1p)  - schedule periodic background work     crontab              (5)  - tables for driving cron (ISC Cron V4.1)     crontabs            (rpm) - Root crontab files used to schedule the execution of programs.     vixie-cron          (rpm) - The Vixie cron daemon for executing specified programs at set times.      Note that there is no page for `vixie-cron`, and the vixie-cron package doesn't actually provide any manpages named `vixie-cron`               $ man vixie-cron     No manual entry for vixie-cron     $ rpm -q --whatprovides /usr/bin/crontab     vixie-cron-4.1-77.el5_4.1     $ rpm -q --list vixie-cron     /etc/cron.d     /etc/pam.d/crond     /etc/rc.d/init.d/crond     /etc/sysconfig/crond     /usr/bin/crontab     /usr/sbin/crond     /usr/share/man/man1/crontab.1.gz     /usr/share/man/man5/crontab.5.gz     /usr/share/man/man8/cron.8.gz     /usr/share/man/man8/crond.8.gz     /var/spool/cron


title: Quoting commands

text: As I've learned to use Linux over the years, I've repeatedly come across the idiom of quoting commands with a leading backtick (`) and a following single quote ('), like so: `rm -rf /tmp/foo/bar' (I first realized that I kept seeing this, I think, on jwz's site. I might have even asked him this question, though that would have been a loooong time ago.) Is there a significance to this style of quoting commands? I do it myself, now, so that if people just copy and paste what I've posted, and don't know enough to leave out the marks, the command will fail. Is there a preferred method for making commands like mysql -hlocalhost -u -p -A bigdatabase obvious in running text, without offsetting it in its own paragraph as above?


title: How to avoid warnings from subshells if the function in PROMPT_COMMAND is not defined?

text: I'm using the following code to get a nice prompt (including git information etc.):               function set_prompt {         # magic happens in here ;)     }          export PROMPT_COMMAND='set_prompt'      However, sometimes I get the following warning after using certain programs that make heavy use of bash internally: > bash: set_prompt: command not found One good example for this is Gentoo's package manager `emerge` which shows that error when it exists. It's not a big deal - just looks ugly and doesn't break anything. But I'd like to get rid of it anyway. I assume it happens because the `PROMPT_COMMAND` environment variable is inherited by emerge's shells but the function isn't. Is there some way to make the `PROMPT_COMMAND` variable as not inheritable? Or another way to avoid this annoying issue?


title: What does this logrotate nginx config do?

text: In my `/etc/logrotate.d/nginx` I saw,               /var/log/nginx/*.log {             daily             missingok             rotate 52             compress             delaycompress             notifempty             create 640 nginx adm             sharedscripts             postrotate                     [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`             endscript     }      The postrotate script looks like killing the nginx process, which does not make sense so I must be wrong. What it is doing?


title: chkconfig bootup script failing, script runs good manually

text: I recently purchased a vps and I attempted to create a startup/restart script to start up my java program. I am running CentOS 6. The script works if I execute it manually with this command: > service policyserver start But fails to run automatically, creates a file in the /tmp/test.log with the following error: > Starting Policy Server: failed Here is the startup script inside `/etc/init.d/`               #!/bin/bash     #     #policyserver:          Startup script for CamSpark Policy Server Application.     #     #chkconfig: 3 80 05     #description:      Startup script for Cam Spark Policy Server Application.          CAMSPARK_POLICY_HOME=/tools/camsparkserver/Policy;     export CAMSPARK_POLICY_HOME          start() {             echo -n "Starting Policy Server: "             $CAMSPARK_POLICY_HOME/Policy.sh start >> /tmp/test.log             sleep 2             echo "done"     }          stop() {             echo -n "Stopping Policy Server: "             $CAMSPARK_POLICY_HOME/Policy.sh stop             echo "done"     }          # See how we were called.     case "$1" in             start)                     start                     ;;             stop)                     stop                     ;;             restart)                     stop                     start                     ;;             *)                     echo $"Usage: policyserver {start|stop|restart}"                     exit     esac      Here is the main script (can't move this script)               #!/bin/bash     #     # chkconfig: 345 99 05      # description: Java deamon script     #     # A non-SUSE Linux start/stop script for Java daemons.     #     # Set this to your Java installation     JAVA_HOME=/usr/java/latest          scriptFile=$(readlink -fn $(type -p $0))                   # the absolute, dereferenced path of this script file     scriptDir=$(dirname $scriptFile)                           # absolute path of the script directory     serviceNameLo="policyserver"                                  # service name with the first letter in lowercase     serviceName="PolicyServer"                                    # service name     serviceUser="root"                                      # OS user name for the service     serviceGroup="root"                                    # OS group name for the service     applDir="/tools/camsparkserver/Policy"                          # home directory of the service application     serviceUserHome="/home/$serviceUser"                       # home directory of the service user     serviceLogFile="/var/log/$serviceNameLo.log"               # log file for StdOut/StdErr     maxShutdownTime=15                                         # maximum number of seconds to wait for the daemon to terminate normally     pidFile="/var/run/$serviceNameLo.pid"                      # name of PID file (PID = process ID number)     javaCommand="java"                                         # name of the Java launcher without the path     javaExe="$javaCommand"                      # file name of the Java application launcher executable     javaArgs="PolicyServer"                     # arguments for Java launcher     javaCommandLine="$javaExe $javaArgs"                       # command line to start the Java service application     javaCommandLineKeyword="PolicyServer"                     # a keyword that occurs on the commandline, used to detect an already running service process and to distinguish it from others          # Makes the file $1 writable by the group $serviceGroup.     function makeFileWritable {        local filename="$1"        touch $filename || return 1        chgrp $serviceGroup $filename || return 1        chmod g+w $filename || return 1        return 0; }          # Returns 0 if the process with PID $1 is running.     function checkProcessIsRunning {        local pid="$1"        if [ -z "$pid" -o "$pid" == " " ]; then return 1; fi        if [ ! -e /proc/$pid ]; then return 1; fi        return 0; }          # Returns 0 if the process with PID $1 is our Java service process.     function checkProcessIsOurService {        local pid="$1"        if [ "$(ps -p $pid --no-headers -o comm)" != "$javaCommand" ]; then return 1; fi        grep -q --binary -F "$javaCommandLineKeyword" /proc/$pid/cmdline        if [ $? -ne 0 ]; then return 1; fi        return 0; }          # Returns 0 when the service is running and sets the variable $pid to the PID.     function getServicePID {        if [ ! -f $pidFile ]; then return 1; fi        pid="$(<$pidFile)"        checkProcessIsRunning $pid || return 1        checkProcessIsOurService $pid || return 1        return 0; }          function startServiceProcess {        cd $applDir || return 1        rm -f $pidFile        makeFileWritable $pidFile || return 1        makeFileWritable $serviceLogFile || return 1        cmd="nohup $javaCommandLine >>$serviceLogFile 2>&1 & echo \$! >$pidFile"        # Don't forget to add -H so the HOME environment variable will be set correctly.        sudo -u $serviceUser -H $SHELL -c "$cmd" || return 1        sleep 0.1        pid="$(<$pidFile)"        if checkProcessIsRunning $pid; then :; else           echo -ne "\n$serviceName start failed, see logfile."           return 1        fi        return 0; }          function stopServiceProcess {        kill $pid || return 1        for ((i=0; i<maxShutdownTime*10; i++)); do           checkProcessIsRunning $pid           if [ $? -ne 0 ]; then              rm -f $pidFile              return 0              fi           sleep 0.1           done        echo -e "\n$serviceName did not terminate within $maxShutdownTime seconds, sending SIGKILL..."        kill -s KILL $pid || return 1        local killWaitTime=15        for ((i=0; i<killWaitTime*10; i++)); do           checkProcessIsRunning $pid           if [ $? -ne 0 ]; then              rm -f $pidFile              return 0              fi           sleep 0.1           done        echo "Error: $serviceName could not be stopped within $maxShutdownTime+$killWaitTime seconds!"        return 1; }          function startService {        getServicePID        if [ $? -eq 0 ]; then echo -n "$serviceName is already running"; RETVAL=0; return 0; fi        echo -n "Starting $serviceName   "        startServiceProcess        if [ $? -ne 0 ]; then RETVAL=1; echo "failed"; return 1; fi        echo "started PID=$pid"        RETVAL=0        return 0; }          function stopService {        getServicePID        if [ $? -ne 0 ]; then echo -n "$serviceName is not running"; RETVAL=0; echo ""; return 0; fi        echo -n "Stopping $serviceName   "        stopServiceProcess        if [ $? -ne 0 ]; then RETVAL=1; echo "failed"; return 1; fi        echo "stopped PID=$pid"        RETVAL=0        return 0; }          function checkServiceStatus {        echo -n "Checking for $serviceName:   "        if getServicePID; then         echo "running PID=$pid"         RETVAL=0        else         echo "stopped"         RETVAL=3        fi        return 0; }          function main {        RETVAL=0        case "$1" in           start)                                               # starts the Java program as a Linux service              startService              ;;           stop)                                                # stops the Java program service              stopService              ;;           restart)                                             # stops and restarts the service              stopService && startService              ;;           status)                                              # displays the service status              checkServiceStatus              ;;           *)              echo "Usage: $0 {start|stop|restart|status}"              exit 1              ;;           esac        exit $RETVAL     }          main $1      Does anyone know what could be the problem? **EDIT:** ran one of the answers posted here. Here is what I get when I just run that command               [root@camspark Policy]# service policyserver stop     Stopping Policy Server: Stopping PolicyServer   stopped PID=683     done     [root@camspark Policy]# bash -x service policyserver start |& tee policyserver_startup.log     + . /etc/init.d/functions     ++ TEXTDOMAIN=initscripts     ++ umask 022     ++ PATH=/sbin:/usr/sbin:/bin:/usr/bin     ++ export PATH     ++ '[' -z '' ']'     ++ COLUMNS=80     ++ '[' -z '' ']'     +++ /sbin/consoletype     ++ CONSOLETYPE=pty     ++ '[' -f /etc/sysconfig/i18n -a -z '' -a -z '' ']'     ++ . /etc/profile.d/lang.sh     ++ unset LANGSH_SOURCED     ++ '[' -z '' ']'     ++ '[' -f /etc/sysconfig/init ']'     ++ . /etc/sysconfig/init     +++ BOOTUP=color     +++ RES_COL=60     +++ MOVE_TO_COL='echo -en \033[60G'     +++ SETCOLOR_SUCCESS='echo -en \033[0;32m'     +++ SETCOLOR_FAILURE='echo -en \033[0;31m'     +++ SETCOLOR_WARNING='echo -en \033[0;33m'     +++ SETCOLOR_NORMAL='echo -en \033[0;39m'     +++ PROMPT=no     +++ AUTOSWAP=no     +++ ACTIVE_CONSOLES='/dev/tty[1-6]'     +++ SINGLE=/sbin/sushell     ++ '[' pty = serial ']'     ++ __sed_discard_ignored_files='/\(~\|\.bak\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d'     ++ basename service     + VERSION='service ver. 0.91'     ++ basename service     + USAGE='Usage: service < option > | --status-all | [ service_name [ command | --full-restart ] ]'     + SERVICE=     + SERVICEDIR=/etc/init.d     + OPTIONS=     + '[' 2 -eq 0 ']'     + cd /     + '[' 2 -gt 0 ']'     + case "${1}" in     + '[' -z '' -a 2 -eq 1 -a policyserver = --status-all ']'     + '[' 2 -eq 2 -a start = --full-restart ']'     + '[' -z '' ']'     + SERVICE=policyserver     + shift     + '[' 1 -gt 0 ']'     + case "${1}" in     + '[' -z policyserver -a 1 -eq 1 -a start = --status-all ']'     + '[' 1 -eq 2 -a '' = --full-restart ']'     + '[' -z policyserver ']'     + OPTIONS=' start'     + shift     + '[' 0 -gt 0 ']'     + '[' -f /etc/init.d/policyserver ']'     + env -i PATH=/sbin:/usr/sbin:/bin:/usr/bin TERM=xterm /etc/init.d/policyserver start     Starting Policy Server: done     [root@camspark Policy]#      Here is what is inside that log file               [root@camspark Policy]# head policyserver_startup.log     + . /etc/init.d/functions     ++ TEXTDOMAIN=initscripts     ++ umask 022     ++ PATH=/sbin:/usr/sbin:/bin:/usr/bin     ++ export PATH     ++ '[' -z '' ']'     ++ COLUMNS=80     ++ '[' -z '' ']'     +++ /sbin/consoletype     ++ CONSOLETYPE=pty     [root@camspark Policy]#


title: cant compile install and Configure any linux kernel in debian 7

text: I followed these steps from the link: (http://www.howopensource.com/2011/08/how-to-compile-and-install-linux- kernel-3-0-in-ubuntu-11-04-10-10-and-10-04/) but these commands don't work:               sudo make modules_install install     sudo make     sudo make oldconfig     sudo make menuconfig      ### Error message    ![ss of error](http://i.stack.imgur.com/Cj2pg.png)


title: Vim Visual Mode - is there a way to change the background color only when in visual mode?

text: I forgot which mode I am in using VIM so I set this up in my `.vimrc` so that I easily know I am in Insert mode as the background changes to Yellow               :au InsertEnter * hi Normal term=reverse ctermbg=darkgrey guibg=yellow "     :au InsertLeave * hi Normal term=NONE    ctermbg=black    guibg=white "       How can I do something similar for when I am in Visual mode? Or is this not possible?


title: how to ensure a program is always running but without root access?

text: Currently I need to have a program running all the time, but when the server is rebooted I need to manually run the program. And sometimes I'm not available when that happens. I can't use a normal configuration to restart my program when the server is starting because I don't have root access and the administrator don't want to install it.


title: ssh log sent to email in Cygwin

text: I am using Cygwin in Windows 7. I am trying to make my syslog-ng daemon send a ssh log via email to me when ever someone tries to log into my computer. I tried using the code below (entered into `/etc/syslog-ng/syslog-ng.conf` but the smtp driver is not recognized. Is there a way to get it to work?               filter f_ssh {             program("sshd"); };              destination d_email_notification {             smtp(                 host("localhost") port(25)                 from("syslog notification" "syslog@localhost")                 reply_to("syslog" "syslog@localhost")                 to("User" "user@email.com")                 subject("[syslog notification]: ssh message")                 body("Syslog received:\n$MSG")                 );         };              log {             source(s_local);             filter(f_ssh);             destination(d_email_notification);         };


title: How to check if DISPLAY is valid

text: I've read man-page X(7) and searched for this but I can't find a solution. How can I check in a long running process if the environment `DISPLAY=:0` is still a valid display? (User could have logged out in the meantime but process is still alive) The icing on the cake would be to check if the DISPLAY is still owned by `<USER>`


title: Read entire file into memory?

text: Is there any way to read entire file into memory in bash, without using external command like `cat`? I know the syntax to get output from a file, i.e `<(/bin/ls)`, but now I need to read the file into entire memory, i.e `$A` would hold the contents (and there could be null, EOF like stuff)


title: Battery Bar in URxvt?

text: I was looking through an ArchLinux thread on URxvt, and I came across a setup at post #184 that I am going crazy looking for. ![enter image description here](http://i.stack.imgur.com/2reNf.png) It looks like there's some kind of battery bar in the PS1, with a bitmap there too. I'm not all that new to Linux, but I can't find anything on how that's done. It's fine if it's only for a specific shell, I would just like to know more about it.


title: Colorizing tail output with sed

text: How would I go about colorizing the output of `tail` with `sed`? `echo "`tput setaf 1`foo`tput op`"` works as expected `echo "foo" | sed -e 's/(foo)/`tput setaf 1`\0`tput op`/g'` however, does not. What am I missing here?


title: Process last line first using awk

text: I have a data file that I want to normalize using `awk`, based on the last datapoint. Therefor, I would like to access the last data point first, to normalize the data, then process normally. The following method, using `tac` twice, does the job, but, is maybe more complicated than necessary.               $ cat file     0 5     1 2     2 3     3 4     $ tac file | awk 'NR==1{norm=$2} {print $1, $2/norm}' | tac     0 1.25     1 0.5     2 0.75     3 1      My question is the following: Is it possible to obtain the above result by using awk only? I think the answer is "No, awk scans the file line by line", but I am open for suggestions for alternatives.


title: Restrict particular applications from accessing certain files

text: Normally the private files stored in the home directory of a user can be accessed by applications running with the effective UID of the user. How can I restrict a particular application from accessing certain private files, while still allowing the files to be accessed by other applications using AppArmor on openSUSE.


title: How to interpret and react to Shorewall log?

text: I see the following pattern in every 2-3 sec, for several minutes in syslog:               Shorewall:net2fw:DROP:IN=eth0 OUT= MAC=aa:bb:cc:dd:ee:ff:gg:hh:ii:jj:kk:ll:mm:nn SRC=12.34.56.78 DST=98.76.54.32 LEN=60 TOS=0x00 PREC=0x00 TTL=41 ID=12746 DF PROTO=TCP SPT=41611 DPT=22 WINDOW=5840 RES=0x00 SYN URGP=0      where values at ID and SPT are different in each line.The server is Debian 6.0, with shorewall and fail2ban. How can I narrow down what is going on and use fail2ban and shorewall to better block this?


title: Where to find printf formatting reference?

text: Where is the _offline reference_ of the format specifiers (e.g., `%i`, `%s`) which are supported by the Bash/system `printf` command? I've looked in `help printf`, `man 1 printf` and `man 3 printf` without luck. `man 1 printf` mentions says it supports > %% a single % > > %b ARGUMENT as a string with `\' escapes interpreted, except that octal > escapes are of the form \0 or \0NNN > > and all C format specifications ending with one of diouxXfeEgGcs, with > ARGUMENTs converted to proper type first. Variable widths are handled. The character list is useful, but doesn't explain the exact semantics of each format specification.


title: Unable to log in to Ubuntu server 10.04 after trying to join Windows domain

text: I was trying to join our Ubuntu 10.04 server to the Windows domain and I ended up editing the `pam.d` configuration files. My aim was to have domain users log into the Ubuntu server with their domain accounts in order to access some applications instead of creating new Unix users each time. My system admin says the join was successful to the domain. Now I have no way of logging into the sever. Is there a way I can undo everything and get the server back to the original login using the local account? I will also appreciate if someone pointed me to some configuration that actually worked - I am still willing to try and make it work.


title: tc class rate 50Kbps != 50K/s in wget?

text: Got the following test rule setup:               tc qdisc add dev wlan0 root handle 1: htb     tc class add dev wlan0 parent 1: classid 1:1 htb rate 1000Mbps     tc class add dev wlan0 parent 1:1 classid 1:5 htb rate 50Kbps ceil 50Kbps burst 1kbit cburst 1kbit     tc qdisc add dev wlan0 parent 1:5 handle 5:0 sfq perturb 5     tc filter add dev wlan0 parent 1:0 protocol ip u32 match ip dport 80 0xffff classid 1:5     tc filter add dev wlan0 parent 1:0 protocol ip u32 match ip sport 80 0xffff classid 1:5      (I've tried this with iptables --set-mark as well but without any real luck so i defaulted back to plain "simple" tc rules.) This example _works_ in the sense that, **it does mark my :80 packages** and throttles them **but not to 50Kbps**...   * `wget` says:              0% [ ] 4,142,336    490K/s        * `tc -s class show dev wlan0` says:              root@bt:~/Desktop/tk_net# tc -s class show dev wlan0     class htb 1:5 parent 1:1 leaf 5: prio 0 rate 400000bit ceil 400000bit burst 128b cburst 128b       Sent 7234 bytes 113 pkt (dropped 0, overlimits 0 requeues 0)       rate 3584bit 7pps backlog 0b 0p requeues 0       lended: 113 borrowed: 0 giants: 0      tokens: 17500 ctokens: 17500          class htb 1:1 root rate 8000Mbit ceil 8000Mbit burst 0b cburst 0b       Sent 7234 bytes 113 pkt (dropped 0, overlimits 0 requeues 0)       rate 3584bit 7pps backlog 0b 0p requeues 0       lended: 0 borrowed: 0 giants: 0      tokens: 15 ctokens: 15        * Changing:              classid 1:5 htb rate 50Kbps ceil 50Kbps      to              classid 1:5 htb rate 1Kbps ceil 1Kbps      generates ~ 34.7K/s in wget   * and `tc` says:              root@bt:~/Desktop/tk_net# tc -s class show dev wlan0     class htb 1:5 parent 1:1 leaf 5: prio 0 rate 8000bit ceil 8000bit burst 127b cburst 127b       Sent 44799 bytes 644 pkt (dropped 112, overlimits 0 requeues 0)       rate 2544bit 4pps backlog 0b 0p requeues 0       lended: 641 borrowed: 0 giants: 0      tokens: 1124984 ctokens: 1124984          class htb 1:1 root rate 8000Mbit ceil 8000Mbit burst 0b cburst 0b       Sent 44601 bytes 641 pkt (dropped 0, overlimits 0 requeues 0)       rate 4208bit 7pps backlog 0b 0p requeues 0       lended: 0 borrowed: 0 giants: 0      tokens: 15 ctokens: 15      I followed these instructions:   * http://lartc.org/howto/lartc.cookbook.fullnat.intro.html   * http://luxik.cdi.cz/~devik/qos/htb/manual/userg.htm   * http://www.adeptus-mechanicus.com/codex/tshape/tshape.html   * http://www.rlogix.com/node/16 What am I doing wrong trying to limit in/outbound :80 traffic?


title: How to schedule something run once using anacron?

text: Frequently within my scripts I schedule auxiliary tasks for later in the form:               at now + 8 hours <<< "rm -f workfile.$$ >> $worklog 2>&1 "      or               at 11pm + $(date +%M) minutes <<< "./postMarketJob.sh $orderID &> $orderID.log"      Trouble is, sometimes the laptops or PCs I use as servers are off when the scheduled time comes, so the **at job** never happens. Same issue is true of **crontab** entries. I'm trying to make sense of anacron's man page for Ubuntu. Is there a tool to schedule a job such that it will run when requested, or at the earliest possibility whenever the server is back online? It doesn't have to be with `anacron`, and if it's something only _root_ can use, then I'll just wrap my invocations with `sudo` CLARIFICATION The tasks are not some fixed scripts (if at all) but very variable, and are conditional, meaning that depending on the unforeseen state of things within programs, they may or must not be scheduled in the first place. It sounds like I might have to develop my own wrapper on top of atd/anacron that gives my programs a similar interface to `at`, but I was hoping something already exists. Been checking if `fcron` fits the bill and if available for Ubuntu in some repo.


title: Bind unprivileged application to privileged port on Mac OS X

text: I'd like to create launchd.plist file for an httpd server. Problem is - when the httpd is run as privileged user it daemonizes, which is not allowed by launchd.plist manual page. If I don't run it as superuser - it cannot bind to privileged port (which is not necessary, but nice to have). Question - what are my options for binding unprivileged daemon to a privileged port? I do know that Linux has privbind project. Is there a solution that can be used together with Mac OS X's launchd? Can/Should I use privbind and hack it together with launchd.plist format?


title: How to update boost of OpenSuse 11.4 to boost version 1.46?

text: I have 64 bit OpenSuse 11.4 and has boost 1.44. I'm trying to update boost to version 1.46 through 1-Click install of OpenSuse's site. However I'm getting a lot of errors about it's repositories being invalid. So I tried the manual package by downloading its rpm, however, installing it requires so many dependencies that I need to download as well. I also tried zypper, here's my repo list:               # | Alias                               | Name                                | Enabled     | Refresh | URI                                                                                --+-------------------------------------+-------------------------------------+---------+---------+----------------------------------------------------------------------------------------------------     1 | Updates-for-openSUSE-11.4-11.4-0    | Updates for openSUSE 11.4 11.4-0    | Yes      | Yes     | http://download.opensuse.org/update/11.4/                                                               2 | devel:gcc:gcc46                     | devel:gcc:gcc46                     | Yes     | Yes     | http://download.opensuse.org/repositories/devel:/gcc/openSUSE_11.4/                                     3 | devel:libraries:c_c++               | devel:libraries:c_c++               | Yes     | Yes     |  http://download.opensuse.org/repositories/devel:/libraries:/c_c++/devel_gcc_gcc46_openSUSE_ Factory/     4 | http-download.opensuse.org-5ae5abcf | http-download.opensuse.org-5ae5abcf | Yes     | Yes     | http://download.opensuse.org/repositories/devel:/gcc/openSUSE_11.4/                                     5 | repo-debug                          | openSUSE-11.4-Debug                 | No      | Yes     | http://download.opensuse.org/debug/distribution/11.4/repo/oss/                                          6 | repo-debug-update                   | openSUSE-11.4-Update-Debug          | No      | Yes     | http://download.opensuse.org/debug/update/11.4/                                                         7 | repo-non-oss                        | openSUSE-11.4-Non-Oss               | Yes     | Yes     | http://download.opensuse.org/distribution/11.4/repo/non-oss/                                            8 | repo-oss                            | openSUSE-11.4-Oss                   | Yes     | Yes     | http://download.opensuse.org/distribution/11.4/repo/oss/                                                9 | repo-source                         | openSUSE-11.4-Source                | No      | Yes     | http://download.opensuse.org/source/distribution/11.4/repo/oss/                                          When I do zypper update, here's what I'm getting:               Loading repository data...     Reading installed packages...          The following package updates will NOT be installed:     aalib aspell aspell-en augeas-lenses binutils binutils-devel binutils-gold boost-devel   boost-devel-32bit boost-jam cpp45 curl db-utils elfutils expat gcc45 gcc45-32bit gcc45-c++  gcc45-info gd gdb gdbm gdbm-32bit gdbm-devel        giflib gmp-devel hunspell hunspell-tools ispell ispell-american libadns1 libaio  libaio-devel libasm1 libaugeas0 libblocxx6 libcloog0 libcurl4 libcurl4-32bit libdaemon0  libdb-4_5 libdb-4_5-devel libdb-4_8 libdb-4_8-32bit        libdnet1 libdw1 libelf0 libelf1 libexpat1 libexpat1-32bit libexpat-devel libffi45 libgcc45 libgcc45-32bit libgcj45 libgcj45-devel libgcj45-jar libgcj_bc45 libgcrypt11 libgfortran45 libgle3 libgmp10 libgmpxx4 libgomp45        libgomp45-32bit libical0 libidn libidn-32bit libieee1284 libilmbase6 libIlmImf6 libiodbc3 libloudmouth-1-0 libmp3 libmpc2 libmpfr4 libmtp8 libneon27 libppl9 libppl_c4 libpth20 libredland0 libslang2 libssh2-1        libssh2-1-32bit libssh4 libstdc++45 libstdc++45-32bit libstdc++45-devel libstdc++45-devel-32bit liburiparser1 libv4l libv4l1-0 libv4l2-0 libv4lconvert0 LibVNCServer libwmf libxslt pkg-config t1lib zziplib           Nothing to do.      Isn't there an easier way to update all of boost and its dependencies?


title: RHEL Time Changes Automatically

text: I Have a RHEL 6.1 server and it's date/time changes automatically even after I change the time settings. Could someone point out how to fix this issue? Note** I suspect this happens when rhn updates are carried out. But I don't know where to set time zones for rhn. Thanks,   Shamal


title: Create a volume group from a logical volume instead of a physical volume

text: Is it possible to create a volume group from a logical volume instead of a physical volume? If so, are there any pitfalls in doing so? Use case: Installing OpenStack Compute on a a system that already has all of the physical volumes assigned to a singe volume group. The nova-volume service requires a separate volume group, as described in the documentation. I want to know if I can carve off a logical volume and then create the "nova-volumes" volume group.


title: Why is rm slow?

text: I have been trying to use rsnapshot for making backups, but I'm finding it unusable. While it is able to diff a directory (50gb) and duplicate it (hardlinking every file) in a few minutes, and I can cp the whole directory in about half an hour, it takes well over an hour to delete it. Even directly using `rm -rfv`, I find it can take up to half a second to rm a single file, whereas the `cp` and `link` commands complete instantly. Why is rm so slow? Is there any faster way to recursively remove hardlinks? It doesn't make sense to me that copying a file should take less time than removing it. The filesystem I am working on is an external storage drive, connected via usb and type fuseblk (which I think means it's ntfs). My computer is running ubuntu linux. Output from top:               Cpu(s):  3.0%us,  1.5%sy,  0.0%ni, 54.8%id, 40.6%wa,  0.0%hi,  0.1%si,  0.0%st     Mem:   8063700k total,  3602416k used,  4461284k free,   557604k buffers


title: Backlight control manjaro linux

text: I'm new to arch/manjaro. I've installed it onto my sony vaio vpceh1m1e. I cannot change the backlight value. I've solved this before on ubuntu, add this line to the `xorg.conf`:               Option "RegistryDwords" "EnableBrightnessControl=1"      Somehow it doesn't work on manjaro.


title: PAM - required and sufficient control flag

text: I'm studying PAM, and I'm a bit clueless about the meaning of some combination of control flags. From the Red Hat documentation we have:               *required          failure of such a PAM will ultimately lead to the PAM-API returning failure     but only after the remaining stacked modules (for this service and type)     have been invoked               *requisite          like required, however, in the case that such a module returns a failure,     control is directly returned to the application.                *sufficient          success of such a module is enough to satisfy the authentication     requirements of the stack of modules (if a prior required module has failed     the success of this one is ignored). A failure of this module is not deemed     as fatal to satisfying the application that this type has succeeded. If the     module succeeds the PAM framework returns success to the application     immediately without trying any other modules.      So, in my understanding, if a module `requisite` fails, the entire stack of modules will not be parsed, and the control will be back to the application immediately. If a module `sufficient` succeeds, the rest of modules stack will not be parsed and the control will be back to the application immediately. If a module `required` fails, the entire stack will be parsed. Now, I cannot understand what will be the behavior when a certain module `required` fails and another module `sufficient` succeeds.


title: How do you implement layout with the autostarting of applications in the i3 window manager?

text: This is a follow-up on a prior question on how to autostart applications on individual workspaces with the i3 window manager and what can and can't be done inside the `~/.i3/config` configuration file. First, the provided solution based on _Arch_ Linux documentation and an update provided by op where he pushes the logic further:               exec --no-startup-id i3-msg 'workspace 1:Web; exec /usr/bin/firefox'     exec --no-startup-id i3-msg 'workspace 1; exec firefox; workspace 2; exec urxvt; workspace 1'      Also of interest is this exchange about leveraging some of that directly on the command line without duplicating:               i3-msg workspace 3; i3-msg exec firefox     i3-msg workspace 9; i3-msg exec chromium      But I have _never_ seen a configuration which autostarts many windows/apps in each workspace according to a desired vertical or horizontal layout. My goal is to autostart this simple configuration I use:                _____ _____     ___________     ___________     | lx  | lx  |   |        |u_|   |     |     |   proportions:     |_____|_____|   |  FF    |lx|   |spacefm    |   1- 25% each     |medit| lx  |   |        |__|   |     | vlc |   2- 75/25 x 25/50/25     |_____|_____|   |________|u_|   |_____|_____|   3- 50/50           1               2               3      So it starts with something like this in the `config` file:               exec --no-startup-id i3-msg 'workspace 1; exec i3-sensible-terminal; layout toggle split; layout splitv; split vertical; exec i3-sensible-terminal; exec i3-sensible-terminal; exec i3-sensible-terminal; workspace 2; exec firefox; exec urxvt; exec i3-sensible-terminal; exec urxvt; workspace 3; exec spacefm; exec vlc'      But how in the world do you achieve the type of layout and vert/horizontal splitting you want? I'm trying, but it's not clear how you "mix" execution and layout. The syntax feels idiosyncratic to start because you're executing `i3-img` within i3's configuration. Do you use `split h` (or v) - `layout split v` - `exec layout split v` - `focus down`(or right) in between each `exec` call?? For a single workspace, the configuration starts all applications either vertically or horizontally and I can't seem to influence layout - or the last `split` command in the chain decides whether the windows are added vertically or horizontally. `i3-msg` seemingly ignores parts of the command that aren't properly formatted in some cases so it's hard to debug. This is further compounded by the fact that you really need to quit X and `startx` again every time to verify the results as just refreshing the configuration with `mod+shift+R` won't cut it even if you close everything on each of the workspaces. What is the proper way of configuring this? Does anyone have a solution which implements something like that? The documentation is pretty good but it doesn't provide that I can see a detailed example which mixes execution and layout on multiple workspaces.


title: How to start aufs for two local directories

text: I'm trying to create a sandbox for testing an untrusted software. I'm using Debian, I have installed `aufs-tools`. When I try to mount a minimal example with the following command:               mount -t aufs -o dirs=./write=rw:/=ro none ./mount      I'm getting:               mount: wrong fs type, bad option, bad superblock on none,            missing codepage or helper program, or other error            (for several filesystems (e.g. nfs, cifs) you might            need a /sbin/mount.<type> helper program)            In some cases useful info is found in syslog - try            dmesg | tail  or so      Using `br:` instead of `dirs=` gives the same.


title: Running Cinnamon/X from command line ---> No sound, software rendering

text: I am booting directly into the terminal of Linux Mint 17. Now I would like from there to start cinnamon gui. I do that with "startx". However, by doing that I do not have any sound (just "Dummy Output" in output devices) and I get the message telling me that Cinnamon is running in "Software Rendering mode". Now, if I directly boot into the GUI, then everything works fine. Also if I run "sudo startx" it works fine, but then I'm logged in as root. EDIT: Here are the outputs for `lsmod` and `service --status-all`: Directly booting into Cinnamon GUI: http://pastebin.com/qWRNVJ6c Booting to terminal, then `startx`: http://pastebin.com/BuBDHin3 I am booting into the terminal by adding `text` into the `grub.cfg`, see this excerpt of /boot/grub/grub.cfg:               menuentry 'Linux Mint 17 Cinnamon 64-bit, 3.13.0-24-generic (/dev/sda3)' --class ubuntu --class gnu-linux --class gnu --class os {         recordfail         gfxmode $linux_gfx_mode         insmod gzio         insmod part_msdos         insmod ext2         set root='hd0,msdos3'         if [ x$feature_platform_search_hint = xy ]; then           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  20503a34-3ca8-45dc-9c02-d397c327c85d         else           search --no-floppy --fs-uuid --set=root 20503a34-3ca8-45dc-9c02-d397c327c85d         fi         linux   /boot/vmlinuz-3.13.0-24-generic root=UUID=20503a34-3ca8-45dc-9c02-d397c327c85d ro quiet text         initrd  /boot/initrd.img-3.13.0-24-generic     }      The only thing I changed here is adding `quiet text` instead of `quiet splash` as it was generated from the Mint installation.


title: what's the difference between "java" located inside jdk/bin/ and jdk/jre/bin

text: After downloading the Oracle JDK and unzipping it, I can see that there exists two "java" executables in two different directories. Which one should be used as primary basis. Or, both are the same in two different locations?