Skip to content

Instantly share code, notes, and snippets.

# Init PowerShell Gui
Add-Type -AssemblyName System.Windows.Forms
# Create a new form
$GUIform = New-Object system.Windows.Forms.Form
$GUIform.MaximizeBox = $false # no maximize
$GUIform.FormBorderStyle = 'Fixed3D' # no resize
# Define the size, title and background color
$GUIform.ClientSize = '500,300'
#!/bin/bash
# Install and fix issues of xrdp on Ubuntu (tested on 22.04)
# v1.0.0
#
# References:
# * https://askubuntu.com/questions/1398732/multiple-users-use-linux-pc-at-the-same-time/1419949#1419949
# * https://superuser.com/questions/1479313/how-do-i-get-the-full-ubuntu-gnome-experience-via-xrdp/1655262#1655262
# * http://c-nergy.be/blog/?p=14051
@lukaszjablonski
lukaszjablonski / git-cdc
Created July 18, 2018 10:48
Change the date of git commit
#!/bin/bash
# Change the date of git commit
# souce: https://stackoverflow.com/a/24584976
# usage: git cdc commit date
# example: git cdc @~ "2014-07-04 20:32:45" would reset date of the commit before HEAD "@~" to "2014-07-04 20:32:45"
#
# commit
# date YYYY-mm-dd HH:MM:SS
commit="$1" datecal="$2"
@lukaszjablonski
lukaszjablonski / win-fr.bat
Last active March 17, 2022 11:37
Recursively find and replace files (Windows)
rem Recursively find and replace files
rem This script starts from current directory recursive search for the file name given in the first parameter and replace it (keeping its name) with the file given in second parameter.
rem source: https://stackoverflow.com/a/10423757
rem usage: fr.bat targetName replacementFile
rem example fr.bat test1.txt c:\data\replacementfile.txt would recursively search for "test1.txt" and replace it (keeping its name) withe the file "c:\data\replacementfile.txt"
@echo off
set targetName=%~NX1
set replacementFile=%~F2
call :processFolder