Skip to content

Instantly share code, notes, and snippets.

View Anubisss's full-sized avatar
🔥
lit

anuka Anubisss

🔥
lit
View GitHub Profile
@Anubisss
Anubisss / HOWTO.md
Last active August 13, 2021 09:10
How to create SSL certificate for localhost development on macOS

How to create SSL certificate for localhost development on macOS

  1. Generate the private key and the certificate
openssl req -x509 -out localhost.crt -keyout localhost.key \
  -newkey rsa:2048 -nodes -sha256 \
  -subj '/CN=localhost' -extensions EXT -config <( \
  printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
  1. Make the OS to trust this certificate
@Anubisss
Anubisss / es6proxy.js
Last active April 2, 2019 09:49
simple ES6 proxy
new Proxy(fasz, {
get(target, name) {
if (typeof target[name] === 'function') {
return function(...params) {
console.log('FUNCTION CALL', params);
return target[name](...params);
};
}
if (target[name] === undefined) {
console.log(`UNDEFINED PROPERTY/FUNCTION: ${name}`);
@Anubisss
Anubisss / README.md
Last active March 13, 2024 10:04
How to compile statically linked OpenVPN client for ARMv5

How to compile statically linked OpenVPN client for ARMv5

You need to install ARMv5 gcc cross compiler: apt-get install gcc-arm-linux-gnueabi

You have to define a directory (via --prefix) where all of your binaries will be installed (copied). In the guide I use the following: /home/user/vpn_compile

OpenSSL

  1. Download the source: wget https://www.openssl.org/source/openssl-1.0.2j.tar.gz
@Anubisss
Anubisss / Gruntfile.js
Created September 18, 2015 10:26
Gruntfile which deploys to AWS S3 and Azure Storage. It converts the LESS code to CSS, minifies it, change values (config) in the JavaScript Angular app and in HTML files also, concatenate and minifies the JavaScript files, minifies the HTML files, prepends the CDN URL into the HTML files.
'use strict';
module.exports = function(grunt) {
var appConfig = {
// The app directory: location of the client-side code.
app: 'app',
// The style directory: location of CSS and LESS files, the code of the style.
style: 'style',
// The build directory: location of the production ready (deployable) app.
@Anubisss
Anubisss / gist:8125260
Created December 25, 2013 17:46
Multiplexing three seven-segment TIL309 red LED displays with a MSP430 microcontroller. Counts from -99 to 999. Video: http://youtu.be/sDOHmbwP8FU
#include <msp430.h>
#define DISPLAY1 BIT4
#define DISPLAY2 BIT5
#define DISPLAY3 BIT6
#define DISPLAY_ALL DISPLAY1 | DISPLAY2 | DISPLAY3
#define LATCH_MINUS 0x0B // minus (-) on the LED display
@Anubisss
Anubisss / gist:8118688
Created December 24, 2013 23:12
Testing a seven-segment TIL309 red LED display with a MSP430 microcontroller
//#include <msp430g2553.h>
#include <msp430.h>
int main()
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P1DIR = BIT1 | BIT2 | BIT3 | BIT4 | BIT5; // make port 1.1-1.5 to output
unsigned char c = 0x00;
while (1)