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 | |
| service=zabbix_server | |
| if (( $(ps -ef | grep -v grep | grep $service | wc -l) > 0 )) | |
| then | |
| echo "$service is running!!!" | |
| else | |
| echo "$service is not running on $HOSTNAME!!!" | |
| /etc/init.d/zabbix-server start | |
| fi |
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 | |
| #define where iptables is | |
| IPT=/sbin/iptables | |
| ############# Begin the NAT table operations ###### | |
| #Flush all the rules in the nat table | |
| $IPT -t nat -F | |
| #Load some modules needed for NAT | |
| /sbin/modprobe ip_nat_ftp | |
| /sbin/modprobe ip_nat_irc | |
| #DNAT the gaming device ports 6500 and 6700 UDP for hosting games |
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 | |
| #delete root qdisc (this will destroy all classes) | |
| tc qdisc del dev eth1 root | |
| #attach root qdisc and create the 100Mbps root class | |
| tc qdisc add dev eth1 root handle 1: htb | |
| tc class add dev eth1 parent 1:0 classid 1:10 htb rate 100Mbit | |
| #create the 1Mbps class for the whole bandwidth | |
| tc class add dev eth1 parent 1:10 classid 1:20 htb rate 1Mbit | |
| #Xboxβ-β128kbit | |
| tc class add dev eth1 parent 1:20 classid 1:100 htb rate 128Kbit ceil 1Mbit |
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 | |
| cname=$(cat /proc/cpuinfo|grep name|head -1|awk '{ $1=$2=$3=""; print }') | |
| cores=$(cat /proc/cpuinfo|grep MHz|wc -l) | |
| freq=$(cat /proc/cpuinfo|grep MHz|head -1|awk '{ print $4 }') | |
| tram=$(free -m | awk 'NR==2'|awk '{ print $2 }') | |
| swap=$(free -m | awk 'NR==4'| awk '{ print $2 }') | |
| up=$(uptime|awk '{ $1=$2=$(NF-6)=$(NF-5)=$(NF-4)=$(NF-3)=$(NF-2)=$(NF-1)=$NF=""; print }') | |
| cache=$((wget -O /dev/null http://cachefly.cachefly.net/100mb.test) 2>&1 | tail -2 | head -1 | awk '{print $3 $4 }') | |
| io=$( (dd if=/dev/zero of=test_$$ bs=64k count=16k conv=fdatasync &&rm -f test_$$) 2>&1 | tail -1| awk '{ print $(NF-1) $NF }') |
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
| <?php | |
| /** | |
| * This script allows you to scan hosts | |
| * Detection of open and closed ports. | |
| * | |
| * | |
| */ | |
| // Insert a style sheet to the results properly looked | |
| echo '<html>'."\n" |
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 | |
| HOST=`/bin/hostname` | |
| SERVER='zabbix.yourdomain.com' | |
| CURL=/usr/bin/curl | |
| read -a stat <<< `$CURL -sm3 "http://${HOST}/nginx_status"` | |
| [ ! -z $stat ] && { | |
| 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
| #!/usr/bin/expect -f | |
| # Zabbix IRC sender script | |
| set force_conservative 0 ;# set to 1 to force conservative mode even if | |
| ;# script wasn't run conservatively originally | |
| if {$force_conservative} { | |
| set send_slow {1 .1} | |
| proc send {ignore arg} { | |
| sleep .1 | |
| exp_send -s -- $arg |
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
| param( | |
| $domain, | |
| $users ) #end param | |
| # Begin Functions | |
| Function funWhatIf() | |
| { | |
| "what if: Perform operation obtain lastlogon time for user $user from | |
| the $domain domain" |
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
| $date = Get-Date -UFormat %Y-%m-%d; | |
| $backupFolder = $date; | |
| $basePath = "F:\mongodb_backup"; | |
| $destinationPath = Join-Path $basePath $backupFolder; | |
| if(!(Test-Path -Path $destinationPath)) { | |
| New-Item -ItemType directory -Path $destinationPath; | |
| (C:\mongodump.exe --out $destinationPath); | |
| } |
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
| #Check if the account exists. | |
| If($Results.Count -eq 0) | |
| { | |
| Write-Warning "The SamAccountName '$UserName' cannot find. Please make sure that it exists." | |
| } | |
| Else | |
| { | |
| Foreach($Result in $Results) | |
| { | |
| $DistinguishedName = $Result.Properties.Item("DistinguishedName") |