This file contains hidden or 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
hdiutil attach /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app | |
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/El\ Capitan | |
hdiutil resize -size 9g /tmp/El\ Capitan.sparseimage | |
hdiutil attach /tmp/El\ Capitan.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build | |
rm /Volumes/install_build/System/Installation/Packages |
This file contains hidden or 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 | |
#usage | |
# ./search.sh "(uid=person)" mail | |
# returns the "mail" value from uid person | |
ldaphost=ldap://server:389 | |
ldapuser=cn=config | |
ldappass=password_hele |
This file contains hidden or 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
# Find Replace in files | |
find /path -type f -iname "*.txt" -exec sed -i.bak 's/foo/bar/g' "{}" +; | |
# Get a .gitignore with common ignore patterns | |
wget -O - https://www.gitignore.io/api/intellij,node,eclipse,visualstudio,linux,osx,windows,elasticbeanstalk > .gitignore |
This file contains hidden or 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
iptables -t nat -A POSTROUTING -j MASQUERADE | |
iptables -I INPUT -s 10.0.0.0/8 -j ACCEPT | |
iptables -I FORWARD -s 10.0.0.0/8 -j ACCEPT | |
iptables -I FORWARD -d 10.0.0.0/8 -j ACCEPT | |
#sysctl -w net.ipv4.ip_forward=1 | |
iptables -I INPUT -i tun+ -j ACCEPT | |
iptables -I FORWARD -i tun+ -j ACCEPT |
This file contains hidden or 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
#This may be a little misleading because the */cmd/in is input to the pipe, therefore output from cat. | |
#therefore */cmd/out is output from the pipe, and therefore input from cat. | |
cat >/tmp/com.thelazycoder.PipesBomb/cmd/in|tee </tmp/com.thelazycoder.PipesBomb/cmd/out | |
# This can be used with input and output from command line executables as well. |
This file contains hidden or 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/sh | |
whoami=`whoami` | |
if [ $whoami == 'root' ]; then | |
echo "Generating New Email User" | |
useradd -G emailusers $1 | |
echo "Creating Directory in Share" | |
mkdir -p /space/home/$1/Maildir | |
echo "Setting ownership to $1:$1" |
This file contains hidden or 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
Add Open With Sublime Service. | |
1. Open Automator. | |
2. New Service as "Shell Script" | |
3. /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n $$ | |
4. Save as "Open In Sublime" | |
Add Command Functionality to open in sublime text |
This file contains hidden or 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
# copied from https://www.e-rave.nl/create-a-self-signed-ssl-key-for-postfix | |
openssl genrsa -des3 -out mail.domain.tld.key 2048 | |
chmod 600 mail.domain.tld.key | |
openssl req -new -key mail.domain.tld.key -out mail.domain.tld.csr | |
openssl x509 -req -days 365 -in mail.domain.tld.csr -signkey mail.domain.tld.key -out mail.domain.tld.crt | |
openssl rsa -in mail.domain.tld.key -out mail.domain.tld.key.nopass | |
mv mail.domain.tld.key.nopass mail.domain.tld.key | |
openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650 | |
chmod 600 mail.domain.tld.key |
This file contains hidden or 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
chcon -R --reference=/var/www/html/ /var/www/html/anotherFolder |