title: xfs_quota Quota always zero

text: I run this command: `xfs_quota -x -c 'report -h' /eamorr/home` Here is the output               User quota on /eamorr/home (/dev/mapper/mpathe)                             Blocks                   User ID      Used   Soft   Hard Warn/Grace        ---------- ---------------------------------      root          48K      0      0  00 [------]     user1         20K  97.7G 107.4G  00 [------]     user3         16K  97.7G 107.4G  00 [------]     user4      944.5M 488.3G 488.3G  00 [------]     73827392      16K      0      0  00 [------]     78473948      16K      0      0  00 [------]     user2       37.4G  97.7G 107.4G  00 [------]     user5         16K  97.7G 107.4G  00 [------]          Group quota on /eamorr/home (/dev/mapper/mpathe)                             Blocks                   Group ID     Used   Soft   Hard Warn/Grace        ---------- ---------------------------------      root            0      0      0  00 [------]     staff       38.3G      0      0  00 [------]     student       32K      0      0  00 [------]      user1, user2, user3, etc. are in the "staff" group 73827392 and 78473948 are in the "student" group. I can set a soft/hard quota for any staff member: `xfs_quota -x -c 'limit bsoft=500m bhard=550m user4' /eamorr/home` Works perfectly However, when I do the same for a student member: `xfs_quota -x -c 'limit bsoft=500m bhard=550m 73827392' /eamorr/home` Their quota stays stuck at zero! **What am I doing wrong?** I'm using autofs. Here is /etc/auto               admin           -fstype=xfs     UUID=8bcd7348-a419-4c93-bdbe-47638d129a3e9dfde5fab0f8     software        -fstype=xfs     UUID=59edae56-f3ad-4ea6-ad56-9dfde5fab0f8     home            -fstype=xfs,uquota,gquota       UUID=df943889-273d-d9-aaf5-5e707ecdaf87     scratch         -fstype=xfs     UUID=bac6837c-afa2-431a-a032-5e707ecdaf87      I tried `service autofs reload`. Doesn't work either. Quotas for students still come up as zero. Is it because the username is numerical? I tried `xfs_quota -x -c "limit bsoft=500m bhard=550m '73827392'" /eamorr/home` I got: xfs_quota: invalid user name: '73827392' However when I do: `xfs_quota -x -c "limit bsoft=500m bhard=550m 73827392" /eamorr/home` It looks like it works, however the quota is still reported as "0".


title: How can I generate a DEB from an installed package?

text: I've done this in the past before but I can't remember how. I'd like to take an installed package on one machine, create an installable deb from it, then send that deb over to another machine. How can I generate the deb?


title: Why are rmdir and unlink two separate system calls?

text: Here's something that kept me wondering for a while:               [15:40:50][/tmp]$ mkdir a     [15:40:52][/tmp]$ strace rmdir a     execve("/usr/bin/rmdir", ["rmdir", "a"], [/* 78 vars */]) = 0     brk(0)                                  = 0x11bb000     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff3772c3000     access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)     open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=245801, ...}) = 0     mmap(NULL, 245801, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff377286000     close(3)                                = 0     open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3     read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\36\3428<\0\0\0"..., 832) = 832     fstat(3, {st_mode=S_IFREG|0755, st_size=2100672, ...}) = 0     mmap(0x3c38e00000, 3924576, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3c38e00000     mprotect(0x3c38fb4000, 2097152, PROT_NONE) = 0     mmap(0x3c391b4000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b4000) = 0x3c391b4000     mmap(0x3c391ba000, 16992, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3c391ba000     close(3)                                = 0     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff377285000     mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff377283000     arch_prctl(ARCH_SET_FS, 0x7ff377283740) = 0     mprotect(0x609000, 4096, PROT_READ)     = 0     mprotect(0x3c391b4000, 16384, PROT_READ) = 0     mprotect(0x3c38c1f000, 4096, PROT_READ) = 0     munmap(0x7ff377286000, 245801)          = 0     brk(0)                                  = 0x11bb000     brk(0x11dc000)                          = 0x11dc000     brk(0)                                  = 0x11dc000     open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=106070960, ...}) = 0     mmap(NULL, 106070960, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff370d5a000     close(3)                                = 0     rmdir("a")                              = 0     close(1)                                = 0     close(2)                                = 0     exit_group(0)                           = ?     +++ exited with 0 +++     [15:40:55][/tmp]$ touch a     [15:41:16][/tmp]$ strace rm a     execve("/usr/bin/rm", ["rm", "a"], [/* 78 vars */]) = 0     brk(0)                                  = 0xfa8000     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3b2388a000     access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)     open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=245801, ...}) = 0     mmap(NULL, 245801, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f3b2384d000     close(3)                                = 0     open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3     read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\36\3428<\0\0\0"..., 832) = 832     fstat(3, {st_mode=S_IFREG|0755, st_size=2100672, ...}) = 0     mmap(0x3c38e00000, 3924576, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3c38e00000     mprotect(0x3c38fb4000, 2097152, PROT_NONE) = 0     mmap(0x3c391b4000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b4000) = 0x3c391b4000     mmap(0x3c391ba000, 16992, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3c391ba000     close(3)                                = 0     mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3b2384c000     mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3b2384a000     arch_prctl(ARCH_SET_FS, 0x7f3b2384a740) = 0     mprotect(0x60d000, 4096, PROT_READ)     = 0     mprotect(0x3c391b4000, 16384, PROT_READ) = 0     mprotect(0x3c38c1f000, 4096, PROT_READ) = 0     munmap(0x7f3b2384d000, 245801)          = 0     brk(0)                                  = 0xfa8000     brk(0xfc9000)                           = 0xfc9000     brk(0)                                  = 0xfc9000     open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3     fstat(3, {st_mode=S_IFREG|0644, st_size=106070960, ...}) = 0     mmap(NULL, 106070960, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f3b1d321000     close(3)                                = 0     ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0     newfstatat(AT_FDCWD, "a", {st_mode=S_IFREG|0664, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0     geteuid()                               = 1000     newfstatat(AT_FDCWD, "a", {st_mode=S_IFREG|0664, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0     faccessat(AT_FDCWD, "a", W_OK)          = 0     unlinkat(AT_FDCWD, "a", 0)              = 0     lseek(0, 0, SEEK_CUR)                   = -1 ESPIPE (Illegal seek)     close(0)                                = 0     close(1)                                = 0     close(2)                                = 0     exit_group(0)                           = ?     +++ exited with 0 +++      Why are there separate system calls for removing a directory and files? Why would these two operations be semantically distinct?


title: Debian disables IRQs

text: It's been two days that my Debian Wheezy 7 randomly disables IRQs apparently with no reason. After the IRQs are disables, I'm unable to mount hard disks and I have to reboot. This is the output of syslog:               Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438414] irq 18: nobody cared (try booting with the "irqpoll" option)     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438419] Pid: 0, comm: swapper/0 Tainted: G           O 3.2.0-4-amd64 #1 Debian 3.2.57-3+deb7u2     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438421] Call Trace:     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438422]  <IRQ>  [<ffffffff81092bad>] ? __report_bad_irq+0x2c/0xb5     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438429]  [<ffffffff81092f6a>] ? note_interrupt+0x170/0x1f2     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438431]  [<ffffffff8109132c>] ? handle_irq_event_percpu+0x15f/0x17d     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438432]  [<ffffffff8109137e>] ? handle_irq_event+0x34/0x52     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438435]  [<ffffffff8106c189>] ? arch_local_irq_save+0x11/0x17     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438437]  [<ffffffff810936e1>] ? handle_fasteoi_irq+0x7c/0xaf     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438440]  [<ffffffff8100f9e1>] ? handle_irq+0x1d/0x21     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438442]  [<ffffffff8100f5ba>] ? do_IRQ+0x42/0x98     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438445]  [<ffffffff8134feee>] ? common_interrupt+0x6e/0x6e     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438446]  <EOI>  [<ffffffff811b0d34>] ? timerqueue_add+0x80/0xa0     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438450]  [<ffffffff811eec0d>] ? intel_idle+0xea/0x119     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438452]  [<ffffffff811eebec>] ? intel_idle+0xc9/0x119     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438455]  [<ffffffff81270851>] ? cpuidle_idle_call+0xec/0x179     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438457]  [<ffffffff8100d242>] ? cpu_idle+0xa5/0xf2     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438460]  [<ffffffff816abb36>] ? start_kernel+0x3b8/0x3c3     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438462]  [<ffffffff816ab140>] ? early_idt_handlers+0x140/0x140     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438463]  [<ffffffff816ab3c4>] ? x86_64_start_kernel+0x104/0x111     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438464] handlers:     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438487] [<ffffffffa00f5cfd>] ata_bmdma_interrupt     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438490] [<ffffffffa0051b0b>] sil24_interrupt     Jul 15 01:56:23 GC01SRVR kernel: [ 5358.438492] Disabling IRQ #18      What could be the source of the problem? What's the path to follow to solve it?


title: Is there a difference between setting an environment variable to the empty string and unsetting it?

text: Is there any practical difference between unsetting an environment variable and setting it to the empty string?


title: Pull a file from a Docker container?

text: I can see that it's possible to insert a file into a Docker container via `insert`:               docker insert IMAGE URL PATH      Is there a way to fetch the contents of a file in a Docker container and save them somewhere on the host operating system? I'd like to extract the value of a configuration file and store it on my host operating system.


title: Adding MySql Workbench to favorites in Fedora 19

text: I'm using Fedora 19 64 bit on my Samsung Series 9 Ultrabook and I have installed MySQL workbench 6 (mysql-workbench-community-6.0.7-1.fc18.x86_64) via the RPM downloaded from the MySQL website. I'm unable to pin this application to favorites. I have tried creating the `mysql-workbench.desktop` at `/usr/share/applications/` and copied the `mysql- workbench.png` icon into `/usr/share/pixmaps/` file as follows:               [Desktop Entry]     Name=MySQL Workbench     Comment=MySQL Database Design, Administration and Development Tool     Exec=mysql-workbench     Terminal=false     Type=Application     Icon=mysql-workbench     MimeType=application/vnd.mysql-workbench-model;     Categories=GTK;Database;Development;      Any pointers would be appreciated.


title: Samba 2.2.12 accepts my password, but is rejecting other user accounts?

