Skip to content

Instantly share code, notes, and snippets.

@ernestom
ernestom / FORTINET-FORTIADC-MIB.mib
Last active March 14, 2023 06:28
FortiADC-VM v5.0.0,build0045,180131 SNMP Walk output
--
-- MODULE-IDENTITY
-- OrgName
-- Fortinet, Inc.
-- ContactInfo
-- Technical Support
-- e-mail: support@fortinet.com
-- http://www.fortinet.com
--
@ernestom
ernestom / script-template.sh
Created December 15, 2020 16:08 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
docker run -d -v /dev/shm:/dev/shm -p 4444:4444 -p 5901:5900 selenium/standalone-chrome-debug:3.4.0-einsteinium
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
#!/usr/bin/env python
import sys
import re
from datetime import datetime
def parse(line):
parser = re.compile(
r'API VALIDATION: (?P<valid>[01]{1}) \| '
r'tokensMatch: (?P<tokensMatch>[01]{1}) \| '
@ernestom
ernestom / akamaiccu.php
Created May 1, 2015 04:32
Akamai's CCU REST API abstraction library.
<?php
/**
* Simple abstraction for the Akamai's REST CCU API,
* to make fire-and-forget purge requests.
*
* @see https://api.ccu.akamai.com/ccu/v2/docs/
* @author Menta Network - www.menta.mx <dev@menta.com.mx>
* @license MIT License
*/
@ernestom
ernestom / keymap.cson
Created March 23, 2015 19:21
Atom Keymap
'atom-text-editor:not([mini])':
'cmd-d': 'editor:delete-line'
'atom-workspace atom-text-editor:not([mini])':
'alt-up': 'editor:move-line-up'
'alt-down': 'editor:move-line-down'
@ernestom
ernestom / clearcache.sh
Created January 22, 2015 19:27
Purgas de caché de Akamai con ECCU para Palacio de Hierro
#!/bin/bash
# Menta Network - www.menta.mx
USERNAME=""
PASSWORD=""
hash akamai_api 2>/dev/null || {
echo >&2 "The Ruby Gem 'akamai_api' is needed:"
echo >&2 "\`$ sudo gem install akamai_api\`"
exit 1;
@ernestom
ernestom / cloud.zsh-theme.diff
Created September 22, 2014 21:37
Cloud theme modifications
diff --git a/themes/cloud.zsh-theme b/themes/cloud.zsh-theme
index 4efbf97..59a3472 100644
--- a/themes/cloud.zsh-theme
+++ b/themes/cloud.zsh-theme
@@ -6,5 +6,5 @@ PROMPT='%{$fg_bold[cyan]%}$ZSH_THEME_CLOUD_PREFIX %{$fg_bold[green]%}%p %{$fg[gr
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
-ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}<E2><9A><A1>%{$reset_color%}"
-ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}]"
@ernestom
ernestom / open-app-preferences-plists.sh
Created September 2, 2014 06:25
Opens all the preferences plist files (NSUserDefaults) for the app in the current directory.
#!/bin/sh
# The project name based on the workspace path, e.g. "MyProject" from "./MyProject.xcworkspace"
WORKSPACE_NAME=$(echo `find . -name *.xcworkspace -type d -exec basename {} \;` | cut -d'.' -f1)
SIMULATOR_PATH="$HOME/Library/Application Support/iPhone Simulator"
# The App's bundle ID taken from its info plist, e.g "com.myproject" from "./MyProject/MyProject-Info.plist"
BUNDLE_ID=`/usr/libexec/PlistBuddy -c Print:CFBundleIdentifier $WORKSPACE_NAME/$WORKSPACE_NAME"-Info.plist"`
# Open all plist files in the simulator path that match the app's bundled ID
# normally one per iOS version
find "$SIMULATOR_PATH" -name $BUNDLE_ID".plist" -type f -print0 | while IFS= read -r -d '' PLIST; do