Skip to content

Instantly share code, notes, and snippets.

View sanzaru's full-sized avatar

Martin Albrecht sanzaru

View GitHub Profile
@sanzaru
sanzaru / searchString.sh
Created September 21, 2015 12:13
Bash function: Search for a string in a given array of strings
#
# Search for a string in a given array of strings
#
# Argumnents:
# $1: String | required | Defines the query string to search for
# $2: String | required | Array of strings to look for the query
#
# Return:
# 0: Success, query string was found
# 1: Error, query string was not found or any other error occured
@sanzaru
sanzaru / bc.py
Last active May 13, 2020 07:56
Simple python script to byte encode a string
import array, sys
ARGV = sys.argv
if len(ARGV) <= 1 or not ARGV[1]:
print 'usage: ' + ARGV[0] + ' <string to encode>'
sys.exit(1)
inp = str(ARGV[1])
bc = ''