Skip to content

Instantly share code, notes, and snippets.

aptで依存パッケージ一覧を得る

apt-get install -s emacs-nox | grep ^Inst | cut -d " " -f 2

利用例:事前にdebをダウンロード

apt-get install -s emacs-nox | grep ^Inst | cut -d " " -f 2 | xargs apt-get download
@aont
aont / yt_skip_ads.js
Last active May 1, 2024 09:27
ad skip tool for YouTube
(function () {
var movie_player = document.getElementById("movie_player");
var video = document.querySelector("video.video-stream");
function adskip(r) {
// console.log(r);
if (Array.from(movie_player.classList).includes("ad-showing")) {
video.playbackRate = 16;
video.currentTime = video.duration;
var asb = movie_player.querySelector(".ytp-skip-ad-button");
@aont
aont / eject_drive.bat
Created April 23, 2024 13:38
ハードウェアの安全な取り外し
@rem https://superuser.com/questions/1547316/eject-connected-external-hard-drive-using-cmd
C:\Windows\System32\rundll32.exe shell32.dll,Control_RunDLL hotplug.dll
#!/usr/bin/env python3
# ref: https://qiita.com/tongari0/items/ffa3297630547c3bb712
# $ python -c 'from mitmproxy.tools.main import mitmdump; mitmdump()' --listen-port 3126 -s compproxy.py --ignore-hosts '(mzstatic|apple|icloud|mobilesuica|crashlytic|google-analytics|merpay|paypay|rakuten-bank|fate|colopl|rakuten-sec|line|kyash|plexure|cloudmosa.net)' --set block_global=false --showhost --rawtcp
import mitmproxy
import mitmproxy.http
import io, time, gzip
# import brotli
import socket
(()=>{
var blankUrl = "about:blank?";
var kill = "kill";
var locationHref = location.href;
// var dateNow = Date.now();
if (locationHref.startsWith(blankUrl)) {
var searchParams = new URL(locationHref).searchParams;
// if(searchParams.get(kill)=='') {
var searchParamsTitle = searchParams.get("t");
var searchParamsUrl = searchParams.get("u");
diff -u a/bash.bash_logout b/bash.bash_logout
--- a/bash.bash_logout 2024-01-06 23:09:23.578819100 +0900
+++ b/bash.bash_logout 2024-01-06 23:06:58.672315000 +0900
@@ -10,6 +10,6 @@
# System-wide bashrc file
# when leaving the console clear the screen to increase privacy
-if [ "$SHLVL" = 1 ]; then
- [ -x /usr/bin/clear ] && /usr/bin/clear
-fi
@aont
aont / caw.py
Last active April 11, 2024 03:57
change active window
#!/usr/bin/env python
import os
import sys
import ctypes
import ctypes.wintypes
import time
import ctypes
@aont
aont / timer.py
Created December 7, 2021 12:18
do something periodically
#!/usr/bin/env python
import sys
import enum
import os
import time
import sys
import datetime
import win32gui
#!/usr/bin/env python
# -*- coding: utf8 -*-
import sys
import tkinter
import tkinter.font
import ctypes
import win32gui
import win32con
SetSuspendState = ctypes.windll.PowrProf.SetSuspendState
#!/usr/bin/env python
# asyncio version of PyEchoCon
# borrowed from https://github.com/iljau/PyEchoCon
import sys
import asyncio
import sys
import asyncio.windows_utils
import _winapi