How can I efficiently dereference all symlinks in `find` *output* filenames?

I need paths to be both fully resolved and relative to a given directory. This must be done efficiently, since the number of paths is often greater than 100,000. **Situation** : I have directories which contain _mostly_ symlinks to other directories, as in               foo      123 -> ../baz/123      896 -> ../bar/896      (Note that foo does NOT contain only symlinks to directories, it also contains ordinary files which I have to catch too.) These symlinked directories contain files. . I want to get a list of those files, in the form               baz/123/some.file     bar/123/other.file      That is, when 'find' finds a symlink, I want it to dereference that path **when it is reporting the contents**. So I am running this command from the parent directory of foo:               find -L foo -type f      But that doesn't work. Honestly, you would expect the `-L` option, which claims to 'follow symbolic links', to implement this behaviour. But, its **actual** behaviour is to look _into_ the contents of those directories, but report files inside them with their non-dereferenced names, ie. the results look like               foo/baz/123/some.file     foo/bar/896/another.file      The results will be used for set operations against a list of filepaths that are all 1. _fully resolved_ and 2. _relative to foo's parent directory_ , so every result must also fulfil that criteria. I can guarantee for these purposes that all links are resolvable ie. none are circular or excessively deep. Most, but not all links, point at directories rather than files. At the moment, the best I can do is a Python script that rewrites any non- dereferenced paths into resolved ones. But since the numbers of files involved is in the **100000+** range, this is not very practical (and rather ridiculous, since `find` already had bothered to dereference them, it just didn't return the dereferenced paths). (EDIT: See my comment on this post -- I've found a non-solution (in that it does the job efficiently but in the wrong way -- executing external commands).) I'm convinced that I should be able to do this task just with `find` and no external commands, but I'm not finding the man page enlightening here -- none of `-L`, `-H`, `-P`, `-follow` have the correct behaviour, nor does `-printf %l`. `-exec` is out for obvious reasons -- it is not internal to `find`. Any ideas? EDIT 2: at this point, Stephane has convinced me that there is no particularly good reason why find **would** have this functionality internally, so I'm willing to accept any reasonably efficient answer.


What's causing VirtualBox OSE to hang my machine?

I'm using VirtualBox OSE and recently, when I run Ubuntu 10.10 on it, my machine tends to hang, forcing me to hard-reset it (not good). How do I start finding where the problem is? Here's the last line from " **/var/log/syslog** ", before the reset:               Jan 27 12:11:22 debian kernel: [  193.400230] warning: `VirtualBox' uses 32-bit capabilities (legacy support in use)      **notes** :   * VirtualBox OSE is version **3.2.10**   * I use 32-bit **2.6.37** kernel on Debian Squeeze   * I can't reproduce this problem when using Fedora 14 VM


Downloading the Google search results page using Linux commands

When I try using wget command, the page which gets downloaded contains only the lefthand side part. I want the right-hand side part of the search-results page, which is called Knowledge Graph. Can anybody help me out in this please?


Running 'make test' on an individual module for Python 2.7.4 build

I am working on building Python 2.7.4 on CentOS 6.4. When running the `make test` step, the `test_gdb` step fails, and I would like to get some more info as to why. Build commands I'm running:               ./configure --prefix=/usr/local/python-2.7.4 --enable-ipv6 --enable-unicode=ucs4 --enable-shared     make     make test      Output of make test: > ... test test_gdb failed -- multiple errors occurred; run in verbose mode > for details ... So basically, I'm trying to figure out how to run the `test_gdb` test separately and in verbose mode. Sounds like I should use `regrtest.py`, but I seem to get `invalid syntax` with the various options I've tried. Any ideas?               banjer@somehost:/usr/local/src/Python-2.7.4> python Lib/test/regrtest.py -v test_gdb       File "Lib/test/regrtest.py", line 679         'test_support',                       ^     SyntaxError: invalid syntax


How can I set up a samba share accessible via windows 7 to a specific point on the server?

A samba share is set up according to the directions here: https://wiki.archlinux.org/index.php/Samba The /etc/samba/smb.conf file looks like this (after some hacking around from googling):               # 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 made any basic syntactic errors.      #     #======================= Global Settings =====================================     [global]          # workgroup = NT-Domain-Name or Workgroup-Name        workgroup = MYGROUP          # server string is the equivalent of the NT Description field        server string = Samba Server          # 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        printcap name = /etc/printcap        load printers = yes          # It should not be necessary to spell out the print system type unless     # yours 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/samba/%m.log          # 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     ;   password server = <NT-Server-Name>          # Password Level allows matching of _n_ characters of the password for     # all combinations of upper and lower case.     ;  password level = 8     ;  username level = 8          # 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     ;  smb passwd file = /etc/samba/smbpasswd          # The following are needed to allow password changing from Windows to     # update the Linux sytsem password also.     # NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.     # NOTE2: You do NOT need these to allow workstations to change only     #        the encrypted SMB passwords. They allow the Unix password     #        to be kept in sync with the SMB password.     ;  unix password sync = Yes     ;  passwd program = /usr/bin/passwd %u     ;  passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*          # Unix users can map to different SMB User names     ;  username map = /etc/samba/smbusers          # 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 = /etc/samba/smb.conf.%m          # 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           # Configure remote browse list synchronisation here     #  request announcement to, or browse list sync from:     #   a specific host or from / to a whole subnet (see below)     ;   remote browse sync = 192.168.3.25 192.168.5.255     # Cause this host to announce itself to local subnets here     ;   remote announce = 192.168.1.255 192.168.2.44          # 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 = yes           # 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 = yes          # Use only if you have an NT server on your network that has been     # configured at install time to be a primary domain controller.     ;   domain controller = <NT-Domain-Controller-SMBName>          # Enable this if you want Samba to be a domain logon server for      # Windows95 workstations.      ;   domain logons = yes          # 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          # All NetBIOS names must be resolved to IP Addresses     # 'Name Resolve Order' allows the named resolution mechanism to be specified     # the default order is "host lmhosts wins bcast". "host" means use the unix     # system gethostbyname() function call that will use either /etc/hosts OR     # DNS or NIS depending on the settings of /etc/host.config, /etc/nsswitch.conf     # and the /etc/resolv.conf file. "host" therefore is system configuration     # dependant. This parameter is most often of use to prevent DNS lookups     # in order to resolve NetBIOS names to IP Addresses. Use with care!     # The example below excludes use of name resolution for machines that are NOT     # on the local network segment     # - OR - are not deliberately to be known via lmhosts or via WINS.     ; name resolve order = wins lmhosts bcast          # 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 = yes          # 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           # Case Preservation can be handy - system default is _no_     # NOTE: These can be set on a per share basis     ;  preserve case = no     ;  short preserve case = no     # Default case is normally upper case for all DOS files     ;  default case = lower     # Be very careful with case sensitivity - it can break things!     ;  case sensitive = no          #============================ Share Definitions ==============================     [homes]        comment = Home Directories        browseable = no        writable = yes          # Un-comment the following and create the netlogon directory for Domain Logons     ; [netlogon]     ;   comment = Network Logon Service     ;   path = /home/netlogon     ;   guest ok = yes     ;   writable = 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 = /home/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        writable = 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 "staff" group     ;[public]     ;   comment = Public Stuff     ;   path = /home/samba     ;   public = yes     ;   read only = yes     ;   write list = @staff          # 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     ;   writable = 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     ;   writable = 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     ;  writable = 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 writable 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 = /media/seagate/files/     ;   public = yes     ;   only guest = yes     ;   writable = yes     ;   printable = no               # 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 writable 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     ;   writable = yes     ;   printable = no     ;   create mask = 0765               [global]        usershare path = /var/lib/samba/usershares        usershare max shares = 100        usershare allow guests = yes        usershare owner only = False          follow symlinks = yes     wide links = yes     unix extensions = no      This allows access from Windows 7 (under the map network drive function) and currently, the files that are desired are accessed by making a ln -s from a folder to the /media folder. How can I simply mount the share to be not to the user's folder, but /media? See image for illustration below: ![example](http://i.stack.imgur.com/jUkqz.png)


How to fix "org.freedesktop.PolicyKit1" error when unmounting USBs in Thunar?

I recently installed Debian Wheezy with XFce4. Whenever I try to unmount a USB, I get this error message:               GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.PolicyKit1 was not provided      How can I fix this?


Redirection of output from the terminal to a file in unix/linux

I am facing a slight problem in my project. I have a menu driven program and one of my options is _Display all_ , which displays all the entries from a map using a loop. The display is on the terminal and I am not being able to view all the entries because it only shows the last few entries before my prompt comes again. I want the output to be redirected to a file so that I can use more commands and give the user a view accordingly. Please suggest few commands or code.


Debian, virtualenv, IPython notebook and matplotlib inline plots

I have been using IPython notebook on both OSX and Windows 7 for a while. Now I'm trying to create a minimal system for me to work on Debian 7 (Wheezy). I installed:   * LXDE    * Python2.7    * python-dev    * python-pip then did a               apt-get build-dep python-matplotlib      Then did a               pip install pip --upgrade     pip install virtualenv      then in virtualenv, installed via pip:   * numpy    * pandas    * matplotlib    * ipython   * tornado with this, I can run the IPython notebook, but when I plot anything, I only get the object (not the figure), as in               <matplotlib.axes.AxesSubplot at 0x42bf6d0>      I would really like to see the figures. Can anyone help?


Specifying a generic interpreter for a program like expect?

I am writing expect script which can be used on mulple operating systems but the problem is i can't use `#!/usr/bin/expect` evreywhere so instead i tried to do                #!`which expect`      at the top but it failed               [sesiv@itseelm-lx4151 ~]$ ./sendcommand     -bash: ./sendcommand: `which: bad interpreter: No such file or directory      any solution for this.


Wrapper script to list sourced/executed files

Is it possible to write a command which runs `my.sh` and _prints every path sourced or executed by this script recursively_ - That is, _without altering the original code_ at all? The idea is to verify which files are actually used for a specific execution path, without time-consuming and error-prone manual tracing. For example:               $ > my.sh cat <<'EOF'     #!/bin/sh     . ./foo.sh     EOF     $ > foo.sh cat <<'EOF'     #!/bin/sh     ./bar.sh     EOF     $ > bar.sh cat <<'EOF'     #!/bin/sh     echo bar     EOF     $ chmod u+x my.sh bar.sh     $ magic command     [...]     ./my.sh     ./foo.sh     ./bar.sh


View Script Over SSH?

A friend, using a remote machine, SSHed to my machine and ran the following python script: * * * while (1): ....print "hello world" * * * (this script simply prints 'hello world' continuously). I am now logged in to my machine. How can I see the output of the script my friend was running? * * * if it helps, I can 'spot' the script my friend is using: me@home:~$ ps aux | grep justprint.py **friend 7494 12.8 0.3 7260 3300 ? Ss 17:24 0:06 python TEST_AREA/justprint.py** friend 7640 0.0 0.0 3320 800 pts/3 S+ 17:25 0:00 grep --color=auto just * * * what steps should I take in order to view the "hello world" messages on my screen?


