Skip to content

Instantly share code, notes, and snippets.

View uobikiemukot's full-sized avatar
😇
rest in peace

uobikiemukot uobikiemukot

😇
rest in peace
View GitHub Profile
@uobikiemukot
uobikiemukot / dspark
Created June 28, 2014 10:58
"double lines" version of holman/spark
#!/usr/bin/env bash
#
# spark
# https://github.com/holman/spark
#
# Generates sparklines for a set of data.
#
# Here's a a good web-based sparkline generator that was a bit of inspiration
# for spark:
#
@uobikiemukot
uobikiemukot / cdebug.sh
Last active August 29, 2015 14:03
catch segmentation fault and show wrong lines in source code
#!/bin/bash
# usage: cdebug.sh ./a.out
# (remember to add "-rdynamic" and "-g" option to gcc!)
# example: gcc -O0 -g -rdynamic foo.c && cdebug.sh ./a.out
if test "$#" -lt 1; then
echo "usage: cdebug.sh ./a.out"
echo "(remember to add '-rdynamic' and '-g' option to gcc!)"
echo "example: gcc -O0 -g -rdynamic foo.c && cdebug.sh ./a.out"
exit 1
@uobikiemukot
uobikiemukot / 16palette.sixel
Last active August 29, 2015 14:02
show default 16 color palette of sixel
Pq"1;1;128;36
#0!16~#1!16~#2!16~#3!16~#4!16~#5!16~#6!16~#7!16~$-
#0!16~#1!16~#2!16~#3!16~#4!16~#5!16~#6!16~#7!16~$-
#0!16~#1!16~#2!16~#3!16~#4!16~#5!16~#6!16~#7!16~$-
#8!16~#9!16~#10!16~#11!16~#12!16~#13!16~#14!16~#15!16~$-
#8!16~#9!16~#10!16~#11!16~#12!16~#13!16~#14!16~#15!16~$-
#8!16~#9!16~#10!16~#11!16~#12!16~#13!16~#14!16~#15!16~$-
\
@uobikiemukot
uobikiemukot / idump.c
Last active August 29, 2015 14:01
broken image viewer for linux framebuffer
#define _XOPEN_SOURCE 600
#include <errno.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <stimg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
@uobikiemukot
uobikiemukot / drm_test.c
Last active June 15, 2025 18:16
dirty and small example of libdrm
/* please refer better example: https://github.com/dvdhrm/docs/tree/master/drm-howto/ */
#define _XOPEN_SOURCE 600
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <unistd.h>
#include <xf86drm.h>
@uobikiemukot
uobikiemukot / kik_str.patch
Created April 24, 2014 05:27
mlterm-3.3.4 patch
--- kiklib/src/kik_str.c.orig 2014-04-24 14:08:29.656026948 +0900
+++ kiklib/src/kik_str.c 2014-04-24 14:07:43.530258598 +0900
@@ -130,6 +130,11 @@
return strcpy( dst , src) ;
}
+char *kik_str_alloca_dup(const char *src)
+{
+ return __kik_str_copy(alloca(strlen(src) + 1), src);
+}
@uobikiemukot
uobikiemukot / framebuffer.h
Created July 10, 2013 07:19
framebuffer drawing library
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <linux/fb.h>
enum {
@uobikiemukot
uobikiemukot / fav.patch
Created April 12, 2013 12:22
bitlbee 3.2 - favorite patch
--- protocols/twitter/twitter.c.orig 2013-04-12 20:33:58.236098274 +0900
+++ protocols/twitter/twitter.c 2013-04-12 20:34:09.505347769 +0900
@@ -615,7 +615,7 @@
twitter_log(ic, "Could not undo last action");
goto eof;
- } else if (g_strcasecmp(cmd[0], "favourite") == 0 && cmd[1]) {
+ } else if (g_strcasecmp(cmd[0], "fav") == 0 && cmd[1]) {
if ((id = twitter_message_id_from_command_arg(ic, cmd[1], NULL))) {
twitter_favourite_tweet(ic, id);
@uobikiemukot
uobikiemukot / mkarchiso.sh
Created November 18, 2012 05:27
append some files to Archlinux LiveCD
#!/bin/bash
# usage: ./mkarchiso.sh ISO_IMAGE
YAFT_32=~haru/yaft/yaft_32
YAFT_64=~haru/yaft/yaft_64
TERMINFO=~haru/yaft/info/yaft.src
KEYMAP=~haru/tmp/special/us-fix.map.gz
ISO=$1
@uobikiemukot
uobikiemukot / color.h
Created November 1, 2012 16:25
solarized for yaft
/* See LICENSE for licence details. */
/*
Standard VGA colors
http://en.wikipedia.org/wiki/ANSI_escape_code
*/
const struct color_t color_list[COLORS] = {
/* system color: 16
{0x00, 0x00, 0x00}, {0xAA, 0x00, 0x00}, {0x00, 0xAA, 0x00}, {0xAA, 0x55, 0x00},
{0x00, 0x00, 0xAA}, {0xAA, 0x00, 0xAA}, {0x00, 0xAA, 0xAA}, {0xAA, 0xAA, 0xAA},
{0x55, 0x55, 0x55}, {0xFF, 0x55, 0x55}, {0x55, 0xFF, 0x55}, {0xFF, 0xFF, 0x55},