text: I'm using a legacy system and I'm stuck with FreeBSD 5.4 and Samba 2.2.12, trying to access it from a Windows 7 system. I've created a unix account in FreeBSD using the `adduser` command and added myself to a group that allows read write access to a shared location. I then created a Samba account for myself using the `smbpasswd -a <user>` command. When I map a network drive to this account under Win 7, I check the "Connect using different credentials" option in the Map Network Drive dialog and provide the Samba username and password to the password challenge. The system accepts it and maps the drive to my account. When I follow the above procedure to create another user however, every time I provide the account name and password, it rejects the credentials and comes back with another password challenge dialog and won't map to the drive. I've run through the procedure several times and I'm pretty sure that the username and password are correct. I'm not sure why it is doing this and I was wondering if somehow my Windows 7 login is influencing my Samba account. It is a bit odd if it does, because besides my full name being associated with the accounts, the unix/samba account has a different username from my Windows account. The content of smb.conf is detailed below, with some changes here and there to retain anonymity.               # This is the main Samba configuration file. You should read the     # smb.conf(5) manual page in order to understand the options listed     # here. Samba has a huge number of configurable options (perhaps too     # many!) most of which are not shown in this example     #     # Any line which starts with a ; (semi-colon) or a # (hash)      # is a comment and is ignored. In this example we will use a #     # for commentry and a ; for parts of the config file that you     # may wish to enable     #     # NOTE: Whenever you modify this file you should run the command "testparm"     # to check that you have not many any basic syntactic errors.      #     #======================= Global Settings =====================================     [global]          # workgroup = NT-Domain-Name or Workgroup-Name, eg: REDHAT4        workgroup = EAGLE          # server string is the equivalent of the NT Description field        server string = EAGLE systems          # This option is important for security. It allows you to restrict     # connections to machines which are on your local network. The     # following example restricts access to two C class networks and     # the "loopback" interface. For more examples of the syntax see     # the smb.conf man page     ;   hosts allow = 192.168.1. 192.168.2. 127.          # If you want to automatically load your printer list rather     # than setting them up individually then you'll need this        load printers = no          # you may wish to override the location of the printcap file     ;   printcap name = /etc/printcap          # on SystemV system setting printcap name to lpstat should allow     # you to automatically obtain a printer list from the SystemV spool     # system     ;   printcap name = lpstat          # It should not be necessary to specify the print system type unless     # it is non-standard. Currently supported print systems include:     # bsd, sysv, plp, lprng, aix, hpux, qnx     ;   printing = bsd          # Uncomment this if you want a guest account, you must add this to /etc/passwd     # otherwise the user "nobody" is used     ;  guest account = pcguest          # this tells Samba to use a separate log file for each machine     # that connects        log file = /var/log/log.%m          # Put a capping on the size of the log files (in Kb).        max log size = 50          # Security mode. Most people will want user level security. See     # security_level.txt for details.        security = user          # Use password server option only with security = server     # The argument list may include:     #   password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]     # or to auto-locate the domain controller/s     #   password server = *     ;   password server = <NT-Server-Name>          # Note: Do NOT use the now deprecated option of "domain controller"     # This option is no longer implemented.          # You may wish to use password encryption. Please read     # ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.     # Do not enable this option unless you have read those documents       encrypt passwords = yes          # Using the following line enables you to customise your configuration     # on a per machine basis. The %m gets replaced with the netbios name     # of the machine that is connecting     ;   include = /usr/local/etc/smb.conf.%m          # Most people will find that this option gives better performance.     # See speed.txt and the manual pages for details     # You may want to add the following on a Linux system:     #         SO_RCVBUF=8192 SO_SNDBUF=8192        socket options = TCP_NODELAY           # Configure Samba to use multiple interfaces     # If you have multiple network interfaces then you must list them     # here. See the man page for details.     ;   interfaces = 192.168.12.2/24 192.168.13.2/24         interfaces = 180.207.29.26/24          # Browser Control Options:     # set local master to no if you don't want Samba to become a master     # browser on your network. Otherwise the normal election rules apply        local master = no          # OS Level determines the precedence of this server in master browser     # elections. The default value should be reasonable     ;   os level = 33          # Domain Master specifies Samba to be the Domain Master Browser. This     # allows Samba to collate browse lists between subnets. Don't use this     # if you already have a Windows NT domain controller doing this job        domain master = no          # Preferred Master causes Samba to force a local browser election on startup     # and gives it a slightly higher chance of winning the election        preferred master = no          # Enable this if you want Samba to be a domain logon server for      # Windows95 workstations.         domain logons = no          # if you enable domain logons then you may want a per-machine or     # per user logon script     # run a specific logon batch file per workstation (machine)     ;   logon script = %m.bat     # run a specific logon batch file per username     ;   logon script = %U.bat          # Where to store roving profiles (only for Win95 and WinNT)     #        %L substitutes for this servers netbios name, %U is username     #        You must uncomment the [Profiles] share below     ;   logon path = \\%L\Profiles\%U          # Windows Internet Name Serving Support Section:     # WINS Support - Tells the NMBD component of Samba to enable it's WINS Server     ;   wins support = yes          # WINS Server - Tells the NMBD components of Samba to be a WINS Client     #   Note: Samba can be either a WINS Server, or a WINS Client, but NOT both     ;   wins server = w.x.y.z          # WINS Proxy - Tells Samba to answer name resolution queries on     # behalf of a non WINS capable client, for this to work there must be     # at least one  WINS Server on the network. The default is NO.        wins proxy = no          # DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names     # via DNS nslookups. The built-in default for versions 1.9.17 is yes,     # this has been changed in version 1.9.18 to no.        dns proxy = no           # Client codepage settings          # for Greek users     ; client code page=737          # for European users (Latin 1)     ; client code page=850          # for European users (Latin 2)     ; client code page=852          # for Icelandic users     ; client code page=861          # for Cyrillic users     ; client code page=866          # for Japanese Users     ; client code page=932     ; coding system=cap          # for Simplified Chinese Users     ; client code page=936     ; coding system=cap          # for Korean Users     ; client code page=949     ; coding system=cap          # for Traditional Chinese Users     ; client code page=950     ; coding system=cap          #============================ Share Definitions ==============================     [homes]        comment = Home Directories        browseable = no        writeable = yes     # Un-comment the following two lines to add a recycle bin facility to a samba share     # NOTE: It currently doesn't work with the [homes] virtual share, use a regular share instead     ;  vfs object = /usr/local/lib/samba/recycle.so     ;  vfs options= /usr/local/etc/recycle.conf.default          # Un-comment the following and create the netlogon directory for Domain Logons     ; [netlogon]     ;   comment = Network Logon Service     ;   path = /usr/local/samba/lib/netlogon     ;   guest ok = yes     ;   writeable = no     ;   share modes = no               # Un-comment the following to provide a specific roving profile share     # the default is to use the user's home directory     ;[Profiles]     ;    path = /usr/local/samba/profiles     ;    browseable = no     ;    guest ok = yes               # NOTE: If you have a BSD-style print system there is no need to      # specifically define each individual printer     ;[printers]     ;   comment = All Printers     ;   path = /var/spool/samba     ;   browseable = no     ;# Set public = yes to allow user 'guest account' to print     ;   guest ok = no     ;   writeable = no     ;   printable = yes          # This one is useful for people to share files     ;[tmp]     ;   comment = Temporary file space     ;   path = /tmp     ;   read only = no     ;   public = yes          # A publicly accessible directory, but read only, except for people in     # the "Bird" group.     # New files/directories put in group Bird, and group write permission added.     [BIRD_disk]        comment = The nesting place.        path = /BIRD_disk        browseable = yes        public = no        writeable = yes        printable = no        write list = @Bird        force group = +Bird        force create mode = 0775        force directory mode = 0775          # Other examples.      #     # A private printer, usable only by fred. Spool data will be placed in fred's     # home directory. Note that fred must have write access to the spool directory,     # wherever it is.     ;[fredsprn]     ;   comment = Fred's Printer     ;   valid users = fred     ;   path = /homes/fred     ;   printer = freds_printer     ;   public = no     ;   writeable = no     ;   printable = yes          # A private directory, usable only by fred. Note that fred requires write     # access to the directory.     ;[fredsdir]     ;   comment = Fred's Service     ;   path = /usr/somewhere/private     ;   valid users = fred     ;   public = no     ;   writeable = yes     ;   printable = no          # a service which has a different directory for each machine that connects     # this allows you to tailor configurations to incoming machines. You could     # also use the %U option to tailor it by user name.     # The %m gets replaced with the machine name that is connecting.     ;[pchome]     ;  comment = PC Directories     ;  path = /usr/pc/%m     ;  public = no     ;  writeable = yes          # A publicly accessible directory, read/write to all users. Note that all files     # created in the directory by users will be owned by the default user, so     # any user with access can delete any other user's files. Obviously this     # directory must be writeable by the default user. Another user could of course     # be specified, in which case all files would be owned by that user instead.     ;[public]     ;   path = /usr/somewhere/else/public     ;   public = yes     ;   only guest = yes     ;   writeable = yes     ;   printable = no     # Un-comment the following two lines to add a recycle bin facility to a samba share     ;  vfs object = /usr/local/lib/samba/recycle.so     ;  vfs options= /usr/local/etc/recycle.conf.default          # The following two entries demonstrate how to share a directory so that two     # users can place files there that will be owned by the specific users. In this     # setup, the directory should be writeable by both users and should have the     # sticky bit set on it to prevent abuse. Obviously this could be extended to     # as many users as required.     ;[myshare]     ;   comment = Mary's and Fred's stuff     ;   path = /usr/somewhere/shared     ;   valid users = mary fred     ;   public = no     ;   writeable = yes     ;   printable = no     ;   create mask = 0765


title: How to configure DNS on Fedora 16?

text: I use Fedora 16 and I'm trying to configure the DNS but it is not working. I followed this tutorial: http://www.server-world.info/en/note?os=Fedora_16&p=dns&f=1 My IP is 172.31.50.86, I want to named domain as ccxte.com Can someone show me a config of named.conf file and another file?


title: Scripting VMware configuration: can I use PowerCLI?

text: I have an automated task to start, it involves various commands in PowerCLI. like               Allocate Space      New-Datastore Parameter(1)     Browse Datastore        Get-Datastore Parameter(1)           Remove file     Remove-Item  Parameter(1)        Cancel task     Stop-Task -Task Parameter(1)     Create virtual machine  New-VM -Name %Parameter(1) -Host Parameter(2)      Delete virtual machine  Remove-VM %Parameter -DeletePermanently           Reconfigure virtual machine Set-VM -VM %Parameter(1) -Name Parameter(2)     Assign network      Set-VMGuestNetworkInterface -VMGuestNetworkInterface %  Parameter   (1) -HostUser Admin -HostPassword Pass01 -GuestUser User -GuestPassword Pass02 -Netmask 255.255.255.255 -Gateway 10.23.112.58     and so on...........     ...........      but the above commands are relevant to configuring VMware in windows environment. I did a lot of searching in Google but could not find a no-GUI (or command line or scripting) way of performing these actions and I don't think it can be done just using shell commands. Is there any standard way of doing these things in Unix environments using command line or scripting? Or can I install PowerCLI in Linux and execute the same set of commands? Do I have to download any tool or there is already some standard tool/command- line that comes with VMWare to do these type of actions in a Unix environment like for VirtualBox?