How to pass the output of one command as the command-line argument to another?

So I have a script that, when I give it two addresses, will search two HTML links:               echo http://maps.google.be/maps?saddr\=$1\&daddr\=$2 | sed 's/ /%/g'      I want to send this to `wget` and then save the output in a file called `temp.html`. I tried this, but ut doens't work. Can someone explain why and/or give me a solution please?               #!/bin/bash     url = echo http://maps.google.be/maps?saddr\=$1\&daddr\=$2 |  sed 's/ /%/g'     wget $url


How can I customize the look of Thunderbird's mailbox list, message list, and headers?

Mozilla Thunderbird's message list, mailbox list, and headers use a font size that is so large, I can barely see any content in the message preview pane. I'd like to reduce these to 10px, and reduce the headers to 8px or less. How can I do this?


Proper location to install services

I originally posted this question over on AskUbuntu but it didn't get any traction so I'll ask here. In ubuntu or linux in general is there a "correct" location to install services that you download from the internet and want to run. I would like to have services such as redis or ventrilo auto run but to me it doesn't make sense to put them in the ~/redis or ~/ventrilo directories since they aren't user specific. Keep in mind that I'm relatively new to the linux world having been a .Net developer for about 4 years now.


Copy the file created newly in UNIX

I have a directory where so many files created daily and need to copy the new files which were generated. And all files will be created with starting name abc_ Ex:I have a file abc_0520123.pdf on the next day two files were created abc_0521234.pdf and abc_0521254.pdf now I want to copy only these two files created newly. Please help me how can I compare old files with new one and to copy them.


Permisison/Ownership issue with secondary FTP account

I have Centos 6.5 final. I have chroot setup and working properly and I also installed vsftpd. I now need to create a new user named `extDeveloper` and give this user access to a specific account. I setup the user using (adding the new account to an existing account):               adduser extDeveloper -d /var/www/vhosts/domain.com     passwd extDeveloper       I also added this user to the apache group so they could access the files. The issue I have is the extDeveloper user is not able to write new files. I thought about making the group writable but then was concerned over security for this. What I am trying to do is create a secondary account (eventually more for this purpose) that I can give access to a few domains. Currently I only need 1 domain but this user may need to access more. I need the user to modify files and push new files but I need these files associated to the proper account:group. My accounts are setup using `domain_user:apache` where apache only has read access. Isn't it bad to let apache have write access? Is the setup I want possible? I assume so as I have been able to have multiple FTP accounts on other servers and they wrote files back using the proper permissions. Rackspace told me this is not how Linux works... I am learning as I go so any assistance or push in the right direction is very much appreciated. Thanks


how to stop kernel threads preempting real time user space processes?

I created some processes in user space and tried to visualize its working in **kernelshark** with the trace recorded using **trace-cmd.** But kernel processes like the ones shown below are preempting my processes with real-time priority 98. I use the scheduler SCHED_FIFO for the processes that I have created in user space.               PID  PPID CLS PRI RTPRIO CMD          359     1 TS   19      - mount.ntfs /dev/disk/by-uuid/AC72763B72760A7A /root     366     2 TS   39      - [loop0]      What can I do to run my processes uninterrupted by these kind of kernel processes?


How to migrate from Proxmox to VMWare?

I am wondering how it is possible to migrate a full hardware VM in Proxmox (qemu) to a full hardware VM in VMWare (vmdk). I have been searching all over the place, and it seems almost impossible to find anything at all. The Linux kernel version from the Proxmox VM is Linux 2.6.32-19-pve. Anyone got any ideas, or even better experience, with migrating from Proxmox -> VMWare?


Application in terminal still running but not directly accessible

> **Possible Duplicate:**   >  How to suspend and bring a background process to foreground I have kind of an odd problem which I haven't encountered before. Here's what I did: I started an application with `./myApp`. No command line arguments, no `&` to make it run in background. Unfortunately, my system froze at some point. No access via the GUI was possible, so I decided to first stop all CPU-intensive tasks. So I brought up a `tty` (Shortcut `Ctrl` + `Alt` + `F2` on Ubuntu) and did `kill -STOP pid`, after getting the right `pid` of `myApp` with `top`. Luckily, after some extra time, the system became unfrozen. So I restarted the process with `kill -CONT pid`. But here's what I see in the terminal:               [2]+ Stopped  ./myApp      And now the terminal is in the state as if the application isn't running (i.e. I can do `ls` or whatever I like), but the process manager still reports the application to be running. I'm very glad it does, because I would lose 34 hours of computing time (and yes, it's an extremely bad app; not written by me, of course), since there is no output at all to file. When the heavy task of the application is finished (expectedly in a couple of hours), I need to enter a specific task inside of the application to make it write to file (it is somewhat of a custom shell prompting for input, so I guess `cin` is in use). So the question is: How to bring me back to the application such that I see its output and can interact with it? If not possible: is it possible to stream into the app and initiate the required command without restarting the app? **Update** The application does still output to the exact same terminal. FYI, as you might need it: I'm running Ubuntu x86 with kernel 3.2.0-36


How to ssh to a server using another server with key from the second server?

How to configure ssh to imitate this:               ssh server1-user-name@server1.net -i /path/to/.ssh/server-1-ssh-key -t ssh server2-user-name@10.0.0.10 -i /home/server1-user-name/.ssh/server2-ssh-key      When I execute               ssh server2      Explanation:   * I'm login to server1.net with a key from my local machine (`/path/to/.ssh/server-1-ssh-key`)              ssh server1-user-name@server1.net -i /path/to/.ssh/server-1-ssh-key        * then I log in to a server with the following IP 10.0.0.10. To do this I use the key (`/home/server1-user-name/.ssh/server2-ssh-key`), which is stored on server-1 How should the ssh configuration look like for this case on my local machine? I tried the following configuration:               Host server2       Hostname 10.0.0.10       User server2-user-name       ForwardAgent yes       ProxyCommand ssh -i /path/to/.ssh/server-1-ssh-key -W %h:%p      But it does not work.


USB modalias. Meaning of numeric values

For the USB modaliases, I know that the values corresponding to the device's vendor and product ids can be found here: http://www.linux-usb.org/usb.ids Which online resources and/or kernel source files, I could use to find the meaning for the rest of the ids: d, dc, dsc, dp, ic, isc, ip, in? For example, I've got this modalias:               usb:v0525pA4A5d0001dc02dsc00dp00ic02isc02ip01in00      Finding the meaning of vendor id (0525) and product id (a4a5) is easy using aforementioned web-page. But I have no idea where to look up the rest of the ids. Update: I understand what the letters mean (v, p, d, dc, etc). But the numeric values are in question. Update2: Take this article for example. Among other things the author says that "The 0900 device class/subclass means hub" and that "Interface class 0E01 is video control". But where does this knowledge come from? In my case: device class/subclass (dc:dsc) is 0200. interface class/subclass (ic:isc) is 0202. What does these numbers mean? Where to lookup them?


Kernel panic not syncing : Attempted to kill init

OEL 5.9 (Tikanga) 2.6.18-371.6.1.0.1.el5 On boot I get the following errors: > ... > > exec of init (/sbin/init) failed!!!: No such file of directory > > Kernel panic - not syncing - Attempted to kill init! > > ... After this I booted to the OEL 5.9 CD in recovery mode. I tried to chroot to `/mnt/sysimage` with the following error: > chroot: cannot run '/bin/sh' : No such file or directory If I cd to `/mnt/sysimage` all of my files are there in `/bin` and `/sbin` (all files appear to be OK permissions and else). I am even able to open a new shell env by executing `/mnt/sysimage/bin/sh` without any issue.


Find records dated before today

how to find record form bellows data having "Last Date" before today's date. i.e : if today date is 09-04-2014 then finding record having "Last Date" before 09-04-2014 -               Email ID : abc@domain.com      Last Date : 30-04-2014     --     Email ID : abc@domain.com      Last Date : 18-03-2014     --     Email ID : abc@domain.com      Last Date : 18-02-2013     --     Email ID : abc@domain.com      Last Date : 18-05-2015     --     Email ID : abc@domain.com      Last Date : 01-05-2012     --     Email ID : abc@domain.com      Last Date : 09-04-2014      Expected output will be:               Email ID : abc@domain.com      Last Date : 18-03-2014     --     Email ID : abc@domain.com      Last Date : 18-02-2013     --     Email ID : abc@domain.com      Last Date : 01-05-2012


Is it possible to get uid table in Linux?

I'm a student in a university and I can `finger` and `id` all users (students etc) through SSH. Here is the id command               e147200@beluga:~$ id e201634     uid=22678(e201634) gid=3561(stat_bs) groups=3561(stat_bs)      Here I can see that the student with id e201634 is agraduate student (bs) at Statistics department (stat). Is there a way to download this gid (or groups) table?               3561 stat_bs     3562 stat_ms     3611 chem_bs     3687 biol_bs     ...


Intel Advanced-N 6235 wireless monitor mode problem

As far as I know, iwlwifi drivers (and this particular wireless card) support monitor mode. The only requirement is to install the latest driver from http://wireless.kernel.org/en/users/Drivers/iwlwifi (in this case, _iwlwifi-6000g2b-ucode-18.168.6.1_ will do the trick). The scenario is the following: BackTrack LiveCD booted in a laptop with this wireless card. The wireless does not work until the above driver is downloaded and loaded into the kernel via `modprobe`. After that, wireless do work (can connect to different networks, being stable, etc). However, when trying to activate monitor mode (`airmon-ng start wlan0`), it will never activate _mon0_ (monitor interface). I have some experience on this with an Alfa 1W and I was expecting a similar result with this card, but it seems that I am missing something, or maybe the drivers does not support monitor mode (using the wrong ones?). I have been googling around but I did not found any specific solution, so hopefully someone can suggest some workaround!


rename files with rename command

Please advice what is wrong with the following command               find /tmp/dir -name "* *" -type f | rename 's/*/fixed_/g'      remark - I prefer to do that with one command not loop syntax What I want is to rename all the files under /tmp/dir , by adding the name **fixed_** before each file For example ( the files )               Fevc.txt     Ddve.txt      Should rename to:               fixed_Fevc.txt     fixed_Ddve.txt


Linux always send ICMP redirect

I have several Debian Squeeze (6.0.6 up to date) used as routers.   When a link is down, they send ICMP redirects to local hosts. This is the default behaviour of Debian and several others. So once the link comes back to life, the hosts can't reach it until reboot. I don't want any ICMP redirect to be sent from those routers. I tested `echo 0 > /proc/sys/net/ipv4/conf/all/send_redirects` and `sysctl -w net.ipv4.conf.all.send_redirects=0` and putting `net.ipv4.conf.all.send_redirects=0` into `/etc/sysctl.d/local.conf`   Every of those solution put the right value into `/proc/sys/net/ipv4/conf/all/send_redirects` But...   the kernel keep sending ICMP redirects. Even after a reboot :               $ tcpdump -n -i eth0     00:56:17.186995 IP 192.168.0.254 > 192.168.0.100: ICMP redirect 10.10.13.102 to host 192.168.0.1, length 68      And the routing table of local hosts (Windows computers) are polluted. I can prevent this with netfilter :   `iptables -t mangle -A POSTROUTING -p icmp --icmp-type redirect -j DROP` Any idea about why the usual method doesn't work ?   And how to prevent ICMP redirect to be sent, without using netfilter ?


