Skip to content

Instantly share code, notes, and snippets.

@yezz123
yezz123 / Exploitation.md
Created May 24, 2021 12:09
Pentesting-Exploitation
View Exploitation.md
View c10k-test-client.c
// HTTP client for testing high connection concurrency
// Authors: Richard Jones and Rasmus Andersson
// Released in the public domain. No restrictions, no support.
#include <sys/types.h>
#include <sys/time.h>
#include <sys/queue.h>
#include <stdlib.h>
#include <err.h>
#include <event.h>
#include <evhttp.h>
@fernandezpablo85
fernandezpablo85 / git-maven-howto.md
Last active March 8, 2023 23:23
how to create your own maven repository on github
View git-maven-howto.md

How to create a maven repository for your github project step by step

Clone your project in a separate folder

(note: replace ORGANIZATION and PROJECT)

git clone git clone git@github.com:ORGANIZATION/PROJECT.git my-repository

Cd into it

@mouredev
mouredev / chatgpt_api.py
Created March 7, 2023 19:31
Ejemplo de uso del API de ChatGPT desde Python
View chatgpt_api.py
import openai # pip install openai
import typer # pip install "typer[all]"
from rich import print # pip install rich
from rich.table import Table
"""
Webs de interés:
- Módulo OpenAI: https://github.com/openai/openai-python
- Documentación API ChatGPT: https://platform.openai.com/docs/api-reference/chat
- Typer: https://typer.tiangolo.com
@quiver
quiver / iam-policy.json
Last active March 8, 2023 23:21
How to connect to Amazon RDS PostgreSQL with IAM credentials
View iam-policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"rds-db:connect"
],
"Resource": [
"arn:aws:rds-db:region:account-id:dbuser:dbi-resource-id/database-user-name"
@davesilva
davesilva / virt-manager-macos.md
Created August 14, 2020 11:50
Remote virt-manager from Mac OS
View virt-manager-macos.md

If you have a Linux machine with KVM on it, you can manage those VMs remotely from a Mac using virt-manager.

Step 1: Allow your user non-root access to KVM

SSH to the Linux machine and add your SSH user to the libvirt group

sudo usermod -a -G libvirt $(whoami)
@superseb
superseb / rke2-commands.md
Last active March 8, 2023 23:19
RKE2 commands
View rke2-commands.md

RKE2 commands

Install

curl -sL https://get.rke2.io | sh
systemctl daemon-reload
systemctl start rke2-server
@benob
benob / reshard.py
Created March 4, 2023 17:35
Script to decompose/recompose LLAMA LLM models with different number of shards.
View reshard.py
# script to decompose/recompose llama model in different number of shards
# note that it loads the full model * 2 in cpu memory
import os
import json
import sys
import torch
import glob
if len(sys.argv) != 4:
@benelog
benelog / java-string-concat.md
Last active March 8, 2023 23:15
String 최적화 JDK 1.5
View java-string-concat.md

jdk1.5에서 String 더하기의 컴파일시의 최적화]

String 클래스를 "+"로 반복해서 더하는 연산을 어떤 경우에 컴파일러에서 자동으로 최적화해주는지 알고 있다면 보다 융퉁성 있게 쓸 수가 있습니다.

몇년전에 javaservice.net에서의 String vs StringBuffer에 대한 논의에서도 이 이야기가 오고 갔었고, 그를 통해 제가 알게 되었던 바는 다음과 같습니다.

  1. 한줄에서 상수 String끼리만 더하는 것은 모두 합쳐진 문자열로 바꿔준다. 즉 String a= "a" + "b" + "c"; 라고 쓰면 String ="abc"; 로 알아서 컴파일해준다는 거죠.
  2. 한줄에서 상수와 다른 String 클래스를 더하는 것은 StringBuffer의 append, toString 메서드를 쓰는 코드로 준다. jdk 1.4 javadoc 의 StringBuffer API설명 에 명시되어 있네요.

String buffers are used by the compiler to implement the binary string concatenation operator . For example, the code:

@hopsoft
hopsoft / README.md
Last active March 8, 2023 23:15
Smart Heroku Review Apps managed by GitHub Actions
View README.md

Smart Heroku Review Apps managed by GitHub Actions

This gist aims to provide a simple solution for managing Heroku Review Apps with GitHub Actions due to the security incident that continues to disrupt Heroku's GitHub integration. Watch the demo to learn more.

Demo Video

.github
├── workflows
│   ├── heroku_review_app_create.yml