Skip to content

Instantly share code, notes, and snippets.

@dimm999
dimm999 / golang_proxy_checker.go
Created November 25, 2015 06:34
Golang Proxy checker
package main
import (
"code.google.com/p/gcfg"
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
"github.com/parnurzeal/gorequest"
"log"
"runtime"
@dimm999
dimm999 / golang_proxy_parser.go
Created November 25, 2015 06:35
Proxy list parser on Go
package main
import (
"fmt"
"github.com/opesun/goquery"
"io/ioutil"
"net/http"
"os"
"strconv"
"time"
@dimm999
dimm999 / ip.txt
Created November 25, 2015 06:40 — forked from sempr/ip.txt
proxy check by golang
129.24.51.99 21320
24.158.231.6 80
54.161.139.184 5555
46.38.166.124 80
192.121.107.107 80
177.91.192.116 8080
1.0.138.14 8080
107.150.29.157 3128
98.145.71.245 21320
68.195.17.204 21320
@dimm999
dimm999 / gopath_linux.sh
Created November 25, 2015 08:48
Golang Path setup on Linux
#В зависимости от эмулятора терминала, нужно добавить в ~/.bashrc (.zshrc, etc), следующие строки:
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
#/usr/local/go - расположение самой инсталляции (может отличатся в зависимости от системы и в случае использования менеджера управления версиями)
#$HOME/go - расположение любой директории, в которой хотите хранить пакеты
@dimm999
dimm999 / main.go
Last active January 5, 2018 09:47
[Golang channels] Golang channels example #go #golang
package tasks
type Task struct {
Name string
}
func (t *Task) Finish() {
// what actually can finish the task
}
@dimm999
dimm999 / js
Created February 11, 2017 13:53
JS clear string function
//in: 123�������������������������
//out: 123
function cleanString(input) {
var output = "";
for (var i=0; i<input.length; i++) {
if (input.charCodeAt(i) <= 127) {
output += input.charAt(i);
}
}
return output;
@dimm999
dimm999 / nodejs_read_replace.js
Created February 14, 2017 13:51
nodejs read all files in dir and replace some part of string inside
const cfgFolder = './cfg/';
const fs = require('fs');
const outFile = './out.txt';
fs.readdir(cfgFolder, (err, files) => {
files.forEach(file => {
fs.readFile(cfgFolder+file, 'utf8', (err, data) => {
if(err) throw err;
let pass = data.match(/(blabla.+)/i);
pass = pass[0].trim();
#!/usr/bin/python3
#22/06/2017 17:17
import telnetlib
import time
import os
import sys
import getpass
import pexpect
from telnetlib import Telnet
import datetime
@dimm999
dimm999 / site.com.conf
Created December 2, 2018 14:14
wordpress + Nginx + PHP 7.2 + Cloudflare (SSL)
server {
listen 80;
listen [::]:80;
server_name site.com www.site.com;
return 302 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
@dimm999
dimm999 / instagram-follow-script.js
Created January 9, 2019 07:32
Instagram script for followers
/* source https://www.youtube.com/watch?v=UKi1NwqKCz8
_aj7mu _r4e4p _95tat _o0442
*/
var jq = document.createElement('script');
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
jQuery.noConflict()