Tag Info

New answers tagged

0

On my system (Debian wheezy), the PPD files are stored as /etc/cups/ppd/printername.ppd. Assuming a similar scheme holds on other systems, you really just need the printer name, which you can get from /etc/cups/printers.conf. This file appears to be in XML format, so you could probably use some suitable XML parsing tool.


8

This is what Bash while loops do: while /path/to/application.app do : done It will run the application, and if it terminates successfully run the body of the loop. : is the shell's no-op command (the loop has to have a body, so that's what we put there); after that it goes back to the top and runs the program again. If it fails, the loop stops running ...


0

I've tested this: #!/bin/bash while <your_cmd_here> do true done This works by testing the return code of your command, POSIX style. 0 means Ok, anything else can be treated as an error.


0

Well, since you asked in UNIX - the "UNIX" way is: while /path/to/application.app ; do echo "Restarting App" sleep 1 done echo "Application has encountered an error!" Or something like that.


2

In MacVim, you need to unmap the Edit > Paste menu item in order to override the shortcut, then you can remap Cmd-V (D-v in MacVim parlance) to the appropriate command in each mode. I added this to my ~/.gvimrc and now everything works wonderfully: macmenu Edit.Paste key=<nop> noremap <D-v> "*P cnoremap <D-v> <C-r>* inoremap ...


0

I would suggest that the easiest way would (assuming both machines have gigabit Ethernet) to connect them both via a gigabit hub/switch and then just rsync or similar. On the assumption that you should be able to transfer ~ 50 MBps then this should take about 20 minutes to complete. Don't even think about doing it over WiFi. Failing that put them on a USB ...


0

This is due to osx's lack of support for NTFS. I just transferred everything all over again through ssh, and it worked perfectly.


0

If you are using any Windows machine in the process as well, my suggestion would be to use NTFS (formatted from the Windows machine) and use fuse-ntfs-3g and ntfs-3g inside the *nix systems. That worked the best for me, as far as having the best compatibility between all 3 systems. Haven't tested on Sun or anything else.


2

Let's start with some "history". /usr/local is typically used to store user programs/data that were not installed with the base operating system. Commonly, when you make programs from source using automake, they will install somewhere under /usr/local. Because the main operating system itself doesn't rely on this directory, permissions are really up to the ...


3

remap control : bind -x '"\C-l": clear'


5

The issue is indeed that the Finder's way of modifying permissions doesn't only affect the indicated bits as one might think. For some reason it zeroes out the first octal of the file's mode and it leaves the executable bits untouched. So, some vital programs get their setuid/setgid and sticky bits stripped off which makes them either useless or behave ...


0

Short Answer /usr/bin contains symbolic links whose permissions will not be modified when you change the permissions on the /usr/bin folder and so the permissions are incorrectly set on the symbolic links which causes the pointer to refer to some memory that is inaccessible (As I understand, inaccessible due to permissions issue). Detailed Answer /bin – ...


1

Run dtruss to see what system calls a process is making: dtruss -p55761 This will tell you what system call the process with PID 55761 is currently engaged in. If that system call accesses some file descriptor, lsof will tell you what file is open there. lsof -p55761 If the file is a pipe or socket, I don't know how to find what if anything is on the ...


0

You can use a while loop: while IFS= read -r _file do cp "$_file" ~/Desktop/temp done < "files.txt" IFS is set to null causes no splitting is performed, and -r tell bash escapes backslash character.


1

xargs does an unfortunate amount of parsing on its input, and depending on what characters occur in filenames (spaces, quotes/apostrophes, backslashes, tabs, etc) it can mangle them in a number of ways. The best way to handle filenames is as a null-delimited list and using xargs -0 (which turns off all of the parsing). If the file list were generated from ...


1

This seems to be a question with the XY-problem - it's not asking the right thing to get the desired solution: Assume the output is colored, and the empty part of the screen is of different color or filled with a character. Think about how you expect the output to look for these cases: An empty line? Lines filled with only space characters? Lines ...


7

With zsh on terminals that support 16 colors or more à la xterm: preexec() printf '\e[90m' # set foreground color to grey before running # the command precmd() printf '\e[m' # reset the foreground color before issuing the # next prompt. Note that commands may change the terminal's foreground color ...


8

STDOUT and STDERR don't have colors. What has color is your terminal (emulator); it has one foreground (and one background color) set at a time. It should also be noted that STDOUT and STDERR are not singular -- they're per process output streams. There is no global STDOUT that applies to all programs. These streams are routed to your terminal, but they ...


1

I found a solution in which I needed to replace a space with a backslash and a space on OS X. Here is what I came up with: echo "Hello World" | sed 's/ /\\ /g' | xargs echo With this all the spaces are retained.


1

Of course it's not persistent, the ssh-agent is a session service that stores keys temporarily for the user. The main purpose of SSH agent is to remember the cleartext version of a key secured using a passphrase. In other words, the key is stored on the disk encrypted using a passphrase and the owner of the key uses ssh-add or some GUI tool to provide the ...


2

The brace expansion you're asking about will only expand for files/directories that match on disk to the pattern you use. The other issue you'll run into is diskutil may not be able to handle more than 1 argument at a time. To expand these you'd need to do a while or for loop, and pass the results to diskutil as you iterate through the loop. Example $ for ...


1

If the output of diskutil list is something like disk0 disk0s1 disk1 disk1s1 (separated by space or newline) then you need something like this: for dev in $(diskutil list); do diskutil info "$dev" done find find ~/ -type f \( -name '*mp3' -or -name '*mp4' \) You must quote the metacharacters which find shall see.


7

The addition of keys to the agent is transient. They last only so long as the agent is running. If you kill it or restart your computer they're lost until you re-add them again. From the ssh-agent man page: excerpt #1 ssh-agent is a program to hold private keys used for public key authentication (RSA, DSA, ECDSA). The idea is that ssh-agent is started ...


0

This answers all your questions related to Mach kernel !!! https://www.youtube.com/watch?v=8RwlEZ88rKM&list=WL&index=9



Top 50 recent answers are included