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

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


How to configure DNS on Fedora 16?

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?


Scripting VMware configuration: can I use PowerCLI?

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?


using tops command to update NSLog statements in cocoa code

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 :-(


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

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?


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

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 ?


Kill all process of users in Ubuntu?

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?


Cannot add script to init.d

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


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

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


Print word that doesn't contain character

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.


Change default title bar icon

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.


Killing background process in bash script when exiting the script

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...


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

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.


Detect which interface traffic to an IP address goes through

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.


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

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


How does one clean up a stale CIFS mount

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.


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

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?


Having problem using sed | Trying to replace a line

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.


GNUplot--Change steps of yrange

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?


How to pipe to multiple places with vertical bar?

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.


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

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.


Is it necessary to use quotes in KDE4 ServiceMenus?

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"`


Set auto completion for a new filetype

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?


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

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.


Create Temporary Samba Share

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.


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

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.


Fixing debian installer

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?


Reading an Microsoft Excel File

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


How to send mail?

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.


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

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?


Mount partition with truecrypt using the commandline

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.


How is paid software distributed and updated in Linux?

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?


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

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`?


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

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.


How to check if EDID can be tusted

`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?


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

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.


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

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?


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

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?


Share/Stream live video on LAN network - raspberry

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?


Listing Debian packages which are not fully installed

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.


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

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'


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

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.


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

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.


Using an already established SSH channel

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?


Copy over ssh and execute commands in one session

> **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?


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

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).


Bad HD video deinterlacing processing

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?


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

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.


Global menu items in Ubuntu 13.10

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.


How to remove root password on Debian?

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.


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

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


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

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.


Wireless network AND dhcp wired server

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


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

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 ?


nginx: Long filenames in directory listing

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?


slow ssh login to a remote machine

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


Get PID of a function executed in the background

#!/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?


Is there a way to merge two files smartly?

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?


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

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?


Stripping null byte blocks with a sparse file?

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


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

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.


Ubuntu 12.04 c++ development system install

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?


lightweight Fedora-base and SUSE-base distros

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.


How can I create an alias synonym?

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


How to automatically record all your terminal sessions with script utility

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?


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

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.


how obtain directory files info

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.


Handling dynamically changing column positions and splitting file

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?


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

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?


Remove unneeded file lock in script

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


Using sudo to give access to another account on same machine

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.


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

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.


apt-get : no installation candidate for libxul-dev

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)


Bad substitution error in zsh shell

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


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

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.)


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

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?


Is there a clang-snapshot?

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?


How to reduce buffers\cache

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


FreeBSD 8.2 setkey null encryption

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.


Can logging be enabled in FirewallD

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?


adding an empty first line inside csv file

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....


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

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?


Using YUM for CentALT packages

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?


How to use command line arguments in a shell script

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?


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

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?


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

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     ~     ~     ~


Failing to block brute force ssh with iptables

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


crashplan desktop alternative?

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


Access VirtualBox Debian Apache Guest on Windows Host

I am running Oracle VirtualBox with Debian as guest OS on a Windows 7 host. I have installed Apache and specified the following two network adapters in VM:   1. Bridge   2. Host-only w/ the same IP set as below. My interfaces network settings on the Debian VM are:               auto lo     iface lo inet loopback          allow-hotplug eth0     iface eth0 inet dhcp     auto eth1          iface eth1 inet static         address 192.168.1.110         netmask 255.255.255.0      which all seems to work well enough via `ping` test between guest and host. However, when I try to browse to my guest instance in a web browser `http://192.168.1.110` I keep getting a 404 message. Any help would be appreciated. Thinking that the ifconfig results my help, I will include those also here:               eth0      Link encap:Ethernet  HWaddr 08:00:27:7a:1a:35             inet addr:192.168.1.106  Bcast:192.168.1.255  Mask:255.255.255.0           inet6 addr: fe80::a00:27ff:fe7a:1a35/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:252 errors:0 dropped:0 overruns:0 frame:0           TX packets:19 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:25417 (24.8 KiB)  TX bytes:1765 (1.7 KiB)          eth1      Link encap:Ethernet  HWaddr 08:00:27:56:3d:90             inet addr:192.168.1.110  Bcast:192.168.1.255  Mask:255.255.255.0           inet6 addr: fe80::a00:27ff:fe56:3d90/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:231 errors:0 dropped:0 overruns:0 frame:0           TX packets:7 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:21945 (21.4 KiB)  TX bytes:578 (578.0 B)          lo        Link encap:Local Loopback             inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:16436  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


How to change SAMBA default port on centos?

I need to change the port numbers of samba. Our ISP is blocking the ports 445 and 139. So I need to run samba in a different port. Please help me to do that.


bash log in windows and run cmd command using .sh script?

Ip of my Windows machine is 172.16.22.53, and it installed cygwin. I want write a bash script like that:               #!/bin/bash      sshpass -p 'myPassWord' ssh userNmae@172.16.22.53     #and some command to run cmd command in the Windows machine.      Is it possible? That is my try(it log in the Windows machine,and go into cygwin command interface .But don't creat the Catalog(myth) in the Windows machine!):               #!/bin/bash      sshpass -p 'myPassWord' ssh userNmae@myIp|mkdir myth


