Skip to content

Instantly share code, notes, and snippets.

View drconopoima's full-sized avatar

Luis Jesús Díaz drconopoima

View GitHub Profile
@lele85
lele85 / di_hello.cs
Created January 31, 2012 20:39
Dependency Injection Hello World in C#
using System;
using System.Configuration;
using System.Threading;
using System.Collections;
using System.Collections.Generic;
namespace HelloDI
{
public class MainClass
{
@arindam89
arindam89 / .bashrc
Created June 5, 2012 06:43
.bashrc example
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't overwrite GNU Midnight Commander's setting of 'ignorespace'.
export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
# ... or force ignoredups and ignorespace
export HISTCONTROL=ignoreboth
@kmoormann
kmoormann / IdempotentSQLAlterTableAddColumn.sql
Created September 20, 2012 20:47
Idempotent SQL Alter Table Statements
IF NOT EXISTS
(
SELECT * FROM [information_schema].[columns]
WHERE table_name = 'Customer'
AND table_schema = 'dbo'
AND column_name = 'FavoriteColorId'
)
BEGIN
ALTER TABLE [dbo].[Customer]
ADD FavoriteColorId int
@dlecocq
dlecocq / 0-dependencies.sh
Last active October 16, 2022 20:04
ElasticSearch Bootstrap
# Environment
#
# export HOSTNAME=...
# export CLUSTER=...
# export RACK=...
# export ESDIR=
# export AWS_ACCESS_KEY=...
# export AWS_SECRET_KEY=...
# Packages
@kgriffs
kgriffs / sysctl.conf
Last active April 29, 2024 11:32
Linux Web Server Kernel Tuning
# 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.
#
# See also: https://gist.github.com/kgriffs/4027835
#
# Assumes a beefy machine with lots of network bandwidth
@vintagewang
vintagewang / os.sh
Created August 4, 2013 01:59
RocketMQ操作系统调优脚本
#!/bin/sh
#
# 此脚本只允许运行一次
#
echo 'vm.overcommit_memory=1' >> /etc/sysctl.conf
echo 'vm.min_free_kbytes=5000000' >> /etc/sysctl.conf
echo 'vm.drop_caches=1' >> /etc/sysctl.conf
echo 'vm.zone_reclaim_mode=0' >> /etc/sysctl.conf
@pensierinmusica
pensierinmusica / network-tuning.conf
Last active January 18, 2024 22:37
Linux sysctl configuration file for NginX
## Place this file in "/etc/sysctl.d/network-tuning.conf" and
## run "sysctl -p" to have the kernel pick the new settings up
# Avoid a smurf attack
net.ipv4.icmp_echo_ignore_broadcasts = 1
# Turn on protection for bad icmp error messages
net.ipv4.icmp_ignore_bogus_error_responses = 1
# Turn on syncookies for SYN flood attack protection
@Rachitlohani
Rachitlohani / sysctl
Last active October 20, 2022 06:49
network
#def 60
net.ipv4.tcp_fin_timeout=20
#def 9
net.ipv4.tcp_keepalive_probes=5
#def 32768
net.ipv4.tcp_max_orphans=32768
#def 10240
net.core.optmem_max=20480
#def 110592
net.core.rmem_default=16777216
@sytone
sytone / pihacks
Last active October 16, 2022 20:14
Pi hacks
# http://raspberrypi.stackexchange.com/questions/169/how-can-i-extend-the-life-of-my-sd-card
# http://www.a-netz.de/2013/02/ramdisks-for-the-raspberry/
# http://web.archive.org/web/20140701023126/http://raspberry.pi.gw.gd/t50-Using-ZRAM.html
#zram
sudo modprobe zram zram_num_devices=1
lsmod | grep zram
Script Contents:
#!/bin/sh -e
@squarism
squarism / iterm2.md
Last active July 7, 2024 05:11
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)