Skip to content

Instantly share code, notes, and snippets.

@mcsooks
mcsooks / useful-linux-commands.md
Last active March 27, 2026 17:58
Linux Commands - potentially useful

useful-linux-commands

find files in FOLDER that have been modified in the past 17 days

find PATH/TO/FOLDER -type f -mtime -17 -ls

same as above, but list file size in human readable format

find PATH/TO/FOLDER -type f -mtime -17 -print0 | xargs -0 ls -lh

@mcsooks
mcsooks / copy-git-repo-via-git-bundle.md
Last active November 22, 2023 20:03
How to copy git repo (including commit history) to an offline (eg Granite) location

How to copy git repo (including commit history) to an offline location:

  • useful for copying repo to a location that does not have internet access, but you want commit history for reference

From local copy of git repo

git bundle create code_library.bundle HEAD main

This will create a file, code_library.bundle

Copy this file to target location

@mcsooks
mcsooks / How2read-SAS-STATA-MDB-files.R
Created February 4, 2022 15:01
Various methods of reading SAS, Stata, and other stats file formats in R
# Various methods of reading SAS, Stata, and other stats file formats in R
#
# Package used to read SAS, Stata, and other stats file formats
# library(foreign)
# NOTE: personally do not use this package
#
# Read Stata data into R using readstata13 package
@mcsooks
mcsooks / .htaccess
Created April 7, 2021 00:16
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/