Hot answers tagged

7

youtube-dl Config File To set a default download location, create a youtube-dl configuration file at: ~/.config/youtube-dl/config Within this file enter the line: -o ~/Downloads/%(title)s-%(id)s.%(ext)s You can create this file using the following two commands: mkdir -p ~/.config/youtube-dl/ echo "-o ~/Downloads/%(title)s-%(id)s.%(ext)s" > ...


4

Note the original question asked why Apple shipped an old version of bash and then asked how to upgrade. This is an answer to the original. If the question is just the latter then it is a duplicate You would have to ask Apple as to why. However I would note that bash is now licensed under GPLv3 and 3.2.57 is the last version released under GPL2. As bash ...


3

You need to copy the .icns file to the root folder of the volume. The new file needs to be named .VolumeIcon.icns. For example, if you are using a Bash shell, have the file vol_external.icns and destination /Volumes/MyStick, then below would be the command. cp vol_external.icns /Volumes/MyStick/.VolumeIcon.icns A word of warning: Once you assign an ...


2

It doesn't download to your home, but to the current working directory. Change it before you want to download. If you're using bash, you might want to create a function in your .bashrc like this: function youtube-dl () { cd ~/Downloads/ && { `which youtube-dl` "$@" cd - > /dev/null } } This changes the working directory ...


2

There is no way of setting a default folder. Instead, you have to append the option -o every time. -o ~/Downloads/%(title)s-%(id)s.%(ext)s %(title)s-%(id)s.%(ext)s is the default filename format for every download.


2

These things can occur based on a whole bunch of small issues, either in the shell used, the terminal application used, the file format or something else altogether. To triage, the following steps may be useful run cat -vet test.txt to see whether there are additional characters in the file run (echo a; echo b)|cat to see if it depending on the input data ...


2

/usr/lib is protected by SIP. Even if this wouldn't be the case, it's not the best idea to put your own stuff there as any system upgrade can wipe it. The better place to store such stuff (or link to it) is /usr/local/lib. You may need to pass appropriate flags to the linker then (or you point it directly to the Cellar folder).


1

Yes, Apple provides these pages online, for example: https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/ls.1.html for the ls command. Source: Dr Drang


1

Here is an answer to get right the pathname of .. from AppleScript: Get Current Path to Script within AppleScript and Append Subdirectory Anyway, the actual construct you got: /path/to/folder//myscript.pl is a correct pathname to your Perl script. The 1st / is coming from the terminal one coming from container: /path/to/folder/. Hence your built find ...


1

I don't think you can. The information that you can get is available via System Profiler: system_profiler SPUSBDataType, which on my Macbook returns: Apple Internal Keyboard / Trackpad: Product ID: 0x0259 Vendor ID: 0x05ac (Apple Inc.) Version: 2.24 Speed: Up to 12 Mb/sec Manufacturer: Apple Inc. Location ID: ...


1

You can permanently assign an app to a Space by right-clicking the app in the dock > Options > Assign to... This Desktop. A faster way to move it to any given Space is to grab the window's title bar, then use your regular shortcut to switch to the desired Space. By default that would be Ctrl ⌃ [number] See System Prefs > Keyboard > Shortcuts > Mission ...


1

The obvious one is emacs itself as info is its documentation format The Apple supplied emacs does do this in the terminal as do more up to date ones There are graphical versions Emacs.app for pure emacs and Aquamacs trying to be more like a standard OSX app. If you need this from the command line other make .info files opened by the emacs app and use the ...


1

Best I've been able to come up with myself is to write a script that runs iftop -f "dst net REMOTE_IP" -t in the background, redirecting the output, and after a certain timeout kills the process, and then grep/awk my way through the redirected output. Hardly elegant.


1

A Homebrew-free command-line alternative is the command line tool from Unarchiver called 'unar'. The command is simply unar filename.pdf http://unarchiver.c3.cx/commandline (The original GUI-based Unarchiver does this as well.)


1

You can install via Homebrew with the following command: brew install poppler


1

Have a look at homebrew-command-not-found. The project tries to reproduce Ubuntu’s command-not-found for Homebrew users on OS X.


1

You have at least two options: Install MacPorts. Install thttpd with this command: sudo port install thttpd I am not using MacPorts and this is untested. Download config.sub.diff and config.guess.diff and put them into thttpd source directory. Execute these commands to patch the config files: patch -R < config.sub.diff patch -R < ...


1

From your ls output: drwxr-xr-x 5 root wheel uchg 170 Aug 20 2015 local That uchg flag means the file or directory cannot be changed. You can remove it with this command: sudo chflags -R nouchg /usr/local For more information about file flags, see the man page for chflags: http://ss64.com/osx/chflags.html


1

Simplest solution is ansiweather which you can install with brew. The result looks like . If you want to write you own command/function it's not that difficult. If the output from the online location is in json, or something similar. You can use jq to parse json, and only print what you need. curl -s http://ip-api.com/json | jq -Cr . Read the manual page ...


1

You can place a link to the contents/macos/app in a location that is in the users path. You don't need to have a separate binary with this approach but your app does need to handle command line arguments. That is not hard to do, but the details of that are beyond the scope of this site.


1

Here's a fish shell script I wrote: function netinfo -d "get network information" # Get public ip address set public (curl -s http://ipecho.net/plain) # Let's account for possible lag in reply from ipecho.net sleep .3 if test -z "$public" # No Internet connection set public "No Internet connection available" end echo " " echo " Public IP: ...


1

I had to do the following steps in order to make it work. # Change working directory cd ~/.ssh # Remove the old public key rm id_rsa.pub # Create a new public key ssh-keygen -y -f id_rsa > id_rsa.pub # Change permission chmod 600 id_rsa* # Add the key to ssh ssh-add id_rsa # Then finally test it (I used github) ssh -i id_rsa.pub git@github.com The ...


1

I adapted Greg Ercolano's perl script to python script. #!/usr/bin/env python2.7 import subprocess as subp import os.path import sys import re from collections import defaultdict def psaxo(): cmd = ['ps', 'axo', 'ppid,pid,comm'] proc = subp.Popen(cmd, stdout=subp.PIPE) proc.stdout.readline() for line in proc.stdout: yield ...



Only top voted, non community-wiki answers of a minimum length are eligible