Closing a file descriptor, >&- vs <&-

In the bash tutorial I am reading, it says that if you open a file descriptor for reading, i.e.               exec 3< echolist      Then you must close it like this,               exec 3<&-      However, if you open a file descriptor for writing, it must be closed like this:               exec 3>&-      Yet when I look on the internet, I see people opening files and then closing them with this:               exec 3>&-       **NOTE:** when, according to the tutorial, they should be using `exec 3<&1`. So my question is, can all file descriptors be closed via `exec n>&-` where n is the file descriptor number? Regardless if it was opened for reading, writing, or both?


Will a running program be killed if I suspend my OS?

I am running a program. If I suspend my OS (Ubuntu 12.04) in the middle, will the process of the running program be killed? If not, when I wake up my OS, how can I resume the process? Thanks!


Tracing executable without read permissions

I found some surprising behavior on Ubuntu 14.04 when using `strace` on an executable, which I do not have read permission on. I wonder if this is a bug, or if some standard mandates this obscure behavior. First let's see what happens when I start an ordinary executable in the background and attach to it. As expected this works:               $ /bin/sleep 100 &     [2] 8078     $ strace -p 8078     Process 8078 attached     restart_syscall(<... resuming interrupted call ...>      Next I try with an executable, which I have no read permissions on:               ---x--x--x 1 root root 26280 Sep  3 09:37 sleep*      Attaching to this running process is not permitted:               $ ./sleep 100 &     [1] 8089     $ strace -p 8089     strace: attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted      This is also what I would expect. Granting execute permission without read permission wouldn't do much good, if I could simply attach a debugger to the process and effectively have read permissions on the executable that way. But if I start the executable under an already traced process, I am permitted to do so:               $ strace ./sleep 100     execve("./sleep", ["./sleep", "100"], [/* 69 vars */]) = 0     brk(0)                                  = 0x9b7a000      This is unexpected for me. Is this a security bug, or is it a feature mandated by a standard?


Lock screen w/ slock after a certain time?

I am running OpenBox in Arch Linux, how can I set it up so that I can have slock lock my screen after a certain amount of time (with no activity)? Thanks!


Job to keep a count of XML files

My friend works in a IT company where he is required to keep a count of XML files inside a directory (including subdirectories). However the count using `ls -LR | grep .xml` or similar takes a lot of time as the count of files is in the millions. I was thinking what can be a better approach? Can some kind of background process take care of this, so that whenever there is a new file created or modification time change, it affects the counter (no. of files)?


Execute a command for each entry in a file

How can I execute a command for file which has address of jar files. The command that I want to execute is `jar xf entry.jar`. I d like to execute that command and sent the outputs to another file. Assume my file contains following entries.               a.jar     b.jar     c.jar      What I want is simply extract these jar files and sent the output to another file.


how to touch files like report-07/05/13

when I want to touch files like `report-05/07/13` with command `touch report-$(date +%D)` it gives me an error like this: `touch: cannot touch`report-07/05/13': No such file or directory` How can I build one? By the way there is "NO FOLDER" it is JUST THE FILENAME.


Change name of em1 to eth0 in Fedora 19?

I have already followed the instructions here but it doesn't seem to work, as my ifconfig output still shows the same "em1","em2" and "lo". I just need a way to rename one of these to eth0 in Fedora 19, since other methods dont seem to work. Matlab needs eth0 to activate, and I am stuck.


Can I share /usr/local between multiple Linux distributions?

I tried Ubuntu 12.04 and based on my understanding I made the following partitions:   * 2GB Swap (I have 2GB of RAM)   * 1GB `/boot`, since I'll be installing different kernel versions (I'm starting kernel development)   * 35GB `/var`   * 40GB `/usr/local`   * 407GB `/home`   * 15GB `/` (root) Now I want to install OpenSUSE 12.2 alongside Ubuntu 12.04. Can I share `/var` and `/usr/local` among the two OSes? I know they are two different distros with different packages, but is there any way I can share the disk space? So that both OSes can have their own `/usr/local` in the same partition or something like that?


Grep to search directories for patterns inside a text file

I have a file where it contains a list of search patterns (`searchPattern.txt`). Its contents is similar to the contents below where there are 3000+ of them.               123456     234567     345678     .     .     .      What I wanted to do is to use `grep` and search directories using the patterns listed in the file if they exist. It would be similar to this kind of command but instead of one search string there are many and its listed in a file.               grep searchPattern.txt diagnostics*      Although the command above doesn't work its just an idea as to what I wanted to happen. Can this be done with `grep`? If it can't be done can someone suggest a better way to do this?


Mac OSX vs Linux Unix-ness

So I know that Linux is considered "Unix-like" while OSX _is_ Unix. Why is this? I feel like Linux is much more "Unix-like" than OSX is. What makes OSX more "Unix" than Linux?


Find out extension of executable files?

When I am building software from source on a GNU+Linux system, during the `./configure` stage I frequently see the following line:               checking for suffix of executables...      How do I create such a check in a bash script? The reason I want to know this is that I want to create a makefile in which it compiles with suffix .exe on Cygwin, but no suffix on true GNU+Linux.


How can I autologin to desktop with systemd?

How can I configure systemd to automatically log me in to my desktop environment, preferably without using login manager? I'm using Arch.


automatically download latest stable tarball from sourceforge from command line?

I'd like to install a program from sourceforge sources. Is there a way to download the latest stable source from SourceForge? an example for `ntopng` would be very welcome.


How can I stop dolphin from reading my entire home directory tree in order to make it usable on AFS?

At work, I would like to use KDE's `dolphin` as a file manager. However, our home directories reside on an AFS share [1]. When starting dolphin, it becomes unresponsive for dozens of minutes. stracing it reveals that it tries to open all the nodes in our AFS tree:               openat(AT_FDCWD, "/afs/somewhereElse.tld", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC      I need to stop dolphin from doing that; this behaviour makes the program completely unusable on AFS trees. Is there some setting that controls this? * * * [1] If you have never worked with AFS before, for the sake of this question, assume that there is a root directory that has subtrees from different universities, research institutes etc. mounted below it. The data in those subtrees really reside at the remote sites, so access is slow and resource- intensive.


Piping content with multiple spaces

I was attempting to copy files listed in a text file into a directory such as:               cat files.txt | xargs  -I{} cp "{}" ~/Desktop/temp      However I noticed that some files would not copy over. The files that wouldn't copy over had double spaces in the name such as "My   Document.pdf". I did a little testing and simply piping an echo removes all the spaces except for one. For example:               echo "Hello         World" | xargs echo      simply returns "Hello World". Is there a way when piping to tell it to preserve spacing in the content? Thanks in advance, Scott


trapping signals inside grouping commands

I recently ran into a strange behavior. Trap doesn't get executed if inside grouping command:               $ cat ./1.sh     #!/usr/bin/env bash     set -eu     trap 'echo exit' EXIT     $ ./1.sh     exit     $ cat ./2.sh     #!/usr/bin/env bash     set -eu     echo test | { trap 'echo exit' EXIT; }     $ ./2.sh      Is it as it's supposed to be?


What is the terminal's graphic API?

How can certain programs set background and font colors, write characters to the same location on screen (e.g. to the third row, fifth column) more than once? Some examples are the progress bar displayed by `curl google.com > a`, some installation screens and nearly any text editor.


install php5-fpm on Debian Squeeze

I tried in many ways to install php5-fpm in om Debian squeeze, but couldn't. I was wondering if I have to upgrade php5.3.3 to higher version because it doesn't seem to work on lower than php5.4 I have no idea if Php5-fpm can be installed on Debian squeeze php5.3 base or not?? I used this commend line to do so, but returned an error:               apt-get install php5-fpm      any help is appreciated!


Sed --- replace a character in a matched line in place?

In a file containing lines like this one:               # lorem ipsum blah variable      I would like to remove `#` (comment) character in the same line that contains a specific string, in place. Is `sed` good for this? I'm struggling to get this conditional working. I have a "clumsy" way of doing this; I can find the matching line number with `awk` or `sed` and then use this number in a separate `sed` command, but I believe that this can be done in a much better way.


Why ACPI Namespace keeps changing

Does anyone know why the ACPI namespace keeps changing? I had a script a while back on a Red Hat system which read the CPU temperature from '/proc/acpi/thermal_zone/THRM'. Now I have a new (but similar hardware) and relatively same distro (except for a few drivers here and there) and it has changed to '/proc/acpi/thermal_zone/TZ00' and '/proc/acpi/thermal_zone/TZ01'? Is this even the CPU thermal? Or is it for something else? I know most will say, read the ACPI docs... But that's beyond the point. Why and who keeps changing the namespace?


Is it safe to leave a enc folder mounted?

I was looking at this and ecryptfs seems cool. I'd like to use it on my server to encrypt git pushes. I dont want to ssh in everytime to mount/unmount the encrypted folder. However once in a while when i reboot or whatever it is fine. I like the idea that someone at my provider cant see my folder when scanning through a bunch of harddrives but is it relatively safe that the folder is always mounted? I dont think the password would be in memory plaintext? nor can someone connect to my server due to it being on the network and be able to access files? (the enc/prv folder would be 700) Do i really have anything to worry about if i leave it mounted all the time? My server is debian 6 (squeeze) if thats interesting.


How can I update the OS on an Iphone on a Linux machine

As I understand it, the iPhone will pop up some options on a Windows computer to update the system when you plug it into the computer. Honestly, I don't own an iPhone, but my friend wants to use my computer to update hers, because it's not receiving data properly. So is it possible for me to mount the phone and push some data to it? or otherwise update it? only relevant looking link I found via google was suggesting a VM, which more than I want to do. Tutorial links are of course welcome. Also please advise if there's a decent chance doing this this way could brick the phone.


Save display settings for specific monitor

When i'm connecting an external Monitor to my notebook (specs below), whether with VGA or Displayport, I always have to configure the screen resolution and display position. At the moment i'm doing this with an GUI utility for XRandR calld arandr. Another issue is, that always the lowest possible display resolution is used, instead of the highest, when connecting a monitor. Is it possible to automatically recall a previously made configuration every time I connect a specific monitor? For example, when I connect the monitor at work, I want to the displays setup side-by-side, at home instead, I use a vertical layout. This problem exists with both of my laptops. They are running Fedora 18 and Xubuntu 13.04, all with XFCE as Window Manager. They are the same devices, Lenovo X220, with the integrated Intel HD3000 graphics. **Update** I tried to make a per monitor setting, but unfortunately fedora don't uses a xorg.conf file , instead it tries to do an automatic configuration every time X is started (see create xorg.conf) Creation of xorg.conf file with `Xorg :1 -configure`, like described in the fedora wiki, fails with `Number of created screens does not match number of detected devices. `. **Workaround** I've made a little workaround that solves the problem, but only for displays connected at the displayport. Arandr can save the display setup as shell script, so i used the saved settings and putted them into the `.xinitrc`. `cat ~/.screenlayout/<name_of_your_settingsfile>.sh > ~/.xinitrc` `chmod u+x ~/.xinitrc` That should do the trick, if someone has a better way to do it, please let me know.


