Skip to content

Instantly share code, notes, and snippets.

View 3dgoose's full-sized avatar
📢
Honk Honk

Adam Ellouze 3dgoose

📢
Honk Honk
View GitHub Profile
@3dgoose
3dgoose / hello.java
Created July 28, 2023 12:12
TODO : convert to Kotlin with Android Studio
class hello_world {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
@3dgoose
3dgoose / tpm.js
Created December 23, 2023 13:24
TPM.js
// Terminal Package Manager
const readline = require("readline");
const fs = require("fs");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
@3dgoose
3dgoose / ftp.py
Created December 29, 2023 18:42
FTP program, Python 2.7
import ftplib
ftp = ftplib.FTP('ftp.cluster028.hosting.ovh.net')
ftp.login('user', 'passwd')
ftp.cwd('/folder')
# Ouvrez le fichier à envoyer
with open('file', 'rb') as f:
ftp.storbinary('STOR file.ext', f)
@3dgoose
3dgoose / enigma.c
Created March 18, 2024 22:18
enigma.c
//Emulates the output of a WWII German Enigma encryption machine
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//#define DEBUG
#define MAX_MESSAGE_LENGTH 100
//Strut Prototypes
#!/bin/env sh
# Customize Console
PROMPT_COMMAND='echo -en "\033]0;$(FBD|cut -d "/" -f 4-100)\a"'
now=$(date)
echo "Undertale Jokes, that's all. Mainly. You know, as ya want."
while true
do
#include <stdio.h>
#define TAILLE_MIN 5
#define TAILLE_MAX 25
int main() {
int N, i, count, majorite;
int T[TAILLE_MAX];
printf("Saisir la taille du tableau N (entre %d et %d) : ", TAILLE_MIN, TAILLE_MAX);
; Define section for data and code
section .data
data db 42, -6, 13, -7, 99, 2 ; Replace with your desired array elements
data_size equ $ - data ; Calculate array size
section .text
global _start
_start:
; Initialize registers
use std::io;
fn main() {
let mut n: u32;
let mut count: i32 = 0;
let mut majorite: i32;
let taille_min = 5;
let taille_max = 25;
let mut t: Vec<i32> = Vec::with_capacity(taille_max);
@3dgoose
3dgoose / arch.sh
Created June 25, 2024 10:52
Install Arch ARM for RPI 0w
#!/bin/sh -exu
dev=$1
cd $(mktemp -d)
function umountboot {
umount boot || true
umount root || true
}
@3dgoose
3dgoose / sysinfo.py
Last active June 28, 2024 20:15
Get SysInfo in Python
import psutil
import os
import subprocess
def get_cpu_temp():
temp = psutil.sensors_temperatures()['cpu_thermal'][0].current
return temp
ip = "hostname -I"
uptime = "uptime -p"