Skip to content

Instantly share code, notes, and snippets.

View grasses's full-sized avatar
🎯
Focusing

grasses

🎯
Focusing
View GitHub Profile
@grasses
grasses / x2ray
Created February 18, 2020 13:42
v2ray installation
#!/bin/bash
red='\e[91m'
green='\e[92m'
yellow='\e[93m'
magenta='\e[95m'
cyan='\e[96m'
none='\e[0m'
_red() { echo -e ${red}$*${none}; }
_green() { echo -e ${green}$*${none}; }
@grasses
grasses / HPF.py
Created November 19, 2019 11:45
High-Pass Filter
import numpy as np, scipy
def high_pass_filter(image):
kernel_5x5 = (1.0/12) * np.array([
[-1, 2, -2, 2, -1],
[2, -6, 8, -6, 2],
[-2, 8, -12, 8, -2],
[2, -6, 8, -6, 2],
[-1, 2, -2, 2, -1]
], dtype=np.float32)
FROM ubuntu:16.04
RUN dpkg --add-architecture i386
RUN sed -i "s/http:\/\/archive.ubuntu.com/http:\/\/mirrors.aliyun.com/g" /etc/apt/sources.list
RUN apt-get update && apt-get -y dist-upgrade
RUN apt-get install -y xinetd libc6:i386 libncurses5:i386 libstdc++6:i386 socat
RUN apt-get install -y python2.7 python-pip
RUN useradd -m ctf
@grasses
grasses / CentOS-Tsinghua.repo
Created November 13, 2018 13:22
Centos7 repo
[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
@grasses
grasses / xssr.sh
Last active November 24, 2021 15:28
Shadowsocks SSR one click installation backup.
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=================================================================#
# System Required: CentOS 6,7, Debian, Ubuntu #
# Description: One click Install ShadowsocksR Server #
# Intro: https://shadowsocks.be/9.html #
#=================================================================#
clear
@grasses
grasses / ipsec.sh
Created December 7, 2017 08:45
One command for ipsec vpn server on Centos7
#!/bin/sh
#
# Script for automatic setup of an IPsec VPN server on CentOS/RHEL 6 and 7.
# Works on any dedicated server or virtual private server (VPS) except OpenVZ.
#
# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC!
#
# The latest version of this script is available at:
# https://github.com/hwdsl2/setup-ipsec-vpn
#
@grasses
grasses / xvpn.sh
Created August 24, 2017 05:57
One command install vpn shell
#!/bin/bash
# Setup Simple PPTP VPN server for CentOS 7
# Copyright (C) 2015-2017 http://homeway.me and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@grasses
grasses / redis-6379.conf
Created July 13, 2017 01:36
Redis example conf, all file save in /home/redis.
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
@grasses
grasses / test.py
Last active July 11, 2017 08:02
rabbitmq
#!/usr/bin/env python2.7.13
import pika, threading, random
scope = []
hostname = "10.1.20.222"
def gen(size):
char_set = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()"
pw = ""
for i in range(size):
@grasses
grasses / install-squid.sh
Last active June 9, 2017 06:19 — forked from cdodd/install-squid.sh
Install a basic squid proxy with authentication on Centos 6 x64. Just modify the variables at the top and run the script on a clean system.
#!/bin/sh
PROXY_USER=user
PROXY_PASS=password
PROXY_PORT=3128
# Clear the repository index caches
yum clean all
# Update the operating system