Why does Debian under-report the space available when installing Qt?

I want to install Qt on my Debian but it doesn't detect the whole free space! I tried to install it in /home/Qt but it says that only 23.87 MiB of space is available while `df -h` says that there is still 7.2G free. ![enter image description here](http://i.stack.imgur.com/rvQQl.png)


Append line to many files

I want to add some text to over 200,000 files I am trying this               find . -name *.txt -print | xargs -I % echo "hello world" >> %      But nothing is happening. When i run `find . -name *.txt` it work by itself as does `echo "hello world" >> myfile.txt`


How to make startx use alternate xinitrc?

I don't have a desktop manager installed (and I don't want to). After logging in through the terminal I use `startx` to start the GUI. I have entries in `~/.xinitrc` for my GUI sessions. Right now I have xmonad in there, but sometimes I want to run a GNOME session, and sometimes a KDE session. I used to edit `~/.xinitrc` for that purpose, but I think there should be a more elegant way (something like using alternate configurations). However, I can't find anything in `man startx` or `man xinit`. I plan to have several configuration files (one for each GUI session), and then tell `startx` to load them when I want. How can I do that?


How do I reimage OpenWRT?

How do I reimage openwrt in such a way that all my settings will be lost. I've been having some issues, and I want to ensure that it's not a lingering setting, I want this to be a fresh install.


On-the-fly monitoring HTTP requests on a network interface?

For debugging purposes I want to monitor the http requests on a network interface. Using a naive `tcpdump` command line I get too much low-level information and the information I need is not very clearly represented. Dumping the traffic via `tcpdump` to a file and then using `wireshark` has the disadvantage that it is not on-the-fly. I imagine a tool usage like this:               $ monitorhttp -ieth0 --only-get --just-urls     2011-01-23 20:00:01 GET http://foo.example.org/blah.js     2011-01-23 20:03:01 GET http://foo.example.org/bar.html     ...      I am using Linux.


Can't shutdown mandriva 2010.2

I can't seem to shutdown my machine from mandriva,I have to restart to shut it down from GRUB it says "System Halted" and just freezes there I'm using the x86_64 GNOME version I've already asked on mandriva forums and they couldn't determine the cause of this problem P.S. I'm using the 2.6.36.2-desktop-2mnb kernel


How do I know from a BeagleBone Black if it is connected via USB (as a client/slave)?

BeagleBone Black has an USB port which allows the user to access it through ssh. In general, we could say that when you plug it to a PC, the PC is the USB host and the BBB is the USB client. On the other hand, it is also possible to turn the BBB on without the USB cable, through its AC cable. I would like to know if it is possible to check, from the BBB point of view, if there is an USB cable plugged to the BBB or not.


Install rcp on RHEL

I have a Linux Red Hat machine version 6.4 (64-bit). I notice that the `rcp` command does not exist on my machine (no `rcp` binary). I also searched in Google in order to find an `rcp` binary that will fit for my Linux machine but with no success. Where I can download `rcp`?


Merge 2 files based on all values of the first column of the first file

I need to merge below 2 files:   * **file1** :  > TABLES REF-IO HEAD-IO DIFF-IO   >  test 200 500 -300   >  exam 2 3 -1   >  final 2 1 1   >  mail 4 2 2   >  TOTAL 208 506 -298   >   * **file2** : > TABLES REF-SELECT HEAD-SELECT DIFF-SELECT   >  test 5 7 -2   >  game 3 3 0   >  exam 0 7 -7   >  final 12 6 6   >  TOTAL 20 23 -3   > **merged file should be as shown below:** > TABLES REF-IO HEAD-IO DIFF-IO REF-SELECT HEAD-SELECT DIFF-SELECT   >  test 200 500 -300 5 7 -2   >  exam 2 3 -1 0 7 -7   >  final 2 1 1 12 6 6   >  mail 4 2 2 0 0 0   >  TOTAL 208 506 -298 20 23 -3   >


Change kernel parameters at runtime

While trying to fix an obscure hardware bug, it was suggested that adding a couple of parameters to the kernel might resolve the issue. I can of course do that, but I was wondering whether I can make these changes to a running kernel. In particular, I know that `procfs` and `sysfs` provide a way to make changes to the running kernel, but I am unsure how to map kernel parameter names to file paths. (I also presume that not _all_ settings are changable at runtime, and these particular parameters might well not be configurable once the system is booted.) The specific parameters I'm interested in are               i8042.nomux=1 i8042.reset      I'm particularly unsure as to whether it's possible to issue the reset command on a running system. If these parameters _are_ tweakable at runtime, where would I find them?


RHEL6 Can't make my script run on shutdown and reboot

I'm trying to execute a script in each shutdown and reboot but the script never runs.   1. I created the script baseRhel64 and save it to `/etc/rc.d/init.d`   2. I did `chkconfig --add baseRhel64`   3. I included in the script              #chkconfig --list     # chkconfig: 06 10 10        4. I verified that the S10 script where created under `/etc/rc0.d/S10baseRhel64` and `/etc/rc6.d/S10baseRhel64` The following is my script:               #!/bin/sh          #chkconfig --list     # chkconfig: 06 10 10          start(){         echo "`basename $0` start"         touch /root/installscripts/test1     }          stop(){         echo "`basename $0` stop"         touch /root/installscripts/test2         touch /root/installscripts/"`basename $0`"     }          case "$1" in         start) start;;         stop) stop;;         *)          echo $"Usage: $0 {start|stop}"         RETCAL=1     esac     exit 0


Using xargs with git

I am trying to practice using `xargs`. I tried the following, passing the SHA1 via `xargs`:               $ git show SHA1 --name-only      I also tried:               $ git log --author=jim --grep="patch" |head -n 1|cut -d ' ' -f2|xargs {} git show {} --name-only      It returned `xargs: {}: No such file or directory` So, I moved on to this:               $ git log --author=jim --grep="patch" |head -n 1|cut -d ' ' -f2|xargs -0 -I {} git show {} --name-only      Which returned:               fatal: ambiguous argument 'a1237ac27321f2daea365787664e4119b339c483': unknown revision or path not in the working tree.     Use '--' to separate paths from revisions, like this:     'git <command> [<revision>...] -- [<file>...]'      The SHA mentioned is the correct one, but I don't understand why this does not work either


init: /etc/init.conf: Unable to load configuration: No such file or directory

Running Linux 6 on VMWare, I noticed this in the system message log: > init: /etc/init.conf: Unable to load configuration: No such file or > directory What's the cause of this error? How do I resolve it?


find -exec in bash script with variable expansion

I'm trying to run a command similar to the one below in a bash script. It should search through all subfolders of $sourcedir and copy all files of a certain type to the root level of $targetdir.               #!/bin/bash          # These are set as arguments to the script, not hard-coded     sourcedir="/path/to/sourcedir"     targetdir="/path/to/targetdir"          find "$sourcedir" -type f -name "*.type" -exec sh -c 'cp "$1" "$2/`basename "$1"`"' "{}" "$targetdir" \;      This seems to be pretty close, except that {} isn't being passed in as $2 to "-exec sh -c ..." I would like to do this as close to the "right way" as possible, with tolerance for special characters in filenames (specifically single quote characters). Thanks in advance! **Edit:** I see people suggesting using xargs or argument chaining. I was under the impression that this is only ok for a limited number of arguments. If I have, for example, thousands of .jpg files I'm trying to copy from a number of gallery directories into a giant slideshow directory, will the solutions chaining arguments still work? **Edit 2:** My problem was I was missing a _ before my first option to sh in the -exec command. For anyone who is curious about how to make the find command work, add the _ and everything will be fine:               find "$sourcedir" -type f -name "*.type" -exec sh -c 'cp "$1" "$2"' _ "{}" "$targetdir" \;      I have accepted an answer below though because it accomplishes the same task, but is more efficient and elegant.


repair the static route to allow traffic to right place

I recently was taking an online test and I got the below question. The server has been configured with a TUN device `tun-aib0` that acts as an endpoint for a VPN tunnel. The IP address of the device is **192.xxx.xx.xx** and the network it is on is using a 22 bit netmask ( **255.255.252.0** ). The problem is that the server needs to be able to communicate with the **10.xx.xxx.x** network with a 24 bit netmask ( **255.255.255.0** ) but none of the traffic appears to be reaching the other VPN endpoint and instead is trying to be sent out to the public internet over `eth0`. Please repair the static route for **10.xx.xxx.0** so that traffic goes to the right place. I read the topics on subnet and kernel virtualization. I have a basic understanding on setting up of network. I am trying to figure out how should I approach the above problem. I believe it has to do something with `/etc/sysconfig/network` and setting up a bridge for eth0 in that file. However, I am not sure if am correct.


How to find inode number using "find" command?

How do you find the inode number of the name of files that start with a particular keyword like "test"? We'll assume that there are files called: test, test1, test2.


Error compiling drivers for Ralink RT2870

Im trying to install drivers for a rosewill RNX-N600UBE wireless card (Ralink RT2870 chipset) on Kali Linux. I downloaded the drivers form their website and unpacked/unzipped them, but now when i try to run the 'make' command i get this error.               /home/fox/System/2011_0427_RT3572_Linux_STA_v2.5.0.0.DPO/os/linux/../../os/linux/rt_linux.c:1156:20: error: incompatible types when assigning to type ‘int’ from type ‘kuid_t’     /home/fox/System/2011_0427_RT3572_Linux_STA_v2.5.0.0.DPO/os/linux/../../os/linux/rt_linux.c:1157:20: error: incompatible types when assigning to type ‘int’ from type ‘kgid_t’     make[4]: *** [/home/fox/System/2011_0427_RT3572_Linux_STA_v2.5.0.0.DPO/os/linux/../../os/linux/rt_linux.o] Error 1     make[3]: *** [_module_/home/fox/System/2011_0427_RT3572_Linux_STA_v2.5.0.0.DPO/os/linux] Error 2     make[2]: *** [sub-make] Error 2     make[1]: *** [all] Error 2      Im new to linux so any help is appreciated.


Postfix Relay Multiple Domains with Multiple Origins

