Skip to content

Instantly share code, notes, and snippets.

@wgm89
wgm89 / http.c
Last active May 6, 2016 02:39
http.c
#include<netinet/in.h>
#include<stdio.h>
#include<stdlib.h>
#include<sys/socket.h>
#include<sys/stat.h>
#include<sys/types.h>
#include<unistd.h>
int main() {
int create_socket, new_socket;
#include "stdio.h"
#include <windows.h>
#include <string.h>
#include <stdlib.h>
// Some Global Variables
char aa[500];
@wgm89
wgm89 / server.c
Last active March 25, 2016 10:07
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#include <dirent.h>
#include <pthread.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <sys/epoll.h>
@wgm89
wgm89 / code.c
Last active March 23, 2016 09:49
windows c
##开机自启动脚本
#include <windows.h>
#include <stdio.h>
int main()
{
HKEY hRoot = HKEY_LOCAL_MACHINE;
char *szSubKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Run";
char *szModule = "D:\\software\\eclipse\\eclipse.exe";
ubuntu
正在解压缩 apache2-bin (从 .../apache2-bin_2.4.16-4+deb.sury.org~precise+4_amd64.deb) ...
dpkg:处理 /var/cache/apt/archives/apache2-bin_2.4.16-4+deb.sury.org~precise+4_amd64.deb (--unpack)时出错:
正试图覆盖 /usr/share/man/man8/apache2.8.gz,它同时被包含于软件包 apache2.2-common 2.2.22-1ubuntu1.10
dpkg -i --force-overwrite /var/cache/apt/archives/libc6_2.15-0ubuntu10.9_amd64.debapt-get -f install
@wgm89
wgm89 / simulate.py
Last active October 23, 2019 01:56
python simulate keybord
import ctypes
LONG = ctypes.c_long
DWORD = ctypes.c_ulong
ULONG_PTR = ctypes.POINTER(DWORD)
WORD = ctypes.c_ushort
class MOUSEINPUT(ctypes.Structure):
_fields_ = (('dx', LONG),
('dy', LONG),
@wgm89
wgm89 / gist:428cab2f9e91389c05eb
Last active August 29, 2015 14:22
selenium get website content
from selenium import webdriver
import selenium.webdriver.chrome.service as service
from pyvirtualdisplay import Display
display = Display(visible=0, size=(800, 600))
display.start()
service = service.Service('/var/www/my/python/chromedriver')
service.start()
capabilities = {}
@wgm89
wgm89 / gist:3f108c515239aab4396d
Created May 21, 2015 02:44
Everyday I come to office, I've to open up a fixed number of links on my web-browser.
#! /usr/bin/python -tt
import webbrowser
def main():
webbrowser.open('http://www.v2ex.com')
webbrowser.open_new_tab('https://www.quora.com')
if __name__ == '__main__':
main()
@wgm89
wgm89 / gist:fde00a0f6e9081bc04e4
Last active August 29, 2015 14:19
ssh socket proxy
export SOCKS5_SERVER=124.251.13.148:40800
export SOCKS5_USER=php
export SOCKS5_PASSWORD=php@syswin2015
ssh php@172.20.1.159
Host 172.20.1.159
ProxyCommand connect-proxy -5 -S 124.251.13.148:40800 %h %p
###########################################################################
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required