Skip to content

Instantly share code, notes, and snippets.

@metalrufflez
metalrufflez / zmcreateuser.sh
Created December 2, 2011 16:48
Mass create zimbra accounts
#/bin/bash
# zmcreateusers
# Mass create zimbra accounts
#
# AUTHORS: Caio Corrêa, Thompson Alves
# LAST UPDATED: 2011/12/02
#
# Version 1.2: Added the report at the ending
# Version 1.1: Added security check of alias and username
@metalrufflez
metalrufflez / ora10bkp.sh
Created November 21, 2011 14:12
Script to fully backup Oracle 10g databases (remember to alter the target date)
#!/bin/bash
export ORACLE_HOME="/path/to/oracle/home"
export ORACLE_SID=SID
DB_BKPDIR="/path/to/backup/directory"
DMPNAME="bkp_$(date +%y%m%d).dmp"
TARNAME="bkp_$(date +%y%m%d).tar.bz2"
LOGNAME="bkp_$(date +%y%m%d).log"
#!/bin/bash
# WARNING: Will if instance contains ';' in either tag key or value
# Will fix it later, maybe
id=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
az=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone/)
region=${az%[a-z]}
IFS=$'\n'
#!/usr/bin/env python3
for i in list(range(1,101)):
if i % 5 and i % 3:
print(i)
else:
if not i % 3:
print("Fizz", end='')
if not i % 5:
" vim: set ft=vim:
function! SSHconfigFolds()
let thisline = getline(v:lnum)
if match(thisline, '^## ') >= 0
return ">2"
elseif match(thisline, '^# ') >= 0
return ">1"
else
return "="
#!/bin/sh
#
# ansible-vault-merge: helper script for merging changes in ansible-vault file
#
PROGNAME=$(basename $0)
usage() {
cat <<EOF
@metalrufflez
metalrufflez / pnp_slicer.sh
Last active January 20, 2018 19:20
Slice Print and Play pages into individual images.
#!/bin/bash
### Using ImageMagick, slices an image in equal parts according to coordinates and column/row numbers
### Useful when slicing images from Print and Play games to later feed to Online Print services
# This is super badly written. Will revise later
function help() {
echo
echo "$(basename $0) -h INT -w INT -H INT -V INT -c INT -r INT -i FILE/DIR -o DIR [-f FILE]"
echo "$(basename $0) -C INTxINT+INT+INT -c INT -r INT -i FILE/DIR -o DIR [-f FILE]"
" vim: set ft=vim:
function! SSHconfigFolds()
let thisline = getline(v:lnum)
if match(thisline, '^## ') >= 0
return ">2"
elseif match(thisline, '^# ') >= 0
return ">1"
else
return "="
ATCO: TAM3800 on the ground at 00 leave the runway by the taxiway Foxtrot maintain position and contact ground on frequency 121.8.
Pilot 1: Roger leaving the runway by the taxiway Foxtrot and contact ground on frequency 121.8.
Pilot 2: Brasília TWR TUS9037 on final, landing gear down and locked
ATCO: TUS9037 cleared to land RWY 11L wind 150 degrees 5 knots.
Pilot 2: TUS9037 roger, cleared to land.
# Cada execução retorna 50 items, quero uma lista com todos os
# items que tiverem um filtro no "campo" name do item
lc_filter = "filter"
lc_list = asg_conn.get_all_launch_configurations()
while true:
lc_subset = asg_conn.get_all_launch_configurations(next_token=lc_list[-1].name)
if len(lc_subset) == 0: