Skip to content

Instantly share code, notes, and snippets.

Avatar
😀

Rogerio Prado de Jesus rogeriopradoj

😀
View GitHub Profile
@rogeriopradoj
rogeriopradoj / jupyter_cell_notify.py
Last active Sep 30, 2020 — 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.
View jupyter_cell_notify.py
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)
View macbook-pro-2011-defective-gpu-fix-v2.md
View macbook_sleep
#!/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 Apr 10, 2019 — forked from realies/adminer autologin
A way to allow direct login to adminer
View adminer autologin
<?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;
View Cntlm Authentication Proxy for Docker.txt
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 Aug 8, 2018 — forked from sayedihashimi/web.config
How to enable directory browsing in web.config
View web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>
@rogeriopradoj
rogeriopradoj / doctrinemap.php
Created Aug 5, 2018 — forked from dwgebler/doctrinemap.php
Generate Symfony 4 entities + repositories from existing database
View doctrinemap.php
<?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 Aug 5, 2018 — forked from tawfekov/generator.php
Doctrine2 Generate Entities form Existing Database
View generator.php
<?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 Jul 22, 2018 — forked from milolav/Portable_WhatsApp.md
Making WhatsApp desktop application portable
View Portable_WhatsApp.md

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:

View gist:e9ec061a353b7c4131d4e873d003e9a2
"C:\Program Files\Git\bin\bash.exe" --login -i "C:\Program Files\Docker Toolbox\start.sh" -new_console:d:"C:\Program Files\Docker Toolbox"
You can’t perform that action at this time.