Skip to content

Instantly share code, notes, and snippets.

View riipandi's full-sized avatar
:octocat:

Aris Ripandi riipandi

:octocat:
View GitHub Profile
@riipandi
riipandi / epm.py
Last active November 10, 2015 04:19
Ertix Code Snippets
#!/usr/bin/python
##
# curl -Lsk http://git.io/vk2NC -o /usr/bin/epm; chmod +x /usr/bin/epm
##
"""
Ertix Package Manager
Last updated: 2015/11/10
"""
from __future__ import print_function
@riipandi
riipandi / install_sublime_text.sh
Created September 20, 2014 23:22
Install Sublime Text 3 on Linux via Bash script - http://simonewebdesign.it/install-sublime-text-3-on-linux/
#!/bin/sh
# Sublime Text 3 install with Package Control
# http://simonewebdesign.it/install-sublime-text-3-on-linux/
# Run this script with:
# $ curl -L git.io/sublimetext | sh
# Detect the architecture
@riipandi
riipandi / 00-header
Last active February 24, 2024 14:09
Dynamic SSH Banner (Tutorial by http://oitibs.com/debian-wheezy-dynamic-motd/)
#!/bin/sh
#
# 00-header - create the header of the MOTD
# Copyright (c) 2013 Nick Charlton
# Copyright (c) 2009-2010 Canonical Ltd.
#
# Authors: Nick Charlton <[email protected]>
# Dustin Kirkland <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
@riipandi
riipandi / quota_notify.sh
Created December 20, 2013 03:30
Quota Notify
#!/usr/bin/perl -w
# Author <[email protected]>
#
# This script assumes that virtual_mailbox_base in defined
# in postfix's main.cf file. This directory is assumed to contain
# directories which themselves contain your virtual user's maildirs.
# For example:
#
# -----------/
@riipandi
riipandi / dynmotd.sh
Last active July 6, 2018 15:56
Simple Linux User Management
#!/bin/bash
# echo "" > /usr/bin/dynmotd; chmod +x /usr/bin/dynmotd; nano /usr/bin/dynmotd
USER=`whoami`
MEMORY1=`free -t -m | grep "buffers/cache" | awk '{print $3" MB";}'`
MEMORY2=`free -t -m | grep "Mem" | awk '{print $2" MB";}'`
# time of day
HOUR=$(date +"%H")
if [ $HOUR -lt 12 -a $HOUR -ge 0 ]; then
@riipandi
riipandi / DropboxSync.py
Last active December 19, 2015 14:09 — forked from wrenoud/DropboxSync.py
Dropbox with Python
import os
import sys
import pickle
import console
# I moved 'dropboxlogin' into a sub folder so it doesn't clutter my main folder
sys.path += [os.path.join(os.path.dirname(os.path.abspath(__file__)), 'lib')]
import dropboxlogin # this code can be found here https://gist.github.com/4034526
STATE_FILE = '.dropbox_state'
@riipandi
riipandi / damm_algorithm.php
Created July 2, 2013 04:22
Sample implementation Damm algorithm in PHP. Generating and Validating. http://en.wikipedia.org/wiki/Damm_algorithm
<?php
/**
* The Damm check digit
* Damm validation & generation code in PHP.
* Damm algorithm is a check digit algorithm that detects all single-digit errors
* and all adjacent transposition errors. Totally anti-symmetric quasigroup.
*
* For more information cf. http://en.wikipedia.org/wiki/Damm_algorithm
*
@riipandi
riipandi / gammu-mysql.sql
Last active December 14, 2015 10:28
Gammu MySQL Database Scheme
-- phpMyAdmin SQL Dump
-- version 2.8.0.3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 10, 2006 at 11:08 PM
-- Server version: 5.0.18
-- PHP Version: 5.1.3
--
-- Database: `smsd`
@riipandi
riipandi / virtualhost.sh
Created February 16, 2013 08:52
Apache2 Virtual Host Generator
#!/bin/sh
#================================================================================
# virtualhost.sh
#
# A fancy little script to setup a new virtualhost in Ubuntu based upon the
# excellent virtualhost (V1.04) script by Patrick Gibson <[email protected]> for OS X.
#
# This script has been tested on Ubuntu 7.10 (Gutsy Gibbon) with Apache2(!) and
# probably works on Debian as well, but this has not been tested (yet). If you use
# this script on other Linux distributions and can confirm it to work I would like to hear
@riipandi
riipandi / ezstream.sh
Last active December 12, 2015 06:28
EzStream Init Script
#! /bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/ezstream
NAME=ezstream
DESC=ezstream
test -x $DAEMON || exit 0
# Defaults