Skip to content

Instantly share code, notes, and snippets.

@natelandau
natelandau / .bash_profile
Last active August 24, 2024 14:09
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@xkr47
xkr47 / letsencrypt-jetty.sh
Last active June 26, 2024 09:03
How to use Letsencrypt certificate & private key with Jetty
# input: fullchain.pem and privkey.pem as generated by the "letsencrypt-auto" script when run with
# the "auth" aka "certonly" subcommand
# convert certificate chain + private key to the PKCS#12 file format
openssl pkcs12 -export -out keystore.pkcs12 -in fullchain.pem -inkey privkey.pem
# convert PKCS#12 file into Java keystore format
keytool -importkeystore -srckeystore keystore.pkcs12 -srcstoretype PKCS12 -destkeystore keystore.jks
# don't need the PKCS#12 file anymore
@raiym
raiym / DeviceAdminInteractor.java
Last active February 21, 2023 07:54
Activate KNOX Standard SDK Demo
public class DeviceAdminInteractor {
private static final String LOG_TAG = DeviceAdminInteractor.class.getName();
// Can be dev and production key
private static final String ELM_LICENSE_KEY
= "SECRETKEY";
public ComponentName componentName;
private DevicePolicyManager devicePolicyManager;
/**
* Samsung KNOX Standard SDK related variables
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active July 14, 2024 19:55
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@carloseduardosx
carloseduardosx / AutoIncrementEntity.java
Last active January 18, 2021 05:36
RealmAutoIncrement is a singleton which maintain the last id saved from each database model
package com.carloseduardo.model;
import com.carloseduardo.constants.KnownClasses;
import com.carloseduardo.exception.UnknownModelException;
import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
import io.realm.annotations.Required;
/**
@contolini
contolini / beginners-guide.md
Last active August 2, 2021 21:01
Beginner's guide to IoT (Internet of Things) and the ESP8266

Beginner's guide to building IoT devices

The gist

Ever heard of an Arduino? It's a $35 microcontroller that lets you write code that interacts with motors and lights and IRL stuff. Well, there's a $2 version that has all the same features and is the size of a postage stamp. It's call the ESP8266.

The ESP8266

ESP8266 is an inexpensive wifi-enabled SoC made by the company Espressif. It was released in 2014 with very little documentation but its low cost motivated hardware hackers around the world to explore and document the module. Online communities formed to discuss the chip and how to build with it.

@stkent
stkent / android-bluetooth-low-energy-resources.md
Last active August 1, 2024 08:47
Android Bluetooth Low Energy (BLE) Resources
@fredy-mederos
fredy-mederos / KoinJavaUtils.kt
Created March 27, 2018 19:00
Koin java utility functions to inject components and properties in java classes.
package com.common.utils
import org.koin.KoinContext
import org.koin.standalone.StandAloneContext
import kotlin.jvm.internal.Reflection
/**
* @author @fredy_mederos
*/
@excid3
excid3 / dynamic-nginx-module-ubuntu-18.04.sh
Created June 20, 2018 17:58
How to compile a dynamic nginx module for Ubuntu 18.04
# Install dependencies that nginx was originally compiled with
sudo apt install libperl-dev libgeoip-dev libgd-dev
# Get the nginx source
wget https://nginx.org/download/nginx-1.14.0.tar.gz
tar zxf nginx-1.14.0.tar.gz
# Get the module source
wget https://github.com/fdintino/nginx-upload-module/archive/master.zip
unzip master.zip
@runo280
runo280 / 00readme.md
Last active September 29, 2020 11:36
Download script for C@ster.i0 free courses

How to use

1- Install requirements

This command is for Ubuntu based distros

sudo apt install aria2 youtube-dl

2- Make [course_name].sh file excutable:

chmod +x [course_name].sh