Compare commits
No commits in common. "ba5cc94b726b8fb1aa0027c94ef479af5f370046" and "5aed9d6f6805d6c9a809e631d74ddb22502f4eae" have entirely different histories.
ba5cc94b72
...
5aed9d6f68
3
.bashrc
3
.bashrc
@ -12,7 +12,7 @@ alias l=lfcd
|
|||||||
alias clip="xclip -selection clipboard"
|
alias clip="xclip -selection clipboard"
|
||||||
alias phone="simple-mtpfs"
|
alias phone="simple-mtpfs"
|
||||||
alias bell="paplay /usr/share/sounds/freedesktop/stereo/complete.oga"
|
alias bell="paplay /usr/share/sounds/freedesktop/stereo/complete.oga"
|
||||||
alias usage="du -h -d 1 2> /dev/null | sort -h"
|
alias useage="du -h -d 1 2> /dev/null | sort -h"
|
||||||
# For laptop multi-gpu offloading
|
# For laptop multi-gpu offloading
|
||||||
alias nvidia_gpu="DRI_PRIME=1 __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia"
|
alias nvidia_gpu="DRI_PRIME=1 __NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia"
|
||||||
# Opinionated defaults
|
# Opinionated defaults
|
||||||
@ -20,7 +20,6 @@ alias feh="swallow feh --force-aliasing --draw-exif --scale-down --draw-filename
|
|||||||
alias ffplay="swallow ffplay $@"
|
alias ffplay="swallow ffplay $@"
|
||||||
alias shutdown="shutdown -P now"
|
alias shutdown="shutdown -P now"
|
||||||
alias untar="tar -xvf $@"
|
alias untar="tar -xvf $@"
|
||||||
alias cura="cura5 -platformtheme gtk3"
|
|
||||||
|
|
||||||
export DENO_INSTALL="/home/oliver/.deno"
|
export DENO_INSTALL="/home/oliver/.deno"
|
||||||
export PATH="$PATH:$DENO_INSTALL/bin:$HOME/.cargo/bin:$HOME/.local/bin/"
|
export PATH="$PATH:$DENO_INSTALL/bin:$HOME/.cargo/bin:$HOME/.local/bin/"
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Adapted from LinuxConfig.org
|
|
||||||
# GNU GPL v3.0+
|
|
||||||
CMDS="mkdir touch mv rm ls grep cat vim"
|
|
||||||
|
|
||||||
USER=$1
|
|
||||||
if ! id "$USER" 2&>/dev/null; then
|
|
||||||
echo 'INFO: User not found'
|
|
||||||
echo 'Creating...'
|
|
||||||
useradd -m $USER
|
|
||||||
fi
|
|
||||||
|
|
||||||
CHROOT=$(eval echo ~$USER)
|
|
||||||
CMDS=($CMDS) # convert to array
|
|
||||||
|
|
||||||
# cp in all commands and dependencies
|
|
||||||
for cmd in "${CMDS[@]}"; do
|
|
||||||
for dep in $( ldd $(which $cmd) | grep -v dynamic | cut -d " " -f 3 | sed 's/://' | sort | uniq ); do
|
|
||||||
cp --parents $dep $CHROOT
|
|
||||||
done
|
|
||||||
cp --parents $(which $cmd) $CHROOT
|
|
||||||
done
|
|
||||||
|
|
||||||
# cp user and group into chroot
|
|
||||||
cat /etc/passwd | grep $USER > $CHROOT/etc/passwd
|
|
||||||
cat /etc/group | grep $USER > $CHROOT/etc/group
|
|
||||||
|
|
||||||
SHELL=$(cat /etc/passwd | grep $USER | tr ":" "\n" | tail -n 1)
|
|
||||||
if [ ! -f $CHROOT$SHELL ]; then
|
|
||||||
echo "WARN: You didn't add the shell specified in /etc/passwd for $USER: ($SHELL)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ARCH amd64
|
|
||||||
if [ -f /lib64/ld-linux-x86-64.so.2 ]; then
|
|
||||||
cp --parents /lib64/ld-linux-x86-64.so.2 /$CHROOT
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ARCH i386
|
|
||||||
if [ -f /lib/ld-linux.so.2 ]; then
|
|
||||||
cp --parents /lib/ld-linux.so.2 /$CHROOT
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "NOTE: If you are using a shell that is NOT /bin/bash, you need to tell"
|
|
||||||
echo " chroot that by using: chroot $CHROOT {other shell path}"
|
|
||||||
echo ""
|
|
||||||
echo "Chroot jail is ready. To access it execute: chroot $CHROOT"
|
|
Loading…
x
Reference in New Issue
Block a user