Skip to content

Instantly share code, notes, and snippets.

View cengiz-io's full-sized avatar

Cengiz Can cengiz-io

View GitHub Profile
#!/usr/bin/env python3
from http.server import BaseHTTPRequestHandler, HTTPServer
from os import curdir, sep
import cgi
class myHandler(BaseHTTPRequestHandler):
def do_GET(self):
return
#!/bin/sh
KERNEL=$HOME/kernel/staging/arch/x86_64/boot/bzImage
ARGS='ignore_loglevel console=ttyS0'
qemu-system-x86_64 -enable-kvm -kernel $KERNEL -append "$ARGS" -nographic
@cengiz-io
cengiz-io / linux-clang-format
Last active July 23, 2020 11:16 — forked from qlyoung/linux-clang-format
Linux kernel style .clang-format
---
BasedOnStyle: LLVM
Language: Cpp
IndentWidth: 8
UseTab: Always
BreakBeforeBraces: Linux
AlwaysBreakBeforeMultilineStrings: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
#include <iostream>
#include <iterator>
#include <algorithm>
#include <vector>
using namespace std;
template <typename T>
ostream& operator<< (ostream& out, const vector<T>& v) {
#include <SparkFun_ADXL345.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
ADXL345 adxl = ADXL345();
void setup() {
Serial.begin(9600);
lcd.begin(16, 2);
@cengiz-io
cengiz-io / alv0_alv1_sensor_data.txt
Last active April 5, 2018 01:23
ALV0 sensor data
FF FF 26 FD 03 FF C0 00 --> 67092480
AB 6A 0D E2 03 FF C0 00
93 81 88 A1 00 00 00 00
93 DA 90 02 00 00 00 00
00 E8 00 13 00 06 71 D8 --> 422360
--> 83592
--> 55744
00 17 00 04 00 00 6C C0 --> 27840
00 01 00 01 00 00 00 00
#!/bin/sh
BACKUP_SOURCE=/
BACKUP_TARGET=/run/media/cengiz/BACKUP/arch_gnome_yedek
sudo rsync -aAXvH --delete --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/home/*/.thumbnails/*","/home/*/.cache/mozilla/*","/home/*/.cache/chromium/*","/home/*/.local/share/Trash/*","/home/*/.ccache/*"} $BACKUP_SOURCE $BACKUP_TARGET
[root@nostromo efivars]# efivar -p --name "7c436110-ab2a-4bbb-a880-fe41995c9f82-SystemAudioVolume"
GUID: 7c436110-ab2a-4bbb-a880-fe41995c9f82
Name: "SystemAudioVolume"
Attributes:
Non-Volatile
Boot Service Access
Runtime Service Access
Value:
00000000 5d |] |
Device (SMC)
{
Name (_HID, EisaId ("APP0001")) // _HID: Hardware ID
Name (_CID, "smc-huronriver") // _CID: Compatible ID
Name (_STA, 0x0B) // _STA: Status
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
IO (Decode16,
0x0300, // Range Minimum
0x0300, // Range Maximum
bool isHappy(int n) {
int sum = 0,
value = n,
tries = 10;
char str[255] = { 0, };
while (1) {
sprintf(str, "%d", value);
for (size_t i = 0; i < strlen(str); i++) {
int digit = str[i] - 48;