Subtract 1 from all file names (rename them) in a directory.

I have a directory which contains image files with names like               image1.jpg      image2.jpg      image3.jpg     ...      Unfortunately, the image names must be zero based, so `image1.jpg` should be `image0.jpg`, `image2.jpg` should be `image1.jpg` and so on. I can write a script to _generate_ mv commands like these, put them in a shell script, and then execute them -               mv image1.jpg image0.jpg     mv image2.jpg image1.jpg     mv image3.jpg image2.jpg     ...      But I suppose there is a neater way to do it in Unix. So what is it?


FC15 yum fedora repo recovery

I have lost all files under /etc/yum.repos.d/ and need a source or quick method for recovery. kernel version : 2.6.43.8-1.fc15.i686 / Fedora 15 Lovelock yum version : yum-3.2.29-9.fc15.noarch


PPTP VPN connected but no internet connection

I have followed this guide to setup a pptp VPN server in Ubuntu (which is a VM in a Windows Host, bridged adapters): https://help.ubuntu.com/community/PPTPServer My usage of the VPN is to overcome geoblock as I will be travelling to China. I can connect to the VPN on my Android phone using the 4G connection, and when I type ifconfig in the terminal in Ubuntu it does show `ppp0 Link encap:Point- to-Point Protocol` However as soon as I connect to the VPN I loose internet on my phone. My Ubuntu (and the Windows host) is behind a router, which I have port- forwarded 1723, alongside with ports 8080 for web servers etc.


Why is Debian Wheezy not displaying desktop icons?

After freshly installing Debian with Gnome 3, I cannot enable desktop icons. I tried to use `dconf-editor`, but all values were locked. I tried `sudo dconf-editor`: The option was changeable but had no effect... I also tried `gnome-tweak-tool` and to no avail. What am I doing wrong?


Problem with sed on a array containing strings containing spaces

I have a array looking like this:               array=("(1 2 3) (123)" "2 31 (231)" "4 5 1 (451)" "(te)xt (1234)")      This array is a example. It does not look like this but its structure is the same _(the strings have the same structure)_.   If I want to use the single strings in a `select` loop I can do it like this:               select string in "${array[@]}"     do        # do something     done      But the string in the parentheses is not for display. So I used sed to remove them:               echo "${array[@]}" | sed -r 's/ \([0-9]+\)$//g'      This did not work. Only the last parentheses were removed and the strings have been merged together. But how can I achieve the desired result which would be the same as the following example:               array2=("(1 2 3)" "2 31" "4 5 1" "(te)xt")          select string in "${array2[@]}"     do        # do something     done


Linux Mint 15 (Ubuntu 13.04) Spontaneously Crashing: Please help me understand the syslog messages

I'm running Linux Mint 15, and my machine is spontaneously rebooting. It appears to happen when the computer is under load. Normal use doesn't seem to cause it, but I'm trying to create a windows vm and I can't make it through the install, because the host keeps crashing. This is what my syslog looks like right before/after a crash. Can anyone help me decipher this? FYI Cerebro is the hostname.               Dec 21 23:18:33 Cerebro kernel: [    6.294603] [Hardware Error]: MC4 Error (node 0): Protocol error (link, L3, probe filter).     Dec 21 23:18:33 Cerebro kernel: [    6.294606] [Hardware Error]: Error Status: System Fatal error.     Dec 21 23:18:33 Cerebro kernel: [    6.294608] [Hardware Error]: CPU:0 (15:2:0) MC4_STATUS[Over|UE|MiscV|PCC|-|-|-]: 0xfa000000000b0c0f     Dec 21 23:18:33 Cerebro kernel: [    6.294610] [Hardware Error]: cache level: L3/GEN, mem/io: GEN, mem-tx: GEN, part-proc: OBS (no timeout)     Dec 21 23:23:18 Cerebro kernel: [  301.422760] mce: [Hardware Error]: Machine check events logged


Wifi works in local, no internet connection. Debain 7

