Skip to content

Instantly share code, notes, and snippets.

View billyriantono's full-sized avatar
:octocat:
git commit -m "Welcome"

Billy R billyriantono

:octocat:
git commit -m "Welcome"
  • Around the world
View GitHub Profile
#!/usr/bin/env python
from __future__ import print_function
import json
import os
import subprocess
device = "msm8996-common"
vendor = "xiaomi"
system = "system/"
@billyriantono
billyriantono / nginx-ssl-config
Created August 28, 2020 13:13 — forked from apollolm/nginx-ssl-config
Nginx Configuration with multiple port apps on same domain, with SSL.
# the IP(s) on which your node server is running. I chose port 3000.
upstream app_geoforce {
server 127.0.0.1:3000;
}
upstream app_pcodes{
server 127.0.0.1:3001;
}
print "hello"
import httplib, urllib
hexstring = "436c6f4b54416741456b67414141414341414152585139614c34554a75784d576b3656424a744a6d5146764447354b4376726e656b56725656454c677532555152424f6469315141747875544231455369754856364c434b62597958346876724a523130556c5f6b5a35675342434c7472584d614241674145674153494b79712d734c786b676d31486b36506e336d6a4d42593945435978526e72644f6e4552354c67384c2d4f31"
hexdata = hexstring.decode("hex")
bytedata = bytearray(hexdata)
base64data = "NDM2YzZmNGI1NDQxNjc0MTQ1NmI2NzQxNDE0MTQxNDM0MTQxNDE1MjU4NTEzOTYxNGMzNDU1NGE3NTc4NGQ1NzZiMzY1NjQyNGE3NDRhNmQ1MTQ2NzY0NDQ3MzU0YjQzNzY3MjZlNjU2YjU2NzI1NjU2NDU0YzY3NzUzMjU1NTE1MjQyNGY2NDY5MzE1MTQxNzQ3ODc1NTQ0MjMxNDU1MzY5NzU0ODU2MzY0YzQzNGI2MjU5Nzk1ODM0Njg3NjcyNGE1MjMxMzA1NTZjNWY2YjVhMzU2NzUzNDI0MzRjNzQ3MjU4NGQ2MTQyNDE2NzQxNDU2NzQxNTM0OTRiNzk3MTJkNzM0Yzc4NmI2NzZkMzE0ODZiMzY1MDZlMzM2ZDZhNGQ0MjU5Mzk0NTQzNTk3ODUyNmU3MjY0NGY2ZTQ1NTIzNTRjNjczODRjMmQ0ZjMx"
url = "www.googleapis.com/certificateprovisioning/v1/devicecertificates/create?key=AIzaSyB-5OLKTx2iU5mko18
@billyriantono
billyriantono / compile-ffmpeg-nvenc.sh
Last active June 30, 2020 16:21
This bash script will compile a static Ffmpeg build with NVENC and VAAPI hardware-accelerated support on Ubuntu in your home directory. You can modify the script to customize the build options as you see fit.
#!/bin/bash
#This script will compile and install a static ffmpeg build with support for nvenc un ubuntu.
#See the prefix path and compile options if edits are needed to suit your needs.
#install required things from apt
installLibs(){
echo "Installing prerequisites"
sudo apt-get update
sudo apt-get -y --force-yes install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev \
@billyriantono
billyriantono / pppd-cve.py
Created May 13, 2020 15:41 — forked from namidairo/pppd-cve.py
Xiaomi RM2100 1.0.14 vs. CVE-2020-8597
from scapy.all import *
from socket import *
interface = "enp0s31f6"
def mysend(pay,interface = interface):
sendp(pay, iface = interface)
def packet_callback(packet):
@billyriantono
billyriantono / stream_to_youtube.sh
Created May 4, 2020 16:08 — forked from olasd/stream_to_youtube.sh
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@billyriantono
billyriantono / vaapi-ffmpeg-build.md
Created April 3, 2020 08:50
Building a VAAPI enabled FFmpeg for use bound to the !/bin prefix

Build FFmpeg and libva with decode and encode hardware acceleration on an Intel-based validation testbed:

Build platform: Ubuntu

Install baseline dependencies first

sudo apt-get -y install autoconf automake build-essential libass-dev libtool pkg-config texinfo zlib1g-dev libva-dev cmake mercurial libdrm-dev libvorbis-dev libogg-dev git libx11-dev libperl-dev libpciaccess-dev libpciaccess0 xorg-dev

Then add the Oibaf PPA, needed to install the latest development headers for libva:

@billyriantono
billyriantono / m3u_to_flussonic.py
Last active February 19, 2021 06:31
convert m3u to flussonic
#!/usr/bin/env python
import sys
import urllib2
import codecs
from contextlib import closing
class Track:
def __init__(self, length, title, path):
self.length = length
@billyriantono
billyriantono / edittext.java
Created December 21, 2018 19:31 — forked from Reacoder/edittext.java
EditText onClick event is not triggering
When a user interacts with a UI element the various listeners are called in a top down order. (For example: OnTouch -> OnFocusChange -> OnClick.) If a listener has been defined (with setOn...Listener) and it consumes this event: the lower priority listeners will not be called. By its nature the first time you touch an EditText it receives focus with OnFocusChangeListener so that the user can type. The action is consumed here therefor OnClick is not called. Each successive touch doesn't change the focus so the event trickles down to the OnClickListener.
Basically, you have three choices:
Set the focusable attribute to false in your XML:
android:focusable="false"
Now the OnClickListener will fire every time it is clicked. But this makes the EditText useless since the user can no longer enter any text...
Implement an OnFocusChangeListener along with the OnClickListener:
# begin build properties
# autogenerated by buildinfo.sh
ro.build.id=JWR66N
ro.build.display.id=JWR66N
ro.build.version.incremental=711294
ro.build.version.sdk=18
ro.build.version.codename=REL
ro.build.version.release=4.3
ro.build.date=Sat Jun 15 19:53:50 UTC 2013
ro.build.date.utc=1371326030