Skip to content

Instantly share code, notes, and snippets.

View jonathanwork's full-sized avatar

Jonathan Lopez jonathanwork

View GitHub Profile
@jonathanwork
jonathanwork / sudoless_docker.sh
Created November 20, 2024 10:04
linux install docker none root
sudo groupadd docker
sudo gpasswd -a $USER docker
newgrp docker
#start running docker without root :D
@jonathanwork
jonathanwork / start_mem.sh
Created August 10, 2024 20:22
start cache system
memcached -m 64 -p 11211
@jonathanwork
jonathanwork / hard_link.sh
Created June 19, 2024 09:17
starting links for bin
@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