Skip to content

Instantly share code, notes, and snippets.

View JUNNETWORKS's full-sized avatar

JUN_NETWORKS JUNNETWORKS

View GitHub Profile
@JUNNETWORKS
JUNNETWORKS / endian_test.c
Created March 15, 2021 11:10
visualize little endian
#include "stdio.h"
#include "unistd.h"
int main(){
char *s = "1234";
printf("%p\n", s);
for (int i = 0; i < 4; i++)
printf("s[%d]: %c\n", i, *(s+i));
write(STDOUT_FILENO, s, 2);
printf("\n");
@JUNNETWORKS
JUNNETWORKS / write_utf-8.c
Last active September 4, 2020 17:04
CでUTF-8で表現されるマルチバイト文字を標準出力
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
void print_bin_from_char(char *c, int bytes){
char *bin = calloc(sizeof(char), 8 * bytes);
int i, j;
unsigned int num;
int bin_digit = 0;
unsigned char *unsigned_c = (unsigned char *)c;
@JUNNETWORKS
JUNNETWORKS / copy_music_from_rhythmbox_playlist_to_dir.py
Created July 26, 2019 13:57
copy music from a Rhythmbox playlist to a directory.
"""
copy music from a Rhythmbox playlist to a directory
"""
import os
import argparse
import re
import shutil
from xml.etree import ElementTree as ET
import urllib.parse
@JUNNETWORKS
JUNNETWORKS / update_menu.py
Created June 9, 2019 17:18
暁寮寮食BOT自動化用定期実行スクリプト
"""
cron で1日1回実行するスクリプト
- 今月のデータがあるか
- 暁寮のHPのメニュー表が更新されているか
- 更新されてればメニュー表をDLし、それを画像に変換し、登録フォームに自動でリクエストを送りメニューを登録する
"""
import requests
import io
@JUNNETWORKS
JUNNETWORKS / libinput-gestures.conf
Created May 5, 2018 21:42
Cinnamon touchpad gestures like windows10 for libinput-gestures
# show all windows in workspace
gesture swipe up 3 xdotool key alt+control+Down
# show Desktop
gesture swipe down 3 xdotool key super+d
# move current workspace for left
gesture swipe left 4 xdotool key alt+control+Right
# move current workspace for right