Skip to content

Instantly share code, notes, and snippets.

View FredyRosero's full-sized avatar
💭
I may be slow to respond.

Fredy Rosero FredyRosero

💭
I may be slow to respond.
View GitHub Profile
[
{
"name": "Yellow",
"munsell_hue": "Y",
"hex": "#FFFF00",
"children": [
{
"name": "Cadmium Yellow Light",
"company": "Liquitex",
@FredyRosero
FredyRosero / .uqbar-logo-ascii
Last active June 1, 2023 17:00
Logo de Uqbar UN en ASCII
|\ |\
| \ | \
| \ | \
| \ | /
\ \| /._
_..\ \ /@@@@o...__
@@@@@/ _ T@@@@@@@@
@@@| `*` T@@@@@@ ,-,,-, ___ /-/ ____ _____ ,-,,-,,---,
@@/ d@@@@@ / // // _ // _ `,,=== // ___/ / // // _ /
@ `-____@@@@@@ / // // // // // // // // / / // // // /
@FredyRosero
FredyRosero / ImportarPythonJupyter.py
Created April 23, 2023 21:46
Importar python en Jupyter desde URL de Google Drive
#@title Importar archivo python
# Obtener archivo python desde la URL
import gdown
fileID='1XON75rGGJIILlUBMJ-De2Bjy0YGaFQXc'
url = f'https://drive.google.com/uc?id={fileID}'
nombreModulo= 'solucionadorPLDosVariables'
nombreArchivo = f'{nombreModulo}.py'
%store nombreArchivo
output = f'/content/{nombreArchivo}'
HOME = .
#oid_file = $ENV::HOME/.oid
oid_section = new_oids
[ new_oids ]
tsa_policy1 = 1.2.3.4.1
tsa_policy2 = 1.2.3.4.5.6
tsa_policy3 = 1.2.3.4.5.7
####################################################################
[ ca ]
@FredyRosero
FredyRosero / conn.sh
Created November 17, 2022 08:06
Connect and disconnect interface
#!/bin/bash
while [ true ]
do
sudo ip link set wlan0 down
sudo ip link set wlan0 up
sleep 20
done
@FredyRosero
FredyRosero / start_phpmyadmin.sh
Last active October 23, 2022 21:56
PHhpMyAdmin en Docker + MySQL en host: Con antelación tenemos un servidor MySQL corriendo en el host en 0.0.0.0:3306
docker run -dit --name phpmyadmin \
-e PMA_HOST=host.docker.internal \
--add-host=host.docker.internal:host-gateway \
-p 8080:80 \
phpmyadmin
docker exec -it phpmyadmin /bin/bash
@FredyRosero
FredyRosero / CiscoKeyGen.py
Created October 7, 2022 18:18 — forked from congto/CiscoKeyGen.py
Cisco IOU License Generator. Originally found at http://www.routingloops.co.uk/cisco/gns3-v1-1-install-on-ubuntu-14-04-lts/, I have done a few changes to it. Make the file executable with " chmod +x CiscoKeyGen.py " and execute it " ./CiscoKeyGen.py ".
#! /usr/bin/python
print "\n*********************************************************************"
print "Cisco IOU License Generator - Kal 2011, python port of 2006 C version"
import os
import socket
import hashlib
import struct
# get the host id and host name to calculate the hostkey
hostid=os.popen("hostid").read().strip()
hostname = socket.gethostname()
@FredyRosero
FredyRosero / anbox-ubuntu.20.04.txt
Last active September 23, 2022 17:51
Anbox for Ubuntu 20.04
# Modules
mkdir /dev/binder
mount -t binder binder /dev/binder
ls -1 /dev/{ashmem,binder}
# Instalation
snap install --devmode --beta anbox
sudo snap set anbox debug.enable=true
# Start
@FredyRosero
FredyRosero / createpost.sh
Created May 12, 2022 16:27
Create a jekyll draft post (in the folder `_drafts`). Usage: ./createpost.sh [post's tittle]. No quotes are required.
#!/bin/bash
# https://jekyllrb.com/docs/front-matter/
Create() {
title="$@"
author='Fredy Rosero'
date=$(date +%F)
FILENAME="${date}-${title// /-}.md"
HEDAER="---\n"
@FredyRosero
FredyRosero / used_ports.sh
Last active March 2, 2022 06:42
Check ports is in use
sudo lsof -i -P -n
# -i If no address is specified, this option selects the listing of all Internet and x.25 (HP-UX) network files.
# -P inhibits the conversion of port numbers to port names for network files.
# -n inhibits the conversion of network numbers to host names for network files.
sudo netstat -tulpn | grep LISTEN
# -t --tcp
# -u --udp
# -l Show only listening sockets. (These are omitted by default.)
# -p Show the PID and name of the program to which each socket belongs.