Advertisement
jcomeau_ictx

scripts for offline blogging

Mar 19th, 2014
128
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jcomeau@aspire:~$ for script in ~/bin/*blog.sh; do echo $script:; echo; cat $script; echo; done
  2. /home/jcomeau/bin/lastblog.sh:
  3.  
  4. #!/bin/bash
  5. cd $HOME/blog
  6. vi $(ls *Z.txt | tail -n 1) $*
  7.  
  8.  
  9. /home/jcomeau/bin/newblog.sh:
  10.  
  11. #!/bin/bash
  12. cd $HOME/blog
  13. vi $(date -u +%Y-%m-%d-%H%MZ.txt)
  14.  
  15. /home/jcomeau/bin/tagblog.sh:
  16.  
  17. #!/bin/bash
  18. cd $HOME/blog
  19. lastblog=$(ls *Z.txt | tail -n 1)
  20. if [ ${#@} = 1 ]; then
  21. ${ECHO-echo} ln -s $lastblog $1
  22. else
  23. ${ECHO-echo} ln -s $lastblog $(echo $* | tr ' ' '_').html
  24. fi
  25.  
  26. /home/jcomeau/bin/upblog.sh:
  27.  
  28. #!/bin/bash
  29. SERVERS='www tek'
  30. for server in $SERVERS; do
  31. rsync -avuz ${DRYRUN---dry-run} $HOME/blog/ $server:blog/
  32. done
Advertisement
RAW Paste Data Copied
Advertisement