title: using tops command to update NSLog statements in cocoa code

text: In my objective-c code base I have several NSLog statements. eg.               NSLog(@"Here is the message without arguments");     NSLog(@"Here is the message with arguments: %s, %s","argument1","argument2");      Now I want to do two things: First to do: **updating NSLog statements with NSLocalizedString( <#key#>, <#comment#>)** eg.               NSLog(NSLocalizedString(@"Here is the message without arguments", @""));     NSLog(NSLocalizedString(@"Here is the message with arguments: %s, %s", @""), "argument1", "argument2");       Second to do: **obtaining format strings from NSLog statements and adding it to localizable.strings file** eg.               "Here is the message without arguments" = "Here is the message without arguments";     "Here is the message with arguments: %s, %s" = "Here is the message with arguments: %s, %s";      Is there any way to do so through `tops` command, please suggest. Note: wanted to add tops as one of the tags but since it is not an existing tag and I don't have enough reputation, could not add the one :-(


title: How to place / store a file in memory on linux?

text: I have read somewhere that one can put a file on a linux system into memory, and loading it will be superfast. How do I do this? How do I verify the file is loaded from memory?


title: print message on terminal as well as /var/log/messages using logger

text: I used below options in script to print on terminal as well as /var/log/messages               echo "System Load is OK : $Current_loadadv"     echo "System Load is OK : $Current_loadadv" | logger      but how can i do that in single line ?


title: Kill all process of users in Ubuntu?

text: How to kill all process of one user? When I make `ps aux` I obtain a list of process with several users, and I want to kill all process of user `name1` for example! What's a command to do that in Ubuntu?


title: Cannot add script to init.d

text: I have installed gerrit on a remote ubuntu server. Now I would like it to automatically start when the server reboots. I am trying to follow this: http://gerrit- documentation.googlecode.com/svn/Documentation/2.3/install.html#rc_d which is a two-liner:               sudo ln -snf `pwd`/home/gerrit2/gerrit_application/bin/gerrit.sh /etc/init.d/gerrit.sh     sudo ln -snf ../init.d/gerrit.sh /etc/rc3.d/S90gerrit      I have verified that both files are created. But when I reboot the application its not started. I still have to manually start it with:               root@mm11:/home/gerrit2/gerrit_application/bin# ./gerrit.sh start      How do I debug/fix this? I have also tried with:               sudo ln -snf /home/gerrit2/gerrit_application/bin/gerrit.sh /etc/init.d/gerrit     sudo update-rc.d gerrit defaults      Which gives:               root@mm11:/home/gerrit2# update-rc.d gerrit defaults      Adding system startup for /etc/init.d/gerrit ...        /etc/rc0.d/K20gerrit -> ../init.d/gerrit        /etc/rc1.d/K20gerrit -> ../init.d/gerrit        /etc/rc6.d/K20gerrit -> ../init.d/gerrit        /etc/rc2.d/S20gerrit -> ../init.d/gerrit        /etc/rc3.d/S20gerrit -> ../init.d/gerrit        /etc/rc4.d/S20gerrit -> ../init.d/gerrit        /etc/rc5.d/S20gerrit -> ../init.d/gerrit


title: How do I add network or user source connection data to history entries?

text: I would like to modify the history settings for all users on the systems that I manage. I would like it to contain the information from the connecting terminal like from `who`               sysadmin:/ # who     sysadmin  pts/0        Mar 26 07:11 (sysadmin.doofus.local)      I currently modify my history in the following ways. I know that many of these settings have been covered here several times. However, I pulled this code from " _Linux System Administration Recipes by: Juliet Kemp_ " long ago.               shopt -s histappend     PROMPT_COMMAND='history -n;history -a'     HISTSIZE=100000     HISTFILESIZE=100000     HISTTIMEFORMAT="%m/%d/%y %T  "      `shopt -s histappend` fixes problem when you have multiple terminals open information may be lost. `PROMPT_COMMAND='history -n;history -a'` extends to give real-time appending to history across multiple terminals. `HISTSIZE=100000` `HISTFILESIZE=100000` extends the amount of `history` retention `HISTTIMEFORMAT="%m/%d/%y %T` " prefaces each line of history with a time stamp What you typically get with `history`               835  ls     836  cd ..      My modified current `history` results               5853  03/26/12 07:16:49  ls     5854  03/26/12 07:16:50  ll      The return from `history` I would like to see               5853  03/26/12 07:16:49  sysadmin.doofus.local    ls     5854  03/26/12 07:16:50  sysadmin.doofus.local    ll          001  03/26/12 05:11:29  demo_user.doofus.local    cd     002  03/26/12 05:11:30  demo_user.doofus.local    ll      I am not "married" to seeing the `DNS` name. I would only want it there if it pulls it from `who` or another location without the need to perform a lookup or query of any kind. I would be happy with IP address.               002  03/26/12 05:11:30  192.168.0.2    ll      Why? I manage several systems where a userid that several users of the same group share to do their daily tasks. This would allow me to correlate their real location & actual user within the organization to what they did in in the history. I am aware that this is not optimal and would like to change it but, when you are on a ship the size of the a cruise liner you don't attempt to make hairpin turns. (Note: when you do the passengers try to toss you overboard) Anyway, until I am able to migrate them to a better solution I would like to have this tracking ability. Also, if you have any recommendations over what I am currently using for my `history` modifications I would love to hear it. Thanks, **Edit: 1** I do not want to run other programs or have to configure anything additional "within reason." I want to add `0` overhead, if I do have to add it needs to be small. I do trust my users I just would like (should something happen) to see which of the say 10 users that logged into the system with the same user:password did it. Or, it might not have been a user it could have been a forgotten `cron` on a system that performs a connection as a user to do something. Or an application Ex: `BMC Control-M` that connects over `ssh` and runs tasks. It is not so much about finding "bad users" as being able to track it down with a minimum of effort. **Edit 2:** The systems are running SLES and RHEL


title: Print word that doesn't contain character

text: My file is in the following format:               this!,is!,another!,test,yes!     this!,is!,another!,column,yes!     no,not!,another!,column      My output should be:               test     column     no      It shouldn't contain the '!' character. I've tried multiple sed and (e)grep commands but none of them are quite working.


title: Change default title bar icon

text: How do I set the default title bar icon for X11 applications? The xterm on my machine is displaying an icon with a red x instead of the normal application- default icon. Changing themes in gnome doesn't help either.


title: Killing background process in bash script when exiting the script

text: I have a script that `tail` a file **while displaying a clock in the top right corner**. I took the clock part from the internet, and it works ok. The entire script is something like (I simplified):               while sleep 1; do tput sc; tput cup 0 $(($(tput cols)-29)); date; tput rc; done &     tail -f mylog.log      All works well, but the problem is that **when I stop the script** using `CTRL+C` the clock continues to run in my console (until I manually kill the left-over bash process). So, _is there a way to stop that process when I quit the script?_ I tried the code below, but it does not work:               while sleep 1; do tput sc; tput cup 0 $(($(tput cols)-29)); date; tput rc; done &     CLOCK_PID=$!     tail -f mylog.log     kill -9 $CLOCK_PID      I searched how to trap `CTRL+C` in bash, but I'm not sure it's the right way...


title: How helpful is it, really, to report bugs against Stable packages?

text: If the bug is fixed in a newer (Testing or Unstable) version of the package, is there any hope that the fix might make it down to Stable before the next major release? I imagine not, unless it has severity Grave or the like. Is it actually helpful to the developers working on versions that are perhaps two or even three years newer? I would like to be as helpful in bug reporting as I can, and to that end, I would like to set up a Sid installation in a virtual machine so that I can try to reproduce my Stable bugs before reporting them, but even if the bug is still present in the newer version, will the developers actually pay much attention to a bug reported against Stable? I guess there's a lot of additional, fuzzier questions around this that I can't quite put into words - but basically, I would love to hear from some developers if I'm just pestering them or if reporting bugs against old packages is actually helpful.


title: Detect which interface traffic to an IP address goes through

text: I'm making an script, and I need to detect in what interface is the traffic of an IP going through. This is because in the arch, an IP address is attended only for one of four NIC's, but can be any of those four. The manual way I did is running a tcpdump: if I see packets, then this is the interface; if not, cancel tcpdump, and do another tcpdump on another interface. I'm running FreeBSD.


title: i2b2 VM: Copy VM won't give me a valid IP address (CentOS 6.5 running with VMWare Player in Windows)

text: Posting on here as well in case this was the incorrect site to post the question. http://serverfault.com/questions/595337/i2b2-vm-copy-vm-wont-give-me-a-valid- ip-address


title: How does one clean up a stale CIFS mount

text: I have a recurring problem where I need to mount a drive of a Win32 machine on my LAN so I can read and write files to it. But I have no control of said machine, and as such, said machine frequently gets turned off or rebooted without warning. And as such, I get directories that I'm "in" and files that are open turning into kernel level blocks, and I can't even `kill -9` these processes, and have to wait well over 15 minutes for those mount points to start expiring. And thats even _with_ using `umount -a -t cifs -f -l`. Nothing I can do seems to alleviate this problem, and I frequently get non- advice such as   * Don't mount non-servers and expect them to work   * Get the person I'm trying to access the files of to not use Samba/CIFS   * Get them not to turn their computer off. The last one is especially incredulous considering Win32's propensity to need regular reboots. A way to tell the kernel "Look, that mount is not going to come back, please stop blocking everything waiting for it to come back" would be nice.


title: Is there a pdf viewer capable of opening multiple documents in the same window?

text: I would like to open all chapters of my PDF ebooks in the same window but neither evince nor okular seems to be capable of doing that (at least not out- of-the-box). Is there a way to work this out?


title: Having problem using sed | Trying to replace a line

text: Contents of gaurav.txt file               $generalNetPath = "/net";     $generalNetPath = "/glbusers4/glb/aimsys/apxwrk48";      I trying to replace `/glbusers4/glb/aimsys/apxwrk48` by `pwd` as follows               qaz=`pwd`     sed '/apxwrk/c\$generalNetPath = "$qaz";' gaurav.txt      I am getting the output as               $generalNetPath = "/net";     $generalNetPath = "$qaz";      I was expecting `$qaz` be replaced by my present working directory.As far as my knowledge this is happening because of `'` (single quotes) that I am using.I have tried using `\` before `"` but that didn't help.Is there any anyway can I do this.I mean can I use anything other than `'` so that I can have value of `$pwd` replaced by using any character other than `'` .I tried using `|` but didn't work.Please help me out with this.


title: GNUplot--Change steps of yrange

text: I'm learning GNUplot. I need to change steps in which Y values increase while plotting my graph.xrange command will change range but steps. Ex. I have data like this   1 1000   2 1500   3 1   4 200   ... By default GNUplot is taking Y range as[0,5000] which is OK for me. but y values are increasing in steps of 500, I want to increase in steps of 200. Is it possible?


title: How to pipe to multiple places with vertical bar?

text: I have a folder full of files with a `.dot` extension like this:               a.dot     b.dot     c.dot      I want to go through all the files in this folder and run a command on them such as this:               dot -Tpdf a.dot -o a.pdf     dot -Tpdf b.dot -o b.pdf     dot -Tpdf c.dot -o c.pdf      I am guessing that I need to use the vertical bar and do a command like this:               ls *.dot | dot -Tpdf ... -o ....pdf      But I don't know how to make the pipe place each file onto the middle part only. Should I be using `xargs`? Furthermore, how to strip the extension then also place it onto the second part. If I could be at least pointed in the right direction (which shell command to use) it would help me very far along the way to figuring this out.


title: Why can't users besides root create files in a samba share?

text: I am sharing a directory on one Red Hat machine via samba, and mounting it on another Red Hat machine with the following command:               mount -t cifs -o guest <remotepath> <localpath>      The smb.conf file on the host is set up to allow the guest user to write and create files. However, the root user can freely create files in the mounted share, and but when other users attempt to create a file, they get a "Permission denied" error. What's the story? Any suggestions would be appreciated.


title: Is it necessary to use quotes in KDE4 ServiceMenus?

text: In the `Exec=` line of a service menu in kde4, I normally use: `Exec=command %f` So I wonder, if it's necessary to quote the `%f`, not sure how KDE4 parses the menu file, i.e `Exec=command "%f"`


title: Set auto completion for a new filetype

text: I have a file, which contains lines of function name, now I want to use them for code auto completion, and only for file names end with `.XXX`. How should I do it, is it possible to work with `ctags` or Omni plugin?


title: System-wide power management policy on debian-based distros?

text: I would like to put idle machines in our lab (running Mint Debian edition) on standby after a timeout. I have tried pm-suspend and it puts the machines on standby and wakes up fine. Does anybody know how to set a system-wide power policy that will be in force when no user is logged in? I've tried packages like laptop-mode-tools but it doesn't offer a suspend timeout. Ideally this should be completely independent of desktop environment. The only solution I found by googling is to hack a GDM logout hook with xautolock calling pm-suspend after a timeout.


title: Create Temporary Samba Share

text: Is there a possibility to temporarily share a directory per Samba? With python3 i can serve the current directory per HTTP using: `python -m http.server`. I'd like to do the same thing with Samba.


title: How to add a dependency to a systemd.mount that is activated by /bin/mount?

text: I want systemd on `mount /mnt/test` to automatically call a program (in real life `cryptsetup` to unlock the underlying device, for testing here `echo`) before the file system is mounted and after it is unmounted. With `/etc/systemd/system/stickbak-encryption.service`:               [Unit]     Description=stickbak encryption     Before=mnt-test.mount     StopWhenUnneeded=true          [Service]     Type=oneshot     ExecStart=/bin/echo Unlock device.     RemainAfterExit=true     ExecStop=/bin/echo Lock device.          [Install]     RequiredBy=mnt-test.mount      and `/etc/fstab` (partly):               /dev/$DEVICE /mnt/test auto noauto 0 0      this works (after daemon reload and enabling the service) for `systemctl start mnt-test.mount` and respectively `systemctl stop mnt-test.mount` (as root). On `mount /mnt/test`, however, `systemctl status mnt-test.mount stickbak- encryption` shows the latter service being `inactive (dead)`, while the former is `active (mounted)`. How can I (or can I not?) set up a dependency that is honoured when `/bin/mount` is called as well? The status of the mount unit shows that `mount /mnt/test` seems to be translated to `ExecMount=/bin/mount /dev/$DEVICE /mnt/test -t auto -o noauto`, so apparently systemd gets notified.


title: Fixing debian installer

text: I have a VPS with Debian GNU/Linux on it. I'm trying to install a PHP file manager so that people could access it and download stuff into a directory. I don't have anything in my /bin about PHP so this is probably an issue. I installed PHP with this command:               apt-get install php5 php5-cgi php5-cli php5-gd php5-mysql libapache2-mod-php5      and it says               Reading package lists... Done     Building dependency tree     Reading state information... Done     php5 is already the newest version.     Package php5-cgi is not available, but is referred to by another package.     This may mean that the package is missing, has been obsoleted, or     is only available from another source     E: Package php5-cgi has no installation candidate      It's saying php is already installed? I try to confirm this by typing `php -v` and it says               Command php not found      Why is this and how can I get php running?


title: Reading an Microsoft Excel File

text: How to read an XLS File (Microsoft Excel) using unix Bash / Corn shell script?


title: How to send mail?

text: I'm trying to send mail from shell(GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)) using;               mail foo@bar.com      After I complete the command, the mail won't show up in the mailbox. What could be wrong, how can I check is my configuration is correct. Thanks.


title: Get raw input from command line (ignore shell meta characters)

text: Is there any way to read raw text from `stdin` before it is expanded or before the shell does anything to it? Say I wanted to run a script where a user enters a string which is then printed out, how can I get the following behavior:               $ sh test.sh     Please enter a string:     ***<><><||&&*&$PATH          You entered:     ***<><><||&&*&$PATH      Is there any way to implicitly surround the text with `''` or escape all meta characters even if the user does not?


title: Mount partition with truecrypt using the commandline

text: I'm trying to mount a encrypted HDD with truecrypt, but I cann't find the device. Where can I finde my HDD and what is the command to mount it in truecrypt? I'm using Raspbian on Raspberypi.


title: How is paid software distributed and updated in Linux?

text: I am developing a cross-platform Java app for OS X, Windows, and Linux. It runs fine on Linux (currently packaged into a .sh file), but now I'm wondering how to distribute it after payment and update it when I make changes. I'm aware that FOSS is typically distributed in a .rpm and .deb package, which provides a convenient way to update the app as well (in Linux mint, for instance, there is a unified software updater that makes use of these). But I don't know if these would be appropriate for paid software that I don't want users to install without paying for. I know that paid software on Linux is somewhat rare, but It certainly does exist. So how is paid software typically distributed and updated on Linux?


title: Using /etc/hosts or iptables to redirect site to https:// version

text: I'd like to have my system automatically take me to https://facebook.com even if I put http://facebook.com into my browser. I can get `/etc/hosts` to redirect to me to different domains, but it seems to ignore it if I put `https://` into it. This works, and it redirects facebook.com to google.com:               74.125.95.103    facebook.com      This does not               https://74.125.95.103   facebook.com      My guess is that you can't use text at all in the part where the IP is, but how do I force it to use https? Is this possible in `iptables`?


title: How can I zero files out inside a VMware image file so that their space can be reclaimed?

text: is there a command on Linux to remove a file but zeroing it's contents first? so if i do, something like this:               rm -rf /var/cache/pacman/pkg/*      it would overwrite each file on that directory with 0 values, then erase it i need it for compacting my VMware image files without creating super big file containing zeros first.


title: How to check if EDID can be tusted

text: `read-edid` gives me the message _"The EDID data should not be trusted as the VBE call failed"_. Thats okay, but I want to find out, that this data is not reliable, another way, because I can't use read-edid on our system. Personally I can find it out studying the Xorg.log, but imho this would be a pretty improper way. Is there a nice way to check the reliability of the EDID data?


title: How to gain root privileges for specific user if we have root password?

text: Can someone suggest how can I change process privileges in Linux to root ? Assume, I have a normal process running under some user-consider me. Now my script should create some users using 'useradd' command and I want to disable the user accounts after few hours. Let us take time frame of 5 hours. Every 5 hours it should enable the account and after 5 more hours it should disable the account. Now the problem is from the script if I try to gain root access only via typing 'su' command it asks for prompt. Well, my intention here is to invoke this script from remote client (probably via web service either in .net or in Java). So Is there a way I can change to root mode and create/enable/disable the accounts in Linux without giving any prompt (where it need to wait for someone's input)? Assume I have a root password. I did try with pipe command as below:               echo "password" | su      But somehow it brings me on the prompt. If I am successful to run a script directly without prompt, I can proceed with doing same thing via web service. Any help is really appreciated on this. Thanks, Tapan


How can I configure Postfix to silently drop/discard/reject mails that were sent from specific users to an external address? It should work only for specific users E.g:   1. abc@localdomain can send mail to only @localdomain users.    2. abc@localdomain can only receive from @localdomain users.


title: Backlight powersaving: Working in X11, but backlight does not turn off on virtual terminal. Gentoo, Asus EeePC 1015bx

text: I'm facing a puzzling issue on my laptop, an Asus EeePC 1015bx, which has an AMD C-60 APU and is running Gentoo. Although the screen powersave functions are working in X11, the backlight does not switch off when I'm at a virtual terminal. Brightness controls are working. This behaviour occurs when using the open source radeon driver with kernel mode setting, but is also present when using fglrx with the VESA framebuffer driver for virtual terminals. I've tried the various settings available with setterm, without any success. The screen blanks at the set time (goes to black on VESA framebuffer or to white on radeondrmfb), and if powerdown is explicitly set, it flickers after that amount of time, but the light stays on nonetheless. At the moment I can only manually switch off the backlight in sysfs using the eeepc-wmi interface in /sys/class/backlight. The radeon_bl0 interface in the same folder allows control of the brightness, but not of the backlight power. Does anyone with a similar device have any idea on how to get the backlight to automatically switch off after a certain time without user input on the virtual terminal?


title: Partitionning disk for installation, what size should I give to filesystem?

text: I am planning to install debian on dual boot, I have 250GB free for that, but I d prefer answer for any size. I want to separate filesystem on different partition (`/`, `/boot`, `/root`, `/home`, `/var`), but I m wondering about what size should I allow to each one. On relative, how much space should I allow to each one? What is the vital minimum for each?


title: Share/Stream live video on LAN network - raspberry

text: As in the question, I need to share a video in lan by broadcasting. From server, I've tried with:               avconv -i video.mov -c:v libx264 -f mpegts udp://[destinationIP]:1234      From client I can play video with:               omxplayer udp://serverIP:1234      But this works only for one "connection". What I need is to put the video stream in broadcast that all the clients can read. Any ideas?


title: Listing Debian packages which are not fully installed

text: This is with reference to sudo: apt-get: command not found. On Debian, SSH. This user managed to break his system by installing some packages from wheezy on a squeeze system - not sure why or how. In any case, he has at least two packages which are not fully installed, and are in the state `iU` (i.e. unpacked only). What is an efficient way to list all packages that are not fully installed, or, putting it differently, partially installed? This seems like something that might have already been asked, but a quick search did not uncover anything. If it is a duplicate, please close.


title: I get the Error "mysqld dead but pid file exists"

text: I get the Error `mysqld dead but pid file exists` This happens every couple of hours. If I restart it works fine and then goes down again.               [root@ip-10-0-0-149 log]# df -h     Filesystem Size Used Avail Use% Mounted on     /dev/xvda1 7.8G 1.5G  6.3G   19% /       devtmpfs 486M  56K  486M    1% /dev          tmpfs 499M    0  499M    0% /dev/shm      `tail` gives:               140717 18:28:43 [ERROR] Got an error from thread_id=4432, /builddir/build/BUILD/ mysql-5.5.38/storage/myisam/mi_delete.c:121      140717 18:28:43 [ERROR] MySQL thread id 4432, OS thread handle 0x7ff640688700, q uery id 269080 localhost root updating DELETE FROM wp_statistics_useronline WHERE timestamp < '1405621693'      140717 18:28:43 [ERROR] Got error 134 when reading table './blog/wp_statistics_u seronline'      140717 18:28:43 [ERROR] Got error 134 when reading table './blog/wp_statistics_u seronline'      140717 18:28:43 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './blo g/wp_statistics_useronline.MYI'; try to repair it      140717 18:28:43 [ERROR] /usr/libexec/mysqld: Incorrect key file for table './blo g/wp_statistics_useronline.MYI'; try to repair it      140717 18:28:43 [ERROR] Got an error from thread_id=4433, /builddir/build/BUILD/ mysql-5.5.38/storage/myisam/mi_delete.c:121      140717 18:28:43 [ERROR] MySQL thread id 4433, OS thread handle 0x7ff64074b700, q uery id 269144 localhost root updating DELETE FROM wp_statistics_useronline WHERE timestamp < '1405621693'


title: How do I use gunzip and tar to extract my tar.gz file to the specific directory I want?

text: When I run `gunzip -dc /path_to_tar.gz_file/zip1.tar.gz | tar xf -` in the directory where the `tar.gz` file is located, it extracts just fine. How do I tell it to place the contents from the `tar.gz` file into a specific directory? I tried this `gunzip -dc /path_to_tar.gz_file/zip1.tar.gz | tar xf /target_directory` with a `tar` error. I should also note here that I am attempting to do this in a bash script and that I'm running Solaris 10.


title: Which command to use to find all files/folders with non-default permissions?

text: Suppose I have a folder, containing other files and folders, and I'd like to find out recursively which subfiles and subfolders have non-default permissions (i.e., not 644 or 755). Which command can be used to do that? The command should output a list of the relevant files and folders, and their permissions.


title: Using an already established SSH channel

text: I have an already established ssh connection between two machines. Is there a way to send commands to the remote machine from a shell script that is run on the local machine, using the already open connection, and without starting another ssh session?


title: Copy over ssh and execute commands in one session

text: > **Possible Duplicate:**   >  Using an already established SSH channel Here is my sync script:               ssh user@remote.host /etc/init.d/some_service stop     scp user@remote.host:/var/some_service/events ./events     scp ./new_data user@remote.host:/var/some_service/new_data     ssh user@remote.host /etc/init.d/some_service start      As You can see, it stops service, perform some copies with scp and starts service back. The problem: it "costs" 4 "similar" ssh connections in a row. Is there any way to make all the work, using one physical ssh connection?


title: Linux why does yum say up-to-date when newer versions available?

text: I am trying to install an up-to-date version (2.19) of `util-linux` to get `lsblk` but yum doesn't find it:               [Harry@SN031568820668 ~]$ sudo yum install util-linux     Loaded plugins: presto, refresh-packagekit     Setting up Install Process     Package util-linux-ng-2.16.2-9.fc12.i686 already installed and latest version     Nothing to do      Please, is there a way round this? I am using Fedora 12 (until tomorrow).


title: Bad HD video deinterlacing processing

text: I have Ubuntu 12.04 32-bit with Unity. My system configuration is:               CPU: Core 2 Quad Q6600 (2.4 GHz)     RAM: 8192 Mb DDR2 Kingston     Video: Palit GeForce GTX 260 216 SP, and my screen resolution is 1680x1050.      I also have Window 7 Ulitimate installed, and I can see the same files in Media Player Classic without any horizontal lines. I've installed vdpau driver, NVIDIA drivers 304.51, and MPlayer 2 (within SMPlayer). I've disabled `Sync to VBlank` option in CCSM (because in other way, by default, MPlayer process use about 50-60 percents of my processor load), tried to swich between different deinterlace options in SMPlayer, used `-vc ffh264vdpau,ffmpeg12vdpau` parameters for MPlayer, switched to `Ubuntu 2D`, but, finally, have no results. Any suggestions? How must I to set up MPlayer?


title: How can I install php5-curl on Ubuntu 12.04 LTS (GNU/Linux 3.2.0-24-generic x86_64)

text: I have a working server running Ubuntu 12.04 LTS (GNU/Linux 3.2.0-24-generic x86_64), including apache and php. Now I want to add curl support for php by running this:               apt-get install php5-curl      Sounds simple? No. I get this response:               Reading package lists... Done     Building dependency tree     Reading state information... Done     You might want to run 'apt-get -f install' to correct these:     The following packages have unmet dependencies:      linux-image-generic : Depends: linux-image-3.2.0-26-generic but it is not going to be installed      php5-curl : Depends: libcurl3 (>= 7.16.2-1) but it is not going to be installed                  Depends: php5-common (= 5.3.10-1ubuntu3.4) but 5.3.10-1ubuntu3.2 is to be installed     E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).      It looks like I have to upgrade to a new kernel (3.2.0-26) just to get php- curl working. I would prefer to not have to do this. Is there some way I can install php curl for my kernel version which is 3.2.0-24? Thanks.


title: Global menu items in Ubuntu 13.10

text: The global menu items for many application on my Ubuntu Linux 13.10 can't be clicked, but this doesn't include all applications, Firefox global menu works just fine and so is VirtualBox, but only "Highlight Mode" may be clicked in gedit, "Change Profile" and "Set Character Encoding" in GNOME Terminal are click-able. I have tried to reset unity, but the "reset" option is deprecated.


title: How to remove root password on Debian?

text: I'm running Debian in a virtual machine and for convenience I would like to remove the password on root (since it doesn't really matter what happens to this box). Internet hasn't been too helpful on this one, which I suppose is OK because this is not normally something you'd want to do! I tried passwd -d root, but su won't accept the empty password. I assume there is some sort of PAM policy blocking me, but I haven't been able to find a working solution. Any help appreciated! (Just to clarify: I don't want to always run as root. I'd like a little bit of accident proofing in case I spaz out and `rm -rf /`. Just, when I'm ready to run as root, I don't want to be second guessed.) Edit: I also know about the sudoers hack. I'm just curious to find out what in Debian is blocking this.


