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 bash | |
if [ -d "/sys/class/fc_host" ]; then | |
cd /sys/class/fc_host/ | |
printf '%-12b%-16b%-30b%-30b\n' "Device" "Port State" "Port Name" "Supported Speeds" | |
for i in $(ls) | |
do | |
device=$i | |
p_n=$(cat $i/port_name) | |
port_name="${p_n:2:2}:${p_n:4:2}:${p_n:6:2}:${p_n:8:2}:${p_n:10:2}:${p_n:12:2}:${p_n:14:2}:${p_n:16: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
logger -p user.info -t "MonitorUserCmd" "$LOGNAME logged from $(who am i |awk '{ print $5 }' |sed 's/(//' |sed 's/)//'), PID: $$" | |
function send_cmd_to_syslog | |
{ | |
declare remote_host | |
remote_host=$(who am i |awk '{ print $5 }' |sed 's/(//' |sed 's/)//g') | |
logger -p user.info -t "MonitorUserCmd" "USER: $LOGNAME, REMOTE_HOST: ${remote_host}, PID: $$, WDIR: $PWD, CMD: $BASH_COMMAND" | |
} | |
trap trap_cmd_to_syslog DEBUG |
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 bash | |
/bin/curl -s -c /tmp/cookie.txt -b /tmp/cookie.txt -e http://www.yourdomain.com/accounts/login/ http://www.yourdomain.com/accounts/login/ > /dev/null | |
DJANGO_TOKEN=$(grep csrftoken /tmp/cookie.txt | sed 's/^.*csrftoken\s*//') | |
/bin/curl -Gs -c /tmp/cookie.txt -b /tmp/cookie.txt \ | |
-H "Host: www.yourdomain.com" \ | |
-H "X-CSRF-Token: ${DJANGO_TOKEN}" \ | |
-e http://www.yourdomain.com/your-url-path/ \ | |
--data-urlencode "a-parameter=aaa" \ |
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 | |
red="\033[0;31m" | |
green="\e[32m" | |
bold="\033[1m" | |
def="\033[0m" | |
for net_name in $(docker network ls |tail -n +2 |awk '{print $2}') | |
do printf '%-6b%20b\n' "${red}${bold}Name:" "${net_name}${def}" | |
echo "---------------------" |
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
if (koşul 1): | |
B kullanıcısına 1,000 ETH gönder (adres: 67214ac443) | |
else if (koşul 2): | |
A kullanıcısına 1,000 ETH gönder (adres: 885eb06ad3) | |
else: | |
ETH gönderme |
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 | |
for addr in $(zmprov -l gaa $1) | |
do | |
acc_detail=$(zmprov ga $addr) | |
line_uid=$(echo "$acc_detail" |grep "^uid: ") | |
line_dname=$(echo "$acc_detail" |grep "^displayName: ") | |
line_mail=$(echo "$acc_detail" |grep "^mail: ") | |
line_title=$(echo "$acc_detail" |grep "^title: ") |
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
from __future__ import print_function | |
import paramiko | |
def get_zone_info(ip, port, username, password, sw_name, cfg_name): | |
cmd = 'zoneshow' | |
ssh=paramiko.SSHClient() | |
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
ssh.connect(ip,port,username,password) |
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 | |
dir_count=$(find . -type d |wc -l) | |
echo "Directories: $dir_count" | |
file_count=$(find . -type f |wc -l) | |
echo "Regular Files: $file_count" | |
ln_count=$(find . -type l |wc -l) | |
echo "Symbolic Links: $ln_count" |
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 os | |
import string | |
import random | |
__location__ = os.path.dirname(os.path.abspath(__file__)) | |
def pass_generator(): |
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 | |
# | |
# du of each subdirectory in a directory for ASM | |
# | |
D=$1 | |
if [[ -z $D ]] | |
then | |
echo "Please provide a directory like followings!" | |
sleep 2 |
NewerOlder