Skip to content

Instantly share code, notes, and snippets.

View karaketir16's full-sized avatar
๐Ÿ˜‘

Osman Karaketir karaketir16

๐Ÿ˜‘
  • ASELSAN
  • Ankara
  • 14:56 (UTC +03:00)
View GitHub Profile
import os
import subprocess
import re
RULES_DIR = "/etc/udev/rules.d/"
RULES_FILE_NAME = "99-usb-serial.rules"
list_ttyUSB_cmd = "ls /dev/ | grep ttyUSB"
ttyUSB_list = subprocess.getoutput(list_ttyUSB_cmd).split()
#!/bin/bash
for i in {0..19}
do
(while true; do dd if=/dev/zero of=/dev/ttyUSB$i bs=4k; done) &
done
sudo swapoff -a ; sudo fallocate -l 15G /swapfile ; sudo chmod 600 /swapfile ; sudo mkswap /swapfile ; sudo swapon /swapfile ; sudo swapon --show
@karaketir16
karaketir16 / pico_my_copy.s
Created May 18, 2023 16:24
my copy function
.syntax unified
.section .text
.thumb_func
.global my_cpy
my_cpy:
push {r4, lr} @ push r4 and lr onto the stack
movs r4, #0
loop:
ldrb r3, [r1, r4] @ load byte from r1 + r4 into r3
strb r3, [r0, r4] @ store byte from r3 into r0 + r4
.syntax unified
.thumb_func
.global main
main:
init: bl stdio_init_all
loop:
ldr r0, DELAY_TIME_MS // Set the delay period
bl sleep_ms // Delay for the specified time
@karaketir16
karaketir16 / create_pseudo_terminal.sh
Created February 17, 2023 17:50
command for creating pseudo tty
sudo socat PTY,link=/dev/ttyPP0,group=dialout,user=${USER} PTY,link=/dev/ttyPP1,group=dialout,user=${USER}
#include "bits/stdc++.h"
using namespace std;
typedef __int128_t lint;
typedef __uint128_t ulint;
#define mod(x) x%1000000007
long long int n,mm;
lint tot = 0;
lint bits[64];
@karaketir16
karaketir16 / 3A.cpp
Created June 20, 2019 21:34
DAY 3 Question A
#include <bits/stdc++.h>
using namespace std;
#define MOD (int)(1e9)
//#define __ <<" "<<
typedef long long int lint;
class Point
{
public:
double x, y;
void print()
#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define sc second
#define inf 1000000000000000LL
#define MP make_pair
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define dbg(x) cerr<<#x<<":"<<x<<endl
#define N 50005
#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define sc second
#define inf 1000000000000000LL
#define MP make_pair
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define dbg(x) cerr<<#x<<":"<<x<<endl
#define N 100005