Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Fredy Rosero FredyRosero

💭
I may be slow to respond.
View GitHub Profile
View openssl_CA.config
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 Nov 17, 2022
Connect and disconnect interface
View conn.sh
#!/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 Oct 23, 2022
PHhpMyAdmin en Docker + MySQL en host: Con antelación tenemos un servidor MySQL corriendo en el host en 0.0.0.0:3306
View start_phpmyadmin.sh
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 Oct 7, 2022 — 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 ".
View 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 Sep 23, 2022
Anbox for Ubuntu 20.04
View anbox-ubuntu.20.04.txt
# 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
Create a jekyll draft post (in the folder `_drafts`). Usage: ./createpost.sh [post's tittle]. No quotes are required.
View createpost.sh
#!/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 Mar 2, 2022
Check ports is in use
View used_ports.sh
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.
View index.html
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>A Basic HTML5 Template</title>
<meta name="description" content="Una plantilla básica de HTML5 para inciar un proyecto.">
<meta name="author" content="Fredy Rosero">
@FredyRosero
FredyRosero / holamundo.py
Last active Feb 1, 2022
Hola mundo de Pythno
View holamundo.py
foo = "hola"
bar = ", mundo!"
print ('{0}{1}'.format(foo,bar))
View gist:a85ff5d7a3f5d0c6e073ee21cbf6ca47
$ ps -p $$ -o args,ppid
COMMAND PPID
bash 1234
$ ps -p 1234 -o args
COMMAND
/usr/lib/gnome-terminal/gnome-terminal-server