Skip to content

Instantly share code, notes, and snippets.

View gut5's full-sized avatar
💭
who cares

guts gut5

💭
who cares
  • !the boat
View GitHub Profile
@gut5
gut5 / gist:870940a93b33118771726a4a94dcd3e5
Created September 8, 2024 08:51
Easy ps4 fpkg backup
You only need this if you want to redo/replace your PS4's HDD for some reason but you don't want to go to the trouble of downloading everything again.
You need to jailbreak the PS4 and then connect with FTP (Filezilla is perfect for this).
Then you just go to the /user/app/CUSAxxxxx folder for the game you want to back up and copy out the app.pkg to your PC. Also check the /user/patch/CUSAxxxxx folder if you want to keep the update pkgs.
@gut5
gut5 / gist:5ac3284b760650c1c968fdd4c0da5732
Created September 8, 2024 08:43
Merge base PS4 fpkg with update fpkg (to cut down on space requirement)
This is for when you already have the base fpkg and the update fpkg for the game and the update is taking up a lot of space and you want to merge it with the base fpkg.
You will need Fake PKG Generator (the version doesn't matter, we only need to use 3 components) https://github.com/CyB1K/PS4-Fake-PKG-Tools-3.87/releases/latest
1. Extract both base and update fpkgs into their own folder using orbis-pub-chk.exe, call the folders whatever as long as you know which one is which.
2. Cut/copy all the contents of the update folder into the base folder and overwrite whatever you get prompted to overwrite.
3. This is where you need to get the naming convention for the merged game folder correct, name the folder according to what the Fake PKG Generator documentation says (not going to repeat it here unnecessarily).
@gut5
gut5 / csv-oneliner.md
Last active July 29, 2023 17:27
CSV one-liners

To print the first column of a CSV file:

awk -F, '{print $1}' file.csv

To print the first and third columns of a CSV file:

awk -F, '{print $1 "," $3}' file.csv

To print only the lines of a CSV file that contain a specific string:

@gut5
gut5 / gist:e6066ced772ed17ada294c3539ff20b7
Created March 19, 2023 17:58
ffmpeg batch convert mp4 to webm
$folder = "C:\path\to\folder"
$webm = "C:\path\to\webm\folder"
$mp4Files = Get-ChildItem -Path $folder -Filter "*.mp4"
foreach ($file in $mp4Files) {
$fileName = $file.Name
$input = $folder + "\" + $fileName
$output = $webm + "\" + $fileName.Replace(".mp4", ".webm")
for f in ./*.mkv
do
ffmpeg -i "$f" [...]
done
@gut5
gut5 / ps1
Created February 17, 2022 19:25
ps1
export PS1="\[\033[38;5;92m\][\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;162m\]\@\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;92m\]]\[$(tput sgr0)\] \[$(tput sgr0)\]\[$(tput bold)\]\[\033[38;5;50m\]\W\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;39m\]>\[$(tput sgr0)\] \[$(tput sgr0)\]"
@gut5
gut5 / git-things.sh
Created July 9, 2021 19:29
Useful Git things
# for seeing who has committed how much to your project
git shortlog -sn --all --no-merges
# See who last changed lines 5 through 10 of the buttons’ CSS:
git blame -L5,10 _components.buttons.scss
# easier to see diff changes
git diff -w
git diff --word-diff
@gut5
gut5 / init.vim
Last active December 14, 2020 13:25
set number
set hlsearch
set incsearch
set foldmethod=indent
syntax enable
filetype plugin indent on
" Specify a directory for plugins
" - For Neovim: stdpath('data') . '/plugged'
#these instructions are for Ubuntu 19.04+
#get the deb https://github.com/devkitPro/pacman/releases/latest
sudo dpkg -i devkitpro-pacman.deb
#add this shit to .profile or .bashrc or .bash_profile, doesn't have to be all 3
export DEVKITPRO=/opt/devkitpro
export DEVKITARM=${DEVKITPRO}/devkitARM
export DEVKITPPC=${DEVKITPRO}/devkitPPC
export PATH=${DEVKITPRO}/tools/bin:$PATH
select replace(convert(varchar,getdate(),112),'.','') + '_' + REPLACE(CONVERT(varchar(5), GETDATE(), 108), ':', '') '_' +