Skip to content

Instantly share code, notes, and snippets.

View MayMeow's full-sized avatar
🌙
Moonlit Coding Session 🌌

May MayMeow

🌙
Moonlit Coding Session 🌌
View GitHub Profile
@MayMeow
MayMeow / ExportOffice365user.ps1
Created October 12, 2023 14:34 — forked from CCOSTAN/ExportOffice365user.ps1
Powershell commands for export Azure AD and import into local AD
#import office 365 session
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
#connect Azure AD
Connect-MsolService -Credential $UserCredential
#Random password generator
Function random-password ($length = 8)
@MayMeow
MayMeow / shades-of-purple-terminal.json
Created November 30, 2022 14:06
Shades of purple inspired theme
{
"background": "#15152B",
"black": "#000000",
"blue": "#6943FF",
"brightBlack": "#5C5C61",
"brightBlue": "#6871FF",
"brightCyan": "#79E8FB",
"brightGreen": "#43D426",
"brightPurple": "#FF628C",
"brightRed": "#F92A1C",
@MayMeow
MayMeow / run-script.ps1
Created October 27, 2022 13:45
Execute script over API on Mikrotik router
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
@MayMeow
MayMeow / termina.json
Created June 28, 2022 11:26
terminal-theme.json
{
"background": "#2D2A2E",
"black": "#1A181A",
"blue": "#1080D0",
"brightBlack": "#707070",
"brightBlue": "#22D5FF",
"brightCyan": "#7ACCD7",
"brightGreen": "#A4CD7C",
"brightPurple": "#AB9DF2",
"brightRed": "#F882A5",
@MayMeow
MayMeow / .gitlab-ci.yml
Created April 15, 2022 08:09 — forked from htuscher/.gitlab-ci.yml
Deploying with docker-compose via SSH tunnel in Gitlab CI
deploy:live:
image: 1drop/docker:git
stage: deploy
when: manual
environment:
name: production
url: https://www.somecustomer.de
before_script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
@MayMeow
MayMeow / Examples.md
Last active February 13, 2022 03:07
Selfsigned Certificates for Code signing in visual studio

Create CA file

$c = New-SelfSignedCertificate -DnsName SelfSignedCA -CertStoreLocation Cert:\CurrentUser\My -NotAfter (Get-Date).AddYears(10)

check certificate fingerprint

$c
@MayMeow
MayMeow / rebind.rsc
Last active January 15, 2022 08:34
Try to get new IP address when no internet on Gateway interface in Mikrotik
# Ping 6 times to some address (google free DNS here) and if no response try to get new IP address
:if ([/ping 8.8.8.8 interface=ethernet-gateway count=6] = 0) do={/ip dhcp-client release numbers=0}
@MayMeow
MayMeow / add-vpn.ps1
Created January 15, 2022 08:29
Add VPN connection with Powershell
# add-l2tp.ps1
param($name, $server, $psk)
Add-VpnConnection -Name $name -ServerAddress $server -TunnelType "L2tp" -AuthenticationMethod Chap,MSChapv2,Pap -L2tpPsk $psk
@MayMeow
MayMeow / send-file.php
Last active January 15, 2022 08:34
Cakephp Send string as file
<?php
public function sendIcs()
{
$icsString = $this->Calendars->generateIcs();
$response = $this->response;
// Inject string content into response body
$response = $response->withStringBody($icsString);