Skip to content

Instantly share code, notes, and snippets.

View shamil's full-sized avatar
🎯
Focusing

Alex Simenduev shamil

🎯
Focusing
View GitHub Profile
@shamil
shamil / apache_ldap_howto.md
Created October 9, 2013 12:57
Apache Active Directory Authentication howto

Apache Active Directory Authentication howto

Modules Needed

mod_authz_ldap

Install mod_authz_ldap

yum install mod_authz_ldap

#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@shamil
shamil / .md
Last active December 14, 2015 17:38
redis-cli config get client-output-buffer-limit

example

$ redis-cli config get client-output-buffer-limit
1) "client-output-buffer-limit"
2) "normal 0 0 0 slave 268435456 67108864 60 pubsub 33554432 8388608 60"
@shamil
shamil / vlc-merge.md
Last active January 28, 2021 10:18
VLC: how to merge and transcode multiple videos

Merge & Transcode

If you have more than one source files that need to be merged into a single output file, the general way is this (no transcoding is necessary if all streams match):

vlc file1.ps file2.ps file3.ps --sout "#gather:std{access=file,mux=ts,dst=all.ts}" --sout-keep

NB that whenever you use sout, your video and audio codecs must "be appropriate" for the mux you use (in this case, ps works with a ts mux, so we're ok).

If you want to write your files out to a mux that doesn't support the current audio or video encoding, or if you are wanting to join streams that do not have matching video/audio, then it is recommended to transcode as well.

@shamil
shamil / .bashrc
Last active June 22, 2020 12:42 — forked from anonymous/.bashrc
Configure OSX shell to be like Debian/Ubuntu. Requires MacPorts.
# ~/.bashrc: executed by bash(1) for non-login shells.
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
@shamil
shamil / uuid.js
Created November 26, 2012 15:52 — forked from jcxplorer/uuid.js
UUID v4 generator in JavaScript (RFC4122 compliant)
function uuid() {
var uuid = "", i, random;
for (i = 0; i < 32; i++) {
random = Math.random() * 16 | 0;
if (i == 8 || i == 12 || i == 16 || i == 20) {
uuid += "-"
}
uuid += (i == 12 ? 4 : (i == 16 ? (random & 3 | 8) : random)).toString(16);
}
@shamil
shamil / aug_redis_conf.sh
Created October 24, 2012 15:09
augeas how to load lenses (redis.conf example)
$ augtool
> set /augeas/load/Spacevars/incl[last()+1] "/etc/redis/redis.conf"
> load
> print /files/etc/redis/redis.conf
@shamil
shamil / gist:3944357
Created October 24, 2012 06:24 — forked from mneedham/gist:3803604
Script to get upstart out of a start/killed state (http://heh.fi/tmp/workaround-upstart-snafu)
#!/usr/bin/env ruby1.8
class Workaround
def initialize target_pid
@target_pid = target_pid
first_child
end
def first_child
@shamil
shamil / gedit2subl.sh
Created October 15, 2012 14:33
Change all associations from gedit to another application
#System wide associations:
sudo sed -i 's/gedit.desktop/yournew.desktop/g' /usr/share/applications/defaults.list
# Just your user's associations:
sed -i 's/gedit.desktop/yournew.desktop/g' ~/.local/share/applications/mimeapps.list
# If you're using the PPA for Sublime Text 2, there is already a .desktop file for it
# sitting in `/usr/share/applications/` so you can just run:
@shamil
shamil / nagios_mod-gearman_ubuntu.md
Created August 21, 2012 20:31
how to install nagios3 with mod-gearman on Ubuntu

how to install nagios3 with mod-gearman on Ubuntu

configure apt to not install sugested and recommended packages

sudo tee /etc/apt/apt.conf.d/02recommends <<END
APT::Install-Recommends "0";
APT::Install-Suggests "0";
APT::AutoRemove::RecommendsImportant false; # optional
END