Skip to content

Instantly share code, notes, and snippets.

View tassoevan's full-sized avatar
🏠
Working from home

Tasso Evangelista tassoevan

🏠
Working from home
View GitHub Profile
@tassoevan
tassoevan / compose-sclk.sh
Created May 21, 2016 01:37
Scroll Lock as Compose Key in Ubuntu 16.04
dconf write /org/gnome/desktop/input-sources/xkb-options "['compose:sclk']"
@tassoevan
tassoevan / dual_boot_setup.md
Created April 17, 2016 01:19 — forked from saltlakeryan/dual_boot_setup.md
Family PC Windows / Linux Dual Boot Setup

Poor Man's SteadyState (or DeepFreeze or ReturnNil or ...)

This is the configuration I have used to set up home PCs to be resistant to the kinds of bugs and malware and spyware that seem to get installed over time on a windows PC. This is in combination with using limited accounts for everyone who uses the PC.

The quick overview is:

  • Partition hard disk into 3 partitions:
@tassoevan
tassoevan / free-software-problems.md
Created April 11, 2016 01:46
Por que no Brasil software livre ainda é visto como coisa de pobre que não pode comprar software proprietário?

Por que no Brasil software livre ainda é visto como coisa de pobre que não pode comprar software proprietário?

extraído de um fórum de internet

  1. Os usuários das distros e comunidades insistem que devemos aprender a usar o terminal.
  2. Os programas livres em sua maioria não fazem a metade das coisas que os proprietários fazem.
    • Gimp não suporta canais de 16 e 32 bits de cores até hoje. Só importa imagens assim, mas não pode salvar.
    • Colocar a imagem que está em uma camada superior em modo overlay ou qualquer outro modo para fazer efeito na imagem da camada inferior não funciona.
  • Inkscape não é tão simples como se imagina. Não possui malha interativa (mesh) e, em máquinas mais modestas, se seu trabalho tiver muitos vetores, não rola.
@tassoevan
tassoevan / PS1.sh
Last active March 21, 2016 02:59
#!/bin/bash PS1
title_part='\[\033]0;\u@\h:\w\007\]\n'
chroot_part='${debian_chroot:+($debian_chroot)}'
host_part='\[\033[01;32m\]\u@\h\[\033[00m\] '
directory_part='\[\033[01;34m\]\w\[\033[00m\] '
git_part='$(__git_ps1 "\e[01;37;45m %s \e[00m")\n'
prompt_part='\$ '
export PS1="${title_part}${chroot_part}${host_part}${directory_part}${git_part}${prompt_part}"
if [ "$SSH_TTY" ]; then
trap 'echo -ne "\033]0;$BASH_COMMAND\007"' DEBUG
fi
@tassoevan
tassoevan / index.html
Created October 23, 2015 03:40
Esboço de um trabalho de Cálculo de Reatores
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Cálculo de Reatores Químicos</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
</head>
<body class="asciimath2jax_ignore">
<div class="container">
@tassoevan
tassoevan / libxml29_compat.patch
Last active August 11, 2021 15:32
Install PHP 5.2.17 in phpbrew
--- ext/dom/node.c 2012-08-06 17:49:48.826716692 +0800
+++ ext/dom/node.c 2012-08-06 17:52:47.633484660 +0800
@@ -1895,9 +1895,17 @@ static void dom_canonicalization(INTERNA
RETVAL_FALSE;
} else {
if (mode == 0) {
+#ifdef LIBXML2_NEW_BUFFER
+ ret = xmlOutputBufferGetSize(buf);
+#else
ret = buf->buffer->use;
@tassoevan
tassoevan / xhtml-to-html5.css
Created October 6, 2015 19:38
XHTML to HTML5 alignment fix
<style>
/* XHTML to HTML5 alignment fix */
img { vertical-align: top; }
</style>
@tassoevan
tassoevan / session-life-cycle.md
Last active September 15, 2015 14:38 — forked from mindplay-dk/session-life-cycle.md
Complete overview of the PHP SessionHandler life-cycle

This page provides a full overview of PHP's SessionHandler life-cycle - this was generated by a set of test-scripts, in order to provide an exact overview of when and what you can expect will be called in your custom SessionHandler implementation.

Each example is a separate script being run by a client with cookies enabled.

To the left, you can see the function being called in your script, and to the right, you can see the resulting calls being made to a custom session-handler registed using session_set_save_handler().

@tassoevan
tassoevan / tipos-de-logradouros.md
Created September 8, 2015 23:43
Tipos de logradouro do Brasil.
  • Aeroporto
  • Alameda
  • Área
  • Avenida
  • Campo
  • Chácara
  • Colônia
  • Condomínio
  • Conjunto
  • Distrito
@tassoevan
tassoevan / wake-on-lan.php
Last active August 29, 2015 14:27
PHP snippet to wake up a machine in network with wake-on-lan feature.
<?php
$macAddress = '00:1D:7D:84:0E:1E'; // MAC address to be woken up
$macAddress = preg_split('/(\\:|\\-)/', $macAddress);
if (count($macAddress) != 6) {
throw new RuntimeException("Invalid MAC address");
}
$macAddress = array_map('hexdec', $macAddress);
$macAddress = call_user_func_array('pack', array_merge(['CCCCCC'], $macAddress));