Skip to content

Instantly share code, notes, and snippets.

@taybenlor
taybenlor / write.rs
Created September 12, 2022 10:30
This program writes whatever you type into STDIN to the file specified in arg1.
use std::io::Read;
use std::{env, fs, io};
fn main() {
let filename = env::args().nth(1).expect("no filename provided");
let stdin = io::stdin();
let mut buf = String::new();
stdin
.lock()
@bgadrian
bgadrian / GolangCPUProfiles.sh
Last active February 28, 2024 04:05
Golang Flame graph profiles
#install FlameGraph library
cd /opt/
sudo git clone https://github.com/brendangregg/FlameGraph.git
#make it accesible from any folder
vim ~/.bashrc
##add these lines anywhere and exit vim (if you can)
export FLAMEPATH=/opt/FlameGraph
PATH=$PATH:$FLAMEPATH
@miguelmota
miguelmota / rsa_util.go
Last active September 27, 2024 02:42
Golang RSA encrypt and decrypt example
package ciphers
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"crypto/x509"
"encoding/pem"
"log"
)
@ashwinrs
ashwinrs / IterateOverJSONUsingGson.java
Last active January 9, 2023 23:54
Iterate over elements in a JSON using GSON in Java
final JsonObject jsonObject = GSON.toJsonTree(<Object>).getAsJsonObject();
for(Map.Entry<String, JsonElement> entry : jsonObject.entrySet()) {
System.out.println("Key = " + entry.getKey() + " Value = " + entry.getValue() );
}
@scottashipp
scottashipp / softwareengineering
Last active October 23, 2024 11:13
Software Engineering Quotes for fortune
# from https://codeburst.io/how-i-hacked-my-terminal-so-a-happy-whale-would-spout-software-quotes-at-me-6791e6c74fc6
%
Simple things should be simple, complex things should be possible.
The Wiki Way: Quick Collaboration on the Web, Bo Leuf, Ward
Cunningham
%
Simplicity is the soul of efficiency.
Austin Freeman
%
@SAW4
SAW4 / README.md
Last active March 6, 2024 11:58
C++ Project, with CLion + CMake + Pkg-config. Use simple gtk application as example.

How to create a C++ GTK project with Cmake + Pkg-config

  1. Create a project with CLion (Click C++ Executable)
  2. Create your source code directory src
  3. Create main.cpp and CMakeLists.txt in src

Content of src/main.cpp:

#include <gtkmm.h>
@delitescere
delitescere / bootstrap.md
Last active February 18, 2021 10:21
Portola (OpenJDK using musl) on Alpine

Get the JDK source (per the OpenJDK instructions):

hg clone http://hg.openjdk.java.net/portola/portola
cd portola
bash ./get_source.sh

You need an existing Alpine with an already-built JDK. I have a Docker image of Alpine with glibc-based Zulu JDK:

@attacus
attacus / riot-matrix-workshop.md
Last active March 13, 2024 00:16
Create your own encrypted chat server with Riot and Matrix

This guide is unmaintained and was created for a specific workshop in 2017. It remains as a legacy reference. Use at your own risk.

Running your own encrypted chat service with Matrix and Riot

Workshop Instructor:

This workshop is distributed under a CC BY-SA 4.0 license.

What are we doing here?

@Arinerron
Arinerron / root.sh
Last active June 10, 2024 17:35
"Root" via dirtyc0w privilege escalation exploit (automation script) / Android (32 bit)
#!/bin/bash
# Give the usual warning.
clear;
echo "[INFO] Automated Android root script started.\n\n[WARN] Exploit requires sdk module \"NDK\".\nFor more information, visit the installation guide @ https://goo.gl/E2nmLF\n[INFO] Press Ctrl+C to stop the script if you need to install the NDK module. Waiting 10 seconds...";
sleep 10;
clear;
# Download and extract exploit files.
echo "[INFO] Downloading exploit files from GitHub...";
@hughbiquitous
hughbiquitous / .gitignore
Created October 24, 2016 17:20
.gitignore for Java/IntelliJ/gradle
# From https://github.com/github/gitignore/blob/master/Gradle.gitignore
.gradle
/build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar