Skip to content

Instantly share code, notes, and snippets.

View omar-yassin's full-sized avatar

Omar Yassin omar-yassin

View GitHub Profile
export PS1='\e[1;35m\u\e[m@\h:\e[1;31m\w\e[m\n\$ '
cat json.file | python -m json.tool | less
@omar-yassin
omar-yassin / gist:9961949
Created April 3, 2014 20:11
GIT clone from local file repo
git clone --no-hardlinks path/to/file.git
@omar-yassin
omar-yassin / dns_spf_expander.sh
Last active October 28, 2019 19:35
DNS SPF Expander (MAX LOOKUP should not exceed 10 lookups)
#!/bin/bash
#TO RUN
# > ./dns_spf_expander.sh domain.com
lookup_count=0
function spf_expand {
for spf in $1 ; do
if echo $spf | grep "include:" > /dev/null 2>&1 ; then
((lookup_count++))
@omar-yassin
omar-yassin / gist:9937810
Created April 2, 2014 16:37
Validating Email SPF/DKIM for GAPPS
validate score of email via:
http://www.mail-tester.com/
email [email protected] (will send email report)
validate SPF synatx with:
http://www.kitterman.com/spf/validate.html?
gapps validator:
https://toolbox.googleapps.com/apps/checkmx/
@omar-yassin
omar-yassin / gist:7832526
Created December 6, 2013 21:38
MYSQL: binary logs
> show binary logs;
> purge binary logs to 'filename';
@omar-yassin
omar-yassin / gist:7776278
Last active May 16, 2023 09:02
IPTABLES cheatsheet
ADD RULE with PORT and IPADDRESS
sudo iptables -A INPUT -p tcp -m tcp --dport port_number -s ip_address -j ACCEPT
ADD RULE for PORT on all addresses
sudo iptables -A INPUT -p tcp -m tcp --dport port_number --sport 1024:65535 -j ACCEPT
DROP IPADRESS
sudo iptables -I INPUT -s x.x.x.x -j DROP
VIEW IPTABLES with rule numbers
@omar-yassin
omar-yassin / gist:7710630
Created November 29, 2013 19:19
Bash: pass arithmetic to BC binary
echo "3/2+1" | bc -l
@omar-yassin
omar-yassin / gist:7419030
Created November 11, 2013 19:36
GIT: merge remote repo to local directory with similar code
git init; git add .; git commit #current directory
git fetch path/to/repo master:whatever-branch-name-you-want
git merge whatever-branch-name-you-want
@omar-yassin
omar-yassin / gist:6764425
Created September 30, 2013 14:12
postfix: checking mail queue
postqueue -p #read queue headers
postcat -q #{message_id} #read message
postsuper -d ALL deferred #delete deferred