Skip to content

Instantly share code, notes, and snippets.

View SonPatrick's full-sized avatar
⚔️
𝙸 𝙰𝙼 𝚃𝙷𝙴 𝙴𝙳𝙶𝙴

Patrick Son SonPatrick

⚔️
𝙸 𝙰𝙼 𝚃𝙷𝙴 𝙴𝙳𝙶𝙴
View GitHub Profile
@SonPatrick
SonPatrick / ubuntu14.04-command-line-install-android-sdk
Created January 22, 2019 20:47 — forked from shark0der/ubuntu14.04-command-line-install-android-sdk
Ubuntu 14.04 command line install android sdk (platform & platform-tools only, no emulator)
# install java
apt-get install -y software-properties-common
apt-add-repository -y ppa:webupd8team/java
apt-get update
apt-get install -y oracle-java8-installer
# download latest android sdk
# http://developer.android.com/sdk/index.html#Other
cd /opt
wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz
@SonPatrick
SonPatrick / PushNotifications.php
Created February 28, 2019 17:36 — forked from joashp/PushNotifications.php
Simple PHP script to send Android Push Notification, iOS Push Notification and Windows Phone 8 Push Notification
<?php
// Server file
class PushNotifications {
// (Android)API access key from Google API's Console.
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI';
// (iOS) Private key's passphrase.
private static $passphrase = 'joashp';
// (Windows Phone 8) The name of our push channel.
private static $channelName = "joashp";
@SonPatrick
SonPatrick / gist:44621b20c50f253e9862cc44d7eb8b0f
Created February 28, 2019 17:37 — forked from prime31/gist:5675017
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
@SonPatrick
SonPatrick / AESenc.java
Created April 9, 2019 20:59 — forked from SimoneStefani/AESenc.java
Example of AES encryption and decryption in Java
/**
* Code written by P. Gajland
* https://github.com/GaPhil
*
* IMPORTANT:
* This code is for educational and demonstrative purpose only.
* If you need to do serious encryption for "production" it is
* recommended to investigate more traditional libraries and
* gain some specific knowledge on cryptography and security.
*/
client=setupApollo()
client.query(FindQuery //From the auto generated class
.builder()
.name(repo_name_edittext.text.toString()) //Passing required arguments
.owner(owner_name_edittext.text.toString()) //Passing required arguments
.build())
.enqueue(object : ApolloCall.Callback<FindQuery.Data>() {
override fun onFailure(e: ApolloException) {
Log.info(e.message.toString())
}
@SonPatrick
SonPatrick / markovChainsNames.java
Created November 30, 2019 03:37 — forked from kunalchandan/markovChainsNames.java
Markov chains name generator complete class file.
import java.io.*;
import java.util.*;
public class markovChainsNames {
static ArrayList<String> names = new ArrayList<String>();
static ArrayList<Integer> ncounts = new ArrayList<Integer>();
static ArrayList<Integer> nlens = new ArrayList<Integer>();
static int alphaLen = 27;
#!/bin/bash
# This will remove Apache
sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin
sudo apt remove apache2.*
sudo apt-get autoremove
whereis apache2
sudo rm -rf /etc/apache2
@SonPatrick
SonPatrick / git-deployment.md
Created March 17, 2022 17:52 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@SonPatrick
SonPatrick / schedule.go
Created June 10, 2022 21:51 — forked from WesleiRamos/schedule.go
A simple match schedule algorithm
package main
import "fmt"
func main() {
times := []string{"Corinthians", "Londrina", "Operário", "Leicester"}
calendario := [][][]string{}
lenTimes := len(times)
lenTimes2 := lenTimes / 2
@SonPatrick
SonPatrick / how-to-install-openssl-1.1.1-on-centos-7.md
Created October 20, 2022 19:23
How to install openssl 1.1.1 on CentOS 7

How To Install OpenSSL 1.1.1 on CentOS 7

This tutorial goes through how to install openssl 1.1.1 on CentOS 7, since the yum repo only installs up to openssl 1.0.

Requirements

Upgrade the system

yum -y update