Skip to content

Instantly share code, notes, and snippets.

@bzz
bzz / GIF-Screencast-OSX.md
Created March 10, 2016 03:24 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

#!/bin/bash
# Install parallel on CentOS 6.
# Assumes you are root. Prefix w/ sudo if not.
cd /etc/yum.repos.d/
wget http://download.opensuse.org/repositories/home:/tange/CentOS_CentOS-6/home:tange.repo
yum install parallel
@bzz
bzz / KafkaEmbedded.scala
Last active January 15, 2018 16:05 — forked from mardambey/KafkaEmbedded.scala
Embedded Kafka 0.8.2.0 (without Zookeeper) and producer/consumer in Scala with Gradle for tests
import java.util.Properties
import scala.util.control.Breaks._
import kafka.server.KafkaServer
import kafka.server.KafkaConfig
import kafka.producer.ProducerConfig
import kafka.producer.Producer
import kafka.message.Message
import kafka.producer.KeyedMessage
import kafka.consumer.SimpleConsumer
import kafka.api.FetchRequest
@bzz
bzz / install-parallel-centos-6.sh
Last active March 30, 2019 01:18
Install GNU Parallel on CentOS 6
#!/bin/bash
# Install parallel on CentOS 6.
# Assumes you are root. Prefix w/ sudo if not.
cd /etc/yum.repos.d/
#wget http://download.opensuse.org/repositories/home:tange/CentOS_CentOS-5/home:tange.repo
wget http://download.opensuse.org/repositories/home:/tange/CentOS_CentOS-6/home:tange.repo
yum install parallel

I used to think that

ssh -X me@some.box

"just bloody worked". However this might not work - ssh must play ball on both sides of the link. On the remote (ssh server, X client) sshd must sit behind some port, tell Xlib to send X11 requests to it and then forward them back to you the X server (where the ssh client is). If the remote box is locked down to prevent this, you will get:

X11 forwarding request failed on channel 0

as part of an otherwise working login. As it happens, I am the admin of the remote box in question, so I followed the ArchWiki and went to /etc/ssh/sshd_config and uncommented

#!/bin/sh
# This program has two feature.
#
# 1. Create a disk image on RAM.
# 2. Mount that disk image.
#
# Usage:
# $0 <dir> <size>
#
"\e[1~": beginning-of-line
"\e[4~": end-of-line
“\e[5~”: history-search-backward
“\e[6~”: history-search-forward
"\e[3~": delete-char
"\e[2~": quoted-insert
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum -y install jenkins
sudo yum -y install java-1.7.0-openjdk.x86_64
# Login as the jenkins user and specify shell explicity,
# since the default shell is /bin/false for most
# jenkins installations.
sudo su jenkins -s /bin/bash