Skip to content

Instantly share code, notes, and snippets.

@StudioLE
StudioLE / 00-change-motd.sh
Last active June 4, 2020 09:58
Ubuntu Change Message of the Day (MOTD)
#!/bin/bash
# https://raymii.org/s/tutorials/Disable_dynamic_motd_and_motd_news_spam_on_Ubuntu_18.04.html
# Disable Dynamic MOTD
# Change ENABLED=1 to ENABLED=0.
sudo nano /etc/default/motd-news
# Disable a few components
sudo chmod -x /etc/update-motd.d/00-header
@StudioLE
StudioLE / git-renormalize.sh
Last active June 9, 2020 16:12
Renormalize all line endings
echo "* text=auto" >.gitattributes
git add --renormalize .
git commit -m "Renormalized end-of-line"
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
git branch -m master main && git fetch origin && git branch -u origin/main main && git remote set-head origin -a
@StudioLE
StudioLE / dotnetlayout.md
Created July 29, 2021 11:46 — forked from davidfowl/dotnetlayout.md
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@StudioLE
StudioLE / git-rewrite-tags-as-commits
Last active September 14, 2021 08:41
Git rewrite tags as commits. Squash everything but preserve tags.
#!/bin/bash
ORIGINAL_BRANCH="main"
NEW_BRANCH="new-history"
START_COMMIT="84eafe059aa3059d2e3db260a2248deae7502c57"
NEW_TAG_PREFIX="v2-"
git checkout -b ${NEW_BRANCH} ${START_COMMIT}
# Loop through every tag on the ORIGINAL_BRANCH
@StudioLE
StudioLE / NaturalLanguageExtensions.cs
Last active September 5, 2022 11:22
Convert TimeSpan and DateTime to a natural language representations
/// <summary>
/// Convert a <see cref="TimeSpan"/> to a natural language representation.
/// </summary>
/// <example>
/// <code>
/// TimeSpan.FromSeconds(10).ToNaturalLanguage();
/// // 10 seconds
/// </code>
/// </example>
public static string ToNaturalLanguage(this TimeSpan @this)
@StudioLE
StudioLE / install-ubuntu-on-ovh.md
Created October 2, 2024 21:57
install-ubuntu-on-ovh.md
  1. Boot into Rescue mode

https://www.ovh.com/manager/

  1. Download and run the Remote KVM Java Applet

  2. Power Control > Set Power Reset

If it doesn't boot into rescue mode you may need to press DEL to run setup and revise to boot order to make Network first.