Skip to content

Instantly share code, notes, and snippets.

View mcxiaoke's full-sized avatar

Hello World mcxiaoke

  • Earth
View GitHub Profile
@mcxiaoke
mcxiaoke / ApplicationInfo.cs
Created June 12, 2022 13:14 — forked from jrgcubano/ApplicationInfo.cs
Provide info about running application C#
/// <summary>
/// This class provides information about the running application.
/// </summary>
public static class ApplicationInfo
{
private static readonly Lazy<string> _productName = new Lazy<string>(GetProductName);
private static readonly Lazy<string> _version = new Lazy<string>(GetVersion);
private static readonly Lazy<string> _company = new Lazy<string>(GetCompany);
private static readonly Lazy<string> _copyright = new Lazy<string>(GetCopyright);
private static readonly Lazy<string> _applicationPath = new Lazy<string>(GetApplicationPath);
@mcxiaoke
mcxiaoke / SingleInstance.cs
Created May 22, 2022 13:41 — forked from meziantou/SingleInstance.cs
SingleInstance
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Ipc;
using System.Threading;
namespace SingleInstance
{
class Program
{
@mcxiaoke
mcxiaoke / FlyCamera.cs
Created May 10, 2022 02:35 — forked from FreyaHolmer/FlyCamera.cs
A camera controller for easily flying around a scene in Unity smoothly. WASD for lateral movement, Space & Ctrl for vertical movement, Shift to move faster. Add this script to an existing camera, or an empty game object, hit play, and you're ready to go~
using UnityEngine;
[RequireComponent( typeof(Camera) )]
public class FlyCamera : MonoBehaviour {
public float acceleration = 50; // how fast you accelerate
public float accSprintMultiplier = 4; // how much faster you go when "sprinting"
public float lookSensitivity = 1; // mouse look sensitivity
public float dampingCoefficient = 5; // how quickly you break to a halt after you stop your input
public bool focusOnEnable = true; // whether or not to focus and lock cursor immediately on enable

1. Create new branch:

git checkout -b otherrepo-master master

2. Get the contents of the PR

git pull https://github.com/otherrepo/my-repo-name.git master
@mcxiaoke
mcxiaoke / shittyinjector.cpp
Created May 2, 2022 07:31 — forked from khang06/shittyinjector.cpp
Barebones launcher/injector for mhynot2
#include <Windows.h>
#include <stdio.h>
#define GAME_DIR L"D:\\Games\\Genshin Impact\\Genshin Impact game"
#define DLL_PATH "C:\\Users\\Khang\\source\\repos\\mhynot2-rewritten\\x64\\Debug\\mhynot2-rewritten.dll"
int main() {
printf("hi\n");
SetCurrentDirectoryW(GAME_DIR);
@mcxiaoke
mcxiaoke / aria2.conf
Created March 26, 2022 06:21 — forked from qzm/aria2.conf
Best aria2 Config
### Basic ###
# The directory to store the downloaded file.
dir=${HOME}/Downloads
# Downloads the URIs listed in FILE.
input-file=${HOME}/.aria2/aria2.session
# Save error/unfinished downloads to FILE on exit.
save-session=${HOME}/.aria2/aria2.session
# Save error/unfinished downloads to a file specified by --save-session option every SEC seconds. If 0 is given, file will be saved only when aria2 exits. Default: 0
save-session-interval=60
# Set the maximum number of parallel downloads for every queue item. See also the --split option. Default: 5
@mcxiaoke
mcxiaoke / android-backup-apk-and-datas.md
Created February 24, 2022 14:56 — forked from AnatomicJC/android-backup-apk-and-datas.md
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Fetch application APK

To get the list of your installed applications:

@mcxiaoke
mcxiaoke / windows_and_office_kms_setup.adoc
Created February 18, 2022 11:06 — forked from jerodg/windows_and_office_kms_setup.adoc
Activate Windows and Office Using KMS Server

Microsoft Windows and Office KMS Setup

@mcxiaoke
mcxiaoke / README.md
Created January 12, 2022 09:55 — forked from mauron85/README.md
PM2 as a Windows Service under Local Service

PM2 as a Windows Service under Local Service

This is a PoC for running PM2 as a Windows Service under the Local Service account instead of the Local System account.

Prerequsites

  • Neither pm2 or pm2-windows-service installed yet. (The Powershell script will run npm i)
    • At the very least, you should run pm2-service-uninstall before running this script
  • npm and npm-cache global folders should be somewhere accessible to NT AUTHORITY\LocalService.
@mcxiaoke
mcxiaoke / wifi-on-ubuntu-server-18.md
Created August 13, 2021 10:40 — forked from austinjp/wifi-on-ubuntu-server-18.md
Enabling wifi on Ubuntu server 18

Wifi on Ubuntu 18 server

TLDR

  1. Install wpasupplicant
  2. Turn on wifi radios: sudo nmcli radio wifi on
  3. Check your devices are recognised even if they're not "managed": sudo iwconfig
  4. Check your wifi (here called "wlp3s0") is capable of detecting nearby routers: sudo iwlist wlp3s0 scan
  5. Configure netplan by dropping a file called 01-netcfg.yaml into /etc/netplan/ or edit existing file there. See example below.
  6. netplan try, netplan generate, netplan apply.