This file contains 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
[base] | |
name=CentOS-$releasever - Base | |
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra | |
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ | |
baseurl=http://vault.centos.org/6.10/os/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 | |
#released updates | |
[updates] |
This file contains 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 | |
iptables -F | |
iptables -P INPUT DROP | |
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
iptables -A INPUT -i lo -j ACCEPT | |
for IP in `curl -s https://www.cloudflare.com/ips-v4` | |
do | |
iptables -A INPUT -s $IP -p tcp -m multiport --dport 80,443 -j ACCEPT | |
done |
This file contains 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 | |
# To get TOKEN, ref this gist https://gist.github.com/pankpan/ad68f50cd44c1dae9203d29964d579e5 | |
# TO is personal uid or conversation id | |
TOKEN= | |
TO= | |
curl -sd '{"type":"message","text":"Test 20210601"}' -H "Authorization: Bearer $TOKEN" https://smba.trafficmanager.net/apis/v3/conversations/$TO/activities |
This file contains 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 | |
# Get skype bot token to send message, fill your CLIENT_ID and CLIENT_SECRET | |
CLIENT_ID= | |
CLIENT_SECRET= | |
TOKEN=`curl -sd "client_id=$CLIENT_ID&client_secret=$CLIENT_SECRET&grant_type=client_credentials&scope=https://api.botframework.com/.default" https://login.microsoftonline.com/common/oauth2/v2.0/token | jq -r .request_token` | |
echo $TOKEN |
This file contains 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 | |
TEMP=/tmp/alexa.html | |
if [ -z $1 ] ; then | |
echo "`basename $0` {dns}" | |
else | |
DNS=$1 | |
[ -f $TEMP ] || curl -s https://www.alexa.com/topsites > $TEMP | |
T1=`date +%s.%N` | |
for HOST in `awk -F[\"\/] '/href=..siteinfo\// {print $4}' $TEMP` |
This file contains 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/sh | |
sed -i 's/ExecStart.*/ExecStart=-\/sbin\/agetty -a root %I \$TERM/' /usr/lib/systemd/system/getty@.service |
This file contains 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/sh | |
if [ -z $1 ] ; then | |
echo "`basename $0` {ip}" | |
else | |
TEMP=/tmp/psauxw.tmp | |
ps auxw > $TEMP | |
for T in `w | grep -w $1 | awk '{print $2}'` | |
do | |
echo Logout $T | |
grep -w $T $TEMP | awk '{print $2}' | xargs kill -9 |
This file contains 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/sh | |
# netmask from http://trap.mtview.ca.us/~talby/netmask_2.4.tar.gz | |
netmask `curl -s http://ftp.apnic.net/stats/apnic/delegated-apnic-latest | awk -F'|' '/TW\|ipv4/ {print $4":+"($5-1)}'` |
This file contains 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
set QT_SCALE_FACTOR=1.25 | |
start %LOCALAPPDATA%\LINE\bin\LineLauncher.exe |
This file contains 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
// implementation 'com.android.volley:volley:1.2.1' | |
import com.android.volley.Response | |
import com.android.volley.toolbox.StringRequest | |
import com.android.volley.toolbox.Volley | |
var apiUrl="https://your-api-url.com/" | |
val request: StringRequest = object : StringRequest( | |
Method.POST, apiUrl, | |
Response.Listener { response -> | |
if (response != null) { |