Skip to content

Instantly share code, notes, and snippets.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 17, 2024 01:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@greneholt
greneholt / AutoHotkey.ahk
Last active September 14, 2020 20:35
AutoHotkey semicolon arrow keys and capslock to ctrl/escape
#SingleInstance force
; Necessary for semicolon arrow to work, since it can send semicolon.
#InstallKeybdHook
; Better performance.
SendMode Input
; Kill CapsLock.
SetCapsLockState AlwaysOff
@shantanuo
shantanuo / mysql_to_big_query.sh
Last active September 14, 2022 07:12
Copy MySQL table to big query. If you need to copy all tables, use the loop given at the end. Exit with error code 3 if blob or text columns are found. The csv files are first copied to google cloud before being imported to big query.
#!/bin/sh
TABLE_SCHEMA=$1
TABLE_NAME=$2
mytime=`date '+%y%m%d%H%M'`
hostname=`hostname | tr 'A-Z' 'a-z'`
file_prefix="trimax$TABLE_NAME$mytime$TABLE_SCHEMA"
bucket_name=$file_prefix
splitat="4000000000"
bulkfiles=200
@kukat
kukat / custom.css
Last active November 14, 2016 13:49
nvAlt with code highlight template.html
/*
This is my hacked up copy of Marked.app/Contents/Resources/gridless.css
Changes:
1. Smaller headings
2. ~~No scrollbars~~ (I now prefer the Lion default behavior)
3. Styling of definition lists ala LaTeX description lists.
4. Centering h1.title, h3.author, h4.date (pandoc's title/author/date block).
@jeroenvandijk
jeroenvandijk / Readm.md
Last active August 31, 2017 09:13
Instructions to test Logstash with Kafka

Test Logstash with Kafka

Setup Kafka

Download Kafka from:

https://www.apache.org/dyn/closer.cgi/incubator/kafka/kafka-0.7.2-incubating/kafka-0.7.2-incubating-src.tgz

Install Kafka

object Kernel {
implicit class Times(val n: Int) extends AnyVal {
def times[T](block: => T) = for (i <- 1 to n) yield block
def times[T](block: Int => T) = for (i <- 1 to n) yield block(i)
}
implicit class RunnableConversion(block: => Unit) extends Runnable {
def run = block
}
@visenger
visenger / install_scala_sbt.sh
Last active January 31, 2023 19:10
Scala and sbt installation on ubuntu 12.04
#!/bin/sh
# one way (older scala version will be installed)
# sudo apt-get install scala
#2nd way
sudo apt-get remove scala-library scala
wget http://www.scala-lang.org/files/archive/scala-2.11.4.deb
sudo dpkg -i scala-2.11.4.deb
sudo apt-get update
@onilton
onilton / scheduled_task.scala
Created September 27, 2013 08:39
Scheduled task in scala
import akka.actor.ActorSystem
import scala.concurrent.duration._
val actorSystem = ActorSystem()
val scheduler = actorSystem.scheduler
val task = new Runnable { def run() { println("Hello") } }
implicit val executor = actorSystem.dispatcher
@willthames
willthames / pkilldemo output
Last active June 19, 2018 04:04
Demo of pkill behaviour with Ansible
[will@fedora pkilldemo]$ ansible-playbook pkilldemo.yml
PLAY [localhost] **************************************************************
GATHERING FACTS ***************************************************************
ok: [127.0.0.1]
TASK: [generate random process string] ****************************************
changed: [127.0.0.1]
@panbanda
panbanda / get_locust.sh
Last active August 29, 2015 14:02
Upgrade Latest Python & PIP on EC2 for Locust Swarms
# Build tools
sudo yum install make automake gcc gcc-c++ kernel-devel git-core -y
# Install python 2.7 and change default python symlink
sudo yum install python27-devel -y
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python
# yum still needs 2.6, so write it in and backup script
sudo cp /usr/bin/yum /usr/bin/_yum_before_27