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
filetype plugin indent on | |
" show existing tab with 4 spaces width | |
set tabstop=4 | |
" when indenting with '>', use 4 spaces width | |
set shiftwidth=4 | |
" On pressing tab, insert 4 spaces | |
set expandtab |
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
import subprocess | |
import shlex | |
p1 = subprocess.Popen(shlex.split("ifconfig wlan0"),stdout=subprocess.PIPE,stderr=subprocess.PIPE) | |
p2 = subprocess.Popen(shlex.split("awk '/inet addr:/ {print substr($2,6)}'"),stdin=p1.stdout,stdout=subprocess.PIPE,stderr=subprocess.PIPE) | |
out, err = p2.communicate() | |
print "out:", out[:-1] | |
print repr(out[:-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
#!/bin/bash | |
addresses=`cat addresses.txt` | |
while IFS= read -r ip | |
do | |
ssh user@"$ip" 'ls | |
cd /tmp | |
pwd | |
touch a | |
echo "merhaba" > a | |
cat a |
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
192.168.1.3 | |
192.168.1.2 |
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 | |
file_a=`cat $1` | |
file_b=`cat $2` | |
while IFS= read -r line_a | |
do | |
while IFS= read -r line_b | |
do | |
if [ "$line_a" != "$line_b" ];then | |
#echo "$line_a : $line_b" | |
echo "$line_b will be deleted" |