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 sys | |
import os | |
# ... | |
# settings.py extra configurations | |
# ... | |
if sys.argv[1] == 'test': | |
DATABASES = { | |
'default': { |
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 re | |
def anagram(a, b): | |
regex = f"^(?!.*(.).*\1)[{a}]*$" | |
if re.search(regex, b, flags=re.IGNORECASE): | |
return True | |
return False |
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 subprocess | |
try: | |
resultado = subprocess.check_output("sudo systemctl status odoo12 | grep 'Active: failed'", shell=True) | |
if "Active: failed" in resultado: | |
subprocess.check_output("sudo systemctl stop odoo12", shell=True) | |
subprocess.check_output("sudo systemctl start odoo12", shell=True) | |
print("activado 1") | |
else: | |
resultado = subprocess.check_output("sudo systemctl status odoo12 | grep inactive", shell=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
# Add these to /etc/hosts | |
# 127.0.0.1 localhost | |
# 127.0.0.1 local.host | |
server { | |
server_name localhost local.host; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
index index.html; |
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 -*- | |
# Encrypt and Decrypt idea extracted from http://rodrigogr.com/blog/cifrado-de-transposicion/ | |
import math | |
def main(): | |
text_encrypt = 'Guillermo Alfonso Morales, 1983-02-12, Santiago de Cali' | |
key_length = int(len(text_encrypt) / 4) | |
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
def order_vowels_reverse(string): | |
list_string = [_ for _ in string] | |
vowels = 'aeiouAEIOU' | |
vowels_pos = list(filter(lambda car: car in vowels, string)) | |
reverse = vowels_pos[::-1] | |
index = 0 | |
for car in range(len(list_string)): | |
if index < len(vowels_pos): |
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 | |
import shutil | |
source_path = '/<path>/<to>/<folder>/app-debug.apk/' | |
main_pkg_dir = './<android_project_directory_name>/' | |
def create_dir(dir_list): | |
global main_pkg_dir |
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
{ | |
"editor.rulers": [80, 100], | |
"window.zoomLevel": 0, | |
"editor.fontSize": 14, | |
"editor.renderWhitespace": "all", | |
"editor.multiCursorModifier": "ctrlCmd", | |
"editor.snippetSuggestions": "top", | |
"editor.formatOnPaste": true, | |
"editor.minimap.enabled": false, | |
"[yaml]": { |
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 | |
# RadicalEd | |
# Genera clave de conexión ssh y archivo ppk | |
RED='\033[0;31m' | |
GREEN='\033[1;32m' | |
BLUE='\033[1;34m' | |
NC='\033[0m' | |
DIRSSH="$HOME/.ssh/" | |
DIRPPK="$HOME/Documentos/proyectos/ppk/" |
OlderNewer