Skip to content

Instantly share code, notes, and snippets.

View erm3nda's full-sized avatar
😑
Expressionless master

m3nda erm3nda

😑
Expressionless master
  • n0n3
  • localhost
View GitHub Profile
@gregmalcolm
gregmalcolm / unixfu (python)
Created September 26, 2011 05:01
Unix Fu Presentation commands (python)
Presentation slides and list of commds are available at:
https://github.com/gregmalcolm/unix_for_programmers_demo
NOTE: I used a Mac with OSX for this demo. Other unixes will differ slightly in behavior!
Examples are all written in Python 2.7
===========
Preparation
===========
@rsvp
rsvp / netspeed.sh
Last active May 13, 2020 15:08
netspeed.sh : check download speed rate via command line | Linux bash script
#!/usr/bin/env bash
# bash 4.1.5(1) Linux Ubuntu 10.04 Date : 2013-07-11
#
# _______________| netspeed : check download speed via command line.
#
# Usage: netspeed [tokyo, london, usw, use, east, west, URL]
# ^default U.S. west coast.
# [ -speed_KB/sec ]
# ^negation activates the Mbps converter.
#
@christopherperry
christopherperry / adb+
Created July 30, 2012 16:12
A bash script that let's you issue adb commands to multiple devices at once
#!/bin/bash
# Script adb+
# Usage
# You can run any command adb provides on all your currently connected devices
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command>
#
# Examples
# ./adb+ version
# ./adb+ install apidemo.apk
# ./adb+ uninstall com.example.android.apis
@dtmilano
dtmilano / android-select-device
Last active November 29, 2023 09:29
Script to select one connected device or emulator when running adb
#! /bin/bash
#=====================================================================
# Selects an android device
# Copyright (C) 2012-2022 Diego Torres Milano. All rights reserved.
#
# The simplest way to invoke this script is creating a function like
# this one in your shell startup file:
#
# ```
# adb ()
@caspian311
caspian311 / client.py
Created January 30, 2013 19:36
Simple client-service dbus example in python.
#!/usr/bin/env python
import dbus
class Client():
def __init__(self):
bus = dbus.SessionBus()
service = bus.get_object('com.example.service', "/com/example/service")
self._message = service.get_dbus_method('get_message', 'com.example.service.Message')
self._quit = service.get_dbus_method('quit', 'com.example.service.Quit')
@robulouski
robulouski / gmail_imap_dump_eml.py
Last active April 10, 2024 12:58
Very simple Python script to dump all emails in an IMAP folder to files.
#!/usr/bin/env python
#
# Very simple Python script to dump all emails in an IMAP folder to files.
# This code is released into the public domain.
#
# RKI Nov 2013
#
import sys
import imaplib
import getpass
@bburky
bburky / instant-wordpress.sh
Created March 3, 2014 03:20
Instantly download and run WordPress using SQLite
#!/bin/sh
# One line:
# curl -L http://git.io/wp.sh | sh
# Optionally specify port number:
# curl -L http://git.io/wp.sh | PORT=8888 sh
# The directory "wordpress" will be created in the current directory.
test -e wordpress && echo "wordpress/ already exists" && exit
@jnerin
jnerin / oom_score_values.sh
Last active August 29, 2015 13:57
oneliners to explore the oom_score* values
#!/bin/bash
# Linked from: https://plus.google.com/+JorgeNer%C3%ADn/posts/3zdnEnXFN7Z
# Some oneliners to explore the oom_score* values:
# Processes with oom_score_adj != 0:
grep . /proc/*/oom_score_adj | grep -v ":0" | grep -v self | perl -ne 'm@/([0-9]+)/oom_score_adj:(-?[0-9]+)@; ($pid,$score)=($1,$2); open FILE,"<","/proc/$pid/cmdline"; $cmd=<FILE>; $cmd=~s/\0.*//; close FILE; print "$score\t$pid\t$cmd\n"; '
# In my system the results sumarized are:
# adj name
@irazasyed
irazasyed / spintax.php
Last active February 21, 2024 17:29
PHP: Text Spinner Class - Nested spinning supported.
<?PHP
/**
* Spintax - A helper class to process Spintax strings.
*/
class Spintax
{
/**
* Set seed to make the spinner predictable.
*/
@elsnosrap
elsnosrap / adb-wrapper.sh
Created May 17, 2014 19:19
A useful shell script that wraps Android adb commands when multiple devices or emulators are connected. The script will prompt for a device or emulator to run the command against, if it detects multiple devices / emulators.
#!/bin/bash
# This is a wrapper for adb. If there are multiple devices / emulators, this script will prompt for which device to use
# Then it'll pass whatever commands to that specific device or emulator.
# Run adb devices once, in event adb hasn't been started yet
BLAH=$(adb devices)
# Grab the IDs of all the connected devices / emulators
IDS=($(adb devices | sed '1,1d' | sed '$d' | cut -f 1 | sort))