Skip to content

Instantly share code, notes, and snippets.

@rothgar
rothgar / install-tmux
Last active April 5, 2023 06:53 — forked from ekiara/how_to_install_tmux_on_centos
Install tmux 1.9 on rhel/centos 6
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
#!/usr/bin/env bash
# Creates a dialog using Zenity that lists all of your open windows and then switches to whatever window matches your input
# Requires Zenity and wmctrl packages
IFS_BAK=$IFS
IFS_LINE=$'\n'$'\r'
IFS=$IFS_LINE
i="0"
WINDOW_LIST=$(wmctrl -l | grep -v "\-1")
@rothgar
rothgar / .bashrc
Created October 15, 2015 21:19 — forked from marioBonales/.bashrc
Default .bashrc for ubuntu
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@rothgar
rothgar / owncloud-docker-compose.yml
Created November 6, 2015 21:06 — forked from MickaelBergem/ owncloud-docker-compose.yml
Docker Compose file for setting up an ownCloud server using a PostgreSQL database
# Composition of the containers
owncloud:
image: owncloud
ports:
- 80:80
volumes_from:
- owncloud-data
links:
- postgres:owncloud-db
@rothgar
rothgar / tmux_local_install.sh
Last active July 16, 2024 03:42 — forked from ryin/tmux_local_install.sh
bash script for installing tmux without root access
#!/bin/bash
TMUX_VERSION="2.1"
LIBEVENT_VERSION="2.0.20"
NCURSES_VERSION="6.0"
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
@rothgar
rothgar / static_build.sh
Last active May 3, 2017 07:50 — forked from aauren/static_build.sh
Create Static Build of the_silver_searcher
#!/bin/bash
PCRE_VERSION="8.38"
XZ_UTILS_VERSION="5.2.2"
AG_VERSION="0.31.0"
PCRE_URL="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-${PCRE_VERSION}.tar.gz"
XZ_URL="http://tukaani.org/xz/xz-${XZ_UTILS_VERSION}.tar.gz"
AG_URL="http://geoff.greer.fm/ag/releases/the_silver_searcher-${AG_VERSION}.tar.gz"
WORK_DIR="${TMPDIR:-/var/tmp/}"
pushd ${WORK_DIR}
@rothgar
rothgar / formatted
Last active June 24, 2017 10:03 — forked from marcellodesales/formatted.sh
One-liner REST server using netcat - nc
rm -f out
mkfifo out
trap "rm -f out" EXIT
while true
do
cat out | nc -l 1500 > >( # parse the netcat output, to build the answer redirected to the pipe "out".
export REQUEST=
while read line
do
line=$(echo "$line" | tr -d '[\r\n]')
I have run an nginx container...
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6d67de07731d nginx "nginx -g 'daemon ..." 40 minutes ago Up 40 minutes 80/tcp, 443/tcp epic_goldberg
I want to use strace for debug:
docker run -it --pid=container:6d67de07731d --net=container:6d67de07731d --cap-add sys_admin --cap-add sys_ptrace bash
I can see the nginx process: