Skip to content

Instantly share code, notes, and snippets.

View wuriyanto48's full-sized avatar

wuriyanto wuriyanto48

View GitHub Profile
@wuriyanto48
wuriyanto48 / README.md
Created February 3, 2023 15:20
Elasticsearch: Max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]: Windows
> wsl -d docker-desktop
> sysctl -w vm.max_map_count=262144
@wuriyanto48
wuriyanto48 / main.go
Last active February 3, 2023 20:37
Golang time to words
package main
import (
"errors"
"fmt"
"math"
"time"
)
func main() {
@wuriyanto48
wuriyanto48 / index.js
Created January 12, 2023 14:46
RSA | convert multiline RSA Private and Public key to oneline
const readline = require('readline');
const fs = require('fs');
const path = require('path');
function main() {
const args = process.argv;
if (args.length <= 2) {
console.log('required pem file argument');
process.exit(1);
}
@wuriyanto48
wuriyanto48 / index.js
Created December 5, 2022 07:57
axios custom httpAgent with root certificate
const https = require('https');
const axios = require('axios');
const fs = require('fs');
const httpsAgent = new https.Agent({
requestCert: true,
rejectUnauthorized: true,
ca: [fs.readFileSync('./root_cert.pem')],
// cert: [fs.readFileSync('./cert.pem')]
});
@wuriyanto48
wuriyanto48 / docker-compose.yml
Created November 10, 2022 05:23
Bull Nodejs example
version: '3'
services:
redis:
image: "redis:3.0-alpine"
command: redis-server --requirepass devpass
volumes:
- "./volumes/redis:/data"
ports:
- "6379:6379"
@wuriyanto48
wuriyanto48 / firebase-messaging-sw.js
Created September 30, 2022 13:32 — forked from loicginoux/firebase-messaging-sw.js
Adding FCM to an html page to receive notifications and sending then via FCM ruby gem. (edit: HTTPS needed!)
// [START initialize_firebase_in_sw]
// Give the service worker access to Firebase Messaging.
// Note that you can only use Firebase Messaging here, other Firebase libraries
// are not available in the service worker.
importScripts('https://www.gstatic.com/firebasejs/3.5.2/firebase-app.js');
importScripts('https://www.gstatic.com/firebasejs/3.5.2/firebase-messaging.js');
// Initialize the Firebase app in the service worker by passing in the
// messagingSenderId.
firebase.initializeApp({
@wuriyanto48
wuriyanto48 / main.go
Created September 17, 2022 07:26
(Golang) Date of Birth simple Serialization with bitwise
// wuriyanto 2022
package main
import "fmt"
func main() {
var year uint32 = 1990
var month uint32 = 10
var day uint32 = 13
@wuriyanto48
wuriyanto48 / notest.md
Last active August 21, 2022 11:27
Mysql Column Level Encryption with AES
@wuriyanto48
wuriyanto48 / notest.md
Last active August 21, 2022 11:27
Postgresql Column Level Symmetric Encryption with PGCRYPTO
@wuriyanto48
wuriyanto48 / index.js
Last active September 20, 2022 08:25
Nodejs: Fetch Google Analytic data with googleapi module
const { google } = require('googleapis');
const fs = require('fs');
const analyticsreporting = google.analyticsreporting('v4');
const setAuth = () => {
// Obtain user credentials to use for the request
const auth = new google.auth.GoogleAuth({
keyFile: 'your_service_account.json',
scopes: ['https://www.googleapis.com/auth/analytics']