-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87600ef
commit e2056de
Showing
5 changed files
with
79 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,4 +166,6 @@ dist | |
# Finder (MacOS) folder config | ||
.DS_Store | ||
|
||
build | ||
build | ||
amdhelper.gz | ||
amdhelper.gz.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
command -v advdef > /dev/null || echo advdef is not installed. Install for a better compression ratio | ||
command -v 7z > /dev/null || echo 7z is not installed. Install for a better compression ratio | ||
|
||
if [ -z "$1" ] | ||
then | ||
echo "USAGE: $0 OUTPUT.gz" | ||
echo "Compresses stdin to OUTPUT.gz" | ||
exit 1 | ||
fi | ||
|
||
|
||
OUT=$1 | ||
|
||
myhash(){ | ||
sha256sum $@ | sed s/\ .*// | ||
} | ||
|
||
time gzip -9 > $OUT.new | ||
mv $OUT.new $OUT | ||
ORIG_HASH=`gunzip < $OUT|myhash` | ||
|
||
accept_new(){ | ||
if [ ".`gunzip < $OUT.new|myhash`" = ".$ORIG_HASH" ] | ||
then | ||
oldsize=$(stat -f%z "$OUT") | ||
newsize=$(stat -f%z "$OUT.new") | ||
if [ $oldsize -gt $newsize ] | ||
then | ||
echo "$oldsize->$newsize: Saved $((oldsize-newsize)) bytes." | ||
mv -f $OUT.new $OUT | ||
else | ||
echo "$oldsize->$newsize: No savings, new file discarded." | ||
fi | ||
else | ||
echo $OUT.new corrupt. Deleting. | ||
rm $OUT.new | ||
fi | ||
} | ||
echo Finished GZIP compression, you now have a complete gz file | ||
echo You can stop here, but we will try to make the file smaller for you. | ||
rm $OUT.new || true | ||
#time 7z a $OUT.new -mx=9 -tgzip $OUT | ||
gunzip < $OUT | time 7z a $OUT.new -mx=9 -tgzip -si | ||
#time 7z a dummy -mx=9 -tgzip -so -si $OUT.new $OUT | ||
|
||
accept_new | ||
#cp $OUT $OUT.new | ||
#echo Trying advdef compression | ||
#time advdef -4 -z $OUT.new # instead link? | ||
#accept_new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
echo "Installing AMDHelper..." | ||
curl -sSL https://github.com/alvindimas05/AMDHelper/releases/latest/download/amdhelper -o amdhelper | ||
curl -sSL https://github.com/alvindimas05/AMDHelper/releases/latest/download/amdhelper.gz -o amdhelper.gz | ||
tar -xvzf amdhelper.gz | ||
chmod +x amdhelper | ||
sudo mv amdhelper /usr/local/bin | ||
echo "AMDHelper installed! Run the command below to start." | ||
echo "sudo amdhelper" | ||
echo "sudo amdhelper" |