I currently have Postfix relaying multiple hosted customer solutions which all works as expected. There are no local accounts and it is used solely as a relay server. In the config I have the following:               mydomain = hostdomain.com     myorigin = $mydomain      In email headers sent from the relay the following lines are seen:               Received: from mailrelay.hostdomain.com ([123.123.123.123])     Received: from sendername (unknown [1.1.1.1])         by mailrelay.hostdomain.com (Postfix) with ESMTP id 6119FA0441         for <end.user@gmail.com>; Wed, 16 Apr 2014 01:00:00 +0100 (BST)      We have multiple customers who wish to relay presenting themselves rather than as the server name. Examples being: Customer Domain - customer1a.com   Desired Headers:               Received: from mailrelay.customer1a.com ([123.123.123.123])     Received: from sendername (unknown [1.1.1.1])         by mailrelay.customer1a.com (Postfix) with ESMTP id 6119FA0441         for <end.user@gmail.com>; Wed, 16 Apr 2014 01:00:00 +0100 (BST)      Customer Domain - customer2b.com   Desired Headers:               Received: from mailrelay.customer2b.com ([123.123.123.123])     Received: from sendername (unknown [1.1.1.1])         by mailrelay.customer2b.com (Postfix) with ESMTP id 6119FA0441         for <end.user@gmail.com>; Wed, 16 Apr 2014 01:00:00 +0100 (BST)      Is this possible to achieve? The documentation I have read includes virtual aliases but I can't see a way listed to achieve the above?


How to get address of connected USB modem?

I just connected my N81 telephone as USB modem to Linux Mint 14. All works fine, just wondering how to find a full path to this device, something like `/dev/tty*`.


How can I identify lines in files over a certain length

I'd like to find lines in my code which exceed a certain length. My code is in multiple files. What's a good way to do this? I'd like to know the files and line numbers; content would be preferred, but not necessary. The purpose of the exercise is to then figure out how to break the lines (probably manually).


what will ¬ do in bash?

While wanting to start `gitg` as backgrounded through writing `gitg &` I accidentally typed `gitg ¬`. This did not cause an error, instead I got with a later command in the same terminal (translated): `[1]+ Finished gitg` I am not sure if the two things were related. Anyway: Does anybody know what `<programm> ¬` will do?


how to disable flareget from firefox?

Hello I want to disable flareget from mozilla firefox. Whenever I click on some download button flareget starts downloading the file. But I want to download by the browser downloader.


Read the middle of a large file

I have a 1 TB file. I would like to read from byte 12345678901 to byte 19876543212 and put that on standard output on a machine with 100 MB RAM. I can easily write a perl script that does this. sysread delivers 700 MB/s (which is fine), but syswrite only delivers 30 MB/s. I would like something more efficient, preferably something that is installed every Unix system and that can deliver in the order of 1 GB/s. My first idea is:               dd if=1tb skip=12345678901 bs=1 count=$((19876543212-12345678901))      But that is not efficient. Edit: I have no idea how I measured syswrite wrong. This delivers 3.5 GB/s:               perl -e 'sysseek(STDIN,shift,0) || die; $left = shift; \              while($read = sysread(STDIN,$buf, ($left > 32768 ? 32768 : $left))){ \                 $left -= $read; syswrite(STDOUT,$buf);              }' 12345678901 $((19876543212-12345678901)) < bigfile      and avoids the `yes | dd bs=1024k count=10 | wc` nightmare.


Can iptables be used to convert a single-homed host into a NAT server?

**Given:** I have a machine (HostA) with **only** one NIC which has Internet connectivity. I have another machine (HostB) with one NIC on the same switch. HostB is _not_ configured for Internet access yet. HostA has its default gateway and DNS servers appropriately configured. IPv4 is being used. OSes on the hosts are Ubuntu 13 and Fedora17. **What I want:** Now, I would like HostB to have Internet connectivity, too. Is this possible using 'some' combination of `iptables`, virtual tun/tap devices, or a VPN setup between HostA and HostB, etc? **What I already know and can do:** Currently, I can use an `ssh`-based SOCKS proxy on HostB (`ssh -D 9050 UserA@HostA`) and route traffic of select 'socksifiable' applications on HostB via this proxy to HostA and beyond. However, sadly, not all applications are socksifiable. Now, I know very well that if HostA had 2 NICs, I could have used some `iptables` rules to convert HostA into a gateway that would then route traffic between its NIC-1 and NIC-2 (where NIC-1 would be connected to HostB and NIC-2 to Internet). But installing another NIC in HostA is not feasible for me. PS: I had posted this earlier on superuser.com but got no useful information. **edit 1:** network information Host A:               :> ip addr     [...]     2: p4p1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000     link/ether d4:be:d9:d5:46:05 brd ff:ff:ff:ff:ff:ff     inet 192.168.22.9/24 brd 192.168.22.255 scope global p4p1           :> ip route     default via 192.168.22.254 dev p4p1 proto static     192.168.22.0/24 dev p4p1 proto kernel scope link src 192.168.22.9      Host B:               :> ip addr     [...]     2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000     link/ether 30:f9:ed:d9:2e:20 brd ff:ff:ff:ff:ff:ff     inet 192.168.22.234/24 brd 192.168.22.255 scope global eth0           :> ip route     169.254.0.0/16 dev eth0 scope link metric 1000     192.168.22.0/24 dev eth0 proto kernel scope link src 192.168.22.234 metric 1


Undocumented pppd exit code

