Skip to content

Instantly share code, notes, and snippets.

View hurelhuyag's full-sized avatar
🇲🇳
Keep moving forward

Khurelkhuyag hurelhuyag

🇲🇳
Keep moving forward
View GitHub Profile
@hurelhuyag
hurelhuyag / SIM900_Chatscript
Created March 7, 2024 12:06 — forked from me-no-dev/SIM900_Chatscript
PPP connection settings for Linux and SIM900
#save as /etc/chatscripts/sim900
ABORT "BUSY"
ABORT "VOICE"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "NO DIAL TONE"
ABORT "NO ANSWER"
ABORT "DELAYED"
REPORT "CONNECT"
TIMEOUT 6
@hurelhuyag
hurelhuyag / fail2ban_drop_ip_addresses.txt
Created June 20, 2023 01:53
brute force ip addresses
1.0.171.2
1.0.243.9
1.116.135.59
1.116.61.245
1.117.65.89
1.117.88.161
1.12.229.48
1.12.243.193
1.12.60.77
1.13.175.120
@hurelhuyag
hurelhuyag / HttpsUrlConnectionExample.java
Last active April 11, 2022 09:24
Two-Way SSL or Mutual SSL or Mutual Authentication Java Demo
import javax.net.ssl.*;
import java.io.*;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.*;
import java.util.Base64;
public class HttpsUrlConnectionExample {
/**
@hurelhuyag
hurelhuyag / EnclosedFrameDecoder.java
Created May 25, 2021 08:40
netty enclosed frame decoder
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ByteToMessageDecoder;
import java.util.List;
public class EnclosedFrameDecoder extends ByteToMessageDecoder {
@hurelhuyag
hurelhuyag / routeros_address_list_update.sh
Last active September 7, 2020 03:36
RouterOS address-list updater
#!/bin/bash
#echo -n Password /[email protected]/ :
#read -s password
password="{Enter Your Password Here or Enable above 2 line}"
ip_bits(){
z=$1;
a=$(echo "l($z)/l(2)" | bc -l | awk '{print int($1)}');
@hurelhuyag
hurelhuyag / add_record.http
Created August 13, 2020 03:23
godaddy domain API
PATCH https://api.godaddy.com/v1/domains/{domain}/records
Accept: application/json
Content-Type: application/json
Authorization: sso-key key:secret
[{"data": "{value}", "name": "{subDomain}", "ttl": 600, "type": "TXT"}]
@hurelhuyag
hurelhuyag / maven_plugin.xml
Created May 27, 2020 01:54
Web developing with SSL enabled tomcat server
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>keytool-maven-plugin</artifactId>
<version>1.5</version>
<configuration>
<workingDirectory>${user.home}</workingDirectory>
<alias>tomcat</alias>
<keyalg>RSA</keyalg>
<dname>CN=SS, OU=Demo, O=SS, L=UB, ST=SS, C=MN</dname>
<storepass>123456</storepass>
@hurelhuyag
hurelhuyag / Main.java
Last active August 6, 2022 19:22
Bixolon printer using from java
package net.hh.bixolondemo2;
import jpos.JposException;
import jpos.POSPrinter;
import jpos.POSPrinterConst;
import jpos.events.StatusUpdateEvent;
import jpos.events.StatusUpdateListener;
import javax.swing.*;
import java.io.IOException;
@hurelhuyag
hurelhuyag / hdd_bench.log
Created December 20, 2019 12:33
hdd_vs_ssd_vs_cached_hdd
Jobs: 1 (f=1): [_(5),w(1)][61.7%][r=0KiB/s,w=0KiB/s][r=0,w=0 IOPS][eta 01h:04m:36s]
Seqread: (groupid=0, jobs=1): err= 0: pid=3334: Fri Dec 20 20:30:30 2019
read: IOPS=125, BW=125MiB/s (132MB/s)(5000MiB/39841msec)
slat (usec): min=35, max=782, avg=154.22, stdev=27.76
clat (msec): min=2, max=421, avg= 7.81, stdev= 8.56
lat (msec): min=2, max=421, avg= 7.96, stdev= 8.56
clat percentiles (msec):
| 1.00th=[ 6], 5.00th=[ 6], 10.00th=[ 7], 20.00th=[ 7],
| 30.00th=[ 7], 40.00th=[ 7], 50.00th=[ 8], 60.00th=[ 8],
| 70.00th=[ 8], 80.00th=[ 8], 90.00th=[ 8], 95.00th=[ 8],
@hurelhuyag
hurelhuyag / fb_group_pending_post_cleaner.js
Created October 16, 2019 12:03
fb_group_pending_post_cleaner.js
(function () {
setInterval(function(){
window.scrollBy(0, 100);
}, 1850);
function delConfirm() {
var el = $('button.layerConfirm');
if (el.length) {
console.log('confirm:', el);