Skip to content

Instantly share code, notes, and snippets.

@kudarap
kudarap / Channel.php
Created August 27, 2015 19:38
eden-json-rest module
<?php //-->
/*
CREATE TABLE IF NOT EXISTS `channel` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`name` text NOT NULL,
`data` longtext NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
@kudarap
kudarap / ss.sh
Last active September 14, 2015 10:41
ubuntu 14 server stack
#!/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
@kudarap
kudarap / goon.sh
Last active September 9, 2015 05:27
install go lang at ease
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 / backup.sh
Last active September 14, 2015 09:33
back up project files & mysql db
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 / atom-update.sh
Created September 24, 2015 05:16
atom updater for linux
#!/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 / app.sh
Last active May 31, 2016 07:37
OL Server Stack CentOS 6 (run with sudo)
# 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 / ImmortalSSE.js
Created February 12, 2017 14:04
SSE auto-revive connection
export const ImmortalSSE = url => {
let url
let instance
let listeners = []
const timeout = 2000
const create = () => {
if (url == undefined) {
return
@kudarap
kudarap / Sublime Text win.xml
Last active April 14, 2020 23:09
JetBrains keymap for windows
<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 / fileserver.go
Created July 1, 2020 11:46
file serving though local netowk
package main
import (
"log"
"fmt"
"os"
"net"
"net/http"
)
@kudarap
kudarap / bpalert.go
Created July 1, 2020 11:51
dota 2 blog content watcher
package main
import (
"flag"
"fmt"
"log"
"strings"
"net/http"
"io/ioutil"
"os/exec"