I installed debain on an old PC, the KDE version. I have internet over wired. I can connect to my router, I and can ping it over wifi - ping 192.168.1.1 is successful. I can ssh into other machines, connected to the same network. I cannot access external web sites via wifi though, cannot ping successfully any ip, too i.e ping 8.8.8.8 results in a timeout. Here are               root@debian:/home/deckoff# ifconfig          eth0  Link encap:Ethernet  HWaddr 00:0a:e4:2d:4a:a0             inet addr:192.168.1.124  Bcast:192.168.1.255  Mask:255.255.255.0           inet6 addr: fe80::20a:e4ff:fe2d:4aa0/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:1419 errors:0 dropped:0 overruns:0 frame:0           TX packets:759 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:563318 (550.1 KiB)  TX bytes:179940 (175.7 KiB)          eth1  Link encap:Ethernet  HWaddr 00:0e:35:b4:04:64             inet addr:192.168.1.123  Bcast:192.168.1.255  Mask:255.255.255.0           inet6 addr: fe80::20e:35ff:feb4:464/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:944 errors:1 dropped:1 overruns:0 frame:0           TX packets:52 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000            RX bytes:137654 (134.4 KiB)  TX bytes:8203 (8.0 KiB)           Interrupt:21 Base address:0x8000 Memory:d0220000-d0220fff           lo        Link encap:Local Loopback             inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1/128 Scope:Host           UP LOOPBACK RUNNING  MTU:16436  Metric:1           RX packets:120 errors:0 dropped:0 overruns:0 frame:0           TX packets:120 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0            RX bytes:9264 (9.0 KiB)  TX bytes:9264 (9.0 KiB)      etc/network/interfaces               # This file describes the network interfaces available on your system     # and how to activate them. For more information, see interfaces(5).          # The loopback network interface     auto lo     iface lo inet loopback      root@debian:/home/deckoff# route -n               Kernel IP routing table     Destination     Gateway         Genmask         Flags Metric Ref    Use Iface     0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth1     169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth1     192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1      root@debian:/home/deckoff# traceroute 8.8.8.8               traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets      1  192.168.1.1 (192.168.1.1)  5.144 ms  8.733 ms  10.349 ms      2  * * *      3  * * *          27  * * *     28  * * *     29  * * *     30  * * *      The adapter is eth1. It uses the ipw2200-bss.fw firmware, which I installed during system installation ,if this info is of any help for solving my problem. Yes, the name of the interface is eth1, an it's been that way on every linux distro I installed on this PC?!?!?


Is this sar/sysstat cron job formatted correctly?

I want it to give me all the sar/sadc options, interrupts,disk,etc.. every 10 seconds starting at noon for the entire hour. On the second line I want to capture the info in /proc/interrupts every minute for the hour of noon in a log file. Please verify the syntax.               * 12 * * *  root /usr/lib64/sa/sa1 -S XALL 10 360     */1 12 * * *  root cat /proc/interrupts >> /root/proc_int.log && date >> /root/proc_int.log


How to indent multiple lines in nano

Selecting lines in nano can be achieved using `Esc+A`. With multiple lines selected, how do I then indent all those lines at once?


Restart does not shutdown first on Debian Squeeze

I installed Debian Squeeze from the live DVD. Going to `System`->`Shutdown`->`Restart` does not shutdown the computer in the usual way where the BIOS screen is seen before login. Instead it simply restarts without going through shutdown and BIOS. Why is that so? Can we configure restart behaviour to switch between these two ways of restarting? I have not experienced this on other Linux distributions or Windows.


No gnome-power-manager command but it is installed on Arch

I'm running latest Arch, have GNOME and Fluxbox and my main windows manager is Fluxbox. I wanted to manage my power settings in Fluxbox and i added gnome- power-manager in startup but is says there isn't a command like that. I checked if gnome-power-manager is installed with pacman and it says it is. Note when i open power settings in GNOME shell environemnt there is no 'close lid' option. **Note : Fixed** My main intention was to use this power manager to manipulate the laptop's state when i close the lid, press the shutdown button etc. I fixed this with instaling xfce4-power-manager.


Scientfic Linux slate wiped clean on VM after restart

I have installed `Scientific Linux` on VirtualBox. After every restart, I get this: ![enter image description here](http://i.stack.imgur.com/zNFdg.png) Which is fine, I suppose. But if I press a button, I get this: ![enter image description here](http://i.stack.imgur.com/Ib5gm.png) I am not sure if that is a common occurrance, I am sure that it should boot right into the OS. But when I got to create a user `useradd sampleUser` and provide it with a password `passwd sampleUser`, it works fine. But when I restart it, it doesn't save the users. I get this for an error:               [liveuser@livecd ~]$ su sampleUser     su: user sampleUser doesn't exist      Is there something I done wrong with this installation? I know that the user shouldn't be liveuser, but I installed this atleast 3 times already and can't seem get past this.


Limit program execution to a list of arguments

I would like that my Unix users can only run a specific command `insecurecommand` with a controlled list of arguments stored in a file. The only solution I have found at this time is to :   1. Create a new security group called `cmdxg`   2. Limit the execution of the command to this group:              chown root:cmdxg /.../insecurecommand     chmod 750 /.../insecurecommand        3. Create a setgid wrapper, which executes the command:              ls -al /.../mywrapper     -rwxr-sr-x 1 root cmdxg /.../mywrapper      The only problem is that `insecurecommand` is executed with `gid=cmdxd` and not with the users real gid. However, I'd like to avoid running the `insecurecommand` command setgid. If in the wrapper code, I go back to real gid with seteuid(), it can't run the `insecurecommand` anymore because the process lost the `cmdxg` right. Is it a way to run a command that needs privileged gid rights, but with the real gid ? Maybe I need to decompose the program execution ? -> first load the binary with the privileged effective gid -> go back to the real gid -> run the program But how can I do this ? Any ideas ?