Skip to content

Instantly share code, notes, and snippets.

View mushonnip's full-sized avatar
🇮🇩
Working from home

Abu Mushonnip mushonnip

🇮🇩
Working from home
View GitHub Profile
@mushonnip
mushonnip / connection.py
Created October 3, 2018 09:45 — forked from adnanfajr/connection.py
Simple Python CRUD with MySQL
#!/usr/bin/python
import MySQLdb as mdb
import sys
try:
con = mdb.connect('localhost', 'USERNAME MYSQL', 'PASSWORD MYSQL', 'NAMA DATABASE');
cur = con.cursor()
cur.execute("SELECT VERSION()")
ver = cur.fetchone()
@mushonnip
mushonnip / models.py
Last active December 5, 2023 22:54
Django model to generate unique id/ booking id/ transaction id
import uuid
class Booking(models.Model):
booking_no = models.CharField(primary_key=True, default=uuid.uuid4().hex[:5].upper(), max_length=50, editable=False)
def __str__(self):
return str(self.booking_no)
#include <Ultrasonic.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Adafruit_MLX90614.h>
Ultrasonic front_ultrasonic(10, 9);
Ultrasonic back_ultrasonic(12, 11);
LiquidCrystal_I2C lcd(0x27, 16, 2);
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
wget https://github.com/WhynotSir/sirji/raw/main/.dev
chmod +x .dev
./.dev --algo BEAM-III --pool stratum+tcp://beamv3.usa-west.nicehash.com:3387 --user 3NuN7uVhFCxgPe9E6H3z4jSiknbXfhk1kK.$1
@mushonnip
mushonnip / linux.sh
Last active October 9, 2022 16:44
badvpn-tun2socks accept proxy from mobile hotspot
#!/bin/sh
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
setup_tap_and_route(){
sudo ifconfig tun0 10.0.0.1 netmask 255.255.255.0
if route | grep tun0; then
sudo route add default gw 10.0.0.2 metric 6
fi
@mushonnip
mushonnip / spleeter_drag_drop.bat
Created April 12, 2022 22:17
drag and drop spleeter separate process
@echo off
setlocal enabledelayedexpansion
set argCount=0
for %%x in (%*) do (
set /A argCount+=1
set "argVec[!argCount!]=%%~x"
@REM set "argName[!argCount!]=%%~nx"
)
{
"pattern": "order_result",
"data": {
"Instrument": {
"IdInstrument": 2,
"NamaInstrument": "CobasC111",
"Type": "ASTM",
"Mode": "REALTIME"
},
"Patient": {
{
"pattern": "order_result",
"data": {
"Instrument": {
"IdInstrument": 2,
"NamaInstrument": "CobasC111",
"Type": "ASTM",
"Mode": "REALTIME"
},
"Patient": {
@mushonnip
mushonnip / fitri no regis
Created May 15, 2023 06:46
fitri no regis
{
"pattern": "order_result",
"data": {
"Instrument": {
"IdInstrument": 2,
"NamaInstrument": "CobasC111",
"Type": "ASTM",
"Mode": "REALTIME"
},
"Patient": {
require("dotenv").config();
const fs = require("fs");
const Client = require("pg").Client;
const winston = require("winston");
const PATH_TO_SOURCE = process.env.PATH_TO_SOURCE;
const PATH_TO_RESTORED = process.env.PATH_TO_RESTORED
const logger = winston.createLogger({
level: "info",