Skip to content

Instantly share code, notes, and snippets.

View alejandrobernardis's full-sized avatar
🐻

Alejandro M. BERNARDIS alejandrobernardis

🐻
View GitHub Profile
# AySA
_proto/
_ignore/
*.ignore
*.ignore.py
.idea
.vscode
.DS_*
*.sublime*
@alejandrobernardis
alejandrobernardis / transport.sh
Created November 12, 2019 12:00
Script para el transporte de imágenes
#!/bin/bash
# Author: Alejandro M. BERNARDIS
# Created: 2019/08/30
set -e
# colors
BLACK=$(printf '\033[30m')
RED=$(printf '\033[31m')
@alejandrobernardis
alejandrobernardis / references.md
Last active October 18, 2019 03:20
REFERENCIAS
@alejandrobernardis
alejandrobernardis / bash.sh
Created October 3, 2019 02:12
back docker images
docker images --format "docker save -o {{.Repository}}_{{.Tag}}.tar {{.Repository}}:{{.Tag}}" | bash
local ret_status="%(?:%{$fg_bold[green]%}>:%{$fg_bold[red]%}>) "
if [[ "$USER" == "root" ]]; then user_mode="%{$fg_bold[red]%}"; else user_mode="%{$fg_bold[black]%}"; fi
function check_git() {
local _status
local cgit=$(printf '\e[38;5;141m')
if git rev-parse --git-dir > /dev/null 2>&1; then
_status=$(git_prompt_status 2> /dev/null)
[[ ! -z "$_status" ]] && _status=" ${_status}"
echo "$(parse_git_dirty) %{$fg_bold[black]%}git:($cgit$(git_current_branch)%{$fg_bold[black]%},$cgit${$(git_prompt_short_sha):-x}%{$fg_bold[black]%})${_status}" \
@alejandrobernardis
alejandrobernardis / createinstallmedia.sh
Last active August 27, 2015 01:51
Create Install Media (Mac OS X)
#!/bin/bash
# sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Yosemite.app --nointeraction
# sudo /Applications/Install\ OS\ X\ El\ Capitan\ Public\ Beta.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ El\ Capitan\ Public\ Beta.app —nointeraction
sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ El\ Capitan\ Public\ Beta.app --nointeraction
@alejandrobernardis
alejandrobernardis / hosts.sh
Last active August 29, 2015 14:22
Hostsfix Function
function hostsfix() {
cp /etc/hosts /etc/hosts.backup
echo "" > /etc/hosts
cat >> EOF
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 domain.local
127.0.0.1 short.local
127.0.0.1 localhost.local
@alejandrobernardis
alejandrobernardis / ua.sh
Created May 20, 2015 19:31
Remove (uninstall) Android Studio
#!/bin/bash
rm -fR /Applications/Android\ Studio.app
rm -fR ~/Library/Preferences/AndroidStudio*
rm -f ~/Library/Preferences/com.google.android.*
rm -fR ~/Library/Application\ Support/AndroidStudio*
rm -fR ~/Library/Logs/AndroidStudio*
rm -fR ~/Library/Caches/AndroidStudio*
# (optional) rm -Rf ~/Library/Android*
rm -fR ~/.gradle
"""Demo of streaming requests with Tornado.
This script features a client using AsyncHTTPClient's body_producer
feature to slowly produce a large request body, and two server
handlers to receive this body (one is a proxy that forwards to the
other, also using body_producer).
It also demonstrates flow control: if --client_delay is smaller than
--server_delay, the client will eventually be suspended to allow the
server to catch up. You can see this in the logs, as the "client