Skip to content

Instantly share code, notes, and snippets.

View hnimminh's full-sized avatar

Minh hnimminh

View GitHub Profile
@hnimminh
hnimminh / curlpost.lua
Created August 4, 2024 08:33
http post/download with curl for lua
-- apt-get -y install lua-curl
-- /bin/ln -s /usr/include/x86_64-linux-gnu/curl /usr/include/
-- /usr/bin/luarocks install lua-curl 0.3.13-1
local function curlpost(url, payload, headers, timeout, filename)
local status, body
local curl = require("cURL")
local respfunc = function(r) body = r end
if filename then respfunc = io.open(filename, "w") end
local c = curl.easy{

ANSIBLE NOTE

Addhoc Command

  • Check Ansible Connection for all inventory host ansible -i inventory/staging all -m ping

  • Run Shell Command: ansible -i inventory/staging webservers -m "shell" -a "systemctl status nginx"

@hnimminh
hnimminh / linux.shell.md
Last active May 5, 2020 06:39
LINUX SHELL COMMAND LINE

LINUX SHELL COMMANDLINE

NETWORKING

  • TCP DUMP: tcpdump -nqt -s0 -A -i any port 5060 |grep "computer networking" -A 10 -B 10
  • Ping with MTU size: ping 122.152.145.101 -s 1500

ADVANDCE

  • Find & Replace: find ./hoiio/ -type f -exec sed -i "s/<origin_string>/<new_string>/g" {} +
  • Repeat Command n times: for i in {1..10}; do <command>; done