Skip to content

Instantly share code, notes, and snippets.

View duyng2512's full-sized avatar
♥️
Focusing

duyntc duyng2512

♥️
Focusing
  • Viet Nam
View GitHub Profile
@duyng2512
duyng2512 / EventLoop.java
Last active October 8, 2022 15:23
Event Loop Implementation
/*
Java implementation of Event Loop
Event Loop contain:
- List of event
- List of handler corresponding to each event data
*/
public final class EventLoop {
@byt3bl33d3r
byt3bl33d3r / log4j_rce_check.py
Created December 10, 2021 06:02
Python script to detect if an HTTP server is potentially vulnerable to the log4j 0day RCE (https://www.lunasec.io/docs/blog/log4j-zero-day/)
#! /usr/bin/env python3
'''
Needs Requests (pip3 install requests)
Author: Marcello Salvati, Twitter: @byt3bl33d3r
License: DWTFUWANTWTL (Do What Ever the Fuck You Want With This License)
This should allow you to detect if something is potentially exploitable to the log4j 0day dropped on December 9th 2021.
@eamirgh
eamirgh / gist:650f86393b1826dd5c5e5fc68dd5f06e
Last active November 28, 2023 16:34
RESET Goland Evaluation period LINUX
rm -rf ~/.config/JetBrains/GoLand2021.3/eval
rm -rf ~/.config/JetBrains/GoLand2021.3/options/other.xml
touch ~/.config/JetBrains/GoLand2021.3/options/other.xml
sed -i -E 's/<property name=\"evl.*\".*\/>//' ~/.config/JetBrains/GoLand2021.3/options/other.xml
rm -rf ~/.java/.userPrefs/jetbrains/goland
@onlurking
onlurking / Ruby and Rails Study Roadmap.md
Created February 25, 2019 23:58
Ruby and Rails Study Roadmap
@prod3v3loper
prod3v3loper / README.md
Last active June 12, 2022 05:55
ApacheBench AB Benchmark Testing

Apache Benchmark AB

Test your website and find out how it reacts if Surf 100 users at the same time and load your webpage with 10 requests each.

Information

-n requests

Number of requests to perform for the benchmarking session. The default is to just perform a single request which usually leads to non-representative benchmarking results.

MongoClientSettings expected = MongoClientSettings.builder()
.applyToClusterSettings(new Block<ClusterSettings.Builder>() {
@Override
void apply(final ClusterSettings.Builder builder) {
builder.hosts([new ServerAddress('host1', 1), new ServerAddress('host2', 2)])
.mode(ClusterConnectionMode.MULTIPLE)
.requiredReplicaSetName('test')
.serverSelectionTimeout(25000, TimeUnit.MILLISECONDS)
.maxWaitQueueSize(10 * 7) // maxPoolSize * waitQueueMultiple
.localThreshold(30, TimeUnit.MILLISECONDS)
@fchollet
fchollet / classifier_from_little_data_script_1.py
Last active May 15, 2024 07:19
Updated to the Keras 2.0 API.
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
@yoavram
yoavram / sklearn_cali_housing_lasso.py
Last active July 19, 2021 19:03
Run Lasso Regression with CV to find alpha on the California Housing dataset using Scikit-Learn
import matplotlib.pyplot as plt
import numpy as np
import sklearn.datasets
import sklearn.cross_validation as cv
from sklearn import linear_model
dataset = sklearn.datasets.fetch_california_housing()
X = dataset['data']
y = dataset['target']
@kastnerkyle
kastnerkyle / painless_q.py
Last active August 18, 2023 09:32
Painless Q-Learning Tutorial implementation in Python http://mnemstudio.org/path-finding-q-learning-tutorial.htm
# Author: Kyle Kastner
# License: BSD 3-Clause
# Implementing http://mnemstudio.org/path-finding-q-learning-tutorial.htm
# Q-learning formula from http://sarvagyavaish.github.io/FlappyBirdRL/
# Visualization based on code from Gael Varoquaux gael.varoquaux@normalesup.org
# http://scikit-learn.org/stable/auto_examples/applications/plot_stock_market.html
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
@thomasdarimont
thomasdarimont / App.java
Last active May 13, 2022 12:40
Example for defining a refreshable Groovy Script in Spring Boot with Java Config - at least thats the current state of affairs :)
package demo;
import java.util.concurrent.TimeUnit;
import org.springframework.aop.TargetSource;
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.aop.support.DelegatingIntroductionInterceptor;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;