Skip to content

Instantly share code, notes, and snippets.

@mizanRahman
mizanRahman / update_version.py
Last active February 22, 2024 14:17
Automated PR creation
from github import Github
import re
import time
TOKEN = "ghp_..."
dependencies = [
["vehicle-api.version" ,"1.0.2-8177-0927ca8" ]
]
@mizanRahman
mizanRahman / LoggerDemo.cs
Last active March 7, 2023 07:32
Logging with log4net. Colored Console Logging and File Logging demonstrated.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;
using log4net.Config;
namespace LogForNetTest
{
@mizanRahman
mizanRahman / burgerbot.rb
Created August 16, 2021 12:03 — forked from daxadax/burgerbot.rb
burgerbot
#!/usr/bin/env ruby
# modified from https://gist.github.com/pbock/3ab260f3862c350e6b5f #
require 'watir-webdriver'
class BurgerBot
def initialize
@attempt_count = 0
@mizanRahman
mizanRahman / Rakefile-Snippet-commit-deploy
Created June 13, 2013 19:42
rake task for git commit and deploy
###
### Rake tasks for git commit and deploy
###
##use it if you want commit only -no pushing
desc "Task description"
task :commit, :message do |t, args|
message = args.message
if message==nil
message = "Source updated at #{Time.now}."
end
@mizanRahman
mizanRahman / 99-network-tuning.conf
Last active August 25, 2020 21:03 — forked from hrchu/99-network-tuning.conf
Linux Web Server Kernel Tuning
# Configuration file for runtime kernel parameters.
# See sysctl.conf(5) for more information.
# See also http://www.nateware.com/linux-network-tuning-for-2013.html for
# an explanation about some of these parameters, and instructions for
# a few other tweaks outside this file.
# See evil packets in your logs.
net.ipv4.conf.all.log_martians = 1
source ~/.vim_runtime/vundle_plugins
set runtimepath+=~/.vim_runtime
set number
set relativenumber
source ~/.vim_runtime/vimrcs/basic.vim
source ~/.vim_runtime/vimrcs/filetypes.vim
@mizanRahman
mizanRahman / one-liners.md
Last active September 15, 2018 21:00
one liner scripts

kill process by port. can be defined as an alias

lsof -i :8080 | awk '{l=$2} END {print l}' | xargs kill

Output an arbitrary number of open TCP or UDP ports in an arbitrary range

comm -23 <(seq "$FROM" "$TO") <(ss -tan | awk '{print $4}' | cut -d':' -f2 | grep "[0-9]\{1,5\}" | sort | uniq) | shuf | head -n "$HOWMANY"
package com.example.kpcat;
import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
import org.jasypt.encryption.StringEncryptor;
import org.jasypt.encryption.pbe.PooledPBEStringEncryptor;
import org.jasypt.encryption.pbe.config.SimpleStringPBEConfig;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
public class UniqueRandomNumberGeneratorImplV2 implements UniqueRandomNumberGenerator {
private SecureRandom random;
@Autowired
public UniqueRandomNumberGeneratorImplV2(SecureRandom random) {
this.random = random;
}
@Override
import requests
services = (
("http://httpbin.org/get", 'POST'),
("http://httpbin.org/get", 'POST'),
("http://httpbin.org/get", 'POST'),
("http://httpbin.org/get", 'POST'),
("http://httpbin.org/get", 'POST'),
("http://httpbin.org/get", 'POST')
)