Skip to content

Instantly share code, notes, and snippets.

Riyad Preukschas riyad

Block or report user

Report or block riyad

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@riyad
riyad / chrome-unsafe.plugin.zsh
Last active Jul 13, 2019
Open a Chrome window with a temporary profile and several security checks disabled.
View chrome-unsafe.plugin.zsh
#
# Author: Riyad Preukschas <riyad@informatik.uni-bremen.de>
# License: Mozilla Public License 2.0
#
# Loads an unsafe (i.e. with several security features disabled) instance of
# Chrome with a temporary profile (i.e. all data is lost once Chrome is closed)
chrome-unsafe() {
# for Homebrew Cask (see http://caskroom.io/) compatibility
local -a CHROME_PATHS
View cleanup_redis_uniquejobs.rb
#!/usr/bin/env ruby
#
# Cleanup Sidekiq uniquejobs in Redis
# see https://github.com/mhenrixon/sidekiq-unique-jobs/issues/195
#
require 'bundler/setup'
require 'sidekiq/api'
DRY_RUN = true
@riyad
riyad / bootstrap_breadcrumbs_builder.rb
Created Feb 28, 2012
How to make breadcrumbs_on_rails render a Bootstrap compatible breadcrumb navigation
View bootstrap_breadcrumbs_builder.rb
# The BootstrapBreadcrumbsBuilder is a Bootstrap compatible breadcrumb builder.
# It provides basic functionalities to render a breadcrumb navigation according to Bootstrap's conventions.
#
# BootstrapBreadcrumbsBuilder accepts a limited set of options:
# * separator: what should be displayed as a separator between elements
#
# You can use it with the :builder option on render_breadcrumbs:
# <%= render_breadcrumbs :builder => ::BootstrapBreadcrumbsBuilder, :separator => "&raquo;" %>
#
# Note: You may need to adjust the autoload_paths in your config/application.rb file for rails to load this class:
@riyad
riyad / android-backup.md
Last active Nov 22, 2018
Backup and Restore your Android Phone With ADB
View android-backup.md

Android-Backup

NOTE: this project has moved to https://github.com/riyad/android-backup

Backup and restore your Android phone with ADB (and rsync)

It will backup and restore all of your /sdcard directory and any other storage (e.g. an external SD Card) mounted within /storage except for emulated and self). Assuming you're using also something like Titanium Backup you'll be able to backup and restore all your apps, settings and data.

@riyad
riyad / another-intermediate-ca_csr.json
Last active Nov 17, 2018
Using CFSSL building your own CA and generating service specific key, cert and chain files.
View another-intermediate-ca_csr.json
{
"CN": "Another Intermediate CA",
"hosts": [
""
],
"key": {
"algo": "ecdsa",
"size": 384
},
"names": [
View magicdict.py
# -*- coding: utf-8 -*-
#
# Author: Riyad Preukschas <riyad@informatik.uni-bremen.de>
# License: Mozilla Public License 2.0
#
from collections import defaultdict
class MagicDict(defaultdict):
@riyad
riyad / sync-to-from
Last active Nov 17, 2018
Synchronize directories between computers using rsync (and SSH)
View sync-to-from
#!/usr/bin/env ruby -rubygems
#
# Author: Riyad Preukschas <riyad@informatik.uni-bremen.de>
# License: Mozilla Public License 2.0
#
# Synchronize directories between computers using rsync (and SSH).
#
# INSTALLATION:
# Save this script as something like `sync-to` somewhere in $PATH.
# Link it to `sync-from` in the same location. (i.e. `ln sync-to sync-from`)
@riyad
riyad / extract-audio.sh
Last active Nov 17, 2018
Extract audio from any media file ffmpeg can play into a new one (without converting or reencoding!)
View extract-audio.sh
#!/bin/sh
#
# Author: Riyad Preukschas <riyad@informatik.uni-bremen.de>
# License: Mozilla Public License 2.0
#
# Extract audio from any file ffmpeg can play (without converting or reencoding!).
if [[ $# -ne 3 ]]; then
echo "Error: wrong number of arguments"
@riyad
riyad / ffmpeg-cut
Last active Nov 17, 2018
Cut out a part of a media file within the given time stamps (without converting or reencoding!)
View ffmpeg-cut
#!/bin/bash
#
# Author: Riyad Preukschas <riyad@informatik.uni-bremen.de>
# License: Mozilla Public License 2.0
#
# Cuts out a part of a media file within the given time stamps (without converting or reencoding!).
set -o nounset # complain when reading unset vars
# set -o xtrace # print every command as it's executed
@riyad
riyad / ffmpeg-mp3-converter.rb
Last active Nov 17, 2018
Small scripts to transcode any file VLC or ffmpeg can play to mp3.
View ffmpeg-mp3-converter.rb
#!/usr/bin/env ruby -rubygems
#
# Author: Riyad Preukschas <riyad@informatik.uni-bremen.de>
# License: Mozilla Public License 2.0
#
# Transcode any file ffmpeg can play to mp3.
require 'optparse'
require 'shellwords'
You can’t perform that action at this time.