Skip to content

Instantly share code, notes, and snippets.

using System.Windows.Automation;
// WINDOWS CREDENTIAL UI AUTOMATION by 3735943886
/*
Credential Dialog Xaml Host
- TextBlock / WindowLogo / 
- TextBlock / / Windows 보안
- Button / CloseButton / 닫기
- ScrollViewer / /
@3735943886
3735943886 / otp.sh
Last active September 20, 2022 07:02
#!/usr/bin/env bash
LOGINUSER="$(who am i | awk '{print $1}')"
HOMEDIR="$(getent passwd $LOGINUSER | cut -d: -f6)"
OTPKEY="$HOMEDIR/.otpkeys"
RCX=0
echo
if [ -f "$OTPKEY" ]
then
while read -r services; do
@3735943886
3735943886 / SetMonitorPower.c
Last active August 4, 2023 17:26
Turn On / Off display monitor
/* dependencies */
#pragma comment(lib, "dxva2")
#pragma comment(lib, "user32")
#include <lowlevelmonitorconfigurationapi.h>
typedef struct _MONITORPOWERPARAM
{
LPCWSTR szPhysicalMonitorDescription;
BOOL bPowerOn;
} MONITOR_POWER_PARAM, *PMONITOR_POWER_PARAM;
@3735943886
3735943886 / SetDeviceState.c
Last active January 25, 2024 08:46
Disable or Enable Device with Hardware ID
/* for Devpkey */
#define INITGUID
/* dependencies */
#pragma comment (lib, "SetupAPI")
#include <windows.h>
#include <SetupAPI.h>
#include <Devpkey.h>
VOID SetDeviceState(LPCWSTR lpszHardwareId, DWORD dwState)
#include <windows.h>
#include <wtsapi32.h>
HANDLE CreateProcessActiveConsole(LPCTSTR app, LPTSTR cmd)
{
static HANDLE hToken;
static STARTUPINFO si;
static PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(STARTUPINFO));
#pragma comment (lib, "ole32")
#pragma comment (lib, "oleaut32")
#pragma comment (lib, "wbemuuid")
#include <stdio.h>
#include <windows.h>
#include <wbemidl.h>
void GetLastInputInfoFromWmi()
{
@3735943886
3735943886 / sexratio.py
Created April 4, 2019 01:55
Sex ratio calculation
from random import random
CONST_FAMILIES = 65536
CONST_GENERATIONS = 100
CONST_NATURAL_RATIO = 0.5
# User input data
A1 = input('How many families are there? (default ' + str(CONST_FAMILIES) + ')')
A2 = input('How many children will one family have? (default ' + str(CONST_GENERATIONS) + ')')
@3735943886
3735943886 / ffxiv.auto.translate.en.cs
Last active March 23, 2024 13:14
Ffxiv auto-translation dictionary
/* Version 4.06a */
using System.Collections.Generic;
namespace Ffxiv
{
static public partial class AutoTranslate
{
static public IReadOnlyDictionary<ulong, string> EnDict = new Dictionary<ulong, string>()
{
/* 【Languages】 */
@3735943886
3735943886 / EorzeaClock.c
Last active August 4, 2023 17:27
Get Eorzea Time
#include <stdio.h>
#include <time.h>
void GetEorzeaTime(int *eHour, int *eMin)
{
/* Get current time */
time_t currentTime;
time(&currentTime);
/* Convert to Eorzea time */
#pragma comment(lib, "user32")
#pragma comment(lib, "psapi")
 
#include <stdio.h>
#include <windows.h>
#include <psapi.h>
 
void main()
{
    HWND hWnd;