Skip to content

Instantly share code, notes, and snippets.

View droidfivex's full-sized avatar

Izumi Inami droidfivex

  • Japan
View GitHub Profile

フォルダ構成と履歴残したままgitレポジトリから数フォルダ切り出してえ

使え。(subdirectory-filter個別にしてこれ実行してpullしたら良い感じになるんじゃねーの!?)

git filter-branch -f --tree-filter '
for file in `find -type f | grep -v ./$(pwd | sed -e "s/\/\.git-rewrite.*//g" | sed -e "s/.*\///g")/ | grep -v .git | sed "s/\.\///g"`
do
if [ -d ${file%/*} ]; then
  mkdir -p $(pwd | sed -e "s/\/\.git-rewrite.*//g" | sed -e "s/.*\///g")/${file%/*}
  mv $file $(pwd | sed -e "s/\/\.git-rewrite.*//g" | sed -e "s/.*\///g")/${file%/*}
@droidfivex
droidfivex / install.sh
Created December 17, 2016 15:09
work with rootkitxperia-20140719 on Linux
#!/bin/bash
echo "--- Xperia rootkit 2014/07/19 ---"
echo "waiting for device..."
adb wait-for-device
for file in `ls files`
do
adb push files/$file /data/local/tmp/

WHAT IS THIS?

mount points from SOL22 stock ramdisk.

  • rc.md ... su then grep "mount" *.rc and remove unuse line
  • fstab.qcom ... raw fstab.qcom

points list (sorted)

/acct

AUTOMATION SET COMMIT MSG / AUTHOR

sample: zhao's Remove enhanced NFC feature commit.

function zhao () {
	git add --all
	device=$(pwd | sed "s/.*_//g")
	echo -e "$device: Remove enhanced NFC feature\n\nThis is no longer used anywhere.\n\nChange-Id: Iaabfaec2d7c734b5f286f3dc4ef651d93b2f2bc8" > .git/COMMIT_EDITMSG
#!/bin/bash
for filename in `find ./cm_device_sony_gaga/ -type f`; do
echo $filename | grep ".git" >& /dev/null
if [ $? -ne 0 ]; then
echo "Processing: $filename"
filenamed=`echo "$filename" | sed -e 's/yuga/gaga/g'`
cat $filename | sed -e 's/yuga/gaga/g' > "${filenamed}.changed"
if [ -x $filename ]; then
rm -rf ${filename}