Skip to content

Instantly share code, notes, and snippets.

View rogeriopradoj's full-sized avatar
😀

Rogerio Prado de Jesus rogeriopradoj

😀
View GitHub Profile
@rogeriopradoj
rogeriopradoj / jupyter_cell_notify.py
Last active September 30, 2020 19:26 — forked from tamsanh/jupyter_cell_notify.py
Generate and play a sound in Jupyter Notebook when then cell is run. Useful as notification when a long-running cell is done.
from IPython.lib.display import Audio
import numpy as np
framerate = 4410
play_time_seconds = 3
t = np.linspace(0, play_time_seconds, framerate*play_time_seconds)
audio_data = np.sin(2*np.pi*300*t) + np.sin(2*np.pi*240*t)
Audio(audio_data, rate=framerate, autoplay=True)
#!/bin/sh
# script to change the sleep mode of an OS X machine
usage () {
echo "supported sleep modes:"
echo " sleep"
echo " safesleep"
echo " hibernate"
echo " secure"
echo " insecure"
@rogeriopradoj
rogeriopradoj / adminer autologin
Created April 10, 2019 13:47 — forked from realies/adminer autologin
A way to allow direct login to adminer
<?php
$_GET["username"] = "";
$_GET["db"] = "database";
function adminer_object() {
class AdminerAutoLogin extends Adminer {
function credentials() {
return array("127.0.0.1", "username", "password");
}
function login($login, $password) {
return true;
@rogeriopradoj
rogeriopradoj / Cntlm Authentication Proxy for Docker.txt
Created March 20, 2019 20:32 — forked from 7171u/Cntlm Authentication Proxy for Docker.txt
Docker Behind Proxy Network with Cntlm on Centos/RHEL
Install and Configure Cntlm:
1. Configure EPEL Repo and install cntlm
yum install cntlm
3. Generate hashes for password-less configuration and add one of the values to /etc/cntlm.conf
cntlm -u <user>@<domain> -H
3. vi /etc/cntlm.conf
Username <Username>
Domain <Domain>
PassNTLMv2 BCB555F5BA8709B8186C2A813C47A4BD # Only for user '<user>', domain '<domain>'
Proxy <ProxyServer>:<Port>
@rogeriopradoj
rogeriopradoj / web.config
Created August 8, 2018 17:09 — forked from sayedihashimi/web.config
How to enable directory browsing in web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>
@rogeriopradoj
rogeriopradoj / doctrinemap.php
Created August 5, 2018 21:09 — forked from dwgebler/doctrinemap.php
Generate Symfony 4 entities + repositories from existing database
<?php
include './vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();
class RepoGen extends Doctrine\ORM\Tools\EntityRepositoryGenerator {
protected static $_template =
@rogeriopradoj
rogeriopradoj / generator.php
Created August 5, 2018 21:08 — forked from tawfekov/generator.php
Doctrine2 Generate Entities form Existing Database
<?php
include '../vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();
// config
$config = new \Doctrine\ORM\Configuration();
@rogeriopradoj
rogeriopradoj / Portable_WhatsApp.md
Created July 22, 2018 21:12 — forked from milolav/Portable_WhatsApp.md
Making WhatsApp desktop application portable

Portable desktop WhatsApp

This tutorial will explain how to make WhatsApp desktop application portable on Windows platform. Maybe this can work for other platforms as well.

For this to work NodeJs and asar package are required.

Download WhatsApp package

Firstly download latest version of WhatsApp. The following link contains all Windows (x64) releases:

@rogeriopradoj
rogeriopradoj / gist:e9ec061a353b7c4131d4e873d003e9a2
Created July 15, 2018 18:20 — forked from opensourcetutorialsnet/gist:51dc12aada3e1f8fc8dd1064d9b78522
Startup command parameters to run Docker terminal in cmder
"C:\Program Files\Git\bin\bash.exe" --login -i "C:\Program Files\Docker Toolbox\start.sh" -new_console:d:"C:\Program Files\Docker Toolbox"