Skip to content

Instantly share code, notes, and snippets.

@sudokai
sudokai / CoreOS swap
Last active August 29, 2015 14:14 — forked from kacinskas/CoreOS swap
# swith to sudo
sudo -i
# create swap
touch /2GiB.swap
chattr +C /2GiB.swap
fallocate -l 2048m /2GiB.swap
chmod 600 /2GiB.swap
mkswap /2GiB.swap
@sudokai
sudokai / cloud-config
Last active August 29, 2015 14:14 — forked from tsertkov/cloud-config
#cloud-config
coreos:
units:
- name: systemd-sysctl.service
command: restart
- name: create-swap.service
command: start
runtime: true
content: |

Linux simple performance tweaks

Change the I/O Scheduler

Open $ vim /etc/default/grub then add elevator=noop next to GRUB_CMDLINE_LINUX_DEFAULT. Run $ update-grub and $ cat /sys/block/sda/queue/scheduler to be sure that noop is being used:

$ vim /etc/default/grub
$ update-grub
$ cat /sys/block/sda/queue/scheduler

[noop] deadline cfq

@sudokai
sudokai / sysctl.conf
Last active August 29, 2015 14:15 — forked from kgriffs/sysctl.conf
# Configuration file for runtime kernel parameters.
# See sysctl.conf(5) for more information.
# See also http://www.nateware.com/linux-network-tuning-for-2013.html for
# an explanation about some of these parameters, and instructions for
# a few other tweaks outside this file.
# Protection from SYN flood attack.
net.ipv4.tcp_syncookies = 1
# Model
from concurrency.fields import IntegerVersionField
class Image(models.Model):
id = models.CharField(max_length=36, primary_key=True)
human_id = models.CharField(max_length=255, null=True) # some images don't have human_id
name = models.CharField(max_length=255)
tenant_id = models.CharField(max_length=255, null=True) # some images don't have tenant_id
version = IntegerVersionField() # django-concurrency
@sudokai
sudokai / jenkins_haproxy_config.cfg
Created November 26, 2015 23:15 — forked from xelwarto/jenkins_haproxy_config.cfg
Jenkins CI haproxy configuration example
global
chroot /var/lib/haproxy
crt-base /etc/pki/tls/certs
daemon
group haproxy
log 127.0.0.1 local0
maxconn 2000
pidfile /var/run/haproxy.pid
stats socket /var/lib/haproxy/stats
tune.ssl.default-dh-param 2048
@sudokai
sudokai / gitlab.conf
Created November 27, 2015 08:17 — forked from sameersbn/gitlab.conf
Nginx reverse proxy configuration for GitLab
upstream gitlab {
server 172.17.42.1:10080 fail_timeout=0;
}
# let gitlab deal with the redirection
server {
listen 80;
server_name git.example.com;
server_tokens off;
root /dev/null;
@sudokai
sudokai / centos_nspawn.md
Created March 25, 2017 13:25 — forked from bhouse/centos_nspawn.md
Centos 7.2.1511 via systemd-nspawn

Make a directory to install CentOS 7.2.1511 in

[root@localhost ~]# mkdir /centos_chroot

Make a directory for the rpm database

[root@localhost ~]# mkdir -p /centos_chroot/var/lib/rpm

Create the RPM database