If my machine (OSX 10.9.2) is not connected to the Internet and I want to establish pptp connection by using **pppd** :               $ sudo /usr/sbin/pppd serviceid 5BE14D3A-7B94-4704-ADE0-9883B189199E debug logfile /tmp/ppp.log plugin /System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp plugin pptp.ppp remoteaddress 11.22.33.44 redialcount 1 redialtimer 5 idle 1800 mru 1500 mtu 1448 receive-all novj 0:0 noipdefault ipcp-accept-local ipcp-accept-remote user bbbbbb password cccccc hide-password noaskpassword looplocal defaultroute usepeerdns mppe-128 nodetach logfd 1      pppd outputs:               Thu Mar 27 15:09:30 2014 : publish_entry SCDSet() failed: Success!     Thu Mar 27 15:09:30 2014 : publish_entry SCDSet() failed: Success!      and terminates with exit code **25** :               $ echo $?     25      **Why pppd returns with exit code which is notdocumented?** Expected exit codes are in the range [0, 19]. Where does this exit code come from? Does this exit code have description? Are there any other "hidden" exit codes for pppd? If I connect to the Internet and run the same command, pptp connection gets established. Last couple of lines of _dtruss_ output are:               $ /usr/bin/sudo dtruss /usr/sbin/pppd serviceid 5BE14D3A-7B94-4704-ADE0-9883B189199E debug logfile /tmp/ppp.log plugin /System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp plugin pptp.ppp remoteaddress 11.22.33.44 redialcount 1 redialtimer 5 idle 1800 mru 1500 mtu 1448 receive-all novj 0:0 noipdefault ipcp-accept-local ipcp-accept-remote user bbbbbbb password cccccccc hide-password noaskpassword looplocal defaultroute usepeerdns mppe-128 nodetach logfd 1     Fri Mar 28 10:31:10 2014 : publish_entry SCDSet() failed: Success!     Fri Mar 28 10:31:10 2014 : publish_entry SCDSet() failed: Success!     Fri Mar 28 10:31:10 2014 : PPTP connecting to server '11.22.33.44' (77.75.123.187)...     Fri Mar 28 10:31:10 2014 : PPTP connect errno = 49 Can't assign requested address     SYSCALL(args)        = return     close(0x3)       = 0 0     getuid(0x0, 0x1103, 0x7FFF772B14E0)      = 0 0     getgid(0x0, 0x1103, 0x0)         = 0 0     getuid(0x7FDEA8D00A80, 0x0, 0x1)         = 0 0     seteuid(0x0, 0x0, 0x0)       = 0 0     open_nocancel("/var/root/.ppprc\0", 0x0, 0x1B6)      = -1 Err#2     seteuid(0x0, 0x7FFF76AB4430, 0xFFFFFFFFFFFFFFFF)         = 0 0     open("/tmp/ppp.log\0", 0xA09, 0x1A4)         = -1 Err#17     open("/tmp/ppp.log\0", 0x9, 0xFFFFFFFFFFFFFFFF)      = 3 0     open_nocancel("/System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp\0", 0x1100004, 0x7FDEA8D00D70)       = 4 0     __sysctl(0x7FFF54902F38, 0x2, 0x7FFF76AB4180)        = 0 0     fstatfs64(0x4, 0x7FFF54902F88, 0x0)      = 0 0     getdirentries64(0x4, 0x7FDEAA000600, 0x1000)         = 88 0     getdirentries64(0x4, 0x7FDEAA000600, 0x1000)         = 0 0     close_nocancel(0x4)      = 0 0     open_nocancel("/System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp/Contents\0", 0x1100004, 0x7FDEA8D01173)      = 4 0     fstatfs64(0x4, 0x7FFF54902F58, 0x0)      = 0 0     getdirentries64(0x4, 0x7FDEAA000600, 0x1000)         = 240 0     getdirentries64(0x4, 0x7FDEAA000600, 0x1000)         = 0 0     close_nocancel(0x4)      = 0 0     open("/System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp/Contents/Info.plist\0", 0x0, 0x1B6)       = 4 0     fstat64(0x4, 0x7FFF54903218, 0x0)        = 0 0     read(0x4, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>BuildMachineOSBuild</key>\n\t<string>13C40z</string>\n\t<key>CFBundleDevelopmentReg", 0x4F1)      = 1265 0     close(0x4)       = 0 0     stat64("/System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp/Contents/MacOS/PPPDialogs\0", 0x7FFF54903C08, 0x7FFF54904156)   = 0 0     stat64("/usr/lib/libesp.dylib\0", 0x7FFF549031C8, 0x7FFF54904070)        = -1 Err#2     stat64("/System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp/Contents/MacOS/PPPDialogs\0", 0x7FFF54902E88, 0x7FFF54903D30)   = 0 0     stat64("/System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp/Contents/MacOS/PPPDialogs\0", 0x7FFF54903B18, 0xF9A90)      = 0 0     open("/System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp/Contents/MacOS/PPPDialogs\0", 0x0, 0x1FF)         = 4 0     read(0x4, "\317\372\355\376\a\0", 0x200)         = 512 0     close(0x4)       = 0 0     stat64("/System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp/Contents/MacOS/PPPDialogs\0", 0x7FFF54902E68, 0x7FFF54903D10)   = 0 0     open("/System/Library/SystemConfiguration/PPPController.bundle/Contents/PlugIns/PPPDialogs.ppp/Contents/MacOS/PPPDialogs\0", 0x0, 0x0)       = 4 0     pread(0x4, "\317\372\355\376\a\0", 0x1000, 0x0)      = 4096 0     fcntl(0x4, 0x3D, 0x7FFF54901190)         = 0 0     mmap(0x10B38C000, 0x2000, 0x5, 0x12, 0x4, 0x0)       = 0x10B38C000 0     mmap(0x10B38E000, 0x1000, 0x3, 0x12, 0x4, 0x2000)        = 0x10B38E000 0     mmap(0x10B38F000, 0x26F0, 0x1, 0x12, 0x4, 0x3000)        = 0x10B38F000 0     close(0x4)       = 0 0     open_nocancel("/System/Library/Extensions/pptp.ppp\0", 0x1100004, 0x7FDEA8D02370)        = 4 0     fstatfs64(0x4, 0x7FFF54902F88, 0x0)      = 0 0     getdirentries64(0x4, 0x7FDEAA000600, 0x1000)         = 88 0     getdirentries64(0x4, 0x7FDEAA000600, 0x1000)         = 0 0     close_nocancel(0x4)      = 0 0     open_nocancel("/System/Library/Extensions/pptp.ppp/Contents\0", 0x1100004, 0x7FDEA8D02573)       = 4 0     fstatfs64(0x4, 0x7FFF54902F58, 0x0)      = 0 0     getdirentries64(0x4, 0x7FDEAA000600, 0x1000)         = 232 0     getdirentries64(0x4, 0x7FDEAA000600, 0x1000)         = 0 0     close_nocancel(0x4)      = 0 0     open("/System/Library/Extensions/pptp.ppp/Contents/Info.plist\0", 0x0, 0x1B6)    = 4 0     fstat64(0x4, 0x7FFF54903218, 0x0)        = 0 0     geteuid(0x100000001103, 0x110000001100, 0x10B356308)         = 0 0     setsid(0x50000000603, 0x60000000600, 0x7FFF772B15A8)         = 3077 0     socket(0x22, 0x3, 0x1)       = 3 0     connect(0x3, 0x7FFF549046B0, 0x8)        = 0 0     fcntl(0x3, 0x3, 0x0)         = 2 0     fcntl(0x3, 0x4, 0x6)         = 0 0     socket(0x2, 0x2, 0x0)        = 4 0     open_nocancel("/usr/sbin\0", 0x1100004, 0x7FFF922AEB6E)      = 5 0     fstatfs64(0x5, 0x7FFF549031B8, 0x0)      = 0 0     getdirentries64(0x5, 0x7FDEAA000600, 0x1000)         = 4080 0     getdirentries64(0x5, 0x7FDEAA000600, 0x1000)         = 4072 0     getdirentries64(0x5, 0x7FDEAA000600, 0x1000)         = 648 0     getdirentries64(0x5, 0x7FDEAA000600, 0x1000)         = 0 0     close_nocancel(0x5)      = 0 0     stat64("/usr/sbin/Contents\0", 0x7FFF549039D8, 0x7FFF54903ABF)       = -1 Err#2     stat64("/usr/sbin/Resources\0", 0x7FFF549039D8, 0x7FFF54903ABF)      = -1 Err#2     stat64("/usr/sbin/Support Files\0", 0x7FFF549039D8, 0x7FFF54903ABF)      = -1 Err#2     stat64("/usr/sbin\0", 0x7FFF54903F58, 0x7FFF5490406B)        = 0 0     open_nocancel("/usr/sbin\0", 0x1100004, 0x7FFF922AEB6E)      = 5 0     fstatfs64(0x5, 0x7FFF54903188, 0x0)      = 0 0     getdirentries64(0x5, 0x7FDEAA000600, 0x1000)         = 4080 0     getdirentries64(0x5, 0x7FDEAA000600, 0x1000)         = 4072 0     getdirentries64(0x5, 0x7FDEAA000600, 0x1000)         = 648 0     getdirentries64(0x5, 0x7FDEAA000600, 0x1000)         = 0 0     close_nocancel(0x5)      = 0 0     stat64("/usr/sbin/pppd\0", 0x7FFF54903DC8, 0x7FFF54903E7E)       = 0 0     open("/usr/sbin/pppd\0", 0x0, 0x1FF)         = 5 0     read(0x5, "\317\372\355\376\a\0", 0x200)         = 512 0     close(0x5)       = 0 0     geteuid(0x7FDEA8D00030, 0x7FFF76F80258, 0x49656E69)      = 0 0     kevent64(0x5, 0x7FFF549043A8, 0x1)       = 1 0     open("/dev/null\0", 0x2, 0x0)        = 6 0     __sysctl(0x7FFF54903AC0, 0x2, 0x7FFF54903AD0)        = 0 0     getuid(0x7FDEAA001743, 0x7FFF54903D60, 0x0)      = 0 0     getgid(0x7FDEAA001748, 0x7FFF54903D60, 0x0)      = 0 0     sigaction(0x1, 0x7FFF54904758, 0x0)      = 0 0     sigaction(0x2, 0x7FFF54904758, 0x0)      = 0 0     sigaction(0xF, 0x7FFF54904758, 0x0)      = 0 0     sigaction(0x14, 0x7FFF54904758, 0x0)         = 0 0     sigaction(0x12, 0x7FFF54904758, 0x0)         = 0 0     sigaction(0x13, 0x7FFF54904758, 0x0)         = 0 0     sigaction(0x1E, 0x7FFF54904758, 0x0)         = 0 0     sigaction(0x1F, 0x7FFF54904758, 0x0)         = 0 0     sigaction(0x6, 0x7FFF54904758, 0x0)      = 0 0     sigaction(0xE, 0x7FFF54904758, 0x0)      = 0 0     sigaction(0x8, 0x7FFF54904758, 0x0)      = 0 0     sigaction(0x4, 0x7FFF54904758, 0x0)      = 0 0     sigaction(0xD, 0x7FFF54904758, 0x0)      = 0 0     sigaction(0x3, 0x7FFF54904758, 0x0)      = 0 0     sigaction(0xB, 0x7FFF54904758, 0x0)      = 0 0     sigaction(0xA, 0x7FFF54904758, 0x0)      = 0 0     sigaction(0x7, 0x7FFF54904758, 0x0)      = 0 0     sigaction(0x1B, 0x7FFF54904758, 0x0)         = 0 0     sigaction(0xC, 0x7FFF54904758, 0x0)      = 0 0     sigaction(0x5, 0x7FFF54904758, 0x0)      = 0 0     sigaction(0x1A, 0x7FFF54904758, 0x0)         = 0 0     sigaction(0x18, 0x7FFF54904758, 0x0)         = 0 0     sigaction(0x19, 0x7FFF54904758, 0x0)         = 0 0     stat64("/System/Library/Frameworks/Security.framework/Security\0", 0x7FFF549040D0, 0x7FFF8E1A1463)       = 0 0     stat64("/System/Library/Frameworks/Security.framework/Security\0", 0x7FFF54903188, 0x7FFF54904030)       = 0 0     csops(0xC05, 0x7, 0x7FFF54904510)        = 0 0     workq_kernreturn(0x20, 0x0, 0x1)         = 0 0     kevent64(0x5, 0x0, 0x0)      = 1 0     kevent64(0x5, 0x10B3AC3C8, 0x1)      = 1 0     workq_kernreturn(0x20, 0x0, 0x1)         = 0 0     kevent64(0x5, 0x0, 0x0)      = 1 0     workq_kernreturn(0x20, 0x0, 0x1)         = 0 0     workq_kernreturn(0x20, 0x0, 0x1)         = 0 0     kevent64(0x5, 0x7FFF75519130, 0x1)       = 1 0     workq_kernreturn(0x20, 0x0, 0x1)         = 0 0     workq_kernreturn(0x20, 0x0, 0x1)         = 0 0     kevent64(0x5, 0x10BC80D88, 0x1)      = 1 0     workq_kernreturn(0x20, 0x0, 0x1)         = 0 0     __sysctl(0x7FFF54903A90, 0x2, 0x7FFF54903AA0)        = 0 0     getuid(0x7FDEAA00170E, 0x7FFF54903D30, 0x0)      = 0 0     getgid(0x7FDEAA001713, 0x7FFF54903D30, 0x0)      = 0 0     csops(0x0, 0x0, 0x7FFF54903F04)      = 0 0     issetugid(0x0, 0x0, 0x0)         = 0 0     pread(0x3, "\312\376\272\276\0", 0x1000, 0x0)        = 4096 0     pread(0x3, "\317\372\355\376\a\0", 0x1000, 0x1000)       = 4096 0     fcntl(0x3, 0x3D, 0x7FFF54901350)         = 0 0     mmap(0x10B357000, 0x2000, 0x5, 0x12, 0x3, 0x1000)        = 0x10B357000 0     mmap(0x10B359000, 0x1000, 0x3, 0x12, 0x3, 0x3000)        = 0x10B359000 0     mmap(0x10B35A000, 0x2050, 0x1, 0x12, 0x3, 0x4000)        = 0x10B35A000 0     close(0x3)       = 0 0     stat64("/usr/lib/libbsm.0.dylib\0", 0x7FFF54902D98, 0x7FFF54903C30)      = 0 0     stat64("/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration\0", 0x7FFF54902D98, 0x7FFF54903C30)      = 0 0     stat64("/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation\0", 0x7FFF54902D98, 0x7FFF54903C30)        = 0 0     stat64("/usr/lib/libSystem.B.dylib\0", 0x7FFF54902D98, 0x7FFF54903C30)       = 0 0     stat64("/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit\0", 0x7FFF54902D98, 0x7FFF54903C30)      = 0 0     stat64("/System/Library/Frameworks/Security.framework/Versions/A/Security\0", 0x7FFF54902D98, 0x7FFF54903C30)        = 0 0     stat64("/usr/lib/system/libcache.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)   = 0 0     stat64("/usr/lib/system/libcommonCrypto.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)        = 0 0     stat64("/usr/lib/system/libcompiler_rt.dylib\0", 0x7FFF54902908, 0x7FFF549037A0 = 0 0     stat64("/usr/lib/system/libcopyfile.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)    = 0 0     stat64("/usr/lib/system/libcorecrypto.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0     stat64("/usr/lib/system/libdispatch.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)    = 0 0     stat64("/usr/lib/system/libdyld.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)    = 0 0     stat64("/usr/lib/system/libkeymgr.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)  = 0 0     stat64("/usr/lib/system/liblaunch.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)  = 0 0     stat64("/usr/lib/system/libmacho.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)   = 0 0     stat64("/usr/lib/system/libquarantine.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0     stat64("/usr/lib/system/libremovefile.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0     stat64("/usr/lib/system/libsystem_asl.dylib\0", 0x7FFF54902908, 0x7FFF549037A0) = 0 0     stat64("/usr/lib/system/libsystem_blocks.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)       = 0 0     stat64("/usr/lib/system/libsystem_c.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)    = 0 0     stat64("/usr/lib/system/libsystem_configuration.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)        = 0 0     stat64("/usr/lib/system/libsystem_dnssd.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)        = 0 0     stat64("/usr/lib/system/libsystem_info.dylib\0", 0x7FFF54902908, 0x7FFF549037A0 = 0 0     stat64("/usr/lib/system/libsystem_kernel.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)       = 0 0     stat64("/usr/lib/system/libsystem_m.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)    = 0 0     stat64("/usr/lib/system/libsystem_malloc.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)       = 0 0     stat64("/usr/lib/system/libsystem_network.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)      = 0 0     stat64("/usr/lib/system/libsystem_notify.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)       = 0 0     stat64("/usr/lib/system/libsystem_platform.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)         = 0 0     stat64("/usr/lib/system/libsystem_pthread.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)      = 0 0     stat64("/usr/lib/system/libsystem_sandbox.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)      = 0 0     stat64("/usr/lib/system/libsystem_stats.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)        = 0 0     stat64("/usr/lib/system/libunc.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)     = 0 0     stat64("/usr/lib/system/libunwind.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)  = 0 0     stat64("/usr/lib/system/libxpc.dylib\0", 0x7FFF54902908, 0x7FFF549037A0)     = 0 0     stat64("/usr/lib/libobjc.A.dylib\0", 0x7FFF54901B48, 0x7FFF549029E0)         = 0 0     stat64("/usr/lib/libauto.dylib\0", 0x7FFF54901B48, 0x7FFF549029E0)       = 0 0     stat64("/usr/lib/libc++abi.dylib\0", 0x7FFF549015F8, 0x7FFF54902490)         = 0 0     stat64("/usr/lib/libc++.1.dylib\0", 0x7FFF549015F8, 0x7FFF54902490)      = 0 0     stat64("/usr/lib/libDiagnosticMessagesClient.dylib\0", 0x7FFF549014D8, 0x7FFF54902370)       = 0 0     stat64("/usr/lib/libicucore.A.dylib\0", 0x7FFF54902B18, 0x7FFF549039B0)      = 0 0     stat64("/usr/lib/libz.1.dylib\0", 0x7FFF54902B18, 0x7FFF549039B0)        = 0 0     stat64("/usr/lib/system/libkxld.dylib\0", 0x7FFF54902C48, 0x7FFF54903AE0)    = 0 0     stat64("/usr/lib/libxar.1.dylib\0", 0x7FFF54902BA8, 0x7FFF54903A40)      = 0 0     stat64("/usr/lib/libsqlite3.dylib\0", 0x7FFF54902BA8, 0x7FFF54903A40)        = 0 0     stat64("/usr/lib/libpam.2.dylib\0", 0x7FFF54902BA8, 0x7FFF54903A40)      = 0 0     stat64("/usr/lib/libOpenScriptingUtil.dylib\0", 0x7FFF54902BA8, 0x7FFF54903A40) = 0 0     stat64("/usr/lib/libbz2.1.0.dylib\0", 0x7FFF54902A78, 0x7FFF54903910)        = 0 0     stat64("/usr/lib/libxml2.2.dylib\0", 0x7FFF54902A78, 0x7FFF54903910)         = 0 0     getpid(0x7FFF54903CF8, 0x10B352004, 0xEA60)      = 3077 0     shm_open(0x7FFF92E96CE4, 0x0, 0x0)       = 3 0     mmap(0x0, 0x1000, 0x1, 0x1, 0x3, 0x0)        = 0x10B38B000 0     close_nocancel(0x3)      = 0 0     geteuid(0x20000000303, 0x30000000300, 0x10B356308)       = 0 0     __sysctl(0x7FFF54904640, 0x2, 0x7FFF54904650)        = 0 0     umask(0x1FF, 0x0, 0xFFFFFFFFFFFFFFE0)        = 18 0     umask(0x12, 0x0, 0x0)        = 511 0     getuid(0x12, 0x0, 0x0)       = 0 0     getgroups(0x10, 0x10B33EE20, 0x0)        = 13 0     __sysctl(0x7FFF54904738, 0x2, 0x7FFF5490472C)        = 0 0     getrlimit(0x1008, 0x7FFF54903DA0, 0x7FFF8BF3CE7C)        = 0 0     open_nocancel("/etc/ppp/options\0", 0x0, 0x1B6)      = -1 Err#2     getuid(0x4, 0x7FFF76AB4430, 0xFFFFFFFFFFFFFFFF)      = 0 0     read(0x4, "\317\372\355\376\a\0", 0x200)         = 512 0     open_nocancel("/etc/ppp/postoptions\0", 0x0, 0x1B6)      = -1 Err#2     geteuid(0x20000000303, 0x30000000300, 0x7FFF772B15A8)        = 0 0     socket(0x22, 0x3, 0x1)       = 4 0     close(0x4)       = 0 0     close(0x3)       = 0 0     getuid(0x7FDEA8E000C0, 0x0, 0xFFFFFFFFFFFFFF01)      = 0 0     getgid(0x7FDEA8E000C0, 0x0, 0x0)         = 0 0     write(0x1, "Fri Mar 28 10:31:10 2014 : \0", 0x1B)        = 27 0     write(0x1, "publish_entry SCDSet() failed: Success!\0", 0x27)        = 39 0     write(0x1, "\n\0", 0x1)      = 1 0     __sysctl(0x7FFF54902800, 0x2, 0x7FFF54902810)        = 0 0     getuid(0x7FDEA9802330, 0x7FFF54902AA0, 0x0)      = 0 0     getgid(0x7FDEA9802335, 0x7FFF54902AA0, 0x0)      = 0 0     write(0x1, "Fri Mar 28 10:31:10 2014 : \0", 0x1B)        = 27 0     write(0x1, "publish_entry SCDSet() failed: Success!\0", 0x27)        = 39 0     write(0x1, "\n\0", 0x1)      = 1 0     guarded_kqueue_np(0x7FFF54903E98, 0x3, 0x7FFF86283A77)       = 5 0     kevent64(0x5, 0x7FFF86296C48, 0x1)       = 0 0     workq_kernreturn(0x10, 0x0, 0x58)        = 0 0     workq_open(0x10, 0x0, 0x0)       = 0 0     bsdthread_create(0x7FFF86283E77, 0x7FFF75518940, 0x10000)        = 188403712 0     kevent64(0x5, 0x7FFF54903F18, 0x1)       = 1 0     kevent64(0x5, 0x10BC80D88, 0x1)      = 1 0     kevent64(0x5, 0x0, 0x0)      = 1 0     workq_kernreturn(0x20, 0x0, 0x1)         = 0 0     thread_selfid(0x0, 0x1DC0, 0x7FFF65505550)       = 88904 0     shared_region_check_np(0x7FFF54901E38, 0x10B2FB000, 0x4)         = 0 0     stat64("/usr/lib/dtrace/libdtrace_dyld.dylib\0", 0x7FFF54902FE8, 0x7FFF54903F20 = 0 0     open("/usr/lib/dtrace/libdtrace_dyld.dylib\0", 0x0, 0x0)         = 3 0     ioctl(0x3, 0x80086804, 0x7FFF54903D78)       = 0 0     kevent64(0x5, 0x7FFF75519130, 0x1)       = 1 0     workq_kernreturn(0x20, 0x0, 0x1)         = 0 0     thread_selfid(0x10BD04000, 0x7FFF77A55258, 0x1010101)        = 88912 0     workq_kernreturn(0x20, 0x0, 0x1)         = 0 0     open("/dev/dtracehelper\0", 0x2, 0x7FFF54903DF0)         = 3 0     __sysctl(0x7FFF54903648, 0x2, 0x7FFF54903658)        = 0 0     thread_selfid(0x7FFF77A55310, 0x7FFF77A55258, 0x10101)       = 88904 0     bsdthread_register(0x7FFF92F30FBC, 0x7FFF92F30FAC, 0x2000)       = 0 0     mprotect(0x10B353000, 0x88, 0x1)         = 0 0     mprotect(0x10B35D000, 0x1000, 0x0)       = 0 0     mprotect(0x10B373000, 0x1000, 0x0)       = 0 0     mprotect(0x10B374000, 0x1000, 0x0)       = 0 0     mprotect(0x10B38A000, 0x1000, 0x0)       = 0 0     mprotect(0x10B355000, 0x1000, 0x1)       = 0 0     mprotect(0x10B353000, 0x88, 0x3)         = 0 0     mprotect(0x10B353000, 0x88, 0x1)         = 0 0     issetugid(0x7FFF75518480, 0x7FFFFFE00034, 0x7FFFFFE00036)        = 0 0     getpid(0x1, 0x10B356000, 0x49656E69)         = 3077 0     __mac_syscall(0x7FFF853DCE3F, 0x2, 0x7FFF549034C8)       = 0 0     stat64("/AppleInternal\0", 0x7FFF54903548, 0x0)      = -1 Err#2     audit_session_self(0x7FFF54903400, 0x7FFF54903238, 0x4)      = 4099 0     geteuid(0x7FFF54903400, 0x7FFF54903238, 0x0)         = 0 0     getegid(0x7FFF54903400, 0x7FFF54903238, 0x0)         = 0 0     getaudit_addr(0x7FFF549034D8, 0x30, 0x0)         = 0 0     csops(0xC05, 0x7, 0x7FFF549030C0)        = 0 0     getuid(0x7FFF5490371C, 0x7FFF54903718, 0x7FFF54904960)       = 0 0     geteuid(0x103, 0x10000000100, 0x7FFF778F8198)        = 0 0     getuid(0x103, 0x10000000100, 0x0)        = 0 0     __sysctl(0x7FFF54902BC0, 0x4, 0x7FFF54902BD8)        = 0 0     issetugid(0x7FFF778D3DC0, 0x0, 0x7FDEA8C062C8)       = 0 0     getuid(0x7FFF54902EE4, 0x0, 0x7FFF54904960)      = 0 0     issetugid(0x7FFF8808BA90, 0x7FFF549045F4, 0x7FFF54904960)        = 0 0     issetugid(0x7FFF758FA678, 0x0, 0x0)      = 0 0     read(0x4, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>BuildMachineOSBuild</key>\n\t<string>13C40z</string>\n\t<key>CFBundleDevelopmentReg", 0x4E5)      = 1253 0     close(0x4)       = 0 0     stat64("/System/Library/Extensions/pptp.ppp/Contents/MacOS/PPTP\0", 0x7FFF54903C08, 0x7FFF54904156)      = 0 0     stat64("/System/Library/Extensions/pptp.ppp/Contents/MacOS/PPTP\0", 0x7FFF54902E88, 0x7FFF54903D30)      = 0 0     stat64("/System/Library/Extensions/pptp.ppp/Contents/MacOS/PPTP\0", 0x7FFF54903B18, 0xF4290)         = 0 0     open("/System/Library/Extensions/pptp.ppp/Contents/MacOS/PPTP\0", 0x0, 0x1FF)    = 4 0     close(0x4)       = 0 0     stat64("/System/Library/Extensions/pptp.ppp/Contents/MacOS/PPTP\0", 0x7FFF54902E68, 0x7FFF54903D10)      = 0 0     open("/System/Library/Extensions/pptp.ppp/Contents/MacOS/PPTP\0", 0x0, 0x0)  = 4 0     pread(0x4, "\317\372\355\376\a\0", 0x1000, 0x0)      = 4096 0     fcntl(0x4, 0x3D, 0x7FFF54901170)         = 0 0     mmap(0x10B392000, 0x5000, 0x5, 0x12, 0x4, 0x0)       = 0x10B392000 0     mmap(0x10B397000, 0x1000, 0x3, 0x12, 0x4, 0x5000)        = 0x10B397000 0     mmap(0x10B398000, 0x3B00, 0x1, 0x12, 0x4, 0x6000)        = 0x10B398000 0     close(0x4)       = 0 0     __sysctl(0x7FFF54902800, 0x2, 0x7FFF54902810)        = 0 0     getuid(0x7FDEA9001D30, 0x7FFF54902AA0, 0x0)      = 0 0     getgid(0x7FDEA9001D35, 0x7FFF54902AA0, 0x0)      = 0 0     access("/etc/localtime\0", 0x4, 0x7)         = 0 0     open_nocancel("/etc/localtime\0", 0x0, 0x0)      = 5 0     fstat64(0x5, 0x7FFF54902B30, 0x0)        = 0 0     read_nocancel(0x5, "TZif\0", 0x2A64)         = 1323 0     close_nocancel(0x5)      = 0 0     thread_selfid(0x10B3AD000, 0x7FFF77A55258, 0x1010101)        = 88910 0     __pthread_sigmask(0x1, 0x10B3ACECC, 0x0)         = 0 0     kevent64(0x5, 0x10B3AC458, 0x1)      = 1 0     madvise(0x10B401000, 0x1000, 0x5)        = 0 0     madvise(0x10B601000, 0x1000, 0x5)        = 0 0     kevent64(0x5, 0x10B3AC4F8, 0x1)      = 1 0     kevent64(0x5, 0x0, 0x0)      = 1 0     madvise(0x10B801000, 0x1000, 0x5)        = 0 0     kevent64(0x5, 0x10B3AC4F8, 0x1)      = 1 0     thread_selfid(0x10BC81000, 0x7FFF77A55258, 0x1010101)        = 88911 0     kevent64(0x5, 0x10BC80D28, 0x1)      = 1 0     kevent64(0x5, 0x7FFF75519130, 0x1)       = 1 0     workq_kernreturn(0x20, 0x0, 0x1)         = 0 0     kevent64(0x5, 0x0, 0x0)      = 1 0     workq_kernreturn(0x20, 0x0, 0x1)         = 0 0     socket(0x20, 0x3, 0x1)       = 7 0     ioctl(0x7, 0x800C6502, 0x7FFF549042D0)       = 0 0     __sysctl(0x7FFF54902460, 0x2, 0x7FFF54902470)        = 0 0     getuid(0x7FDEA9001D45, 0x7FFF54902700, 0x0)      = 0 0     getgid(0x7FDEA9001D4A, 0x7FFF54902700, 0x0)      = 0 0     write(0x1, "Fri Mar 28 10:31:10 2014 : \0", 0x1B)        = 27 0     write(0x1, "PPTP connecting to server '11.22.33.44' (11.22.33.44)...\0", 0x3C)       = 60 0     write(0x1, "\n\0", 0x1)      = 1 0     socket(0x2, 0x1, 0x0)        = 8 0     setsockopt(0x8, 0x6, 0x20)       = 0 0     connect(0x8, 0x7FFF549042E0, 0x10)       = -1 Err#49     __sysctl(0x7FFF54902460, 0x2, 0x7FFF54902470)        = 0 0     getuid(0x7FDEA9001D3F, 0x7FFF54902700, 0x0)      = 0 0     getgid(0x7FDEA9001D44, 0x7FFF54902700, 0x0)      = 0 0     write(0x1, "Fri Mar 28 10:31:10 2014 : \0", 0x1B)        = 27 0     write(0x1, "PPTP connect errno = 49 Can't assign requested address\0", 0x36)     = 54 0     write(0x1, "\n\0", 0x1)      = 1 0     close(0x7)       = 0 0     close(0x8)       = 0 0     workq_kernreturn(0x20, 0x0, 0x1)         = 0 0     kevent64(0x5, 0x7FFF75519130, 0x1)       = -1 Err#4      25 in hexadecimal is 0x19 but this number does not appear anywhere.


rebuilding kernel without using apt-get

I am setting up my Macbook Air 6.2 with Debian Jessie. since I do not have any wireless, I need to set it up manually, but all documentation I find how to do it are using apt-get               apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') broadcom-sta-dkms      source How can I do it without apt-get? I did install the linux-headers and other essential packages manually, but now I am stuck rebuilding my kernel without this short and beautiful command .. -.-'


What is ELF Magic?

I've seen discussion before about ELF magic (most recently the comments in this Security stack exchange question. I've seen it mentioned before, and I've seen it in my own boot logs.. But I'm not sure what it is. The man page on elf is a bit over my head, as I don't do C or lower level languages. As someone who uses Linux as an every day operating system, what is ELF?


How can I figure out why gnome-panel is frequently misbehaving?

On my system (Debian Lenny AMD64), `gnome-panel` seems to act up now and again. I've not found a way to force it to happen, but it seems to be related to launching processes. Basically, I launch some process, and I see 1 core max itself out, and the taskbar freezes. I `pkill gnome-panel`, the taskbar reappears, and everything is ok. If I don't notice it, eventually my entire computer freezes and I have to hard boot. How would I go about getting some kind of information on why this is happening that could help me or developers? Is there a debug build or something I could run?


Why do some default bindkey keys do not work in tcsh?

