This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
# Function to print usage | |
function usage() { | |
echo "Usage: $0 <folder_path>" | |
echo "e.g. $0 /Movies/MyMovie/Subtitles" | |
echo "Please provide a folder path as the single argument to this script." | |
echo "All files in the selected folder will be converted to UTF-8 encoding." | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# To fix the " gpg: WARNING: unsafe permissions on homedir '/home/path/to/user/.gnupg' " error | |
# Make sure that the .gnupg directory and its contents is accessibile by your user. | |
chown -R $(whoami) ~/.gnupg/ | |
# Also correct the permissions and access rights on the directory | |
chmod 600 ~/.gnupg/* | |
chmod 700 ~/.gnupg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Editing long shell commands in Sublime Text with edit-and-execute-command | |
## | |
## | |
## Typing "subl" on command line will open Sublime Text by adding this symlink | |
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl ~/bin/subl | |
## | |
## | |
## Make Sublime Text the default editor... | |
## | |
## ...if using BASH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check which version of sed is used when you run the `sed` command | |
# The version that ships with Mac OS X is | |
# /usr/bin/sed | |
which sed | |
# Install gnu-sed using Homebrew | |
# The `--with-default-names` option configures `sed` to use gnu-sed | |
# Without that option, you'll need to type `gsed` to use gnu-sed | |
brew install --default-names gnu-sed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#################################################################### | |
# Change the number of rows and columns to display in Launchpad # | |
# by typing the following two lines in Terminal. You can use any # | |
# two integers for the number of rows and columns. I'm using 15x10 # | |
#################################################################### | |
defaults write com.apple.dock springboard-columns -int 15 | |
defaults write com.apple.dock springboard-rows -int 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# You need ffmpeg and lame utils, which you can install with homebrew: $ brew install ffmpeg lame | |
# Tip – Try adding this one liner to your bash profile as an alias. | |
find . -name "*.flac" -exec ffmpeg -i {} -acodec libmp3lame -ab 320k {}.mp3 \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include("lib/http.php"); | |
include("lib/parse.php"); | |
$product_array = array(); | |
$product_count = 0; | |
# Download the target web page | |
$target = "http://www.webbotsspidersscreenscrapers.com/buyair/"; |
NewerOlder