Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Coding

Jorge Frisancho teocci

👨‍💻
Coding
View GitHub Profile
@teocci
teocci / MultipleDevicesOverTCP.md
Last active Apr 7, 2021
How to connect multiple Android devices with ADB over TCP
View MultipleDevicesOverTCP.md

#How to connect multiple Android devices with ADB over TCP

From your device, if it is rooted

According to a post on xda-developers, you can enable ADB over Wi-Fi from the device with the commands:

su
setprop service.adb.tcp.port 5555
stop adbd
start adbd
@teocci
teocci / compile_ffmpeg.md
Last active Apr 3, 2021
Compile FFmpeg on Ubuntu 16.04
View compile_ffmpeg.md

Compile FFmpeg on Ubuntu

This basic guide supports Ubuntu Xenial Xerus 16.04 and will enable several external encoding and decoding libraries: libfaac (AAC encoder), libfdk-aac (AAC encoder), libmp3lame (MP3 encoder), libopencore-amr (AMR encoder/decoder), librtmp (for additional RTMP protocols), libtheora (Theora encoder), libvorbis (Vorbis encoder), libvpx (VP8 encoder/decoder), and libx264 (H.264 encoder). These are optional and may be omitted if desired. This guide will also install many filters (see the filter list in the [Filtering Guide][1].

Note: Copy and paste the whole code box for each step.

Preparation

@teocci
teocci / AwesomeCourses.md
Last active Jan 28, 2021
List of awesome university courses for learning Computer Science!
View AwesomeCourses.md

Awesome Courses Awesome

Introduction

There is a lot of hidden treasure lying within university pages scattered across the internet. This list is an attempt to bring to light those awesome courses which make their high-quality material i.e. assignments, lectures, notes, readings & examinations available online for free.

Table of Contents

@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
@teocci
teocci / disable-bots.md
Created Dec 16, 2020
How to disable bots in specific channels
View disable-bots.md

How to disable bots in specific channels

See how the bot responds in a channel that shouldn't have bots?

After this tutorial you will know how to disable that!

Edit bot roles!

1. Open the server settings

View TuningNginx-BestPerformance.md

Tuning Nginx for Best Performance

This article is part 2 of a series about building a high-performance web cluster powerful enough to handle 3 million requests per second. For this part of the project, you can use any web server you like. I decided to use Nginx, because it’s lightweight, reliable, and fast.

Generally, a properly tuned Nginx server on Linux can handle 500,000 – 600,000 requests per second. My Nginx servers consistently handle 904k req/sec, and have sustained high loads like these for the ~12 hours that I tested them.

It’s important to know that everything listed here was used in a testing environment, and that you might actually want very different settings for your production servers.

Install the Nginx package from the EPEL repository.

View convert-image-to-byte.java
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
View StackoverflowCodeSnippets.md

Introducing Runnable JavaScript, CSS, and HTML Code Snippets

On Stack Overflow and our other code-related sites, creating a minimal, complete, and verifiable example is the best way to get an answer to your question. We’ve always loved JSFiddle and sites like it because they let both askers and answerers reference runnable, working code that demonstrates their problem or solution.

Unfortunately, the use of these external sites introduces a few problems:

  1. If the link breaks, the post becomes worthless.
  2. If the code isn’t embedded in the page, visitors are forced to go elsewhere to get the full content of the question or answer.
  3. Also, because the code isn’t a part of our post Markdown, changes to it don’t show up in the revision history.

The community voiced similar concerns around external sites, which eventually led us to block posts that contain links to JSFiddle and similar sites without a corresponding code block. This is an unnecessary burden for both askers and answerers.

@teocci
teocci / do-compile-ffmpeg.sh
Created Jul 13, 2017
FFmpeg iOS build script
View do-compile-ffmpeg.sh
#! /bin/sh
# This script is based on projects below
# https://github.com/kolyvan/kxmovie
# https://github.com/yixia/FFmpeg-Android
# http://git.videolan.org/?p=vlc-ports/android.git;a=summary
# https://github.com/kewlbear/FFmpeg-iOS-build-script/
#--------------------
echo "===================="
View convert-office-to-vl.cmd
@echo off
Title Converter Office 2016 Retail to Volume
echo Press Enter to start VL-Conversion...
echo.
pause
echo.
for /f "tokens=6 delims=[]. " %%G in ('ver') do set win=%%G