Skip to content

Instantly share code, notes, and snippets.

@fcrespo82
fcrespo82 / deploy.sh
Created Nov 6, 2020
Kubernetes - Deploy dashboard, create user and expose it on ingress
View deploy.sh
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
EOF
@fcrespo82
fcrespo82 / AlertTest.js
Created Oct 16, 2020
Scriptable Helper Scripts
View AlertTest.js
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: yellow; icon-glyph: check-double;
let alertUtils = importModule("AlertUtils")
// Ask for input with validation
let input = await alertUtils.askInput({
title: "Enter phone number",
validate: (value) => {
if (isNaN(parseInt(value))) {
@fcrespo82
fcrespo82 / Schedule WhatsApp.js
Last active Oct 31, 2020
Schedule WhatsApp messages
View Schedule WhatsApp.js
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-green; icon-glyph: comment-alt;
// If you need to send message from another app customize the url here
function getMessageURL(item) {
return `https://wa.me/${item.number}/?text=${encodeURIComponent(item.message)}`
}
async function createTable(data) {
@fcrespo82
fcrespo82 / TimeZones.js
Last active Nov 8, 2020
Scriptable time zones widget
View TimeZones.js
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: cyan; icon-glyph: clock;
// TimeZones Widget for Scriptable
// Author: Fernando Crespo
// Version: 1.0
//
// This script supports all widget sizes, but the number of timezones differ as follow:
//
@fcrespo82
fcrespo82 / Dice.js
Last active Sep 30, 2020
Dice roller in widget for Scriptable iOS app
View Dice.js
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-green; icon-glyph: dice;
let widget = new ListWidget()
widget.backgroundColor = Color.white()
let padding = 10
widget.setPadding(padding,padding,padding,padding)
let dot = "⚫️"
View keybase.md

Keybase proof

I hereby claim:

  • I am fcrespo82 on github.
  • I am fcrespo82 (https://keybase.io/fcrespo82) on keybase.
  • I have a public key ASCl04WJAhzfhkVNvPBcVSM83DCElgpDsQ4jvBCQeK-HqQo

To claim this, I am signing this object:

@fcrespo82
fcrespo82 / Rules.md
Created Nov 14, 2017
Wall Monster (game instructions)
View Rules.md

At least 5 people:

  • Narrator
  • Normal person (crew)
  • 2 lovers (crew) (optional?)
  • Security camera (crew)
  • Baby wall monster (optional?)
  • Bodyguard (crew)
  • Wall monster

Bodyguard can choose 1 person to defend per night. If chooses a wall monster he is dragged out of the space station.

@fcrespo82
fcrespo82 / safesign.md
Created Aug 19, 2016 — forked from jonasmalacofilho/safesign.md
Instalando o SafeSign Crypto USB Token no Firefox/Linux
View safesign.md

Instalando o SafeSign Crypto USB Token no Firefox/Linux

Hardware: Giesecke & Devrient SafeSign Crypto USB Token

Sistema operacional: Ubuntu 14.04 LTS AMD 64

  1. Dependências: libccid, pcscd e libpcsclite1. Adicionalmente, é interessante instalar o pacote pcsc-tools e executar pcsc_scan para verificar a visibilidade do token.
@fcrespo82
fcrespo82 / remove.md
Last active May 20, 2016
Remove all files from a make install that do not provide a make uninstall
View remove.md

You can use make install and DESTDIR to get a clean tree of the files in the kit. The following (untested script) should delete all the files of the SVN source kit.

BE CAREFUL WITH THIS COMMAND SINCE IT USES sudo rm AND COULD DAMAGE YOUR SYSTEM.

YOU HAVE BEEN WARNED!

make install DESTDIR=/tmp/qqq
cd /tmp/qqq
@fcrespo82
fcrespo82 / count_quotation_mark.py
Created Feb 9, 2015
Script to count quotation marks in jsp
View count_quotation_mark.py
import os
import re
with open("/home/fxcrespo/workspaces/workspace_siga/count.log", "w") as thelog:
for path, dirs, files in os.walk("/home/fxcrespo/workspaces/workspace_siga"):
for thefile in files:
thepath = os.path.join(path, thefile)
if thepath.endswith("jsp"):
thecount = len(re.findall("\"", "".join(open(thepath).readlines())))
if thecount > 0 and (thecount % 2 != 0):