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 / .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 / 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 / .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"
#!/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 / 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

put that into .bashrc:

export HISTFILESIZE=
export HISTSIZE=

There you go, unlimited history :)

From "man bash":

If HIST‐FILESIZE is not set, no truncation is performed.

##################################################################
# /etc/elasticsearch/elasticsearch.yml
#
# Base configuration for a write heavy cluster
#
# Cluster / Node Basics
cluster.name: logng
# Node can have abritrary attributes we can use for routing

Installing from scratch

Starting from a fresh install of EL6.5, first install EPEL:

# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

Then install the Graphite dependencies:

# yum -y install python-whisper python-carbon graphite-web python-memcached python-ldap httpd memcached nodejs npm nc
@shamil
shamil / mount_qcow2.md
Last active April 19, 2024 10:28
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@shamil
shamil / mailx_smtp.md
Created November 2, 2014 19:42
How to send email using mailx through SMTP

###How to send email using mailx through SMTP

Via command line

This is an all-in-one command that sends email to $TO_EMAIL_ADDRESS. You need to also replace these $FROM_EMAIL_ADDRESS and $FRIENDLY_NAME variables with your email and name.

$ mailx -v -s "$EMAIL_SUBJECT" \
    -S smtp=smtp://smtp.domain.tld \
    -S from="$FROM_EMAIL_ADDRESS($FRIENDLY_NAME)" \

$TO_EMAIL_ADDRESS