Skip to content

Instantly share code, notes, and snippets.

View aminkhoshzahmat's full-sized avatar
:shipit:
Discovering

Amin aminkhoshzahmat

:shipit:
Discovering
View GitHub Profile
@aminkhoshzahmat
aminkhoshzahmat / tasks.yml
Last active January 8, 2022 17:08
Ansible examples with modules
- name: ----- Create dir1 in /home -----
file:
path: /home/dir1
state: directory
owner: root
group: root
mode: 0755
tags: [create_dir1]
- name: ----- create dir2 in /home ------
@aminkhoshzahmat
aminkhoshzahmat / Makefile
Last active January 14, 2021 14:58
Makefile sample file
# =================================
# Variables #
# =================================
CG=\033[0;36m#..........green color
CP=\033[0;35m#...........pink color
CF=\033[0;33m#...........pink color
NC=\033[0m#................no color
SPRINT=1.0.0#...............Version
COMMANDS=${CP}Commands${NC}
DATE=`date +%Y-%m-%d-%H.%M.%S`
@aminkhoshzahmat
aminkhoshzahmat / 2nginx_with_haproxy.yml
Created January 29, 2021 13:50
Ansible: Install 2 nginx server and load balance with haproxy
- name: ----- Add haproxy to host -----
lineinfile:
path: /etc/hosts
insertafter: EOF
line: '192.168.56.66 haproxy'
tags: haproxt
- name: ----- Install epel-release and enginx -----
yum:
@aminkhoshzahmat
aminkhoshzahmat / cast_collation.sql
Last active January 30, 2021 19:49
Convert collation
UPDATE company
SET name=convert(cast(convert(name using latin1) as binary) using utf8mb4),
contact_role=convert(cast(convert(contact_role using latin1) as binary) using utf8mb4),
address=convert(cast(convert(address using latin1) as binary) using utf8mb4),
city=convert(cast(convert(city using latin1) as binary) using utf8mb4),
phone=convert(cast(convert(phone using latin1) as binary) using utf8mb4),
postal_code=convert(cast(convert(postal_code using latin1) as binary) using utf8mb4),
website=convert(cast(convert(website using latin1) as binary) using utf8mb4),
code=convert(cast(convert(code using latin1) as binary) using utf8mb4);
version: '3'
services:
drupal:
image: drupal
ports:
- "80:80"
volumes:
- drupal-modules:/var/www/html/modules
- drupal-profiles:/var/www/html/profiles
@aminkhoshzahmat
aminkhoshzahmat / config
Created November 8, 2021 13:48 — forked from pksunkara/config
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
[sendemail]
smtpencryption = tls
// Builders
class SimpleBuilder {
constructor(private current = {}) {
}
prop(key: string, value: any) {
return new SimpleBuilder({ ...this.current, ...{ [key]: value } });
}
Google dorks
1) find useful files > site: tesla.com filetype:pdf
2) find emails > "@tesla.com" -site:tesla.com
> "@etf.bg.ac.rs" -site:etf.bg.ac.rs
> intitle:admin OR inurl:admin site:etf.bg.ac.rs
3) Search "googl dorks" > exploit.com
Find IP
Ping, Host, nslookup (active)
@aminkhoshzahmat
aminkhoshzahmat / CountryType
Last active August 16, 2022 04:51
Country names, codes, phones
<?php
namespace App\Entity\Enums;
define("CODE", 'code');
define("PHONE", 'phone');
define("NAME", 'name');
enum CountryType
{
const { log } = require("console");
const http = require("http");
const WebSocketServer = require("websocket").server;
let connections = [];
const httpServer = http.createServer();
const websocket = new WebSocketServer({ httpServer: httpServer });