Skip to content

Instantly share code, notes, and snippets.

View aalonzolu's full-sized avatar

Andrés Alonzo y Alonzo aalonzolu

View GitHub Profile
@aalonzolu
aalonzolu / installed_python_packages_google_run.MD
Last active October 6, 2023 22:42
Check installed python packages on Google Cloud Run Image
  1. pull google image ( see pull command on artifact registry)
  2. run with: docker run --rm -it --entrypoint bash <image:tag>
  3. Inside the image execute: ls /layers/google.python.pip/pip/lib/python3.9/site-packages (Change python version if nessesary)
@aalonzolu
aalonzolu / ZIp node.js
Created August 29, 2023 22:48
npm install adm-zip --save
var AdmZip = require("adm-zip");
var zip = new AdmZip();
// Agregar archivos (hacer loop por cada archivo en tu lista)
zip.addLocalFile("/home/me/some_picture.png");
// Escribir el archivo final
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClient.h>
#include <SoftwareSerial.h>
#define buzzerPin D4
// Replace with your SSID and Password
const char *ssid = "NiJo";
const char *password = "uatguate7";
@aalonzolu
aalonzolu / .gitlab-ci.yml
Created August 4, 2020 15:21
Deploy app from gitlab to AWS Beanstalk
stages:
- build
- deploy
build:
image: aalonzolu/nodeawsdeploy
only:
- master
stage: build
allow_failure: false
@aalonzolu
aalonzolu / code update.js
Created January 21, 2020 22:33
Cordova/Phonegap/Ionic1 Custom update with AppCenter CodePush
let onSyncStatusChange = function(status) {
switch (status) {
case SyncStatus.CHECKING_FOR_UPDATE:
// Show "Checking for update" notification
console.log('checking for update');
break;
case SyncStatus.AWAITING_USER_ACTION:
// Show "Checking for update" notification
console.log('AWAITING_USER_ACTION');
break;
@aalonzolu
aalonzolu / install.bash
Created November 13, 2019 05:35
Install Docker in ubuntu 19.10
wget "https://download.docker.com/linux/ubuntu/dists/disco/pool/stable/amd64/containerd.io_1.2.6-3_amd64.deb"
wget "https://download.docker.com/linux/ubuntu/dists/disco/pool/stable/amd64/docker-ce-cli_19.03.3~3-0~ubuntu-disco_amd64.deb"
wget "https://download.docker.com/linux/ubuntu/dists/disco/pool/stable/amd64/docker-ce_19.03.3~3-0~ubuntu-disco_amd64.deb"
sudo dpkg -i "containerd.io_1.2.6-3_amd64.deb"
sudo dpkg -i "docker-ce-cli_19.03.3~3-0~ubuntu-disco_amd64.deb"
sudo dpkg -i "docker-ce_19.03.3~3-0~ubuntu-disco_amd64.deb"
@aalonzolu
aalonzolu / odoo.class.php
Created September 14, 2018 20:31
Odoo Class for PHP
<?php
/**
* Created by PhpStorm.
* User: lexo
* Date: 9/13/18
* Time: 11:49 AM
*/
require_once("ripcord.php");
/**
@aalonzolu
aalonzolu / import-export-vultr-dns.py
Last active May 18, 2018 03:55
Export Vultr DNS records to BIND text file for importing in Cloudflare
import requests
import json
domain_name = 'example.com' # Change this
accces_token = 'API_KEY' #Change this
r=requests.get("https://api.vultr.com/v1/dns/records?domain="+domain_name, headers={"API-Key":accces_token,'Content-Type': 'application/json'})
JSON_DATA = r.json()
if(r.status_code != 200):
print "Error: "+r.text
else:
DNS_TYPE={}
@aalonzolu
aalonzolu / wificar.ino
Created May 4, 2018 04:40
ESP8266 Arduino compatible Wifi Car (AP Mode)
#include <ESP8266WiFi.h>
const char WiFiAPPSK[] = "holamundo";
WiFiServer server(80);
void setup()
{
initHardware();
setupWiFi();
server.begin();
@aalonzolu
aalonzolu / phptoken.php
Created January 19, 2018 16:32
simple method to encrypt or decrypt a plain text string with php
<?php
/**
* simple method to encrypt or decrypt a plain text string
* initialization vector(IV) has to be the same when encrypting and decrypting
*
* @param string $action: can be 'encrypt' or 'decrypt'
* @param string $string: string to encrypt or decrypt
*
* @return string
*/