Giter Club home page Giter Club logo

pokrovsky's Introduction

Pokrovsky

Github History Vandalism as a Service

The unbroken chain of pointless Things-as-a-Service continues. This one uses my Uncle Clive tool (via my Dead Cockroach tool) to generate a script suitable for vandalising your Git commit history (my account is probably displaying an example right now).

API

/:user/:repo/:text

Will return a bash script which, when run locally, will:

  • initialise a local git repo named :repo
  • create a series of empty commits
  • push the repo to [email protected]:user/repo.git

The commits will be structured such that they will 'write' the first six characters of :text on the Github commit calendar using the 1982 Sinclair Spectrum character set. There is a limitation in that the Spectrum font is 8 units high, and the Github calendar has a height of 7 (see dead-cockroach for an explanation of how this is handled).

All of the above assumes that you can do public-key authentication to Github from the box on which you're running this.

Running it

This used to all run on the Heroku free-tier, but they stopped that party in November 2022, so I've now revived it with an over-elaborate docker-compose setup. You need to check out three different repos, so find somewhere on your laptop where you wanna put it all, then:

for REPO in uncle-clive dead-cockroach pokrovsky ;
do
    git clone https://github.com/pikesley/${REPO}
done

Then create the docker-compose files:

cat <<EOF > docker-compose.yaml
version: "3.9"

services:
  uncle-clive:
    build: uncle-clive
    image: pikesley/uncle-clive
    ports:
      - ${CLIVE_PORT}:${CLIVE_PORT}
    working_dir: /opt/uncle-clive
    command: bundle exec rackup -p ${CLIVE_PORT} -o 0.0.0.0

  dead-cockroach:
    build: dead-cockroach
    image: pikesley/dead-cockroach
    ports:
      - ${COCKROACH_PORT}:${COCKROACH_PORT}
    working_dir: /opt/dead-cockroach
    environment:
      CLIVE_PORT: ${CLIVE_PORT}
    command: bundle exec rackup -p ${COCKROACH_PORT} -o 0.0.0.0

  pokrovsky:
    build: pokrovsky
    image: pikesley/pokrovsky
    ports:
      - ${POKROVSKY_PORT}:${POKROVSKY_PORT}
    working_dir: /opt/pokrovsky
    environment:
      POKROVSKY_PORT: ${POKROVSKY_PORT}
      COCKROACH_PORT: ${COCKROACH_PORT}
    command: bundle exec ruby lib/pokrovsky.rb
EOF

cat  <<EOF > .env
CLIVE_PORT=6060
COCKROACH_PORT=7070
POKROVSKY_PORT=8080
EOF

And build and run it:

docker compose build
docker compose up

Using it

To actually vandalise your GH commit graph, from a different terminal,

export SERVER=http://localhost:8080
export REPO=dummy
export TEXT=`echo "© 1982" | sed "s: :%20:g"`
export GHUSER=yourghuser
curl "${SERVER}/${GHUSER}/${REPO}/${TEXT}" | bash

(Note: there's some latency before the commits actually appear in your graph, be patient)

Notes

  • This is ancient Ruby and I have no interest in updating it. Many of the tests are now busted and I really don't care.
  • You should start with a fresh repo each time, both locally and on Github. The script makes no attempt to create a new Github repo, and it certainly doesn't try to delete anything from there. If you can't work out how to do this safely, you probably shouldn't use these tools.
  • If you decide this isn't for you after all, just delete the repo and it will all go away.
  • This owes a massive debt to Gelstudios' splendid Gitfiti.
  • I gave a talk about this at EMF Camp 2014.

pokrovsky's People

Contributors

pikesley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pokrovsky's Issues

Usage example

Make it like

USER=pikesley
etc

Maybe github user can be pulled out of the environment

Mocking

Shouldn't call out to external API. Maybe VCR?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.