Skip to content

Instantly share code, notes, and snippets.

View karaketir16's full-sized avatar
😑

Osman Karaketir karaketir16

😑
  • ASELSAN
  • Ankara
  • 03:49 (UTC +03:00)
View GitHub Profile
#include <iostream>
int multiply(int number_a, int number_b){
return number_a * number_b;
}
int my_function()
{
int c;
c = 5;
@karaketir16
karaketir16 / vscode_qt
Created November 10, 2023 14:25
VS Code Clangd and Qt
CMAKE_PREFIX_PATH="~/Qt/6.5.3/gcc_64/" cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
@karaketir16
karaketir16 / gist:d5c6b798ecc1fe651b8a7668754aeb76
Created November 9, 2023 19:54
Ubuntu Python Version Install
https://web.archive.org/web/20231005145415/https://www.linuxcapable.com/install-python-3-8-on-ubuntu-linux/
@karaketir16
karaketir16 / disableDPMS
Created October 19, 2023 13:59
disable DPMS -- disable screen off / yocto mini-x-session
#!/bin/sh
#/etc/mini_x/session.d/disableDPMS
/usr/bin/xset -dpms s off s noblank s 0 0 s noexpose
@karaketir16
karaketir16 / 20-wired.network
Created October 18, 2023 14:54
static ip for systems with systemd
#/etc/systemd/network/20-wired.network
[Match]
Name=eth0
[Network]
Address=192.168.8.55/24
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