Skip to content

Instantly share code, notes, and snippets.

View serrasqueiro's full-sized avatar
🎯
Focusing

Henrique serrasqueiro

🎯
Focusing
View GitHub Profile
@serrasqueiro
serrasqueiro / git_svnst.sh
Last active December 27, 2021 00:43
List files in "svn status" style-alike
#!/bin/sh
#
# (c)2020 Henrique Moreira
# git_svnst.sh
# The following line proves you will only show lines starting with '??'
# echo -e "ab AB-123\n?? DE-567" | sed 's/^?? \([A-Za-z0-9].*\)/:: \1/'
show_svnst ()
# read ms (win32) shell shortcut (.lnk)
# (c)2021 Henrique Moreira
import struct
#path = 'myfile.txt.lnk'
def shell_ms(path) -> tuple:
target = ''
with open(path, 'rb') as stream:
@serrasqueiro
serrasqueiro / iban_pt_nib.md
Last active November 21, 2021 18:41
Portugal Bank NIFs

About this source

  • Published at GIST, here

IBAN NIB part

Portugal

Responsible entity:

# simple_pop_list.txt
#
# https://docs.python.org/3/library/poplib.html
import poplib
email, password = "*@*", "*"
pop3_server = "pop.zoho.com"
server = poplib.POP3_SSL(pop3_server, 995, timeout=10)
@serrasqueiro
serrasqueiro / how_to_create_CVS_pre_commit_hook.md
Last active June 25, 2021 13:58
How-To create CVS pre-commit hook

How To, create CVS pre-commit hook

Installing CVS, if needed

If you do not have CVS, you can install it. If you come in a Linux OS with pre-installed CVS, but you have an empty $CVSROOT/CVSROOT/ content, you can initialize CVS as follow:

  • cvs -d /usr/local/cvsroot init

I am using actually:

  • cvs -d /opt/cvsroot init

Creating the pre-hook

@serrasqueiro
serrasqueiro / README.md
Last active June 4, 2023 13:54 — forked from cookedapple/l2h
convert unicode chars to html (incomplete)
  • Introduction 'another_4433185' gathers different ways of dumping latin-1 chars (such as accented letters) from UniCode 0..255 into straight 7bit/ HTML strings.

  • Original author This was originally fetched from cookedapple It was a very basic function (see 'l2h').

  • Content ** Files:

@serrasqueiro
serrasqueiro / ls_colors
Created July 4, 2021 16:27 — forked from jmoz/ls_colors
ls_colors file to change colour of ls
# di=5;34;43 Setting the LS_COLORS di parameter to the above example will make directories appear in flashing blue text with an orange background
#0 = Default Colour
#1 = Bold
#4 = Underlined
#5 = Flashing Text
#7 = Reverse Field
#31 = Red
#32 = Green
#33 = Orange
#34 = Blue
@serrasqueiro
serrasqueiro / secs_text.py
Created July 10, 2021 10:44
Shown seconds text
#-*- coding: utf-8 -*-
# secs_text.py (c)2021 Henrique Moreira
"""
Function to show seconds in a human readable way
"""
import sys
def show_seconds_text(args):
@serrasqueiro
serrasqueiro / states_hash.json
Created July 10, 2021 13:19 — forked from mshafrir/states_hash.json
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
# Configuration file for the color ls utility
#
# This file goes in the /etc directory, and must be world readable.
# You can copy this file to .dir_colors in your $HOME directory to override
# the system defaults.
# COLOR needs one of these arguments: 'tty' colorizes output to ttys, but not
# pipes. 'all' adds color characters to all output. 'none' shuts colorization
# off.
COLOR tty