Skip to content

Instantly share code, notes, and snippets.

View vehsamrak's full-sized avatar
❤️

Petr Karmashev vehsamrak

❤️
View GitHub Profile
@vehsamrak
vehsamrak / work.sh
Created February 21, 2024 11:27 — forked from montethinks/work.sh
Start tmux with preconfigured windows and panes.
#!/bin/sh
# Setup a work space called `work` with four windows
session="work"
# set up tmux
tmux start-server
# create a new tmux session with <NAME>
@vehsamrak
vehsamrak / main.go
Created December 1, 2020 21:32 — forked from mcarrowd/main.go
golang win1251 <-> utf8 encoding issue demonstration
package main
import (
"fmt"
"golang.org/x/text/encoding/charmap"
)
func main() {
for i := 0; i <= 255; i++ {
charnum := uint8(i)
@vehsamrak
vehsamrak / Version20121011141021.php
Last active April 26, 2018 11:44 — forked from ziadoz/Version20121011141021.php
Doctrine DBAL and Migrations Example
<?php
/*
* /path/to/migrations/directory/Version20121011141021.php
*/
namespace ExampleMigrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
class Version20121011141021 extends AbstractMigration

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@vehsamrak
vehsamrak / install_golang.sh
Created February 24, 2018 07:43 — forked from jniltinho/install_golang.sh
Install Golang on Linux
#!/bin/bash
## Install Golang 1.10 64Bits on Linux (Debian|Ubuntu|OpenSUSE|CentOS)
## http://www.linuxpro.com.br/2015/06/golang-aula-1-instalacao-da-linguagem-no-linux.html
## Run as root (sudo su)
## Thank's @geosoft1 | @gwmoura
GO_URL="https://storage.googleapis.com/golang"
GO_VERSION=${1:-"1.10"}
GO_FILE="go$GO_VERSION.linux-amd64.tar.gz"
@vehsamrak
vehsamrak / Install-php7.md
Created January 18, 2016 08:29 — forked from hollodotme/Install-php7.md
Installing php7-fpm with phpredis extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php-7.0
# Update index
apt-get update
# Install php7.0-fpm with needed extensions
@vehsamrak
vehsamrak / _service.md
Last active August 29, 2015 14:27 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@vehsamrak
vehsamrak / redis.markdown
Last active August 29, 2015 14:26 — forked from bdotdub/redis.markdown
Running redis using upstart on Ubuntu

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install: