Skip to content

Instantly share code, notes, and snippets.

@jamesfreeman959
jamesfreeman959 / keepawake.ps1
Last active May 7, 2024 14:52
A very simple PowerShell script to keep a Windows PC awake and make lync think the user is active on the keyboard
# Useful references:
#
# https://superuser.com/questions/992511/emulate-a-keyboard-button-via-the-command-line
# https://ss64.com/vb/sendkeys.html
# https://social.technet.microsoft.com/Forums/windowsserver/en-US/96b339e2-e9da-4802-a66d-be619aeb21ac/execute-function-one-time-in-every-10-mins-in-windows-powershell?forum=winserverpowershell
# https://learn-powershell.net/2013/02/08/powershell-and-events-object-events/
#
# Future enhancements - use events rather than an infinite loop
$wsh = New-Object -ComObject WScript.Shell
while (1) {
1. hiltvm (applicable in top-level)
@dagger.hilt.android.lifecycle.HiltViewModel
class $NAME$ @javax.inject.Inject constructor(
$PARAM$
) : androidx.lifecycle.ViewModel() {
$END$
}
2. vmstatefunc (applicable in class)
private val _$NAME$ = androidx.compose.runtime.mutableStateOf<$TYPE$>($INITIAL_VALUE$)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/ PropertyList-1.0.dtd">
<key>com.apple.springboard.debugapplications
<true/>
<key>run-unsigned-code
<true/>
<key>get-task-allow
<true/>
<key>task_for_pid-allow
@avoiney
avoiney / .env
Created July 28, 2021 06:47
Directus under non root path with nginx
DIRECTUS_KEY=<...>
DIRECTUS_SECRET=<...>
DIRECTUS_DB_DATABASE=<...>
DIRECTUS_DB_USER=<...>
DIRECTUS_DB_PASSWORD=<...>
DIRECTUS_CACHE_ENABLED=true
DIRECTUS_CACHE_STORE=redis
DIRECTUS_ADMIN_EMAIL=<...>
DIRECTUS_ADMIN_PASSWORD=<...>
DIRECTUS_PUBLIC_URL=https://<server_name>/directus/ # server_name is the one used in nginx. Note the slash at the end.
@HarmJ0y
HarmJ0y / PowerView-3.0-tricks.ps1
Last active May 7, 2024 14:48
PowerView-3.0 tips and tricks
# PowerView's last major overhaul is detailed here: http://www.harmj0y.net/blog/powershell/make-powerview-great-again/
# tricks for the 'old' PowerView are at https://gist.github.com/HarmJ0y/3328d954607d71362e3c
# the most up-to-date version of PowerView will always be in the dev branch of PowerSploit:
# https://github.com/PowerShellMafia/PowerSploit/blob/dev/Recon/PowerView.ps1
# New function naming schema:
# Verbs:
# Get : retrieve full raw data sets
# Find : ‘find’ specific data entries in a data set
@0xjac
0xjac / private_fork.md
Last active May 7, 2024 14:47
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@viercc
viercc / sequenceA-eq-distribute.md
Last active May 7, 2024 14:46
sequenceA == distribute?

https://twitter.com/lotz84_/status/1787796266484908211

lotz @lotz84_

これを書いていて Vector n a 同士の sequenceA が distribute のように振る舞うのが気になった👀 一般に Traversable の distribute が Distributive の sequenceA に一致することが則を使って言えないだろうか?🤔 QuickCheck で少し探してみたけど反例はなさそう

大枠

@spiermar
spiermar / nginx.conf
Created September 12, 2018 06:42
Nginx RMTP to HLS and DASH
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid /var/run/nginx.pid;
events {
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@sergiecode
sergiecode / ANGULAR.md
Last active May 7, 2024 14:45
Instalaciones necesarias para el curso de ANGULAR