Skip to content

Instantly share code, notes, and snippets.

View AlexRogalskiy's full-sized avatar
🛰️
Work on stuff that matters

Alexander AlexRogalskiy

🛰️
Work on stuff that matters
View GitHub Profile
@AlexRogalskiy
AlexRogalskiy / gist:530b713d4979dc2db75a31d05ddb68e0
Created February 24, 2022 19:25
ruby-debug universal installer

Manual install on 1.8+ or JRuby

gem install ruby-debug

Manual install on 1.9+

gem sources -a https://gems.gemfury.com/8n1rdTK8pezvcsyVmmgJ/   # creates ~/.gemrc
gem install ruby-debug19 -- --with-ruby-include="$rvm_path/src/`rvm tools strings`" # -- --with... for RVM only
@AlexRogalskiy
AlexRogalskiy / gist:9e52797bc06784813e3cce252974943e
Created February 24, 2022 19:24
Run this script on a mac osx box running 10.6 and you will get a luajit with batteries included and all the good libs
#!/bin/sh
install_home=/usr/local
if ! which cc
then
echo install command line tools for xcode (or a compiler), try again:
echo
echo ' https://developer.apple.com/downloads/'
echo
@AlexRogalskiy
AlexRogalskiy / install_nginx.sh
Created February 24, 2022 19:23
build and install customized nginx on ubuntu (maybe debian)
#!/bin/sh
set -e
PKG_NAME="nginx"
VERSION="1.1.17"
RELEASE="1"
[email protected]
@AlexRogalskiy
AlexRogalskiy / gist:ac4303e93a230f4fa83cbca962ee31ed
Created February 24, 2022 19:22
figure out what a mac chroot needs
sudo dtruss chroot . 2>&1 | grep '/' | sed 's%[^/]*\(/.*\)\\0.*%\1%g' | grep -v AppleI | grep -v dev
@AlexRogalskiy
AlexRogalskiy / zfs_create.sh
Created February 24, 2022 19:22
shortcut for creating zfs volumes
# zfs create na nd nx ns blah
zfs_create() {
options=""
while [ $# -gt 0 ]
do
case $1
na) option="atime=off" ;;
a) option="atime=on" ;;
nm) option="mountpoint=none" ;;
@AlexRogalskiy
AlexRogalskiy / xenstore-dump.sh
Created February 24, 2022 18:29
xenstore dump that actually works
#!/bin/sh
dumpkey() {
local param=${1}
local key
local result
local param_prefix
result=$(xenstore-list ${param})
@AlexRogalskiy
AlexRogalskiy / install_zfs.sh
Created February 24, 2022 18:28
install native zfs on linux
#!/usr/bin/env bash
set -e
# ---- may change frequently - start
version="0.6.0-rc8"
spl_tar_sha1=a3bba691e5b3b680f4cbeac70f7ea29367e6f337
zfs_tar_sha1=90597083069e17cc066fa435974bcdcabebad44d
@AlexRogalskiy
AlexRogalskiy / 11-promisc
Created February 22, 2022 13:37
NetworkManager fixes
#!/usr/bin/env bash
#
# usage: /etc/NetworkManager/dispatcher.d/11-promisc eth0|eth.. up|down [verbose]
#
SAMPLE="
# primary public interface
# /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=dhcp
DEFROUTE=yes
@AlexRogalskiy
AlexRogalskiy / uninstall-haskell-platform.sh
Created February 22, 2022 13:36
uninstall haskell platform (osx)
#!/bin/sh
if [ ! -d /Library/Frameworks/HaskellPlatform.framework ]
then
if which -s ghc
then
echo "A different Haskell was found." >&2
else
echo "Haskell Platform for OSX is not installed." >&2
fi
@AlexRogalskiy
AlexRogalskiy / osx-install-jdk7
Created February 22, 2022 13:36
install jdk7 for Mac OS X (10.7, 10.8) automagically
#!/bin/sh
set -e
JAVA_VER=7
rm -f /tmp/oab-index.html /tmp/oab-download.html >/dev/null 2>&1 || true
trap "rm -f /tmp/oab-index.html /tmp/oab-download.html" EXIT ERR QUIT INT TERM
# Try and dynamic find the JDK downloads
echo " [x] Getting Java SE download page "