Skip to content

Instantly share code, notes, and snippets.

#!/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
@cbuctok
cbuctok / install_elixir.md
Last active April 2, 2018 11:08 — forked from rubencaro/install_elixir.md
Elixir installation guide

Elixir installation guide

Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.

The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir and you are good to go.

Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to a specific version, you will need to compile it yourself. Then asdf is your best friend.

@cbuctok
cbuctok / merge-subtitles.py
Created February 18, 2018 16:16 — forked from NamPNQ/merge-subtitles.py
Python Merge two subtitles
#!/usr/bin/python3
# -*- coding: utf8 -*-
# ----------------------------------------------------------------------------
# Name: merge-subtitles
# Desc: Merge two subtitles
# Usage: merge-subtitles sub1_file sub2_file out.ass
# Example: merge_subtitles friends_s01e01_720p_bluray_x264-sujaidr.mp4en.srt friends_s01e01_720p_bluray_x264-sujaidr.mp4vi.srt friends_s01e01_720p_bluray_x264-sujaidr.mp4.ass
# Copy From: https://github.com/duyamin/standalone-scripts/blob/master/python/merge-subtitles.py
# ----------------------------------------------------------------------------
@cbuctok
cbuctok / zsh_to_fish.py
Created February 1, 2018 08:20 — forked from dvdbng/zsh_to_fish.py
Migrate zsh history to fish
import os
import re
def zsh_to_fish(cmd):
return (cmd.replace('&&', '; and ')
.replace('||', '; or '))
def is_valid_fish(cmd):
@cbuctok
cbuctok / build-zsh.sh
Created January 16, 2018 15:33
Build last stable version of ZSH from sources on Ubuntu, or any other version with small changes
#!/bin/bash
# Build Zsh from sources on Ubuntu.
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file.
# Make script gives up on any error
set -e
# Some packages may be missing
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo checkinstall