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 os, zipfile | |
import sys | |
dir_name = sys.argv[1] if len(sys.argv) > 1 else None | |
extension = sys.argv[2] if len(sys.argv) > 2 else ".zip" | |
if not dir_name: | |
print("No dir name") | |
sys.exit(1) |
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
{ | |
"basics": { | |
"name": "Jorge Arevalo", | |
"label": "Python/Django Web Developer", | |
"summary": "I’m a software developer since 2007. Specialized in web development with Python and Django. Previous experience with C as developer of GDAL PostGIS Raster driver and PostGIS Raster extension. Also experience as tech trainer.", | |
"website": "https://about.me/jorgeas80", | |
"email": "[email protected]", | |
"location": { | |
"city": "Madrid", | |
"countryCode": "ES" |
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
#!/bin/bash | |
a=1 | |
for i in *.png; do | |
new=$(printf "%04d.png" "$a") #04 pad to length of 4 | |
mv -i -- "$i" "$new" | |
let a=a+1 | |
done |
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
# Put a breakpoint in a file that is not part of our code | |
# Ref: https://stackoverflow.com/q/13589736/593722 | |
(Pdb) import sys | |
(Pdb) sys.path.append("/home/user/path/to/another/module") | |
(Pdb) import another_module | |
(Pdb) b another_module:356 | |
Breakpoint 1 at /home/user/path/to/another/module/another_module.py:356 | |
(Pdb) c | |
# Conditionally hit the breakpoint #1 |
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
# Delete starting and ending blank spaces | |
s/^\s+|\s+$|\s+(?=\s) | |
# Delete duplicated lines, after sorting | |
^(.+)$\n^\1$ |
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
# Get docker container names | |
docker ps --format "{{.Names}}" | |
# Stop all running containers | |
docker stop $(docker ps -aq) |
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
#!/bin/sh | |
CONTAINERD_VERSION="1.2.10-3" | |
DOCKER_CE_CLI_VERSION="19.03.3~3-0" | |
DOCKER_CE_VERSION="19.03.3~3-0" | |
echo "# DOWNLOAD THE DOCKER FILES" | |
wget "https://download.docker.com/linux/ubuntu/dists/disco/pool/stable/amd64/containerd.io_"$CONTAINERD_VERSION"_amd64.deb" | |
wget "https://download.docker.com/linux/ubuntu/dists/disco/pool/stable/amd64/docker-ce-cli_"$DOCKER_CE_CLI_VERSION"~ubuntu-disco_amd64.deb" | |
wget "https://download.docker.com/linux/ubuntu/dists/disco/pool/stable/amd64/docker-ce_"$DOCKER_CE_VERSION"~ubuntu-disco_amd64.deb" |
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
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH="/Users/jorgearevalo/.oh-my-zsh" | |
# Set name of the theme to load --- if set to "random", it will | |
# load a random theme each time oh-my-zsh is loaded, in which case, | |
# to know which specific one was loaded, run: echo $RANDOM_THEME | |
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes |
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
set nocompatible | |
filetype off | |
filetype indent plugin on | |
" Buffers | |
nnoremap gp :bp<CR> | |
nnoremap gn :bn<CR> | |
nnoremap gl :ls<CR> | |
nnoremap gb :ls<CR>:b |
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 | |
# Requires Python > 3.5.2 | |
import aiohttp | |
import asyncio | |
from wallabag_api.wallabag import Wallabag | |
# If you use wallabag.it this is: https://app.wallabag.it | |
my_host = 'MY_HOST' |
NewerOlder