This file contains 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
# removed dangling imagese: | |
docker rmi -f $(docker images -qf dangling=true) |
This file contains 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 http.cookiejar | |
import getpass | |
import html.parser | |
import re | |
import sys | |
import urllib.request, urllib.parse, urllib.error | |
import urllib.request, urllib.error, urllib.parse | |
class Client: |
This file contains 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 mv ORIGINAL o | |
sudo socat -t100 -x -v UNIX-LISTEN:./ORIGIAL,mode=777,reuseaddr,fork UNIX-CONNECT:./o |
This file contains 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 | |
""" | |
Created on %(date)s | |
@author: %(username)s | |
""" | |
This file contains 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
"""Softmax.""" | |
scores = [3.0, 1.0, 0.2] | |
import numpy as np | |
def softmax(x): | |
"""Compute softmax values for each sets of scores in x.""" | |
exp_x = np.exp(x) | |
return exp_x / exp_x.sum(axis=0) |
This file contains 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
@ECHO off | |
SET ROOT_KEY="HKEY_CURRENT_USER" | |
FOR /f "skip=2 tokens=3" %%i in ('reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage /v OEMCP') do set OEMCP=%%i | |
ECHO System default values: | |
ECHO. |
This file contains 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
## ON THE OLD SERVER: | |
# DB dump (PostgreSQL should be running): | |
sudo -u postgres pg_dump securetrans | bzip2 >securetrans.sql.bz2 | |
# application and apache configuration backup | |
tar -C / -cjf ~/archive.tar.bz2 ./opt/sft_web ./etc/apache2 ~/ | |
## archive static content: | |
tar -C /var -cjf ~/www.tar.bz2 ./www | |
## Keys: | |
sudo tar cjf ssh_keys.tar.bz2 /etc/ssl/certs/server.crt /etc/ssl/private/server.key |
This file contains 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
sed '0,/\<pre\>/d; /<\/pre>/,$d; s/ *//g; s/\t\t*/\n/g' -i archive.txt | |
# or together with the retrieving | |
curl https://web.archive.org/web/20111005152029/http://registro.br/dominio/proclib-l.html | sed '0,/\<pre\>/d; /<\/pre>/,$d; s/ *//g; s/\t\t*/\n/g' >archive.txt | |
# useful tihg | |
sort -R archive.txt > random_archive.txt |
This file contains 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 aiohttp | |
async def fetch_dmoz(url): | |
async with aiohttp.client.get("https://www.dmoz.org/search?q=" + url) as res: | |
page = await res.text() | |
return page.find("DMOZ Categories"), page.find("DMOZ Sites") |
This file contains 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
[PyScripter] | |
Version=2.6.0.0 | |
[Highlighters\Python] | |
Name=SynPythonSyn | |
Tag=0 | |
DefaultFilter=Python Files (*.py;*.pyw)|*.py;*.pyw | |
Enabled=TRUE | |
[Highlighters\Python\Options] |