Skip to content

Instantly share code, notes, and snippets.

View fliedonion's full-sized avatar

Takahiro KITAHARA fliedonion

View GitHub Profile
@fliedonion
fliedonion / dns_client_log.ps1
Created October 25, 2024 01:36 — forked from randomvariable/dns_client_log.ps1
DNS Client Logging on Windows
function Start-DNSClientLog {
$DnsOpLog = Get-WinEvent -ListLog Microsoft-Windows-DNS-Client/Operational
$DnsOpLog.IsEnabled = $true
$DnsOpLog.SaveChanges()
}
function Get-DNSClientQueries {
foreach($event in (get-winevent Microsoft-Windows-DNS-Client/Operational | % { [xml]$_.ToXml() })) {
$Query = ($event.Event.EventData.Data | Where-Object { $_.Name -eq "QueryName" }).'#text'
@fliedonion
fliedonion / Git cleanup repository
Created June 5, 2024 16:07 — forked from boywijnmaalen/Git cleanup repository
Deletes all dangling commits, objects and blobs
# empty the stash
$ git stash clear
# objects can also be reached through the reflog.
# while branches record the history of some project, reflogs record the history of these branches.
# if you amend, reset etc. commits are removed from the branch history
# but git keeps them around in case you realize that you made a mistake.
# reflogs are a convenient way to find out what destructive (and other) operations were performed
# on a branch (or HEAD), making it easier to undo a destructive operation.
@fliedonion
fliedonion / InsertIgnoreUniqErrorManualTxService.java
Created December 20, 2022 17:29
Spring Boot Insert with manual transaction to Ignore DuplicateKeyException Example
package net.case_of_t.egpostgresmybatis.insertIgnoreUniqErrorDomain;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.DefaultTransactionDefinition;
@fliedonion
fliedonion / SampleCodeForm.cs
Last active December 20, 2022 10:59
JSON.NET Deserialize null string to string.Empty.
using JsonConvertOptionForm.Entity;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
@fliedonion
fliedonion / seafile-ignore.txt
Last active May 7, 2022 17:37
My Seafile ignore
# put this file your ROOT of share folder.
## comments below are tips or examples
# # a regular file (put both)
# test-file
# **/test-file
#
# # a dir (put both)
# test-dir/
# **/test-dir/
#
@fliedonion
fliedonion / settings.xml
Created January 17, 2022 16:36
Maven settings.xml example to configure Local directory / Network directory as Repository.
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>my-local-repo</id>
<repositories>
<repository>
<id>network-drive-repo</id>
<name>Test Local Repository</name>
<!-- copy %USERPROFILE%\.m2\repository as following directory -->
@fliedonion
fliedonion / !jun-app_apache_container.md
Last active November 29, 2020 12:59
try to shrink centos container image by jun-app.

以下で紹介されていたコンテナのサイズが小さくなればいいなとためしてみた。

https://jun-app.com/laravel-on-docker/

単純にRUNを結合した飲み。 うちだとsystemdなコンテナは使えないので (Volumeのマウント的にも)、動作確認はしていない。

インストールパッケージを参考にさせてもらって別のベースイメージでつくってみようかな(独り言)

結果から:

@fliedonion
fliedonion / test-pxssh.py
Last active November 14, 2020 17:26 — forked from jquast/test-pxssh.py
Fork for Update source for python3 and my pxssh testing.
##!/usr/bin/env python3
import os
import sys
from pexpect.pxssh import pxssh as PXSSH
import getpass
class Debug_PXSSH(PXSSH):
def sendline(self, input='') -> int:
@fliedonion
fliedonion / docker-compose.yml
Created July 9, 2020 17:57
rocket.chat 3.4.1 / let's chat docker-compose sample
version: "3"
services:
letschat:
image: sdelements/lets-chat
# image: lets-chat:2020-07-08
links:
- mongo
ports:
- 8080:8080
@fliedonion
fliedonion / !selenium_edge_osx.py
Last active November 29, 2023 08:38
selenium with Microsoft Edge on Mac OS X.
# coding: utf-8
from selenium import webdriver
edge_options = {
"executable_path": "/Users/takahiro/selenium-webdrivers/edge-83/msedgedriver",
# ofcourse change path to driver you downloaded.
"capabilities": {
"platformName": 'mac os x', # I get this from Chrome driver's capabilities
# "os" : "OS X", # also ok.
}