title: Accidentally deleted the partitions on my boot disk. The system is still running. How can I recover?

text: I just accidentally scrubbed all the partitions from the wrong disk. `/dev/sda` is the boot disk, and `/dev/sdb` is a new disk I am trying to set up as a RAID mirror. I accidentally fat-fingered it, and wound up deleting the partition table on `/dev/sda`, rather then `/dev/sdb`. The system is still up and running, so it's running off a cached partition table somewhere. Can I recover the partition table, or at least view it, so I can recreate the partitions exactly where they were? `fdisk /dev/sda -l` yields no partitions. Yeah, I feel clever


title: How to close all apps before X-server goes down?

text: I'm using debian testing OS and openbox WM. Moreover, I start X-server via the `.xinitrc` file, which has the following content:               xrdb /home/morfik/.Xresources     exec ck-launch-session dbus-launch --sh-syntax --exit-with-session openbox-session      I notices bunch of errors while rebooting my system. All of them were logged into the file `.xsession-errors.old`. I added               if [[ $(tty) = /dev/tty4 ]]; then         mv ~/.xsession-errors ~/.xsession-errors.old         exec startx &> ~/.xsession-errors     fi      and that's why I have the `.xsession-errors` and `.xsession-errors.old` files and can read theirs content. For instance, the essential part of the file looks like this:               xinit: connection to X server lost          waiting for X server to shut down urxvt: X connection to ':0' broken, unable to recover, exiting.     XIO:  fatal IO error 4 (Interrupted system call) on X server ":0"           after 5353 requests (5353 known processed) with 0 events remaining.     real transparency on... depth: 32     xRandr: Found crtc's: 2     xRandr: Linking output DVI-I-2 with crtc 0     NO XSETTINGS manager, tint2 use config 'launcher_icon_theme'.     XIO:  fatal IO error 4 (Interrupted system call) on X server ":0"           after 13565 requests (13565 known processed) with 0 events remaining.     real transparency on... depth: 32     xRandr: Found crtc's: 2     xRandr: Linking output DVI-I-2 with crtc 0          (kglobalaccel:1707): GConf-WARNING **: Got Disconnected from DBus.          firefox: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.     kdeinit4: Fatal IO error: client killed     kglobalaccel: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.     xscreensaver: 11:27:38: SIGHUP received: restarting...     xscreensaver: 11:27:38: running as morfik/morfik (1000/1000)          klauncher: Exiting on signal 15     kdeinit4: Fatal IO error: client killed     kdeinit4: kded4 [kdeinit]: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.     g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting.     .Terminated     .claws-mail: Fatal IO error 2 (No such file or directory) on X server :0.     xscreensaver: 11:27:41: Can't open display: :0     xscreensaver: 11:27:41: running as morfik/morfik (1000/1000)          xscreensaver: 11:27:41: Errors at startup are usually authorization problems.                   But you're not logging in as root (good!) so something                   else must be wrong.  Did you read the manual and the FAQ?                        http://www.jwz.org/xscreensaver/faq.html                   http://www.jwz.org/xscreensaver/man.html          .(EE) Server terminated successfully (0). Closing log file.     (EE)      (EE) Backtrace:     (EE) 0: /usr/bin/X (xorg_backtrace+0x48) [0x7fc1bbd38c58]     (EE) 1: /usr/bin/X (0x7fc1bbb91000+0x1ab949) [0x7fc1bbd3c949]     (EE) 2: /lib/x86_64-linux-gnu/libpthread.so.0 (0x7fc1ba913000+0xf210) [0x7fc1ba922210]     (EE) 3: /lib/x86_64-linux-gnu/libc.so.6 (malloc_usable_size+0x26) [0x7fc1b93d1d36]     (EE) 4: /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x7fc1bab2f000+0xab6f3) [0x7fc1babda6f3]     (EE)      (EE) Segmentation fault at address 0x0     (EE)      Fatal server error:     (EE) Caught signal 11 (Segmentation fault). Server aborting     (EE)      (EE)      Please consult the The X.Org Foundation support           at http://wiki.x.org      for help.      (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.     (EE)      I'm getting this kind of message every time I type `openbox --exit` in a terminal. I found some similar topics on the subject, and people were saying that the errors appear because of SIGTERM signal which was sent to X-server, and all the other applications just can't connect to it anymore, so they crash. How to solve this issue? How to close all the GUI apps before X-server will be terminated? **UPDATE#1** I tried the aecolley's solution, but unfortunately I couldn't even start the graphical environment -- it just hanged, no errors in the `/var/log/Xorg.0.log` or `.xsession-errors` files. I could restart X-server via `ctrl+alt+del`, but I just had a black screen, and that's all. The other thing with the solution is that it installs many dependencies. In order to have `openbox-gnome-session`, I had to install the packages: `openbox-gnome-session` , `gnome-settings-daemon` , `packagekit` , `libpam- systemd`. And they install this stuff:               # aptitude install openbox-gnome-session gnome-settings-daemon packagekit libpam-systemd     The following NEW packages will be installed:       gdebi-core{a} gnome-desktop3-data{a} gnome-session-bin{a} gnome-settings-daemon libelfg0{a} libglib2.0-bin{a} libglib2.0-data{a}       libgnome-desktop-3-7{a} libibus-1.0-5{a} libimobiledevice4{a} libjson-glib-1.0-0{a} libjson-glib-1.0-common{a} libpackagekit-glib2-16{a}       libpam-systemd libplist1{a} libupower-glib1{a} libusbmuxd2{a} libwacom-common{a} libwacom2{a} nautilus-data{a} openbox-gnome-session       packagekit packagekit-backend-aptcc{a} python3-dbus{a} python3-packagekit{a} systemd{a} upower{a} usbmuxd{a}     The following packages are RECOMMENDED but will NOT be installed:       nautilus packagekit-tools     0 packages upgraded, 28 newly installed, 0 to remove and 0 not upgraded.     Need to get 0 B/12.7 MB of archives. After unpacking 52.6 MB will be used.     Do you want to continue? [Y/n/?]      I installed it and added:               exec ck-launch-session dbus-launch --sh-syntax --exit-with-session openbox-gnome-session      or               exec openbox-gnome-session      to the .xinitrc file. Even if the solution worked, I wouldn't do this to my system. :) There's got to be another way to fix this.


