Skip to content

Instantly share code, notes, and snippets.

View GLinBoy's full-sized avatar
🎱
O(≧∇≦)O

Hojjat Abedi GLinBoy

🎱
O(≧∇≦)O
View GitHub Profile
@GLinBoy
GLinBoy / JVM Arguments.txt
Created November 8, 2023 19:27
This gist contains my personal JVM arguments that I use to run my Java application for development
-XX:+UseZGC
-Xlog:gc*:file=log/kravatar.gc.log
-XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=log/crashes/kravatar.hprof
-Xss256k
-Dsun.net.client.defaultConnectTimeout=2000
-Dsun.net.client.defaultReadTimeout=2000

There are a simple shell script to setup a minkube cluster by a profile name.

@GLinBoy
GLinBoy / check_file_urls.py
Created June 7, 2022 14:39
A simple python 3 script to find URLs in a text file, replace file extention and test it is still valid
import re
import urllib.request
import urllib.error
with open('file.json') as f:
urls = f.read()
links = re.findall('"((http)s?://.*?)"', urls)
failed_counter = 0
@GLinBoy
GLinBoy / SpringToolSuite4.ini
Last active October 29, 2022 12:18
Spring Tools Configuration
-startup
../Eclipse/plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar
--launcher.library
../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.2.500.v20220509-0833
-vm
../Eclipse/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.macosx.x86_64_17.0.3.v20220515-1416/jre/lib/libjli.dylib
-product
org.springframework.boot.ide.branding.sts4
--launcher.defaultAction
openFile
@GLinBoy
GLinBoy / TestNativeQueryToListJson.java
Created August 12, 2021 18:39 — forked from baxtheman/TestNativeQueryToListJson.java
Java JPA Native Query using Tuple and return List of Jackson JSON Object
/*
Needs Hibernate 5.2.11.Final
*/
public List<ObjectNode> getQuery(
Integer anno,
Integer settimana) {
Query q = em.createNativeQuery(
"NATIVE SQL....",Tuple.class);
@GLinBoy
GLinBoy / KeycloakService.java
Created February 27, 2020 03:08
How to compile Java project into a single JAR file including library for keycloak admin clinet
import lombok.extern.log4j.Log4j2;
import org.keycloak.OAuth2Constants;
import org.keycloak.admin.client.Keycloak;
import org.keycloak.admin.client.KeycloakBuilder;
import org.keycloak.admin.client.resource.RealmResource;
import org.keycloak.admin.client.resource.UsersResource;
import org.keycloak.representations.idm.CredentialRepresentation;
import org.keycloak.representations.idm.UserRepresentation;
import javax.ws.rs.core.Response;
@GLinBoy
GLinBoy / web-servers.md
Created April 21, 2019 13:40 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@GLinBoy
GLinBoy / 404.html
Last active January 10, 2019 09:11
404 Page Not find Matrix style
<!DOCTYPE html>
<html lang=en>
<head>
<meta content="text/html;charset=utf-8"http-equiv=Content-Type>
<title>001101000011000000110100</title>
<script src=http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js></script>
<style>html{height:100%}#main{background-color:#000;width:100%;height:100%;position:relative;padding:0;margin:0 auto;font-family:font-family: Courier New,Courier,Lucida Sans Typewriter,Lucida Typewriter,monospace}.q canvas{position:absolute;z-index:1}#contents,#contents pre{padding:0;width:100%;height:30%;left:0;top:20%;position:absolute;margin:0;z-index:2;vertical-align:middle;text-align:center;font-weight:bolder;text-shadow:0 0 .2em #fff;color:#0F0}div{height:100%;width:100%;display:table;text-align:center;z-index:0}</style>
<!-- Original script by Arunkumar Gudelli http://www.arungudelli.com/html5/matrix-effect-using-html5-and-javascript/ --><script>$(document).ready(function(){function t(){"undefined"!=typeof Game_Interval&&clearInterval(Game_Interv
@GLinBoy
GLinBoy / gist:0a4170ffbccfcf507b258ac716c02103
Created October 7, 2018 11:15 — forked from sartak/a.md
Anki 2 annotated schema
-- see https://github.com/ankidroid/Anki-Android/wiki/Database-Structure for a more maintained version of this
-- cards are what you review. easy!
CREATE TABLE cards (
id integer primary key,
-- the epoch milliseconds of when the card was created
nid integer not null,
-- notes.id
did integer not null,
-- deck id (available in col table)

Rename Files With MD5

I play with linux bash and in a micro seconds i do a BIG MISTAKE!!! I depressed and thought of missing my files :'( BUT WAITING I CAN USE PYTHON for recovery my file name and fix this mistake :P So i write this program and publish result for another users that may be need something like this :)

How It Work?

Fill original_files.md5.csv with original file name and file MD5; Then generate hashed_files.md5.csv with anything that yu can. note: I use md5sum * > md5.txt bash command in Linux Mint 18.1 Then, replace folder variable in rename_files function.