Skip to content

Instantly share code, notes, and snippets.

@kudarap
kudarap / updategolinux.sh
Last active Jul 17, 2020
bash script for updating golang
View updategolinux.sh
#!/bin/sh
ver=$1
if [ -z "$ver" ]
then
echo go version required
exit
fi
echo Downloading go version $ver...
@kudarap
kudarap / bpalert.go
Created Jul 1, 2020
dota 2 blog content watcher
View bpalert.go
package main
import (
"flag"
"fmt"
"log"
"strings"
"net/http"
"io/ioutil"
"os/exec"
@kudarap
kudarap / fileserver.go
Created Jul 1, 2020
file serving though local netowk
View fileserver.go
package main
import (
"log"
"fmt"
"os"
"net"
"net/http"
)
@kudarap
kudarap / Sublime Text win.xml
Last active Apr 14, 2020
JetBrains keymap for windows
View Sublime Text win.xml
<keymap version="1" name="Sublime Text win" parent="Sublime Text">
<action id="ActivateFavoritesToolWindow" />
<action id="ActivateProjectToolWindow" />
<action id="ActivateRunToolWindow" />
<action id="ChangesView.ShelveSilently" />
<action id="DatabaseView.SqlGenerator" />
<action id="DuplicatesForm.SendToLeft" />
<action id="DuplicatesForm.SendToRight" />
<action id="FileChooser.GotoHome" />
<action id="FileChooser.GotoModule" />
@kudarap
kudarap / ImmortalSSE.js
Created Feb 12, 2017
SSE auto-revive connection
View ImmortalSSE.js
export const ImmortalSSE = url => {
let url
let instance
let listeners = []
const timeout = 2000
const create = () => {
if (url == undefined) {
return
@kudarap
kudarap / app.sh
Last active May 31, 2016
OL Server Stack CentOS 6 (run with sudo)
View app.sh
# Apache 2 & PHP 5.6
cd ~
yum update -y
yum install -y httpd httpd-devel
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
yum install -y php56w php56w-opcache php56w-devel php56w-gd php56w-imap php56w-mcrypt php56w-mysql php56w-pdo php56w-pear
yum install -y php56w-pecl-geoip php56w-pgsql php56w-bcmath php56w-mbstring git
@kudarap
kudarap / atom-update.sh
Created Sep 24, 2015
atom updater for linux
View atom-update.sh
#!/bin/bash
wget -q https://github.com/atom/atom/releases/latest -O /tmp/latest
wget --progress=bar -q 'https://github.com'$(cat /tmp/latest | grep -o -E 'href="([^"#]+)atom-amd64.deb"' | cut -d'"' -f2 | sort | uniq) -O /tmp/atom-amd64.deb -q --show-progress
sudo dpkg -i /tmp/atom-amd64.deb
@kudarap
kudarap / backup.sh
Last active Sep 14, 2015
back up project files & mysql db
View backup.sh
echo 'backing up ...'
# sql dump all
mysqldump -v -u dev -p --all-databases > mysql-`date '+%d-%m-%Y'`.sql
# project files
tar jcvf project-`date '+%d-%m-%Y'`.tar.bz2 /project/
# put all together
tar jcvf backup-`date '+%d-%m-%Y'`.tar.bz2 project-* mysql-*
@kudarap
kudarap / goon.sh
Last active Sep 9, 2015
install go lang at ease
View goon.sh
echo 'go install ...'
wget https://storage.googleapis.com/golang/go1.5.1.linux-amd64.tar.gz;
tar xvf go1.5.1.linux-amd64.tar.gz;
sudo mv go /usr/local
export PATH=$PATH:/usr/local/go/bin
sudo mkdir /project/go
export GOPATH=/project/go
echo 'done!'
@kudarap
kudarap / ss.sh
Last active Sep 14, 2015
ubuntu 14 server stack
View ss.sh
#!/bin/bash
echo 'updating system ...'
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo apt-get -y install curl
curl -sL https://deb.nodesource.com/setup | sudo bash -
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=bin --filename=composer