random scripts I use
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
983B

  1. #!/usr/bin/env fish
  2. # copy regular files
  3. while read f t
  4. eval set t $t
  5. cp -vr "$t" "$f"
  6. end < files
  7. # copy font configs
  8. function copy-confd -a path out
  9. find $path/*.conf > $out/conflist
  10. rm $out/*.conf
  11. for f in $path/*.conf
  12. if not test -L "$f"
  13. cp -v "$f" "$out"
  14. end
  15. end
  16. end
  17. copy-confd /etc/fonts/conf.d system/fonts/
  18. copy-confd /etc/X11/xorg.conf.d system/xorg/
  19. # copy vim package names
  20. tree -dL 3 ~/.vim/pack > vim/packages
  21. for repo in ~/.vim/pack/*/*/*
  22. pushd $repo
  23. echo -n (basename $PWD)" " | tee /dev/stderr
  24. if test -d .git
  25. echo "<"(git config --get remote.(git rev-parse --abbrev-ref "master@{upstream}" | sed 's/\(.*\)\/.*/\1/').url)">"
  26. else
  27. echo "<no url>"
  28. end
  29. popd
  30. end | sort > vim/package_repos
  31. echo
  32. # erase passwords
  33. function erasepw -a inp out
  34. sed -i "$inp" "$out"
  35. echo "$out"
  36. end
  37. erasepw 's/password>.*<\//password>password removed<\//g' network/icecast.xml
  38. erasepw 's/password\(\s*\)".*"/password\1"password removed"/g' network/mpd.conf