Skip to content

Instantly share code, notes, and snippets.

View islander's full-sized avatar

kiba islander

  • Innova Distribution
  • Moscow | Saint Petersburg
View GitHub Profile
@sosedoff
sosedoff / 1_simple.go
Created July 16, 2016 18:45
Golang Custom Struct Tags Example
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"
@duan-li
duan-li / my.ini
Created May 17, 2016 01:54
disable and remove bin log file
[mysqld]
skip-log-bin
innodb_file_per_table=1
expire_logs_days = 1
max_binlog_size = 10M
#use following detail to clean everything about bin log
#PURGE BINARY LOGS TO 'mysql-bin.000029';
#RESET MASTER;
@giovtorres
giovtorres / virt-install-centos
Last active March 15, 2023 09:57
Install CentOS cloud images on KVM using cloud-init
#!/bin/bash
## **Updates to this file are now at https://github.com/giovtorres/kvm-install-vm.**
## **This updated version has more options and less hardcoded variables.**
# Take one argument from the commandline: VM name
if ! [ $# -eq 1 ]; then
echo "Usage: $0 <node-name>"
exit 1
fi
@scaratec
scaratec / gpt_grub_tutorial.md
Last active January 28, 2019 01:32
How to install Debian Jessie on a LVM Rootpartition

How to install Debian Jessie on a LVM Rootpartition

This document describes the installation of Debian Jessie via debootstrap on a Logical Volume which in turn is installed on a Software Raid managed by mdadm. The partition table will be gpt with grub2

Please note that this doc is primarily for my personal use but I want so share it with the community. If you have any amendments please just leave me a note or send me a pull-request.

Motivation
When operating large virtual machines, there is a need a making backups with minimum downtime. My strategie here is to shutdown the vm (like a Windows Server on KVM) to have them in a consistent state. Then I create a LVM snapshot and start the machine again.

This gives me the time to write the im

@justrjlewis
justrjlewis / caddy-updated.in.sh
Last active November 25, 2018 01:48
Run caddy server as a service: FreeBSD 10.2
#!/bin/sh
# PROVIDE: caddy
# REQUIRE: LOGIN
# KEYWORD: shutdown
# Documentation=https://caddyserver.com/docs
# add php-fpm to REQUIRE to run php/fastcgi processes
# Add the following lines to /etc/rc.conf to enable caddy:
@JoelQ
JoelQ / README.md
Created October 15, 2015 13:50
Using Shell Scripts for a Better User Experience (source for https://robots.thoughtbot.com/improving-user-experience-with-shell-scripts)

Server scripts

This is the source for the scripts discussed in https://robots.thoughtbot.com/improving-user-experience-with-shell-scripts

Both scripts are in the bin/ directory of the repo that contains all the markdown documents for blog posts. Users run bin/server and everything is automatically set up for them to view a local preview of the blog. bin/server-setup is a dependency of bin/server and is never run directly by users.

Maitre-d is the name of the "blog engine" discussed in the article.

@paulirish
paulirish / what-forces-layout.md
Last active April 24, 2025 09:45
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@RickyCook
RickyCook / Command.md
Last active November 7, 2023 06:55
Using socat to forward new ports via STDIO in a running Docker container

What?... Why?

Imagine you're messing around in a container, and you install some stuff, add some config, and now it's time to load up your client and check it out! Oh wait, you forgot to forward ports when you created the container! Fear not, all is not lost, for in the world of pipes, and streams, there is always a way to do something disgusting.

The Dockerfile

Example Dockerfile included will install Nginx, and socat in a container, and make Nginx run in foreground mode. To build, and run:

@paulochf
paulochf / countries.sql
Last active April 26, 2024 09:50 — forked from adhipg/countries.sql
Outdated. Used with discretion. Accepting updates.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@nicktoumpelis
nicktoumpelis / repo-rinse.sh
Created April 23, 2014 13:00
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive