Skip to content

Instantly share code, notes, and snippets.

View luzfcb's full-sized avatar

Fábio C. Barrionuevo da Luz luzfcb

View GitHub Profile
@cben
cben / dodgetocat_v2.png
Last active April 1, 2023 13:16 — forked from alienlebarge/dodgetocat_v2.png
Is there an easy way to link image in a GIST ?
dodgetocat_v2.png
@huogerac
huogerac / page1.html
Last active August 29, 2015 14:16
Two options for using Magnific-Popup JS (Django Template)
<!DOCTYPE html>
<html lang="en">
<head>
<link href="{% static 'bootstrap/dist/css/bootstrap.min.css' %}" rel="stylesheet">
<link href="{% static 'magnific-popup/dist/magnific-popup.css' %}" rel="stylesheet" media="screen">
<!-- pode ir para o final -->
<script src="{% static 'jquery/dist/jquery.min.js' %}"></script>
<script src="{% static 'bootstrap/dist/js/bootstrap.min.js' %}"></script>
@lecram
lecram / profilight.py
Created February 24, 2015 03:35
Minimal Python profiler implemented in pure Python.
import sys
import os
import linecache
class Profiler:
def __init__(self, instrument):
self.instrument = instrument
def run(self, func, *args, **kwargs):
@artschwagerb
artschwagerb / gist:35130c93b276d6aa2b05
Created January 28, 2015 18:25
Python LDAP - Change Password
def changePassword(user_dn, old_password, new_password):
ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_NEVER)
l = ldap.initialize("LDAPS://DOMAIN.COM")
l.set_option(ldap.OPT_REFERRALS,0)
l.set_option(ldap.OPT_PROTOCOL_VERSION,3)
l.set_option(ldap.OPT_X_TLS,ldap.OPT_X_TLS_DEMAND)
l.set_option(ldap.OPT_X_TLS_DEMAND,True)
l.set_option(ldap.OPT_DEBUG_LEVEL,255)
l.simple_bind_s("[email protected]", "PASSWORD")
@drgarcia1986
drgarcia1986 / bottle_hello.py
Last active January 20, 2025 21:50
Python HelloWorld (WebFrameworks) Collection
# -*- coding: utf-8 -*-
from bottle import route, run
@route('/')
def index():
return '<h1>Hello World/h1>'
run(host='localhost', port=8000)
@luzfcb
luzfcb / oracle_database_schema_tables_views.sql
Last active March 13, 2025 05:54
sql for introspection information about schema, tables, views and other for various database
-- basic doc: http://docs.oracle.com/cd/B19306_01/network.102/b14266/admusers.htm#i1008832
-- get all database schema's name from Oracle Database
-- http://www.orafaq.com/wiki/List_of_default_database_users
-- http://www.adp-gmbh.ch/ora/misc/known_schemas.html
SELECT DISTINCT OWNER
FROM ALL_OBJECTS
WHERE OWNER NOT IN ('APEX_030200', 'CTXSYS', 'DBSNMP', 'EXFSYS',
'MDSYS', 'OLAPSYS', 'ORDDATA', 'ORDPLUGINS',
'ORDSYS', 'PUBLIC', 'SYS', 'SYSTEM', 'WMSYS',

Small bag / wearing

  • Passport (+I-797B)
  • Hoodie
  • Bluetooth headphones
  • Surface
  • 3DS/Vita (+games for 3DS)
  • Nexus 9
  • Kindle
@gibatronic
gibatronic / workit.bash
Last active June 24, 2019 09:10
Automatically run workon when entering a directory
function check_for_virtual_env {
[ -d .git ] || git rev-parse --git-dir &> /dev/null
if [ $? == 0 ]; then
local ENV_NAME=`basename \`pwd\``
if [ "${VIRTUAL_ENV##*/}" != $ENV_NAME ] && [ -e $WORKON_HOME/$ENV_NAME/bin/activate ]; then
workon $ENV_NAME && export CD_VIRTUAL_ENV=$ENV_NAME
fi
elif [ $CD_VIRTUAL_ENV ]; then
@wdullaer
wdullaer / docker-cleanup
Last active September 27, 2024 02:02
Cleanup unused Docker images and containers
#!/bin/sh
# Cleanup docker files: untagged containers and images.
#
# Use `docker-cleanup -n` for a dry run to see what would be deleted.
untagged_containers() {
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1.
# NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6).
# Ref: https://github.com/blueyed/dotfiles/commit/a14f0b4b#commitcomment-6736470
docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}'
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def crc32(string):
crctab = []
for table in range(256):
crc = table << 24