Simple Python script which uses DBus + ALSA to record current Spotify song.
First, you need a graphical desktop environment.
The setup.sh
should be enough for Arch-based distro.
You need Spotify API credentials, find out how to get them.
#-- | |
# MAIN MODULE -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
#++ | |
module Simplex | |
#-- | |
# UTILITIES -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
#++ | |
module Util |
<?php | |
/** | |
* Get a private variable from any object. | |
* | |
* @param mixed $obj | |
* @param string $name | |
* @return mixed | |
*/ | |
function get_private_var($obj, $name) { |
Simple proof of concept for converting XSD schemas into pure Java classes at
runtime and by using reflection. It can be improved to, for example, build
intelligent JAX-RS console or GUI clients without knowledge of the domain model,
by querying application.wadl
and looking for the schema. The classes are
transpiled, compiled and appended to the path at runtime so they are always
updated. Other things missing is fetching the schema from network instead of a
file, not depending on JXC and Javax Tools, building a schema and creating an
automatic CLI client for it, between other tree of possibilities.
#!/usr/bin/bash | |
ifaces=($(ip link | grep '^[0-9]' | cut -d: -f2 | sed '1d;s/ //')) | |
iface=${ifaces[0]} | |
if [ $# -gt 0 ]; then | |
found=0 | |
for i in ${ifaces[@]}; do | |
if [ $1 == $i ]; then | |
found=1 | |
break |
import java.util.Map; | |
import java.util.HashMap; | |
import java.util.Base64; | |
import java.util.Map.Entry; | |
import javax.crypto.Cipher; | |
import javax.crypto.SecretKey; | |
import java.io.FileInputStream; | |
import java.io.ObjectInputStream; | |
import javax.crypto.spec.PBEKeySpec; | |
import javax.crypto.SecretKeyFactory; |
After installing mitmproxy run it (just type mitmproxy
) in a terminal session and quit.
This will create the necessaries certificates files at ~/.mitmproxy
.
Extract the certificate to .crt
format:
openssl x509 -in ~/.mitmproxy/mitmproxy-ca.pem -inform PEM -out ca.crt
Trust the certificate into CA:
sudo trust anchor ca.crt
Run the mitmproxy
again
set -x | |
mkdir -p src usr | |
# Set variables | |
export PREFIX=$PWD/usr | |
export HOST_TAG=linux-x86_64 | |
export NDK=$HOME/Android/Sdk/ndk-bundle | |
export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/$HOST_TAG | |
export AR=$TOOLCHAIN/bin/arm-linux-androideabi-ar | |
export AS=$TOOLCHAIN/bin/arm-linux-androideabi-as |
from __future__ import division | |
from smbus import SMBus | |
SSD1306_ADDRESS = 0x3C | |
SSD1306_MEMORYMODE = 0x20 | |
SSD1306_COLUMNADDR = 0x21 | |
SSD1306_PAGEADDR = 0x22 | |
SSD1306_SETCONTRAST = 0x81 |