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
| altoidnerd@pion:~ $ A="foo bar baz"; for X in $A; do echo "$X"; done | |
| foo | |
| bar | |
| baz | |
| # VS | |
| altoidnerd@pion:~ $ B="foo bar baz"; for X in "$B"; do echo "$X"; done | |
| foo bar baz |
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
| #!/usr/bin/env python | |
| import subprocess | |
| import re | |
| # Get process info | |
| ps = subprocess.Popen(['ps', '-caxm', '-orss,comm'], stdout=subprocess.PIPE).communicate()[0] | |
| vm = subprocess.Popen(['vm_stat'], stdout=subprocess.PIPE).communicate()[0] | |
| # Iterate processes |
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
| # use after failed command to recall last command with sudo | |
| alias please='sudo $(fc -ln -1)' | |
| # use when ubuntu says "The program foo is not installed. You can install it by typing: ..." | |
| alias ok='eval $($(fc -ln -1) 2>&1 | sed -n 2p)' | |
| # add cmd memory purge to linux | |
| alias purge='echo "echo 1 > /proc/sys/vm/drop_caches" | sudo sh' | |
| # colorized 'cat' (linux only) | |
| alias dog='pygemtize -g' | |
| # function for easy extraction |
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
| echo "echo sleep 0.5 >> ~/.bashrc" >> ~/.bashrc |
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
| ls | while read line; do ls $line; done |
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 | |
| echo "${USER} is a meme machine" |
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
| for NAME in *; do NEWNAME=$(echo $NAME| sed -e 's/__//')'__'; mv $(echo $NAME) $(echo $NEWNAME); done |
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
| #!/usr/bin/env python3 | |
| import os | |
| for item in os.listdir(): | |
| if item.startswith("__"): | |
| os.rename(item, item.replace("__", "")+"__" | |
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
| for N in {0..107} ;do printf $N':''\033['$N'mSome SAMPLE text!!! %s\033[m\n' "$_host"; done |
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
| # encoding: utf8 1,1 Top# encoding: utf8 | |
| import argparse | |
| from datetime import datetime | |
| import json | |
| from random import randint | |
| import requests | |
| import sys | |
| from time import sleep |