I'm using tcsh and I'm seeing that some of my custom and some of the default bindkey bindings do not work. Why don't they work? For example: I load some default bindings: `bindkey -e` I check the default bindings for backward-word `bindkey | grep backward-word` and see:               "\302"         ->  backward-word     "\342"         ->  backward-word     "^[B"          -> backward-word     "^[b"          -> backward-word      When I try to use backward-word, Alt+Shift+b works just fine, but Alt+b does not work. What gives? I try to create a new binding for backward-word `bindkey "^[u" backward-word`, but when I try to use it (Alt+u), it acts like backward-char instead.


How do I add PC BSD / FreeBSD to Grub 2 boot loader?

I have Ubuntu 10.04 installed as my primary operating system, and I installed PC BSD in a different partition: `/dev/sda4` without installing it's boot loader. I figured out that I need to edit `/etc/grub.d/40_custom` to add an entry for PC-BSD. So far, nothing seems to work, though. EDIT: this sort of works, but doesn't fully boot the OS, it then asks me for the MOUNTROOT partition.               menuentry "PC-BSD 8.1" {         insmod ufs2         set root=(hd0,4)         kfreebsd /boot/kernel/kernel     }      The selected answer below is correct. If you are dual-booting with Linux I suggest _NOT_ installing the PC-BSD bootloader as the documentation suggests, unless you enjoy pain.


Getting a short wifi password to work on Linux Mint

Wifi password became a problem to me. My wifi password consists of only 4 letters but my Linux Mint 12 is expecting more than 7 letters - until then connect button is disabled. Can I work around this issue?


linux disk caching affects access times reported by stat?

On Ubuntu 12.04 I did the following   1. stat a file   2. cat the same file   3. stat the file again   4. cat the file again after 5 min   5. stat the file The access time reported at 3. reflects the point at which 2. was run. However, the access time reported at 5. coincides with 2. and not 4. Is this because Linux serves the file out of cache and avoids disk access in the second instance? Also is there a way to retrieve a list of files that are currently resident in disk cache?


What File Transferring Method (i.e. FTP) Can I Use for rlogin (Solaris 8 on SPARC)

For all my other Unix Virtual Machines, I use `SSH` and I use WinSCP to transfer files from my Windows Vista machine to the VM's. Now, One of the VM's is using `rlogin`, **What can I use to transfer files from my machine to the VM?** I use PuTTY to connect remotely to the machine, but through `rlogin`. Please can someone help me? Thanks.


How to generate folder ownership lists for each user?

I'd like to generate several separate lists for each user in Ubuntu. The lists contains the files and folders belong to each user. Using the command following list me all the users in the system:               cat /etc/passwd | awk -F: '{print $1;}'      Suppose "user1" is the first result, I'd like to get the list as:               find / -user "user1" > user1.txt      Thus, my problem is how can I get all the lists using commands as little as possible. Thanks in advance.


Git auto-complete

I am using Git as many of you do. Also, I don't use any GUI for that — just CLI. So I was wondering: are there any way to make Git commands (`git status`, `git checkout` etc.) complete themselves when hitting Tab? Like other CLI commands do. P.S. I'm using Arch Linux, if that anyhow matters.


How can I setup a SOCKS4 or 5 proxy on CentOS 5.8?

I live in Iran and due to its restrict censorship, We all have extreme difficulties accessing normal sites and services. So I thought this would be a great idea to setup a proxy server on my VPS, so that I myself could find a way around this censorship. Can anyone show me a step by step working tutorial on this matter? Or guide me in the right direction? I will be grateful.


Find out if a specific device is an USB mass storage

# Context I'm automating SD card imaging from an existing `dd` factory image. The SD card is always connected through an external USB card reader and thus appears in the system as a SCSI block device `/dev/sd*`. Currently the syntax of my command is: `write-image DEVICE` where `DEVICE` is the SD card block device, eg. `/dev/sdd`. # Problem I'm already doing a basic check on `DEVICE` to verify it is of the form `/dev/sd*` but this is not enough: I fear the users (production people not used to Linux) make a mistake and specify another seemingly valid device, eg. `/dev/sda`. You can see the looming catastrophe, especially since my imaging script needs root privileges (not to write the image itself, mind you, but to modify the SD card afterwards, including adjusting a partition's size depending on the SD card's real size)... # Question I would like to verify that the specified device actually is some USB mass storage (or at the very least a removable device) so that I can protect the system disks from being trashed accidentally. How can I do that? I found nothing relevant in `/proc` or on the web, I'm quite at loss now.


I tried to compile some C code to get object file from a shell prompt:               $cc a.c        But this gives me the following error:               /usr/ucb/cc:  language optional software package not installed      How can I compile C code?


Cheap 100% Debian compatible ultrabooks

I'm looking for relatively cheap ultrabooks with 100% Debian compatible features. I have several ultrabooks on my list but they contain some additional features which i don't need (additional graphic card or 'beats' studio). When reading the reviews everyone mention that there are 'minor' issues with running linux on them - mute indicator.


How to convert a PowerPoint ppt file into HTML files?

I have to find a free, gratis command line solution to convert primary Microsoft PowerPoint presentations into HTML files (1 HTML file per foil) on Linux (Debian, OpenSuse). It would be nice if the solution supports OpenOffice Impress presentations as well but this is not necessary. What is/are solution/s for this matter?


mv a file to /dev/null breaks dev/null

If I do: `touch file; mv file /dev/null` as root, `/dev/null` disappears. `ls -lad /dev/null` results in no such file or directory. This breaks applications which depend on `/dev/null` like SSH and can be resolved by doing `mknod /dev/null c 1 3; chmod 666 /dev/null`. Why does moving a regular file to this special file result in the disappearance of `/dev/null`? To clarify, this was for testing purposes, and I understand how the `mv` command works. What I am curious about is why `ls -la /dev/null` before replacing it with a regular file shows the expected output, but afterwards it shows that `/dev/null` does not exist even though a file was allegedly created via the original `mv` command and the file command shows ASCII Text. I think this must be a combination of the `ls` command behavior in conjunction with `devfs` when a non special file replaces a character/special file. This is on Mac OS X, behaviors may vary on other OS's.


How to change the default program for a specific file extension system-wise in kde or xfce?

I'd like to have certain file extensions to be opened with some specific programs. What are the files the edit ? I have found in /usr/share/appplications/default.list but it doesn't work.