Skip to content

Instantly share code, notes, and snippets.

View fcharlie's full-sized avatar

Force Charlie fcharlie

View GitHub Profile
@fcharlie
fcharlie / my.minttyrc
Created November 13, 2016 10:24
My Mintty color
ForegroundColour=248,248,242
BackgroundColour=39,40,34
CursorColour=248,248,242
Black=39,40,34
BoldBlack=117,113,94
Red=249,38,114
BoldRed=253,151,31
Green=166,226,46
BoldGreen=56,56,48
Yellow=244,191,117
@fcharlie
fcharlie / stashandrestore.ps1
Last active August 27, 2017 01:58
Track Repository
<#
#>
param(
[Switch]$Stash,
[Switch]$Restore
)
Function Restore-Repositories{
param(
@fcharlie
fcharlie / ProcessArgvLinux.cc
Created August 29, 2017 08:34
Server restart get other process command line for linux
#include <string>
#include <climits>
#include <cstring>
#include <unistd.h>
#include <vector>
#include <fcntl.h>
//// Support Restart
class ProcessArgv {
public:
@fcharlie
fcharlie / removewindowsold.txt
Created August 30, 2017 01:36
Remove Windows.old
0: CMD ADMIN
1: takeown /F c:\Windows.old\* /R /A /D S
2: cacls C:\Windows.old\*.* /T /grant administrators:F
3: rmdir /S /Q c:\Windows.old
@fcharlie
fcharlie / psrcline.ps1
Created September 8, 2017 10:35
Project sources line counts
#!/usr/bin/env powershell
# -----------
param(
[String]$ProjectDir
)
Function Get-FileLines {
param(
[string]$Path
@fcharlie
fcharlie / GitlabHookGen.ps1
Created September 21, 2017 09:07
Create Hook SymblocLink for all repo (Gitlab like)
#!/usr/bin/env powershell
### bind hook
$Repositories = "/home/git/repositories"
$Global:Installroot = "/home/git/gitlab-shell"
Function SymlinkNative {
param(
[string]$Path,
[string[]]$Hooks
@fcharlie
fcharlie / wdv.js
Created December 14, 2017 14:08
WDV
"use strict";var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor}}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}var codeStr='"use strict";var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(v
@fcharlie
fcharlie / consoleapi.h
Last active July 11, 2018 12:50
console API
// begin_consoleapi_h
/********************************************************************************
* *
* consoleapi.h -- ApiSet Contract for api-ms-win-core-console-l1 *
* *
* Copyright (c) Microsoft Corporation. All rights reserved. *
* *
********************************************************************************/
#ifdef _MSC_VER
@fcharlie
fcharlie / whois.cc
Last active August 30, 2018 13:39
whois windows
////
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
///
#include <functional>
#include <string>
#include <string_view>
#include <vector>
#include <asio.hpp>
#include <asio/ssl.hpp>
#include <algorithm>
#include <atomic>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <memory>
#include <thread>