Skip to content

Instantly share code, notes, and snippets.

View shinvdu's full-sized avatar

Tian Xie shinvdu

View GitHub Profile
@shinvdu
shinvdu / gist:9307cae34727bedbe63fc4186ef6ca84
Last active March 6, 2023 01:46
alicloud pulumi ecs javascript working example
"use strict";
const pulumi = require("@pulumi/pulumi");
const alicloud = require("@pulumi/alicloud");
const exampleRg = new alicloud.resourcemanager.ResourceGroup("pulumiDeployment", {
displayName: "Pulumi Example RG",
// error: [ERROR] terraform-provider-alicloud@v1.176.0/alicloud/resource_alicloud_resource_manager_resource_group.go:95:
// [ERROR] Argument "name" or "resource_group_name" must be set one!
resourceGroupName: "pulumiDeployment",
});
@shinvdu
shinvdu / tun-ping-linux.py
Created August 18, 2016 05:32 — forked from glacjay/tun-ping-linux.py
Reading/writing Linux's TUN/TAP device using Python.
import fcntl
import os
import struct
import subprocess
# Some constants used to ioctl the device file. I got them by a simple C
# program.
TUNSETIFF = 0x400454ca
TUNSETOWNER = TUNSETIFF + 2
@shinvdu
shinvdu / send_file.py
Created August 2, 2016 02:55 — forked from dengshilong/send_file.py
使用smtplib的例子
#--*-- encoding:utf-8 --*--
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email import encoders
from datetime import date
def sendMail(user,pwd,to,subject,filename):
outer = MIMEMultipart()
outer['From'] = user
outer['To'] = to
@shinvdu
shinvdu / build_mysql.sh
Created March 2, 2016 09:03 — forked from shichao-an/build_mysql.sh
Build and install MySQL 5.1 from source on Ubuntu 14.04
#!/bin/bash
# Run as root
set -e
apt-get update
apt-get install -y build-essential
apt-get install -y libncurses5-dev
useradd mysql
@shinvdu
shinvdu / gist:d0054671bad636310320
Last active August 29, 2015 14:27 — forked from saga/gist:1381374
Python实现QQ机器人
目前网上有不少的实现QQ机器人的方法,都不太稳定甚至都已经失效了,而且我们还要冒着QQ号被盗用的风险。其实我们可以自己实现一个QQ自动应答的机器人,思路非常简单:通过模拟登录3G版QQ,来实现相关的操作:
一、首先我们得看看3GQQ的相关协议
为此,我们需要一个支持WAP的浏览器,可以使用Firefox的wmlbrowser插件,打开FF后,访问地址:https://addons.mozilla.org/zh-CN/firefox/search/?q=wmlbrowser&cat=all&x=17&y=11
二、进入3GQQ的进行协议分析
3GQQ的地址是:http://pt.3g.qq.com/s?aid=nLogin3gqq 用安装了wmlbrowser插件的FF打开页面后,启用firebug,即可监视提交的数据。
三、源代码