Skip to content

Instantly share code, notes, and snippets.

View amenpunk's full-sized avatar
🌌

Edgar Rolando Cosajay Campos amenpunk

🌌
View GitHub Profile
const mysql = require('mysql');
const dotenv = require("dotenv");
dotenv.config()
const env = process.env;
var connection = mysql.createConnection({
host : env.host,
user : env.user,
password : env.password,
database : env.database
console.log( (![] + [])[+[]] + (![] + [])[+!+[]] +
([![]] + [][[]])[+!+[] + [+[]]] + (![] + [])[!+[] + !+[]])
@amenpunk
amenpunk / gist:3d28311cdc9cf54fde2e0dfaf50a844d
Created December 31, 2020 00:39 — forked from pete911/gist:6219918
jenkins with private github projects
- login to jenkins box (ssh)
- switch user to jenkins "sudo su -s /bin/bash jenkins"
- go to jenkins home directory "cd ~"
- generate keys (you need separate pair per github private project as the projects are on the same domain)
- "ssh-keygen -t rsa -f ~/.ssh/id_rsa_<project>" (replace <project> with your project name)
- repeat this for every github project
- crate "config" file in .ssh dir - "vim ~/.ssh/config" with the following content:
# <project1>
Host github.com-<project1>
HostName github.com
@amenpunk
amenpunk / gist:33480537b2d466c6fdb4f273f8eea0be
Created December 31, 2020 00:39 — forked from pete911/gist:6219918
jenkins with private github projects
- login to jenkins box (ssh)
- switch user to jenkins "sudo su -s /bin/bash jenkins"
- go to jenkins home directory "cd ~"
- generate keys (you need separate pair per github private project as the projects are on the same domain)
- "ssh-keygen -t rsa -f ~/.ssh/id_rsa_<project>" (replace <project> with your project name)
- repeat this for every github project
- crate "config" file in .ssh dir - "vim ~/.ssh/config" with the following content:
# <project1>
Host github.com-<project1>
HostName github.com
@amenpunk
amenpunk / respond_and_process.php
Created January 28, 2021 16:22 — forked from kfriend/respond_and_process.php
PHP: Send response and continue processing
<?php
// Buffer all upcoming output...
ob_start();
// Send your response.
echo "Testing response";
// Get the size of the output.
$size = ob_get_length();
@amenpunk
amenpunk / jquery-redux-example.js
Created February 22, 2021 02:05 — forked from tzkmx/jquery-redux-example.js
Redux with jQuery simple example
// original from:https://codepen.io/mdd/pen/wGRqbw
// Reducer
const counter = (state = 0, actions) => {
switch (actions.type) {
case 'INCREMENT': return state + 1;
case 'DECREMENT': return state - 1;
default: return state
}
}
@amenpunk
amenpunk / rclone.service
Last active September 14, 2021 16:46
Simple rclone gdrive systemd service
# /etc/systemd/system/rclone.service
[Unit]
Description=Google Drive (rclone ming)
AssertPathIsDirectory=/home/ming/Drive
After=plexdrive.service
[Service]
Type=simple
ExecStart=/usr/bin/rclone mount \
--allow-other \
let body = {
"nombre" : "Lucas Joel",
"apelidos" : "Juarez Jocon",
"telefono" : "45435345",
"direccio": "4 calle zona 1",
"fechacumple": "2021-01-01",
"nit": "5345435",
"cui": "555555",
"email": "[email protected]",
"username": "[email protected]",
@amenpunk
amenpunk / trace.log
Last active September 8, 2022 23:35
Root: ${Root}
Local: ${LocalEnvironment}
Environment: ${Environment}
ExceptionList: ${ExceptionList}
TRUNCATE table db2was.esb_logging IMMEDIATE
id nombre
1 Acatempa
2 Acatenango
3 Agua Blanca
4 Aguacatan
5 Almolonga
6 Alotenango
7 Amatitlan
8 Antigua Guatemala
9 Asuncion Mita