Skip to content

Instantly share code, notes, and snippets.

View hoantp's full-sized avatar
🎯
Focusing

Hoan Tran hoantp

🎯
Focusing
View GitHub Profile
@SecurityPhoton
SecurityPhoton / install-k8s-2node.sh
Created October 14, 2024 10:54
This bash script sets up a Kubernetes cluster by configuring either a master or a worker node based on user input. It updates the system, configures network settings, disables swap, and installs necessary components like Containerd and Kubernetes tools (kubelet, kubeadm, kubectl). For the master node, it initializes the cluster and deploys the C…
#!/bin/bash
# Setting IP and DNS names for each server
MASTER_IP="10.10.10.1"
WORKER_IP="10.10.10.2"
MASTER_DNS="k8s-master"
WORKER_DNS="k8s-worker"
# Checking the role of the node (master or worker)
if [ "$1" == "master" ]; then
@QuanTrieuPCYT
QuanTrieuPCYT / FPTU.md
Created April 15, 2024 13:04
FPTU Kỳ Truyện - Đại học FPT: khi sinh viên gian lận và hack vào server trường

Đại học FPT: khi sinh viên gian lận và hack vào server trường

Lấy từ nguồn: https://tinhte.vn/thread/dai-hoc-fpt-khi-sinh-vien-gian-lan-va-hack-vao-server-truong.1091706/


Trường Đại Học FPT (FU) số 8 Tôn Thất Thuyết - Cầu Giấy - Hà Nội (Toà nhà Detect - đối diện bến xe Mĩ Đình) Trong 3 năm nay, FU có thực hiện việc thi cử online bằng phần mềm chuyên dụng của trường, được nhà trường đặt hàng của Phan Trường Lâm (LamPT) có 2 phiên bản đều được code bằng C# .NET:
1- bản EOS Client dùng thi môn Business English (BE).
2- bản IT Client thi các môn Software Engineering: Java, C#, C/C+- Computer Network, Operating System (OS), Introduction to Database, ...

@linhmtran168
linhmtran168 / .wslconfig
Last active June 26, 2020 07:19
WSL config
# %USERPROFILE%.wslconfig
[wsl2]
memory=4GB
swap=2GB
processors=2
swapFile=D:\\wsl2-swap.vhdx
@holmberd
holmberd / php-pools.md
Last active November 13, 2025 10:56
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
@IzumiSy
IzumiSy / balloon.jsx
Created July 12, 2017 08:08
Balloon component for React Native
import React from "react";
import {
StyleSheet,
TouchableWithoutFeedback,
View
} from "react-native";
export class Notifications extends React.Component {
componentWillMount() {
this.state = {
@geoffreydhuyvetters
geoffreydhuyvetters / react_fiber.md
Last active August 15, 2024 15:17
What is React Fiber? And how can I try it out today?
@up1
up1 / CSVLibrary.py
Last active January 11, 2022 19:04
Robot Framework :: Working with CSV file
class CSVLibrary(object):
def read_csv_file(self, filename):
file = open(filename, 'r')
csvfile = csv.reader(file)
file.close
return [row for row in csvfile]
@mokagio
mokagio / install-xcode-cli-tools.sh
Created September 9, 2015 09:28
Install Xcode CLI Tools without GUI
#!/bin/bash
# See http://apple.stackexchange.com/questions/107307/how-can-i-install-the-command-line-tools-completely-from-the-command-line
echo "Checking Xcode CLI tools"
# Only run if the tools are not installed yet
# To check that try to print the SDK path
xcode-select -p &> /dev/null
if [ $? -ne 0 ]; then
echo "Xcode CLI tools not found. Installing them..."
@ssokolow
ssokolow / pagination_example.sql
Created December 23, 2009 13:02
Reasonably efficient pagination without OFFSET (SQLite version)
-- Reasonably efficient pagination without OFFSET
-- SQLite version (Adapted from MS SQL syntax)
-- Source: http://www.phpbuilder.com/board/showpost.php?p=10376515&postcount=6
SELECT foo, bar, baz, quux FROM table
WHERE oid NOT IN ( SELECT oid FROM table
ORDER BY title ASC LIMIT 50 )
ORDER BY title ASC LIMIT 10