Skip to content

Instantly share code, notes, and snippets.

View BlackMetalz's full-sized avatar
🎯
Focusing

Luong Trung Kien BlackMetalz

🎯
Focusing
View GitHub Profile
@kamleshchandnani
kamleshchandnani / haproxy-reqrep.md
Last active April 25, 2023 15:50
Understanding "reqrep" in HA Proxy config

Let's assume we have following line in our HA proxy file:
reqrep ^([^\ :]*)\ /api/v1/api-name/(.*) \1\ /staging/path-name/\2
Here is our sample domain:
https://example.com/api/v1/api-name/

The goal here is to rewrite /api/v1/api-name/ to /staging/path-name/ leaving anything else unchanged.

Breaking the Regex and understanding in parts:
There are basically 3 parts in the regex:

@hoangdh
hoangdh / find-command.md
Last active January 7, 2021 16:14
Câu lệnh find - Tìm kiếm file và thư mục trong linux - Tips & Tricks FIND command

Ghi chép tùy chọn của find

  • Các tùy chọn hay dùng:
    • -name: Tìm kiếm theo tên file/folder
    • -type: Theo kiểu, f: Folder; d: Directory
    • -mtime N: Thời gian tạo/chỉnh sửa. N: là số ngày
    • -exec: Thực thi gì đó với các file tìm được
    • -perm: Tìm theo quyền truy cập (RWX)
    • -user: Tìm file thuộc sở hữu của user nào đó
  • -group: Tìm file sở hữu của group nào đó
DELETE FROM creature_template WHERE entry = '90006';
INSERT INTO `creature_template` VALUES ('90006', '0', '0', '0', '0', '0', '42063', '42061', '0', '0', 'Teleporter', 'Locations', 'Directions', '55555', '90', '90', '4', '0', '35', '3', '1', '1.14286', '1', '1', '0', '0', '0', '0', '1', '0', '0', '1', '0', '2048', '0', '0', '0', '0', '0', '0', '0', '0', '7', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'SmartAI', '0', '3', '1', '12', '0', '0', '0', '0', '0', '0', '', '0', '1', '0', '0', '', '1', '1', '1', '1', '0');
DELETE FROM creature_template_addon WHERE Entry = '90006' ;
INSERT INTO creature_template_addon (entry, mount, bytes1, bytes2, emote, path_id, auras) VALUES
('90006', 0, 0, 0, 0, 0, '35766');
DELETE FROM gossip_menu WHERE entry>'55555'-1 AND entry<'55555'+9;
DELETE FROM npc_text WHERE ID>'333333'-1 AND ID<'333333'+5;
INSERT INTO gossip_menu (entry, text_id) VALUES
('55555'+4, '333333'+3),
('55555'+3, '333333'+2),
@imwilsonxu
imwilsonxu / app.py
Last active September 14, 2024 12:55
[Flask + Wtforms + Select2] #flask
# -*- coding: utf-8 -*-
from flask import Flask, request, render_template, current_app
from flask_wtf import Form
from wtforms.validators import DataRequired
from wtforms import SelectField, SelectMultipleField, SubmitField
app = Flask(__name__)
@mreschke
mreschke / nginx.conf
Last active January 3, 2025 07:03
Nginx config for multiple laravel sites based on /api/v1 url paths
# This config will host your main [Laravel] GUI application at /, and any additional [Lumen] webservices at /api/v1 and /api/v2...
# This also works perfectly for all static file content in all projects
# This is full of debug comments so you can see how to print debug output to browser! Took me hours to nail this perfect config.
# Example:
# http://example.com - Main Laravel site as usual
# http://example.com/about - Main Laravel site about page as usual
# http://example.com/robots.txt - Main Laravel site static content as usual
# http://example.com/api/v1 - Lumen v1 api default / route
# http://example.com/api/v1/ - Lumen v1 api default / route
@litnimax
litnimax / gist:1a02be9091ace89f3603
Created October 20, 2015 14:44
Flask signal example
from flask import Flask
from flaskext.sqlalchemy import SQLAlchemy, models_comitted
app = Flask(__name__)
db = SQLAlchemy(app)
class Post(db.Model):
id = db.Column('post_id', db.Integer, primary_key=True)
title = db.Column(db.String(200))
text = db.Column(db.String)
@Lillecarl
Lillecarl / readme.txt
Last active October 10, 2023 21:30
Linux mangos/trinitycore restarter, made for *nix handicapped people. Creds to Dufernst for coming up with some ideas :). Thanks google for bash syntax... xD
To run wowadmin you must specify your servers locations inside the script and set the proper names.
The reason i use "oldname" and "newname" for worlserver binary is because you might want to run more then 1 realm, then you set up 2 wowadmin.sh clones, same authserver config, but different worldserver path and "newnames". This will make multirealming on linux very simple.
reports/suggestions? comment here or email: lillecarl RETARDEDA gmail.com
This gist will be updated when the restarter is. Regards
NEEDED PACKAGES: