How To: Web stuff

Manage a website using git

  • Create a local repo on your workstation:
$ git init
$ git add index.html
$ git commit
  • SSH into the server and create the remote repo:
$ mkdir website.git
$ cd website.git
$ git init --bare
  • Create a post-receive hook (hooks/post-receive) that automatically updates the server’s DocumentRoot:
$ vim hooks/post-receive

GIT_WORK_TREE=/var/www/ git checkout -f

$ chmod +x hooks/post-receive
  • On your workstation, add the remote repo as a “remote”:
$ git remote add website ssh://
$ git push website +master:refs/heads/master
  • Afterwards, any further changes can be pushed with the usual git push


  • Send a POST request using curl:
curl -d "var1=value&var2=value2" -X POST "https://..."
  • Use POST parameters from a file:
curl "https://..." -X POST -d @myfile.txt
  • Use sqlmap for basic pentesting:
python .\ -u "https://.../?var1=value1&var2=value2" -p "var1,var2"
python .\ -u "https://.../" --data "var1=value1" -p "var1" --method POST