title: Wireless network AND dhcp wired server

text: I have an ubuntu server, which automatically connects to a wireless network on startup. This is achieved through `/etc/network/interfaces`:               auto lo     iface lo inet loopback          auto wlan0     iface wlan0 inet dhcp     pre-up wpa_supplicant [...]     post-down sudo killall [...]      However, I would like the machine to act also as a dhcp server when somebody plugs in a cable. I installed `dhcp3-server`, and then configured `/etc/network/interfaces` by adding:               auto eth0     iface eth0 inet static       address 10.0.0.1       netmask 255.255.255.0       network 10.0.0.0/25       gateway 10.0.0.1      However, Internet is now unreachable, as the machine tries (me thinks) to connect through eth0 rather than wlan0. _How do I configure a machine to have both wireless internet access, and acting as a wired dhcp server?_ EDIT: attached requested output. `ifconfig -a`               eth0      Link encap:Ethernet  HWaddr [...]                 inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0               UP BROADCAST MULTICAST  MTU:1500  Metric:1               RX packets:0 errors:0 dropped:0 overruns:0 frame:0               TX packets:0 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)               Interrupt:17           lo        Link encap:Local Loopback                 [...]          wlan0     Link encap:Ethernet  HWaddr [...]                 inet addr:10.7.0.213  Bcast:10.7.255.255  Mask:255.255.0.0               inet6 addr: fe80::21c:bfff:fe36:cea7/64 Scope:Link               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:1368 errors:0 dropped:0 overruns:0 frame:0               TX packets:66 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:267437 (267.4 KB)  TX bytes:9606 (9.6 KB)      `rounte -n`               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         10.0.0.1        0.0.0.0         UG    100    0        0 eth0     10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0     10.7.0.0        0.0.0.0         255.255.0.0     U     0      0        0 wlan0


