Skip to content

Instantly share code, notes, and snippets.

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

Wellington Torrejais da Silva wellington1993

🏠
Working from home
View GitHub Profile
@wellington1993
wellington1993 / 1397BC53640DB551.sig.sh
Last active September 1, 2023 16:05
Fix update: NO_PUBKEY A2F683C52980AECF VirtualBox PPA and Others
#W: http://dl.google.com/linux/chrome/deb/dists/stable/Release.gpg: Signature by key 4CCA1EAF950CEE4AB83976DCA040830F7FAC5991 uses weak digest algorithm (SHA1)
#W: Não existem chaves públicas para os seguintes IDs de chaves:
1397BC53640DB551
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
# From:
# https://www.vivaolinux.com.br/topico/Navegadores/Problema-ao-atualizar-o-Google-Chrome-no-Ubuntu
@wellington1993
wellington1993 / tab.md
Created May 11, 2016 14:15
Tabularção VIM, Vim Tabulation

:set ts=2 sw=2 sts=2 et

@wellington1993
wellington1993 / teste1.md.js
Last active May 13, 2016 17:18
Tests with Lodash array
//Subtract the $scope.mission.astronauts array from all_astronauts array.
//The Astronaut inside all_astronauts are different as $scope.mission.astronauts astronaut
// but have some id
mission_astronauts_ids = _.map($scope.mission.astronauts,"id")
diff_astronauts = _.filter(all_astronauts, function(astronaut){
return mission_astronauts.indexOf(astronaut.id) >= 0
});
@wellington1993
wellington1993 / ubuntu_rails_install.rb
Created May 16, 2016 14:52 — forked from JangoSteve/ubuntu_rails_install.rb
Capistrano script to install Ruby, RVM, Rails in ubuntu (modified from deploy.rb scripts)
namespace :ubuntu do
desc "Setup Environment"
task :setup_env, :roles => :app do
update_apt_get
install_dev_tools
install_git
install_subversion
install_sqlite3
# Install and setup RVM instead of old Rails stack
#install_rails_stack
@wellington1993
wellington1993 / git-unique-abbrev.sh
Created May 19, 2016 20:24
git-unique-abbrev calc from: How short can Git abbreviate?(Josh Stone)
#!/bin/bash
# git-unique-abbrev
OBJECTS="$(mktemp)"
git rev-list --all --objects | cut -c1-40 | sort >"$OBJECTS"
printf "%d objects\n" $(wc -l <"$OBJECTS")
for abbrev in $(seq 4 40); do
DUPES="$(mktemp)"
uniq -D -w $abbrev <"$OBJECTS" >"$DUPES"
count=$(wc -l <"$DUPES")
@wellington1993
wellington1993 / 0-Procedure-create-if-no-exist-Domain-Firebird-Fabiano.sql
Last active May 27, 2016 12:23
Procedure to Create Domain if not exist (Firebird) - By Fabiano P.
create or alter procedure DOM
as
declare variable COMANDO varchar(200);
begin
if (not exists(select
RDB$FIELD_NAME
from
RDB$FIELDS
where
upper(RDB$FIELD_NAME) = 'VARCHAR_70')) then
@wellington1993
wellington1993 / 0-Backup.sh
Last active December 28, 2022 18:44
Firebird Restore GBAK
# Backup the database.
gbak -user SYSDBA -password masterkey original.fdb backup.fbk
#or
# gfix -v -f database_name
# If broken gfix -m database_name
# if not work try add -g
@wellington1993
wellington1993 / fstab-mount-cifs.md.sh
Last active August 4, 2016 17:37
Montar Compartilhamento Windows CIFS no FSTAB
sudo apt-get install cifs-utils smbclient samba samba-common
# em sudo gedit ~/.smbcredentials
#username=msusername
#password=mspassword
#Criar a pasta de destino
sudo mkdir -p /mnt/publico
#No fstab adicionar e edicar conforme dados abaixo:
@wellington1993
wellington1993 / encoding-convert1.py
Last active June 1, 2016 19:57
Convert From ISO-8859-1 to UTF-8
import re,
import codecs
import commands
import shutil
import sys
import unicodedata
import unidecode
mpa = dict.fromkeys(range(32))
@wellington1993
wellington1993 / utf8-problems.python.md
Created June 2, 2016 12:45
Unicode (utf8) reading and writing to files in python, Encoding and Decoding of text in Python