Skip to content

Instantly share code, notes, and snippets.

@roktas
roktas / gotcha.sh
Created January 27, 2025 06:38
Shell gothcas
#!/bin/bash
set -eu
foo() {
false
echo Expected to not reach here
}
fooer=foo
@roktas
roktas / topla.txt
Created October 8, 2024 07:07
Topla
başla get klavyeden bir sayı al
ifzero duyur eğer sayı sıfır ise "göster"e git
add toplam aküdeki yeni sayıyı mevcut toplama ekle
store toplam sonucu yin toplam hücresine kaydet
goto başla yeni sayıyı almak için "başla"ya git
duyur load toplam toplamı aküye yükle
print sonucu duyur
stop işlem tamam
toplam 0 "toplam" hücresinin ilk değeri 0 (program başlamadan önce)
@roktas
roktas / a.c
Created May 20, 2024 09:00
C dersinde verilen örnek
int a[] = {
56,
32,
7,
-4,
0,
103,
21,
-75
@roktas
roktas / square.html
Created January 30, 2024 09:20
Test Square 10cm x 10cm
<!DOCTYPE html>
<html>
<head>
<style>
#square {
width: 10cm;
height: 10cm;
border: solid 1px;
margin: 0cm;
padding: 0cm;
@roktas
roktas / gist:4f10793e8a3772b5a10e2cc7e9005528
Created October 17, 2023 12:02 — forked from fernandoaleman/gist:5083680
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
#!/usr/bin/env bash
# Process spool of scanned images
# Copyright (c) 2020, Recai Oktaş
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
@roktas
roktas / vit
Created October 14, 2023 22:50
#!/usr/bin/env bash
# Copyright (c) 2020, Recai Oktaş
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#!/usr/bin/env bash
set -Eeuo pipefail; shopt -s nullglob; [[ -z ${TRACE:-} ]] || set -x; unset CDPATH; IFS=$' \t\n'
cd "$(dirname "$(readlink -f "$0")")"/../.. || exit
# shellcheck disable=2034
declare -gr PROGNAME=${0##*/} # Program name
cry() {
dpkg-divert --add --rename --divert /usr/share/X11/xkb/symbols/pc.orig /usr/share/X11/xkb/symbols/pc
patch <<-EOF
--- pc.orig 2020-07-09 15:13:44.428924012 +0300
+++ pc 2020-07-09 15:50:21.658899698 +0300
@@ -19,7 +19,7 @@
key <TAB> { [ Tab, ISO_Left_Tab ] };
key <RTRN> { [ Return ] };
- key <CAPS> { [ Caps_Lock ] };
+ key <CAPS> { [ backslash ] };