title: How can I add a space automatically after every command I type in bash?

text: Due to some unknown reason I am not able to edit/delete the last character of any bash command from the bash history i.e. when I access last bash command using 'up' arrow I cannot change or delete the last character in that command and also I cannot add anything to that command after the last character. If I can add a space to the end of every command then I can edit the last command as I want. So my question is can I add a space automatically after every command I type in bash ?


title: nginx: Long filenames in directory listing

text: Using nginx/1.4.1 with OpenBSD 5.4, 64bit: ![enter image description here](http://i.stack.imgur.com/UPF7s.png) How could we set nginx to show the full filename (or at least show more from the filename then the default) when using directory listing? Googling around only gave me this:               http://forum.nginx.org/read.php?2,124400,167420#msg-167420     January 18, 2011 08:36PM     fagtron     I looked all over the net and wasn't able to find this answer anyway, so I looked into the nginx source files and it's very easy.          Simply modify the file located at [b]src/http/modules/ngx_http_autoindex_module.c[/b] and then compile.          Change these lines:          [b]#define NGX_HTTP_AUTOINDEX_PREALLOCATE 50          #define NGX_HTTP_AUTOINDEX_NAME_LEN 50[/b]          to whatever you want, such as:          [b]#define NGX_HTTP_AUTOINDEX_PREALLOCATE 100          #define NGX_HTTP_AUTOINDEX_NAME_LEN 100[/b]          And then compile and restart nginx. That's it !!!      **Question** : are there no other way then to recomplie it?


title: slow ssh login to a remote machine

text: I am experiencing slow ssh login from a machine to a remote machine. The verbose of ssh is shown below in two broken blocks. ssh freezes for 15 seconds in the below shown block.               [root@zabbix ~]# ssh -vvv zabbix@172.18.xxx.xx     OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010     debug1: Reading configuration data /etc/ssh/ssh_config     debug1: Applying options for *     debug2: ssh_connect: needpriv 0     debug1: Connecting to 172.18.xxx.xx [172.18.xxx.xx] port 22.     debug1: Connection established.     debug1: permanently_set_uid: 0/0     debug1: identity file /root/.ssh/identity type -1     debug1: identity file /root/.ssh/id_rsa type -1     debug1: identity file /root/.ssh/id_dsa type -1     debug1: Remote protocol version 2.0, remote software version Sun_SSH_1.1.4     debug1: no match: Sun_SSH_1.1.4     debug1: Enabling compatibility mode for protocol 2.0     ...............     ...............     debug1: Trying private key: /root/.ssh/id_dsa     debug3: no such identity: /root/.ssh/id_dsa     debug2: we did not send a packet, disable method     debug3: authmethod_lookup keyboard-interactive     debug3: remaining preferred: password     debug3: authmethod_is_enabled keyboard-interactive     debug1: Next authentication method: keyboard-interactive     debug2: userauth_kbdint     debug2: we sent a keyboard-interactive packet, wait for reply     debug3: Wrote 96 bytes for a total of 1205      ssh hangs here for approx 15 seconds and then it asks for the password               debug2: input_userauth_info_req     debug2: input_userauth_info_req: num_prompts 1     Password:      After password input, it hangs at the end of the line shown below:               debug3: packet_send2: adding 32 (len 23 padlen 9 extra_pad 64)     debug3: Wrote 80 bytes for a total of 1285     debug1: Authentication succeeded (keyboard-interactive).     debug1: channel 0: new [client-session]     debug3: ssh_session2_open: channel_new: 0     debug2: channel 0: send open     debug1: Entering interactive session.     debug3: Wrote 64 bytes for a total of 1349      After approx 15 seconds, login is done successfully. **My question is, what can I do to make this ssh attempt faster?** This login attempt is done from a RHEL 6.2 machine to a Solaris 10 machine. At the very first moment I thought that it could be a network issue but later I found that I could login without any such freezes from an another Solaris 10 machine to the same remote Solaris machine I mentioned above. The version of SSH in the remote Solaris machine is shown below:               $ ssh -V     Sun_SSH_1.1.4, SSH protocols 1.5/2.0, OpenSSL 0x0090704f      While the version of SSH in RHEL machine is shown below:               [root@zabbix ~]# ssh -V     OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010      Please note that the remote Solaris 10 machine is a zone on Physical solaris 10 machine. Attempt to login using ssh to the Physical solaris 10 machine is very fast from the local RHEL machine. So, I suppose, this is not network issue at all. **Update** : Adding below all enabled directives in sshd_config file in the remote Solaris 10 machine.               Protocol 2     Port 22     ListenAddress 0.0.0.0     AllowTcpForwarding yes     GatewayPorts yes     X11Forwarding yes     X11DisplayOffset 10     X11UseLocalhost yes     PrintMotd no     KeepAlive yes     SyslogFacility auth     LogLevel info     HostKey /etc/ssh/ssh_host_rsa_key     HostKey /etc/ssh/ssh_host_dsa_key     ServerKeyBits 768     KeyRegenerationInterval 3600     StrictModes yes     LoginGraceTime 600     MaxAuthTries    6     MaxAuthTriesLog 3     PermitEmptyPasswords no     PasswordAuthentication yes     PAMAuthenticationViaKBDInt yes     Subsystem   sftp    internal-sftp     IgnoreRhosts yes     RhostsAuthentication no     RhostsRSAAuthentication no     RSAAuthentication yes      Your input is highly appreciated. Thanks


title: Get PID of a function executed in the background

text: #!/bin/bash          function abc() # wait for some event to happen, can be terminated by other process     {         sleep 3333      }          echo "PID: $$"     abc &     echo "PID: $$" I need to retrieve the `pid` of this function, but the echo prints the same string. If I'm not going to put `abc()` out of this script, is it possible to get it's `pid` and terminate that function?


title: Is there a way to merge two files smartly?

text: I have two files with some lines being the same. File A :               command 1{         some code lines     }     command 2     command 3     command 4{         some code lines     }      File B :               command 5     command 3     command 1{         some code lines     }      I'd like to have a final file containing this:               command 1{         some code lines     }     command 2     command 3     command 4{         some code lines     }     command 5      Order of lines is not relevant. Is there an existing tool (or a command) to do so?


title: "client denied by server configuration" with "AllowOverride All"

text: I've installed CentOS 6.3 with Apache 2.2 on a VM. I'm trying to set up a LAMP stack with these VirtualHosts:   * `localhost` loads the path `/var/www/html/`   * `lcl.mydomain.com` loads the path `/var/www/html/dev_lcl/` In `httpd.conf` I added:               NameVirtualHost XXX.XXX.XXX.XXX:80      Then I added the `virtualhosts.conf` file:               <VirtualHost XXX.XXX.XXX.XXX:80>         DocumentRoot /var/www/html/         ServerName localhost         <Directory "/var/www/html/">             Options Indexes FollowSymLinks             AllowOverride All             Order allow,deny             Allow from all         </Directory>         ErrorLog /var/log/httpd/error_log_localhost         CustomLog /var/log/httpd/access_log_localhost "combined"     </VirtualHost>          <VirtualHost XXX.XXX.XXX.XXX:80>         DocumentRoot /var/www/html/dev_lcl/         ServerName lcl.mydomain.com         <Directory "/var/www/html/dev_lcl/">             Options Indexes FollowSymLinks             AllowOverride All             Order allow,deny             Allow from all         </Directory>         ErrorLog /var/log/httpd/error_log_dev_lcl         CustomLog /var/log/httpd/access_log_dev_lcl "combined"     </VirtualHost>      This gives me the error: > client denied by server configuration When I remove `AllowOverride All` both `ServerNames` load, but `mod_rewrite` doesn't work and I need it. How can I resolve this?


title: Stripping null byte blocks with a sparse file?

text: I've created a sparse file with `dd`. How do I copy contents of another file there, leaving all the zero blocks unallocated?


title: "Merging" two input device drivers/nodes to one device node

text: Okay, I have two joysticks attached to my linux box and they show up as `/dev/js0` and `/dev/js1`. My problem is, I have a third party application, (that I cannot change), that uses a joystick, and it can only listen to one node, (so only one joystick at a time). I can determine which node the application will "listen" to, (e.g. `/dev/js0`), but I can only specify one node. This means I can determine which joystick the application will use, but that also means it can only use one joystick at a time. I have been tasked to come up with a way that this application can use both joysticks at the same time in an either/or scenario and not one or the other. Is there a way to redirect the outputs of the two joystick nodes into a third node to which I could then point the application? Is there another way that comes to mind to somehow "merge" these two drivers/nodes into one? I tried creating a new third node, (`dev/js2`) using `mknod`, but I couldn't figure out how to redirect the output of `js0` and `js1` to `js2`. I'm also not opposed to doing this using a small program and `udev`, but I'm not sure how to go about it.


title: Ubuntu 12.04 c++ development system install

text: I am trying to install the Intel Parallel Studio 2013 on Ubuntu 12.04. During installation I received a failure notice that the command g++ was missing. I asked Intel and they indicated that the C++ development system needs to be installed. Can I install this without having to go through the install again?


title: lightweight Fedora-base and SUSE-base distros

text: I need to use two different linux distros simulanously work some learning (network administration learning) purposes, I chose Ubuntu/Fedora or ubuntu/SUSE families. and decided to select a lightweight derivation of such of these three, for Ubuntu selected Lubuntu, But I do not know lightweight but complete distros that derived from the other two families. which you recommend. I have a two year old laptop (Core i5 cpu, 4G ram) and cannot dedicate lots of resources to virtual machines. I don't need X, and can (and prefer to) shut it down at first. I run Lubuntu (without X) with 128MB of RAM and it works fine.


title: How can I create an alias synonym?

text: I have an alias `pwd` How can I create another alias that is a synonym for it? For example I have               alias cd1='cd ~/dir1'      I want a second alias `cd01` that points to the same place but I don't want to also have:   `alias cd01='cd ~/dir1'`   in case `/dir1` changes


title: How to automatically record all your terminal sessions with script utility

text: What I want to achieve is be able to record my terminal sessions to file automatically whenever I use Yakuake/Konsole. It's easy to achieve if at the start of my session I do:               script -f /home/$USER/bin/shell_logs/$(date +"%d-%b-%y_%H-%M-%S")_shell.log      But I want to run the above automatically whenever I start Yakuake or open a new tab. Using .bashrc does not work because it creates endless loop as 'script' opens a new session, which in turn reads .bashrc and starts another 'script' and so on. So presumably I need to script Yakuake/Konsole somehow to run 'script' once as a new tab gets opened. The question is how?


title: How to transfer data "offline" between osx and ubuntu?

text: I need to transfer around 50gb of data from my Ubuntu to my OSX. `scp` and `samba` are both too slow it seems - even with the Ethernet cable connected (14-15 hours!). I have physical access to both machines. How can I easily transfer my 3d animation videos from ubuntu to mac osx? I found info on `scp` and `samba` methods and both were too slow for me.


title: how obtain directory files info

text: I have the need to get information about a specific directory, basically I need to know the correlation between small, medium and big files. I came up with this:               for i in K M G; do       printf $i       du -h /usr/opt |         awk '{print $1}' |         grep ${i}$ |         wc -l     done | tee /stat.out      from the result then I add all numbers and subtract the total to obtain the number of files under 1k. ( I presume we have a lot of them since it's source files) Anyway, this way is good for small directories, I actually have a very big one (expecting over 1Tera) and no idea of the files distribution. I need to copy all these files to a private storage and need to give a estimate time on the copy. I was thinking on the line of doing something as this:               find pwd |xargs ls -lph |awk '{print $5}'       But I miss what I should put after or if I should take another approach. Any help would be most welcome.


title: Handling dynamically changing column positions and splitting file

text: I have a unique problem. I have a file with following columns               PersonId, AB1, AB2, AB3, DG1_B1,DG1_B2,DG2     1,0,1,0,3,5,7     2,0,3,1,3,7,4      I want to split this and create multiple files based on the column prefix. I want the output to be as follows   * `File_AB1.csv`              PersonId, AB1, AB2, AB3     1,0,1,0     2,0,3,1        * `File_DG1.csv`              PersonId, DG1_B1,DG1_B2     1,3,5     2,3,7        * `File_DG2.csv`              PersonId, DG2     1,7     2,4      There is another problem with this file as well. The ordering of the columns can change the next time I get the input file as shown below (note column AB3 moved to the end of the line).               PersonId, AB1, AB2,DG1_B1,DG1_B2,DG2,AB3     1,0,1,3,5,7,0     2,0,3,3,7,4,1      How can I accomplish this in awk?


title: Is it possible to change shell using bashrc when assigned a nologin default shell?

text: i have assigned a /sbin/nologin shell to a user while creating that user (specifying -s option in useradd), if this user logs in using SFTP and changes his .bashrc file, will he be able to change his shell?


title: Remove unneeded file lock in script

text: I have some script using flock executable. It works well. Problem is when this script calls another script, and it creates background process. In this situation background process inherits file locked file handle, this is system behavior. I'm looking for any tool that works as wrapper and close all unneeded handles, specially for with file locks. In my idea only main process shoud be protected against running twice. I know this is untypical sytuation. Usually all children should finish for leaving file lock, but in this situation this does not work. At now I use some workaround, using some wrapper with main code above, but I'd preffer use some binary wrapper. code:               #!/bin/bash     for fd in $(ls /proc/$$/fd); do     case "$fd" in     0|1|2|255)         ;;     *)     eval "exec $fd>&-"         ;;         esac     done     exec $1 $2 $3 $4 $5 $6 $7 $8 $9


title: Using sudo to give access to another account on same machine

text: There are two unix accounts `A` and `B`.I want to execute a unix command from account `B` such that the command behaves as if it was executed from account `A` .How can I do this ? The problem here is that how can I give privileges to the command so that it runs as an owner of account `A` but run from account `B`.Can this be done using `sudo` ? This is similar to something like `passwd` command which when run from any account is able to alter a file `/etc/passwd` which has root as owner.


title: re-arrange values in one column without affecting other columns using awk or sed

text: I have a csv file in following format:               abc,124,123,2014-08-13,abc     def,124,123,2014-08-13,abc     ghi,124,123,2014-08-13,abc      Now I need to modify only 5th column (`2014-08-13`) to produce output as given below               abc,124,123,13/08/2014,abc     def,124,123,13/08/2014,abc     ghi,124,123,13/08/2014,abc      One liner `awk` or `sed` solutions would be preferred if possible.


title: apt-get : no installation candidate for libxul-dev

text: When I'm installing `libxul-dev` I end with this error message:               $ sudo apt-get install libxul-dev     Reading package lists... Done     Building dependency tree           Reading state information... Done     Package libxul-dev is not available, but is referred to by another package.     This may mean that the package is missing, has been obsoleted, or     is only available from another source     E: Package libxul-dev has no installation candidate      How can I solve this? sources.list


Why does Ubuntu recommend download the 32-bit version? On their 32bit_and_64bit Page they even say               Unless you have specific reasons to choose 32-bit, we recommend 64-bit     to utilise the full capacity of your hardware.      Do why does their download page show the 32-bit version as "recommended" ? ![screenshot-with- shadow.png](http://img830.imageshack.us/img830/4526/screenshotwithshadow.png)


title: Bad substitution error in zsh shell

text: Hi in my previous question I got clarity on how to use associative arrays in zsh shell. But whenever I trigger the following command in my script `for KEY in ${!array[@]}` to iterate amongst the keys in my array I get a `bad substitution` error. even `echo ${!array[@]}` gives the same. NB: `array` is the name of my associative array


title: An efficient filter for .sql files with just "INSERT INTO"

text: Several times I've found myself working on data that has been exported to `.sql` files that I want to process rather than import into a database. I'm only talking about "pure data" sql files. Ones that have nothing other than `INSERT INTO` statements. (They may have some prolog at the top that I can ignore.) Generally the files will have many lines beginning with `INSERT INTO` and ending with `;` between will be a variable number of "records" beginning with `(`, ending with `)`, and separated with `,`. Each "record" will be made up of a fixed number of "fields" which are also separated by `,`. The filter should strip out all the SQL statements, separators, terminators, etc. It should output just one "record" per line with each "field" separated by say a comma or tab. In my mind it should be totally trivial and common enough that it must've been implemented many times. But I never seem to be able to find existing tools or scripts. I usually try to tackle it in Perl by treating `),(` as the record separator instead of `\n` but I always get stuck in annoying details. Has anyone got (or can make) a really simple script that does this? I don't care whether it's in bash, sed, awk, Perl, Python, etc. Here's some real example data. I have altered it to have only a few records per line. The actualy files have about a million characters per line /statement before they reach the `;` and begin the next one.               > INSERT INTO `categorylinks` VALUES     > (0,'Wikisaurus','RunJobs.php','2008-01-27     > 03:10:30','','','page'),(8,'Wiktionary','TEXT OF THE GNU FREE     > DOCUMENTATION LICENSE','2011-01-26     > 23:50:34','','uppercase','page'),(12,'Wiktionary','WHAT WIKTIONARY IS     > NOT\nWHAT WIKTIONARY IS NOT','2011-04-10 18:22:23','What Wiktionary is     > not','uppercase','page'),(12,'Wiktionary:Help','WHAT WIKTIONARY IS     > NOT\nWHAT WIKTIONARY IS NOT','2011-04-10 18:22:23','What Wiktionary is     > not','uppercase','page'); INSERT INTO `categorylinks` VALUES     > (2184,'Swedish_nouns','RELIGION','2011-01-06     > 00:04:41','','uppercase','page'),(2184,'Translations_to_be_checked_(Albanian)','RELIGION','2007-01-27     > 08:16:34','','uppercase','page'),(2184,'Translations_to_be_checked_(Bulgarian)','RELIGION','2007-01-27     > 08:16:34','','uppercase','page');      Output would be something like this. Whether fields are quoted or not probably doesn't matter. Comma or tab separated doesn't matter. Correct escaping of commas would be needed though. > >     0,'Wikisaurus','RunJobs.php','2008-01-27 03:10:30','','','page' >     8,'Wiktionary','TEXT OF THE GNU FREE DOCUMENTATION LICENSE','2011-01-26 > 23:50:34','','uppercase','page' >     12,'Wiktionary','WHAT WIKTIONARY IS NOT\nWHAT WIKTIONARY IS > NOT','2011-04-10 18:22:23','What Wiktionary is not','uppercase','page' >     12,'Wiktionary:Help','WHAT WIKTIONARY IS NOT\nWHAT WIKTIONARY IS > NOT','2011-04-10 18:22:23','What Wiktionary is not','uppercase','page' >     2184,'Swedish_nouns','RELIGION','2011-01-06 > 00:04:41','','uppercase','page' >     2184,'Translations_to_be_checked_(Albanian)','RELIGION','2007-01-27 > 08:16:34','','uppercase','page' >     2184,'Translations_to_be_checked_(Bulgarian)','RELIGION','2007-01-27 > 08:16:34','','uppercase','page' >   (The data I'm usually working with is part of the dumps of Wikipedia and Wiktionary.)


title: Most Efficient way to back up/sync large directories over SSH

text: I'm looking to back up some large directories on a Dedicated Server to another Server on a daily basis using minimal bandwidth RSync looks like its up to the task but I'm unsure of the best command switches I would like to do multiple selected directories to one "backup" directory on another machine over SSH Any ideas?


title: Is there a clang-snapshot?

text: I've just discovered the wonderful gcc-snapshot package for Ubuntu. I don't see a clang-snapshot or llvm-snapshot package though. Is there an equivalent for clang?


title: How to reduce buffers\cache

text: A monitoring system keeps alerting that my machine is reaching\breaking through it's RAM utilization threshold which is **15 GBs**. I've done some reading and understood that the apparent RAM utilization is not actual and that the extra RAM is used for caching\buffering disk I\O operation to improve the performance of the server. I'm running MySQL on that server, that's the only notable service running.   * So how can I reduce the disk I\O caching\buffering RAM as not to break through the threshold ? Could this be a MySQL issue and not Linux's ? That's the output of `free -gt`               [root@ipk ~]# free -gt                  total       used       free     shared    buffers     cached     Mem:            15         15          0          0          0          9     -/+ buffers/cache:          5         10     Swap:            5          0          5     Total:          21         15          6      Linux version is:               [root@ipk ~]# uname -rmo     2.6.32-220.el6.x86_64 x86_64 GNU/Linux


title: FreeBSD 8.2 setkey null encryption

text: Anyone got progress on setting null encryption in FreeBSD 8 ipsec?               # ./setkey -c     add 10.10.19.50 10.10.19.100 esp 1680464666 -m transport -E null -A hmac-md5 "authentication!!" ;          The result of line 1: Invalid argument.      patch from here change nothing same error.


title: Can logging be enabled in FirewallD

text: I'm running Fedora 20 and would like to see what my firewall is doing in the background. Is it possible to view a log of the traffic blocked by FirewallD?


title: adding an empty first line inside csv file

text: I input data into a csv by 'echo'-ing some values into another csv. I tried echo "" and in the next line echo "values" but i get intermittent empty lines.. I need empty line only at the start....


title: What does the search flag 'z' do in VIM?

text: I was looking for a way to show a bit of context around my searches when doing `g/mysearchtext/p` When I stumbled across this page Search-a-pattern-and-provide-a-context-few- lines-above-and-below where someone mentions the mysterious (to me) search flag 'z'. As in `g/cat/z#.3` My initial research suggests it some sort of 'total number of lines returned per result' but setting it to `z#.2` only shows one line per search result. So I am confused and I'm having trouble finding the docs under `:help pattern`. So here are my questions:   * What does the `z` flag do?    * How does `#.3` modify it?    * Where in the docs can I find this information?


title: Using YUM for CentALT packages

text: Since CentALT isn't available anymore I can't upgrade some of my packages. Sure I can use a mirror for CentALT to get it working, but it only lists 'older' packages since it's not updated anymore. I installed MariaDB 10.0.11 with CentALT and would like to update it to 10.0.12. Unfortunately this results in an error with a RPM of the MariaDB repo. Is there a way to update it without removing the current package?


title: How to use command line arguments in a shell script

text: I have a shell script and when invoking it `./test` it asks for an input.I 've seen a quicker way just by writing at once `./test myInput` ,how is that achievable?


title: Non-root user cannot control NetworkManager. polkit rule has no effect

text: I have disabled slim and lightdm, using startx instead. Almost everything works, except I cannot control the network connections with NetworkManager when logged in as the non-root user. Enable Networking and Enable Wifi are grayed out. If I go to Edit Connections and select either connection, the Edit button is grayed out. I have tested using the root user, which does work. I wrote a polkit rule that is supposed to resolve this, but it does not. I created file /etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules containing:               polkit.addRule(function(action, subject) {       if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("netdev")) {         return polkit.Result.YES;       }     });      My userid is a member of group netdev. My system is Debian Sid and my DE is LXDE. My ~/.xinitrc contains:               exec ck-launch-session dbus-launch /usr/bin/startlxde      I have been fighting with this almost all day. Can anyone explain what I am doing incorrectly?


title: Replacing a pattern with another between first and second occurrence of a pattern in file

text: Want the comma's (,) replaced by the alphabet u between the first occurrence of y till the second occurrence of y. Given below is the sample input file.               100y00893225900,008932259,06,2013,NOKIA Q PHONE,TXS000000287356,PDF,Text,MEOB,1.4,00 00,DoD,07/07/2013,06/01/2013,06/30/2013,07/10/2024,trueyr=56734,d=199y     56734_199_0.pdf     100y00893225900,008932259,06,2013,SAMSUNG T PHONE,TXS000000287356,PDF,Text,MEOB,1.4,00 00,DoD,07/07/2013,06/01/2013,06/30/2013,07/10/2024,trueyr=56734,d=199y     56734_199_0.pdf           100y00893225900,008932259,06,2013,APPLE S PHONE,TXS000000287356,PDF,Text,MEOB,1.4,00 00,DoD,07/07/2013,06/01/2013,06/30/2013,07/10/2024,trueyr=56734,d=199y     56734_199_0.pdf     ~     ~     ~      Actually speaking each line has 3 "y" occurrences. **Desired Output:**               100y00893225900u008932259u06u2013uNOKIA Q PHONEuTXS000000287356uPDFuTextuMEOBu1.4u00 00uDoDu07/07/2013u06/01/2013u06/30/2013u07/10/2024utrueyr=56734,d=199y     56734_199_0.pdf     100y00893225900u008932259u06u2013uSAMSUNG T PHONEuTXS000000287356uPDFuTextuMEOBu1.4u00 00uDoDu07/07/2013u06/01/2013u06/30/2013u07/10/2024utrueyr=56734,d=199y     56734_199_0.pdf     100y00893225900u008932259u06u2013uAPPLE S PHONEuTXS000000287356uPDFuTextuMEOBu1.4u00 00uDoDu07/07/2013u06/01/2013u06/30/2013u07/10/2024utrueyr=56734,d=199y     56734_199_0.pdf     ~     ~     ~


title: Failing to block brute force ssh with iptables

text: I'm trying to block (slow down) brute force attacks on my sshd server. I'm following this guide http://www.rackaid.com/resources/how-to-block-ssh-brute- force-attacks/ which basically says I need to just enter the 2 commands below.               sudo iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --set     sudo iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent  --update --seconds 60 --hitcount 4 -j DROP      My sshd port is 6622, so I changed the entries from "22" to "6622", and put those commands in. Then I attempted to simply test the new iptables. I went to another pc and purposefully put in the wrong login password several times. Unfortunately, the new rules don't seem to be stopping me from trying as much as I want. Listed below are my current rules. What am I doing wrong?               # iptables --list          Chain INPUT (policy ACCEPT)     target     prot opt source               destination              DROP       tcp  --  anywhere             anywhere             tcp dpt:6622 state NEW recent: UPDATE seconds: 60 hit_count: 4 name: DEFAULT side: source                tcp  --  anywhere             anywhere             tcp dpt:6622 state NEW recent: SET name: DEFAULT side: source          Chain FORWARD (policy ACCEPT)     target     prot opt source               destination                   Chain OUTPUT (policy ACCEPT)     target     prot opt source               destination                   Chain LOGDROP (0 references)     target     prot opt source               destination              LOG        all  --  anywhere             anywhere             LOG level warning     DROP       all  --  anywhere             anywhere


title: crashplan desktop alternative?

text: Is there a good alternative (free software) for Crashplan for UNIX desktops? There is a plethora of backup systems out there, but there doesn't seem to be one that rivals with Crashplan. The specifications are:   * continuous, seemless backup   * intuitive desktop user interface   * backups to remote servers (aka "the cloud"), local hard drives, friends   * incremental backups   * encryption for remotes   * optionally: "go back in time" Similar questions:   * Open alternative to crashplan friends - focuses exclusively on the "friends" functionality   * Easy incremental backups to an external drive - no desktop interface, no remote server   * easy rsync solution with file manager (thunar or nautilus or…) - simply a workaround   * Comparison of backup tools - on askubuntu.com