Skip to content

Instantly share code, notes, and snippets.

View wuriyanto48's full-sized avatar

wuriyanto wuriyanto48

View GitHub Profile
@wuriyanto48
wuriyanto48 / main.go
Created July 14, 2024 18:27
Golang Authenticator Time Based (you can use it with Authenticator App. Eg: Google Authenticator)
package main
import (
"encoding/base64"
"fmt"
"time"
"github.com/skip2/go-qrcode"
"github.com/xlzd/gotp"
)
@wuriyanto48
wuriyanto48 / email.txt
Created July 9, 2024 15:10
send email command line
From: "User Name" <noreply@your-smtp-server.co>
To: "John Smith" <to-who@yahoo.com>
Subject: This is a test
Hi John,
I’m sending this mail with curl thru my gmail account.
Bye!
@wuriyanto48
wuriyanto48 / index.html
Last active June 26, 2024 17:04
Bezier Curves in Javascript
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<canvas id="myCanvas" width="800" height="400" style="border:1px solid #000000;">
Your browser does not support the HTML canvas tag.
</canvas>
@wuriyanto48
wuriyanto48 / index.html
Created June 20, 2024 09:08
jquery: auto complete
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.3/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script src="https://code.jquery.com/ui/1.13.3/jquery-ui.js"></script>
<script>
@wuriyanto48
wuriyanto48 / minio.conf
Created March 21, 2024 17:11
minio nginx conf
server {
listen 443 ssl;
server_name storage.mydomain.co;
# ssl
ssl_certificate /home/ubuntu/ssl/storage.mydomain.co/server.crt;
ssl_certificate_key /home/ubuntu/ssl/storage.mydomain.co/server.key;
# To allow special characters in headers
ignore_invalid_headers off;
@wuriyanto48
wuriyanto48 / README.md
Created February 7, 2024 18:34
sudo: no valid sudoers sources found, quitting

You can bind the /etc volume into docker like that:

docker run -it --rm -v /etc:/etc_host ubuntu bash

You gained root access. Then you can change the permissions of /etc_host/sudoers to 777:

chmod 777 /etc_host/sudoers
@wuriyanto48
wuriyanto48 / a.md
Created January 6, 2024 12:15
install pytorch

Install pytorch CPU only

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu

Install pytorch GPU

pip3 install torch torchvision torchaudio
@wuriyanto48
wuriyanto48 / main.py
Created November 30, 2023 13:50
(Python) Gitlab REST API get commit by user
import requests
import ujson as json
header ={
'PRIVATE-TOKEN': 'your_token'
}
def get_commits_by_user(project_id, email, since, until, branch):
json_loads_of_commit = []
params = {
"since": since,
@wuriyanto48
wuriyanto48 / main.go
Created November 30, 2023 13:44
Google Text To Speech
package main
import (
"fmt"
"io"
"net/http"
"net/url"
"os"
)
@wuriyanto48
wuriyanto48 / main.js
Last active November 15, 2023 06:36
convert JSON to .env file
const readline = require('readline');
const fs = require('fs');
const path = require('path');
// this function will convert json file to .env
// USAGE:
// => node ./scripts/json_to_env.js env.json
function main() {
const args = process.argv;
if (args.length <= 2) {