Skip to content

Instantly share code, notes, and snippets.

View fajarlabs's full-sized avatar
💭
loved technology & learn anything

Fajar Rizki Dwi Prasetya fajarlabs

💭
loved technology & learn anything
View GitHub Profile
@fajarlabs
fajarlabs / readme.txt
Created April 16, 2021 08:03
Raspberry RTL-AIS
# ========================================================================================|
# INSTALL_USB_DONGLE_RTL
# ========================================================================================|
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git git-core cmake libusb-1.0-0-dev build-essential lsof
install the RTL-2832U USB dongle driver
git clone https://git.osmocom.org/rtl-sdr
@fajarlabs
fajarlabs / blynk_configurable.ino
Created March 13, 2021 17:43
Blynk configurable
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include <WiFiManager.h>
#include <EEPROM.h>
#include <BlynkSimpleEsp8266.h>
WiFiManager wifiManager;
/* Secret Door Knock Detecting Door Lock
Originally from Steve Hoefer http://grathio.com Version 0.1.10.20.10
Updates by Lee Sonko
Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0
http://creativecommons.org/licenses/by-nc-sa/3.0/us/
(In short: Do what you want, just be sure to include this line and the four above it, and don't sell it or use it in anything you sell without contacting me.)
Analog Pin 0: Piezo speaker (connected to ground with 1M pulldown resistor)
Digital Pin 2: Switch to enter a new code. Short this to enter programming mode.
@fajarlabs
fajarlabs / client.js
Created September 28, 2020 08:54 — forked from crtr0/client.js
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@fajarlabs
fajarlabs / Vigenere.js
Created September 3, 2020 04:34
Sample Javascript
// sandi vigene chiper
// teori dasar https://id.wikipedia.org/wiki/Sandi_Vigen%C3%A8re
function ord(string) {
var str = string + '',
code = str.charCodeAt(0);
if (0xD800 <= code && code <= 0xDBFF) {
var hi = code;
if (str.length === 1) {
return code;
@fajarlabs
fajarlabs / Vigenere.py
Created September 3, 2020 04:34
Sample Python Script
# sandi vigene chiper
# teori dasar https://id.wikipedia.org/wiki/Sandi_Vigen%C3%A8re
def encode(key, string):
encoded_chars = []
for i in range(len(string)):
key_c = key[i % len(key)]
encoded_c = chr(ord(string[i]) + ord(key_c) % 256)
encoded_chars.append(encoded_c)
encoded_string = ''.join(encoded_chars)
@fajarlabs
fajarlabs / vigenere.php
Created September 3, 2020 04:33
Sample PHP Script
<?php
// sandi vigene chiper
// teori dasar https://id.wikipedia.org/wiki/Sandi_Vigen%C3%A8re
function encode($key, $string) {
$encoded_chars = array();
$i = 0;
foreach(str_split($string) as $c){
$key_c = $key[$i % strlen($key)];
@fajarlabs
fajarlabs / vigenere-cipher.py
Created September 1, 2020 09:38 — forked from gowhari/vigenere-cipher.py
vigenere cipher
# encoding: utf8
# vigenere cipher
# https://stackoverflow.com/a/2490718/1675586
def encode(key, string):
encoded_chars = []
for i in range(len(string)):
key_c = key[i % len(key)]
encoded_c = chr(ord(string[i]) + ord(key_c) % 256)
encoded_chars.append(encoded_c)
@fajarlabs
fajarlabs / goto.latlon.openlayer4
Last active August 12, 2020 18:37
GO TO Latlon marker
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/openlayers/4.3.2/ol.css" type="text/css">
@fajarlabs
fajarlabs / generate_latlon_to_polygon_geojson.js
Created August 8, 2020 09:19
Generate lat-lon to polygon geojson and output file csv
// CONVERTER POINT TO POLYGON SECARA KODINGAN
// const util = require('util')
// function createGeoJSONCircle(center, radiusInKm = 1, parentId = 0, points = 64) {
// const coords = {
// latitude: center[1],
// longitude: center[0],
// };