Skip to content

Instantly share code, notes, and snippets.

View notsobad's full-sized avatar

notsobad notsobad

View GitHub Profile
docker run -v `pwd`:/data/ -e NODE_TLS_REJECT_UNAUTHORIZED=0 --rm -ti elasticdump/elasticsearch-dump \
--input=https://user:pass@domain.com/dir/ \
--input-index=index/type \
--searchBody="{\"query\":{\"term\":{\"key\": \"xxxx\"}}}" \
--output=/data/xxx.json \
--size=1000 \
--concurrency=5 \
--type=data
# https://askubuntu.com/questions/1049302/wired-ethernet-not-working-ubuntu-18-04
# ubuntu 18.04 桌面版,发现每次重启后,有线网络是off的状态,需要点击connect,才能连接,查了下,有不少人遇到同样问题,下面这个方法可以解决问题
service network-manager stop
rm /var/lib/NetworkManager/NetworkManager.state
service network-manager start
@notsobad
notsobad / Makefile
Created December 31, 2019 06:00
Makefile for start jupyter.
WORK_DIR = /root/notsobad/jupyter/work
CONTAINER_NAME = jupyter
init :
docker run -d --name $(CONTAINER_NAME) -p 8888:8888 -e NB_UID=1000 -e JUPYTER_ENABLE_LAB=yes -v "$(WORK_DIR)":/home/jovyan/work jupyter/tensorflow-notebook start-notebook.sh --NotebookApp.password='sha1:XXX:XXXX'
start :
docker start $(CONTAINER_NAME)
stop :
docker stop $(CONTAINER_NAME)
@notsobad
notsobad / filter-tls-1.0.sh
Created November 22, 2019 06:38
过滤tls1.0的client hello数据包
# 过滤tls1.0的client hello数据包,参考https://www.netmeister.org/blog/tcpdump-ssl-and-tls.html
tcpdump -ni eth0 '((tcp[((tcp[12] & 0xf0) >>2)] = 0x16) && (tcp[((tcp[12] & 0xf0) >> 2)+1] = 0x03) && (tcp[((tcp[12] & 0xf0) >> 2)+9] = 0x03) && (tcp[((tcp[12] & 0xf0) >> 2)+10] = 0x01))'
for i in range(100):
n = i + 1
out = []
if n % 3 == 0:
out.append('fizz')
if n % 5 == 0:
out.append('buzz')
if not out:
@notsobad
notsobad / wx.py
Last active November 19, 2019 09:22
企业微信群机器人消息,python wx.py `now is date`
import sys
import json
import requests
API_URL = 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=XXXXXXXXXX'
def send_msg(msg):
obj = {
"msgtype": "text",
#!/bin/bash
cat <<EOF > /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
#!/bin/bash
url=$1
argc=$#
argv=($@)
host=`echo $url | awk -F[/:] '{print $4}'`
for ((i=1; i<argc; i++)); do
ip=${argv[i]}
final_url=`echo $url | sed "s/$host/$ip/"`
#!/usr/bin/env perl
use strict;
use warnings;
use feature qw( say );
use local::lib 'local';
use MaxMind::DB::Writer::Tree;
use Net::Works::Network;