Skip to content

Instantly share code, notes, and snippets.

View ikubaku's full-sized avatar
🐶
woof

ikubaku ikubaku

🐶
woof
View GitHub Profile
@ikubaku
ikubaku / .zshrc
Created March 27, 2021 13:18
いつもの.zshrc
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/Users/ikubaku/.zshrc'
autoload -Uz compinit
@ikubaku
ikubaku / gpg-agent.conf
Last active March 27, 2021 15:24
ssh-agentを使いたいとき用gpg-agent.conf
enable-ssh-support
pinentry-program /usr/bin/pinentry-x11
# macOSなら下
#pinentry-program /opt/homebrew/bin/pinentry-mac
@ikubaku
ikubaku / .gitconfig
Created March 27, 2021 13:08
いつもの.gitconfig
[user]
name = ikubaku
email = hide4d51@gmail.com
[init]
defaultBranch = dev
[pull]
rebase = false
@ikubaku
ikubaku / migrate_acl.ps1
Last active November 21, 2020 12:37
不明なアカウントから所有権とアクセス制御を奪い取るPowerShellスクリプト
[String]$sid = "<Fill in the old SID here>"
[String]$newuser = "<Fill in the new username here(domain\user)>"
$path = Get-ChildItem "<Fill in the directory to perform operation(note that the directory specified here will not be modified)>" -Recurse
foreach($file in $path) {
$acl = Get-Acl -LiteralPath $file.FullName
if($acl.Owner -eq "O:$sid") {
foreach($acc in $acl.access) {
if($acc.IdentityReference.Value -match $sid) {
$newacc = New-Object System.Security.AccessControl.FileSystemAccessRule($newuser, @($acc.FileSystemRights), @($acc.InheritanceFlags), @($acc.PropagationFlags), @($acc.AccessControlType))
@ikubaku
ikubaku / packages.txt
Created October 25, 2020 11:00
いつものパッケージ
base plasma a2jmidid alsa-utils appstream-glib ark bluez-alsa-git bluez-utils bubblewrap-suid cadence chromium cups diffutils dolphin dosfstools downgrade e2fsprogs efibootmgr emacs-nox fcitx fcitx-mozc fcitx-qt5 firefox flatpak gnome-themes-extra grub gst-plugins-good gwenview htop imagemagick inetutils jack2 kate kcm-fcitx kcm-wacomtablet kdeconnect keepassxc konsole lhasa lib32-gst-plugins-good lib32-ncurses5-compat-libs libappindicator-gtk3 libva-mesa-driver linux linux-firmware linux-headers linux-lts linux-lts-headers linux-rt linux-rt-headers linux-xanmod linux-xanmod-headers logrotate lvm2 man-db man-pages mesa nano ncurses5-compat-libs networkmanager non-mixer noto-fonts-cjk noto-fonts-emoji noto-fonts-extra ocl-icd opencl-mesa openssh os-prober partitionmanager pavucontrol perl pkgstats print-manager pulseaudio pulseaudio-jack rkhunter rsync s-nail sddm spectacle sudo sysfsutils timidity++ ttf-dejavu unhide unrar unzip usbutils vi vlc vulkan-radeon vulkan-tools wget which whois xclip xdg-user-dirs x
@ikubaku
ikubaku / blinky.sh
Created August 1, 2020 04:05
gpiosetでのGPIO制御
#!/bin/sh
### GPIO character device blinky(toggles the offset 2 line of the /dev/gpiochip0)
while :; do
gpioset -m time -u 500000 gpiochip0 2=0
test $? -gt 128 && break
gpioset -m time -u 500000 gpiochip0 2=1
test $? -gt 128 && break
done
@ikubaku
ikubaku / blinky_sysfs.sh
Created August 1, 2020 03:37
Sysfsインタフェースを用いたGPIO制御
#!/bin/sh
### GPIO Sysfs interface blinky(toggles gpio2)
N_GPIO=2
PERIOD=0.5
unexport_gpio() {
echo $N_GPIO > /sys/class/gpio/unexport
exit 0
}
@ikubaku
ikubaku / quine.c
Created June 22, 2019 06:08
見様見真似で書いたクワイン
#include <stdio.h>
#include <string.h>
int main(void) {
char x[256];
char r[512];
strcpy(x, "#include <stdio.h>%c#include <string.h>%c%c%cint main(void) {%c char x[256];%c char r[512];%c strcpy(x, %c%s%c);%c sprintf(r, x, 10, 10, 10, 10, 10, 10, 10, 34, x, 34, 10, 10, 10, 10, 10);%c puts(r);%c return 0;%c}%c");
sprintf(r, x, 10, 10, 10, 10, 10, 10, 10, 34, x, 34, 10, 10, 10, 10, 10);
puts(r);
@ikubaku
ikubaku / graphs.py
Last active December 8, 2018 14:15
グラフのいろいろ
# graphs.py - Graph nodes and misc. functions for Python3
# 2018 (C) ikubaku
# Published under the MIT License https://opensource.org/licenses/MIT
import sys
import math
import queue
import copy