Skip to content

Instantly share code, notes, and snippets.

View technoscavenger's full-sized avatar

technoscavenger

  • Austin, TX
View GitHub Profile
@technoscavenger
technoscavenger / SecureStringToString.cs
Last active October 24, 2018 05:46
C# Convert SecureString to String
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
@technoscavenger
technoscavenger / WhiteXOpenCloseNotepad.cs
Created January 2, 2019 06:03
Example code to close and open Notepad using WhiteX
using System;
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TestStack.White;
using TestStack.White.Factory;
using TestStack.White.UIItems.Finders;
using TestStack.White.UIItems.MenuItems;
using TestStack.White.UIItems.WindowItems;
namespace UnitTestProject1
@technoscavenger
technoscavenger / .bash_profile
Last active December 2, 2019 04:28
Bash profile to get powerline-status working
export PATH=$PATH:/data/data/com.termux/files/usr/lib/python3.8/site-packages
powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
. /data/data/com.termux/files/usr/lib/python3.8/site-packages/powerline/bindings/bash/powerline.sh
@technoscavenger
technoscavenger / hidefromtaskbar.ps1
Created December 4, 2019 01:30
Hide an application from the taskbar
$code = @"
[DllImport("user32.dll", SetLastError = true)]
public static extern int GetWindowLong(IntPtr hWnd, int nIndex);
[DllImport("user32.dll")]
public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
[DllImport("user32.dll")]
public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
"@
Add-Type -MemberDefinition $code -Name Win32Util -Namespace System
@technoscavenger
technoscavenger / Enable-DisableNic.ps1
Created December 4, 2019 01:35
Disable/Enable network interface using PowerShell
$nic = Get-NetAdapter -Name 'O'
"Disabling nic"
$nic | Disable-NetAdapter -Confirm:$false
"Enabling nic"
$nic | Enable-NetAdapter
@technoscavenger
technoscavenger / EnableClearType.ps1
Created December 4, 2019 01:37
Enable ClearType using PowerShell
$signature = @'
[DllImport("user32.dll")]
public static extern bool SystemParametersInfo(
uint uiAction,
uint uiParam,
uint pvParam,
uint fWinIni);
'@
$SPI_SETFONTSMOOTHING = 0x004B
@technoscavenger
technoscavenger / GetUserMembership.ps1
Created December 4, 2019 01:39
Get membership of a given Windows user
$query = "ASSOCIATORS OF {Win32_Account.Name='timus',Domain='mydomain'} WHERE ResultRole=GroupComponent ResultClass=Win32_Account"
Get-WMIObject -Query $query | Select Name
@technoscavenger
technoscavenger / tsconfig.json
Created December 18, 2019 02:33
My default TypeScript configuration
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"strict": true,
"declaration": true,
"sourceMap": true,
"outDir": "./dist"
},
"include": [
@technoscavenger
technoscavenger / installer.js
Created December 18, 2019 06:11
Updated version of installer.js for Appium Windows Applicatin Driver
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.downloadWAD = downloadWAD;
exports.setupWAD = setupWAD;
exports.verifyWAD = verifyWAD;
@technoscavenger
technoscavenger / helloworld.cpp
Created January 25, 2020 15:11
Hello world in C++
#include <iostream>
using namespace std;
int main()
{
cout << "hello, world!\n";
return 0;
}