Skip to content

Instantly share code, notes, and snippets.

@vitalyp
Created June 29, 2017 08:51
Show Gist options
  • Save vitalyp/b7ee6db012c33709f7f8de5e58dd05b5 to your computer and use it in GitHub Desktop.
Save vitalyp/b7ee6db012c33709f7f8de5e58dd05b5 to your computer and use it in GitHub Desktop.
How to setup midnight-commander file manager to heroku
#!/bin/bash
# Create file:
# cat > heroku_mc.sh <<- "EOF"
# this file contents
# EOF
mkdir -p /tmp
McDIR="/tmp/mc";McBinDIR="$McDIR/bin";mkdir -p $McDIR;cd $McDIR;TmpDIR="/temp_deb";mkdir -p $McDIR/$TmpDIR;cd $McDIR/$TmpDIR;wget http://security.ubuntu.com/ubuntu/pool/universe/m/mc/mc_4.8.1-2ubuntu1_amd64.deb;ar -x mc_4.8.1-2ubuntu1_amd64.deb;tar -xvf data.tar.gz;
mv usr/* $McDIR;mkdir $McDIR/etc;mv ./etc/mc/* $McDIR/etc;cd $McDIR;rm -rf $TmpDIR;
cd $McDIR;TmpDIR="temp_libgpm";mkdir $TmpDIR;cd $TmpDIR;wget http://ftp.us.debian.org/debian/pool/main/g/gpm/libgpm2_1.20.4-6.2+b1_amd64.deb;ar -x libgpm2_1.20.4-6.2+b1_amd64.deb;tar -xvf data.tar.xz;
cp usr/lib/x86_64-linux-gnu/libgpm.so.2 $McBinDIR;
cd $McDIR;rm -rf $TmpDIR;cd $McBinDIR;echo "----> libgpm.so.2 arc => ";file -L libgpm.so.2;echo "----> mc arc => ";file -L mc;
alias mc='env LD_LIBRARY_PATH="$HOME/local/lib:$McBinDIR" $McBinDIR/mc;'
env LD_LIBRARY_PATH="$HOME/local/lib:$McBinDIR" $McBinDIR/mc;
# chmod +x heroku_mc.sh
# heroku_mc.sh
# Then, use alias 'mc'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment