:set ts=2 sw=2 sts=2 et
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re, | |
import codecs | |
import commands | |
import shutil | |
import sys | |
import unicodedata | |
import unidecode | |
mpa = dict.fromkeys(range(32)) |
Unicode (utf8) reading and writing to files in python http://stackoverflow.com/questions/491921/unicode-utf8-reading-and-writing-to-files-in-python
Write to UTF-8 file in Python http://stackoverflow.com/questions/934160/write-to-utf-8-file-in-python
Delete every non utf-8 symbols froms string http://stackoverflow.com/questions/26541968/delete-every-non-utf-8-symbols-froms-string
Encoding and Decoding of text in Python