Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Coding

Jorge Frisancho teocci

👨‍💻
Coding
View GitHub Profile
@teocci
teocci / YouTubeCenter.user.js
Created Aug 12, 2019
YouTube Disable Polymer + Center (looper) for 누리
View YouTubeCenter.user.js
This file has been truncated, but you can view the full file.
/**
The MIT License (MIT)
Copyright © 2015 Jeppe Rune Mortensen
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
View nginx-rtmp-rtsp.conf
rtmp {
access_log /var/log/nginx/rtmp_access.log;
server {
listen 1935;
ping 30s;
notify_method get;
application camera1 {
live on;
exec_pull ffmpeg -i rtsp://admin:admin@10.10.10.11/axis-media/media.amp -threads 2 -f flv -r 25 -s 1280x720 -an rtmp://localhost:1935/cam1/stream 2>>/var/log/nginx/ffmpeg.log;
}
View th-sub-eng.srt
1
00:03:37,683 --> 00:03:40,143
I forgot where I am.
2
00:03:40,268 --> 00:03:41,895
You're at the place
where the killers meet
3
@teocci
teocci / androidPlayAudio.java
Created Jun 7, 2019 — forked from yavor87/androidPlayAudio.java
Record, play and visualize raw audio data in Android
View androidPlayAudio.java
ShortBuffer mSamples; // the samples to play
int mNumSamples; // number of samples to play
void playAudio() {
new Thread(new Runnable() {
@Override
public void run() {
int bufferSize = AudioTrack.getMinBufferSize(SAMPLE_RATE, AudioFormat.CHANNEL_OUT_MONO,
AudioFormat.ENCODING_PCM_16BIT);
if (bufferSize == AudioTrack.ERROR || bufferSize == AudioTrack.ERROR_BAD_VALUE) {
@teocci
teocci / nginx-config-guide.md
Last active Jul 1, 2019
Nginx SSL configuration
View nginx-config-guide.md

How to enable SSL on NGINX

Secure Sockets Layer (SSL) has become a necessity for web servers. Why? Because security has been forced into the spotlight, and every company now faces the fact that their web servers must serve up content securely.

To that end, you need to make use of SSL. If you happen to work with NGINX, you're in luck, as the process is quite possible (though slightly complicated).

I want to walk you through the steps of enabling SSL on a Ubuntu Server 18.04, running NGINX. I will demonstrate this with a self-signed certificate, but a certificate from an official Certificate Authority (CA) is a much better choice. In fact, you should use the self-signed certificate only as a means for testing purposes.

What you need

To accomplish this, you'll need NGINX running on Ubuntu Server 18.04, with a self-signed certificate at the ready. I'll assume you already have Ubuntu and NGINX up and running. We'll walk through the process of creating the self-signed certificate.

@teocci
teocci / disable-bixby.md
Last active May 16, 2019
How to disable/uninstall Bixby without root access
View disable-bixby.md

How to disable/uninstall Bixby without root access

Ever since Samsung announced the Galaxy S8 with its onboard assistant, Bixby, people have been asking for ways to disable it and forget the button ever existed in the first place. With the Galaxy S9 and Note 9, that chorus became even louder, and with the Galaxy S10 now available, a whole new generation of customers will be looking to disable Bixby.

Why do you want to disable Bixby?

One of the biggest frustrations with the Bixby button is its placement; the button is right under the volume keys and nearly directly opposite the power buttons. On larger phones like the Galaxy S9+ and Note 8, this often leads to accidental presses and unintended Bixby launches, especially when double-pressing the power button to launch the camera.

The Bixby button is also not mappable to another action; Samsung wants you to use it for Bixby, or not at all. This isn't ideal, so many people will inevitably choose to just forget it exists and move on.

While the hardware

@teocci
teocci / AndroidManifest.xml
Created Feb 15, 2019
AndroidManifest.xml intent filter for YouTube videos
View AndroidManifest.xml
<manifest>
<application>
<activity android:name="com.example.MainActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="www.youtube.com" android:pathPrefix="/watch" />
<data android:scheme="https" android:host="www.youtube.com" android:pathPrefix="/watch" />
<data android:scheme="http" android:host="youtube.com" android:pathPrefix="/watch" />
@teocci
teocci / ffmpeg_install_latest.md
Last active Jun 20, 2019
Easy way to convert MKV to MP4 with ffmpeg
View ffmpeg_install_latest.md

How to install FFmpeg on Ubuntu

FFmpeg is a free and open source command line tool for transcoding multimedia files. It contains a set of shared audio and video libraries such as: libavcodec, libavformat, and libavutil. With this tool, you can convert between various video and audio formats, set sample rates and resize videos.

In this document will show you how to install a stable version and the latest version of FFmpeg. This instructions apply for any Ubuntu based distribution, including Linux Mint and Elementary OS.

Prerequisites

In order to be able to add new repositories and install packages on your Ubuntu system, you must be logged in as a user with sudo privileges.

Installing FFmpeg 4.x on Ubuntu

View php-benchmark.md
Expression gettype() empty() is_null() isset() boolean : if($x)
$var = ''; string true false true false
$var = null; NULL true true false false
var $x; NULL true true false false
$var is undefined NULL true true false false
$var = array(); array true false true false
$var = false; bool true false true false
$var = true; bool false false true true
$var = 1; int false false true true
@teocci
teocci / php-nginx-install.md
Last active Jan 7, 2021
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 18.04
View php-nginx-install.md

Install NGINX

# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common

# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable

# Update packages after adding ppa
sudo apt-get update