Skip to content

Instantly share code, notes, and snippets.

Sunry hplc

View GitHub Profile
@hplc
hplc / lte-terms.php
Last active Apr 10, 2019
PHP script to practice several LTE terms.
View lte-terms.php
#!/usr/bin/php
<?php
$terms = [
"LTE" => "Long Term Evolution",
"SAE" => "System Architecture Evolution",
"E-UTRAN" => "Evolved Universal Terrestrial Radio Access Network",
"EPC" => "Evolved Packet Core",
"EPS" => "Evolved Packet System",
@hplc
hplc / monitor_ocserv.sh
Created Jun 13, 2017
Monitor service and restart it if down in OpenWrt.
View monitor_ocserv.sh
#!/bin/sh
# Put this script run in crond.
service=ocserv
if test $(netstat -na | grep 0.0.0.0:443 | wc -l) = 2
then
echo "$service is running!"
else
/etc/init.d/$service start
View wget_loop.sh
#!/bin/bash
for (( ; ; ))
do
wget -m http://www.youobd2.com
sleep 1h
done
@hplc
hplc / autovote.php
Created Apr 6, 2017
Auto Vote by PHP
View autovote.php
<?php
// $url_login = "http://192.168.1.6/weboa/sys/logon.aspx?stferNo=200&stferPassword=hehehe";
$url = "http://http://zhiye.jiaoshi.com.cn//admin/deal_vote.php?pid=49&type=1";
$file="cookie.txt";
echo postPage($url, "$postfields");
@hplc
hplc / bash_ssh_scanner.sh
Created Apr 1, 2017
Bash pipe TCP port scanner.
View bash_ssh_scanner.sh
#!/bin/sh
# Worked in CentOS 7.
for ip in 10.1.41.106 10.1.41.158 10.1.41.149 10.1.41.104 10.1.41.145 10.1.41.122 10.1.41.113 10.1.41.223 10.1.41.200; do
timeout 1 bash -c "echo >/dev/tcp/${ip}/22" &&
echo "$ip SSH is OPEN" ||
echo "$ip SSH is $(tput setaf 1)CLOSED$(tput sgr0)"
done
View IC Card Crack.cpp
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
#include <iostream>
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include <fstream>
#include <io.h>
//控制字定义
#define BLOCK0_EN 0x01
@hplc
hplc / tcpdump_flood.sh
Last active Apr 1, 2017
Tcpdump Flood Packets
View tcpdump_flood.sh
#!/bin/bash
HOST=`hostname`
INTERFACE=eth0
DUMPDIR=./dump/
SUBJECT="WARNING: Packet alert on $HOST"
EMAIL="who@will.receive"
EMAILMESSAGE="./dump/emailmessage.txt"
LOG="./dump/log.txt"
@hplc
hplc / record.sh
Created Mar 6, 2012
Gather machine hardware informations from snmp.
View record.sh
#!/bin/sh
# Put it in /etc/rc.local, let it run every time machine boot.
filename=`date +%Y%m%d-%H%M%S`
cd /etc/records
hostname >> $filename
ifconfig eth0|grep inet|grep -v inet6|awk '{print $2}' >> $filename
@hplc
hplc / identify_cmyk.sh
Created Dec 20, 2011
Identify CMYK colorspace JPG files.
View identify_cmyk.sh
#!/bin/sh
# Find out all .jpg files except in *CorelDRAW* subdirectories and identify them.
# Filter out CMYK colorspace files.
find ./ -path "*CorelDRAW*" -prune -o -name *.jpg -print0 | \
xargs -0 identify -verbose | \
grep -E '(^Image|^ Colorspace: CMYK)' | \
grep -B1 CMYK
@hplc
hplc / judge_md5.sh
Created Dec 17, 2011
Chech all files MD5 in one subdirectory, find out the same one.
View judge_md5.sh
#!/bin/sh
# Sum student's upload files MD5.
# Check whether they copy file each other.
# Tested in CentOS Linux.
dir=`date +%Y.%m.%d`
output="result.html"
echo -e "<pre>\n$dir" >> $output
md5sum $dir/* | sort | uniq -Dw32 | sed -e "s/$dir\///" >> $output
echo "</pre>" >> $output
You can’t perform that action at this time.