Skip to content

Instantly share code, notes, and snippets.

@enten
enten / checkdroid.sh
Last active April 5, 2024 14:17
Detect if a shell script is running on Android
## To do this, we need the code below in a file somewhere on the Android device (in /data/checkdroid for example):
ANDROID_HOST=0
ANDROID_BUSYBOX=/system/bin/busybox
ANDROID_BUSYBOX_APPLETS="acpid add-shell addgroup adduser adjtimex arp arping ash awk base64 basename beep blkid blockdev bootchartd brctl bunzip2 bzcat bzip2 cal cat catv chat chattr chgrp chmod chown chpasswd chpst chroot chrt chvt cksum clear cmp comm conspy cp cpio crond crontab cryptpw cttyhack cut date dc dd deallocvt delgroup deluser depmod devmem df dhcprelay diff dirname dmesg dnsd dnsdomainname dos2unix du dumpkmap dumpleases echo ed egrep eject env envdir envuidgid ether-wake expand expr fakeidentd false fbset fbsplash fdflush fdformat fdisk fgconsole fgrep find findfs flock fold free freeramdisk fsck fsck.minix fsync ftpd ftpget ftpput fuser getopt getty grep groups gunzip gzip halt hd hdparm head hexdump hostid hostname httpd hush hwclock id ifconfig ifdown ifenslave ifplugd ifup inetd init insmod install ionice iostat ip ipaddr ipc
@enten
enten / nygma.sh
Last active October 10, 2022 19:44
set -u
## ========================================================================================
## nygma : a tiNY Great MAnager
## ========================================================================================
PROGNAME="nygma"
PROGVERS="0.0.3"
PROGHELP="Usage: $PROGNAME <Nygfile> [DIR]
Arguments:
<Nyfile> # Path to Nygfile
#!/system/bin/sh
set -u
## ========================================================================================
## alfred : manages an ArchLinux rootfs for enable LXC usage on Android
## ========================================================================================
PROGNAME="alfred"
PROGVERS="0.0.6"
PROGCONF="/data/$PROGNAME"
PROGHELP="Usage: $PROGNAME [cmd]
@enten
enten / cpld
Created February 28, 2015 13:28
#!/bin/bash
# Author : Hemanth.HM, Steven ENTEN
# Email : hemanth[dot]hm[at]gmail[dot]com, steven[at]enten[dot]fr
# License : GNU GPLv3
#
function useage()
{
cat << EOU
Useage: bash $0 <path to the binary> <path to the rootfs where copy the dependencies>
@enten
enten / increase-android-userdata-img.sh
Last active May 6, 2016 17:53
Increase userdata.img size outcome of Android compilation
dd if=/dev/zero bs=1G count=16 >> userdata.img
e2fsck -f userdata.img
resize2fs userdata.img
e2fsck -f userdata.img
@enten
enten / README.md
Last active June 13, 2020 23:50
version.sh - semver helper

version.sh - semver helper

Usage

NAME:
	version.sh - semver helper

VERSION:
	0.0.3
@enten
enten / get-origin-remote-url.sh
Last active August 29, 2015 14:25
How to read origin remote URL from git config
cat .git/config | grep remote -A 5 | grep 'url =' | awk -F ' = ' '{ print $2 }'
@enten
enten / contributors.sh
Created August 23, 2015 17:52
Create MAINTAINERS file from git commits
#!/bin/sh
# contributors: Generate MAINTAINERS content from git commits
#
# Author: Steven Enten <steven@enten.fr>
# License : MIT
# Requirements: dirname cat echo eval grep read readlink shift tail
# Site: https//github.com/enten/losh
set -u
@enten
enten / get-gh-pages-url.sh
Last active April 3, 2018 13:08
Print Github username/repository from the current remote branch
REPO=git remote -v | grep -e push | awk '{print $2}' | sed 's/https:\/\/github.com\///g' | sed 's/.git//g'
REPOUSER=$(echo $REPO | awk -F '/' '{print $1}')
REPONAME=$(echo $REPO | awk -F '/' '{print $2}')
echo "https://$REPOUSER.github.io/$REPONAME"
for i in $(git status | grep modified | awk -F " " '{print $2}');
do cat $i | tr -d '\r' > $i.tmp; mv $i.tmp $i;
done