Skip to content

Instantly share code, notes, and snippets.

View polaco1782's full-sized avatar

Cassiano Martin polaco1782

  • Santa Cruz do Sul, RS, Brazil
View GitHub Profile
@polaco1782
polaco1782 / aws-region-ipv4.sh
Created February 20, 2025 12:01
Get AWS ipv4 ranges based on region
#!/bin/bash
#
# You need JQ. Replace the region with the one you want
#
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq '.prefixes[] | select(.region == "us-east-1") | .ip_prefix'
@polaco1782
polaco1782 / aravis.ps1
Last active September 13, 2024 17:45
Aravis library win64 building
# run commands using windows powershell, administrator
### install python, ninja, meson and pkg-config tool using chocolatey package manager
###
### ! MUST HAVE POWERSHELL ADMINISTRATOR PRIVILEGES TO WORK !
###
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install python311
choco install meson
choco install ninja
#include <windows.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
HWND findWindow(HWND hwnd, const char *name) {
char windowName[256];
GetWindowText(hwnd, windowName, sizeof(windowName));
if (strcmp(windowName, name) == 0) {
return hwnd;
@polaco1782
polaco1782 / moveit.c
Created July 19, 2023 18:03
mouse moving
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include <X11/extensions/XTest.h>
Window findWindow(Display *display, Window window, const char *name) {
Window root, parent, *children;
unsigned int numChildren;
@polaco1782
polaco1782 / squid-ut.cpp
Created December 11, 2020 18:16
Old Squid store-id integration
#include <cstdlib>
#include <string>
#include <sstream>
#include <vector>
#include <iostream>
#include <curl/curl.h>
namespace UT
{
CURL *handle;
@polaco1782
polaco1782 / list_gcp_iprange.sh
Created May 11, 2020 21:11 — forked from n0531m/list_gcp_iprange.sh
Google Cloud Platform : ip address range
#!/bin/bash
# https://cloud.google.com/compute/docs/faq#find_ip_range
# nslookup -q=TXT _cloud-netblocks.googleusercontent.com 8.8.8.8
myarray=()
for LINE in `dig txt _cloud-netblocks.googleusercontent.com +short | tr " " "\n" | grep include | cut -f 2 -d :`
do
myarray+=($LINE)
for LINE2 in `dig txt $LINE +short | tr " " "\n" | grep include | cut -f 2 -d :`
@polaco1782
polaco1782 / Vagrantfile
Created March 12, 2020 18:10 — forked from tomoemon/Vagrantfile
sample Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
<?php
define('TICKS_PER_SEC', 60);
define('SECTOR_SIZE', 16);
define('WALKING_SPEED', 5);
define('FLYING_SPEED', 15);
define('TERMINAL_VELOCITY', 50);
define('PLAYER_HEIGHT', 2);
@polaco1782
polaco1782 / slowgram.sh
Created June 22, 2019 03:19
Slow down instagram and facebook on you network. Applies to Brazilian NET/Claro networks
#!/bin/sh
tc qdisc del dev eth1 root
echo 0 > /proc/fast_nat
tc qdisc add dev eth1 root handle 1: prio
tc qdisc add dev eth1 parent 1:3 handle 30: tbf rate 20kbit buffer 1600 limit 3000
tc filter add dev eth1 protocol ip parent 1:0 prio 3 u32 match ip src 31.13.85.0/24 flowid 1:3
tc filter add dev eth1 protocol ip parent 1:0 prio 3 u32 match ip src 179.232.0.0/14 flowid 1:3
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
end_of_line = lf
charset = utf-8