This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding:utf-8 -*- | |
from itertools import combinations | |
from pprint import pprint | |
bundle = [51,49,5] | |
candidates = [bundle] | |
loop = True | |
loop_count = 0 | |
largest_member = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import os, re, logging | |
from glob import glob | |
from pipes import quote | |
from shutil import rmtree | |
SOURCES = ('/mnt/1.5T/,movie/','/mnt/1.5T/,tv/',) | |
LOGFILE = '/home/keizie/.brag/autounrar.log' | |
EXECUTE_RAR = 'unrar' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
modprobe vfio-pci | |
for dev in "$@"; do | |
if [ -e /sys/bus/pci/drivers/vfio-pci/$dev ]; then | |
continue | |
fi | |
vendor=$(cat /sys/bus/pci/devices/$dev/vendor) | |
device=$(cat /sys/bus/pci/devices/$dev/device) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$epoch = microtime(true); | |
function times(int $a) { | |
global $epoch; | |
$i = 0; | |
while (++$i <= $a) { | |
//sleep(1); | |
var_dump(microtime(true) - $epoch); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var request = require('request'); | |
var base64 = require('base64-stream'); | |
var JSONStream = require('JSONStream'); | |
var visionArgs = {key: fs.readFileSync('vision.key')}; | |
var visionUrl = 'https://vision.googleapis.com/v1/images:annotate'; | |
var reader = process.stdin.pipe(base64.encode()); | |
var writer = request.post({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FIFO="/tmp/mpvpipe" | |
TARGET=$1 | |
if [ "x--" = "x$TARGET" ]; then | |
TARGET=$2 | |
fi | |
PID=$(fuser $FIFO 2> /dev/null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TARGET_URL="$1" | |
BASE_URL=$(dirname $TARGET_URL) | |
NEXT_URL="go first" | |
until [ -z "$NEXT_URL" ] | |
do | |
w3m -I cp949 -O cp949 -cols 72 -dump $TARGET_URL | awk 'BEGIN {sw=""} /\[목록보기\]/ {sw=""} {if (sw) print} /댓글 부분으로/ {sw="ok"}' | |
NEXT_URL=$(w3m -dump_source $TARGET_URL | grep -m 1 "윗글" | awk -F\' '{print $2}') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# linkwarden > Settings > Access Token | |
TOKEN="" | |
HOST_URL="" | |
COLLECTION_ID="" | |
# collection where invalid urls go | |
INVALID_COLLECTION_ID="" | |
# some notes | |
# 1. "while read -r" is required to preserve escape from compact output from jq | |
# 2. NEW_URL can make jq breaking if NEW_URL itself have double-qoutations (which is not escaped) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable, OnModuleDestroy, OnModuleInit } from '@nestjs/common' | |
import { PrismaClient } from '@prisma/client' | |
import { faker } from '@faker-js/faker' // 샘플 문자열 생성 용도 | |
@Injectable() | |
export class DatabaseService | |
extends getExtendedClient() | |
implements OnModuleInit, OnModuleDestroy | |
{ | |
async onModuleInit() { |
OlderNewer