Skip to content

Instantly share code, notes, and snippets.

View lesthack's full-sized avatar
⚔️
Struggling

Jorge Hernández lesthack

⚔️
Struggling
View GitHub Profile
@lesthack
lesthack / export_google_music.js
Created January 30, 2020 17:13 — forked from dcalacci/export_google_music.js
Export your Google Music Library and Playlists (Google Play Music All Access) (see http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music for more)
// Jeremie Miserez <jeremie@miserez.org>, 2015
//
// A little bit of Javascript to let you export your Google Music library, playlists, and album track lists :)
//
// I posted this as an answer here: http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music
//
// 1. Go to: https://play.google.com/music/listen#/all (or your playlist)
//
// 2. Open a developer console (F12 for Chrome). Paste
// code below into the console.
@lesthack
lesthack / pod2vid.sh
Last active January 30, 2020 01:14 — forked from eruizdechavez/pod2vid.sh
#!/bin/bash
font_family="FiraCode-Regular.ttf"
image="logo.jpg"
getMetaTitle (){
tmp=$( ffprobe "$1" 2>&1 | grep title)
echo ${tmp##*:}
}
@lesthack
lesthack / battery.py
Created September 23, 2019 17:22 — forked from wangqr/battery.py
Python script to get battery status on Windows
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import ctypes
from ctypes import wintypes
class SYSTEM_POWER_STATUS(ctypes.Structure):
_fields_ = [
('ACLineStatus', wintypes.BYTE),
('BatteryFlag', wintypes.BYTE),
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
from argparse import ArgumentParser
import sqlite3
import json
import os
import sys
filename = None
sqlitefile = None
#/bin/bash
# Paths
home_path="/home/user"
wallpapers_path="$home_path/Wallpapers"
# Test Internet Connection
wget -q --spider http://google.com
if [ $? -eq 0 ]; then
from BeautifulSoup import BeautifulSoup as bs
import sqlite3
import os
import sys
import json
reload(sys)
sys.setdefaultencoding('utf-8')
base = os.path.dirname(os.path.realpath(__file__))
#!/bin/bash
# By: lesthack
if [[ $EUID -ne 0 ]]; then
echo "What? Make it yourself."
echo '
_____
|_ _|
n (O O) n
H _|\_/|_ H
@lesthack
lesthack / disable-vagrant-time-sync.sh
Created December 27, 2016 21:56 — forked from X0nic/disable-vagrant-time-sync.sh
Disable vagrant time sync
#List vms
VBoxManage list vms
#get status of time sync
VBoxManage getextradata <vm-name> VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled
#NOTE: Make sure to restart the VM after changing these settings.
#disable time sync
VBoxManage setextradata <vm-name> VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled 1
import sys
import math
# game loop
while True:
mountains = []
for i in xrange(8):
mountain_h = int(raw_input()) # represents the height of one mountain.
mountains.append(mountain_h)
print mountains.index(max(mountains))
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/lesthack/.virtualenvs/pymxweb/lib/python3.4/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/Users/lesthack/.virtualenvs/pymxweb/lib/python3.4/site-packages/django/core/management/__init__.py", line 354, in execute
django.setup()
File "/Users/lesthack/.virtualenvs/pymxweb/lib/python3.4/site-packages/django/__init__.py", line 21, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/lesthack/.virtualenvs/pymxweb/lib/python3.4/site-packages/django/apps/registry.py", line 85, in populate