Skip to content

Instantly share code, notes, and snippets.

View ymollard's full-sized avatar
🐧

Yoan Mollard ymollard

🐧
View GitHub Profile
@ymollard
ymollard / clean_git_repository.bash
Created February 4, 2016 00:54
Clean a git repository by deleting history and data of old deleted files
#!/bin/bash
# This script, executed at the root of a git repository, deletes traces of every old file in this repository, index + blob on all branches
# It can take 10-30 minutes to run and will print regular warning stating than some references are unchanged
# time ./clear_git_repositor.bash >cleaning.log
# We need several passes to clean files renamed multiple times (git log --find-renames prevents its deletion for each renaming)
# MAXIMUM_PASSES should be more than the maximum number of renamings/movings for any file, if not then we might keep some traces of former files
MAXIMUM_PASSES=10 # Maximum number of passes
@ymollard
ymollard / xrandr.bash
Last active September 25, 2024 12:02
Set the screen to a custom resolution with xrandr
# 1. Select first the resolution you would like to get the modeline (preferably the screen native resolution)
$ cvt 1920 1080
# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
# 2. Identify your screen name (here VGA-0 with a low res)
$ xrandr
Screen 0: minimum 8 x 8, current 2560 x 1080, maximum 16384 x 16384
VGA-0 connected 640x480+1920+0 (normal left inverted right x axis y axis) 0mm x 0mm
640x480 59.9*+