Skip to content

Instantly share code, notes, and snippets.

This is a gist
@amomin
amomin / README.md
Last active August 29, 2015 14:16
Sample Simple DB dump script

Simple MySQLDump script

If run daily, will keep daily snapshots for one week, weekly snapshots for one month, and monthly snapshots for one year.

You will need a database user with SELECT privileges for the given database. This example suggests to place the mysql creds in the .my.cnf file - suggest to set the permissions on this file to 600.

@amomin
amomin / gist:09ebffc5ca25c7822c07
Last active August 29, 2015 14:17
instructions.md

A very basic Apache set-up to host python apps with mod WSGI

This is almost all taken from (https://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide) - I'm adding something here because I did not realize that I had port 81 blockked on my firewall and lost a bit of time figuring that out (was able to wget the expected url but could not navigate in a browser). Anyway, here are the basic steps. See the link google code link though.

In my case, I have an already running php server where I just want to test out some python web apps and don't particularly care about performance or anything like that. In reality, it might make sense to have a separate instance of apache running for the python apps. But that's beyond the scope of what I'm trying to accomplish today, which is just to get a hello world python app up and running.

  1. Install mod_wsgi: sudo apt-get install libapache2-mod-wsgi
  2. For this installation we will run python apps on a different port, namely port 88. It is not necessary to do
@amomin
amomin / README.markdown
Created September 22, 2015 15:45
Git log pretty

Git log alias

This short but sweet post shows how to create a simple command to create an alias to a suped-up git log.

It's just a one-liner

$ git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@amomin
amomin / cygwin.markdown
Last active October 19, 2022 18:52
Cygwin notes

Notes on making cygwin work

  • See this so answer using mkpasswd for one way to change your default home directory
  • You can always add packages after install by re-running setup.

Packages to add

  • wget (Web)
  • curl (PHP, Net)
  • ssh (Net)
@amomin
amomin / scripts.markdown
Last active September 23, 2015 00:05
Things I forget

Firewalls

Add rule to open port 3000 for nodejs on line 2001 (which must be before the DROP rule)

First get the line numbers

$ sudo iptables -nL --line-numbers
@amomin
amomin / README.md
Last active October 17, 2015 03:27
Building 64-bit emacs on Windows

Building 64-bit emacs on Windows

Licensed under CC BY 4.0.

This was actually reasonably straightforward....

Installing msys2

I installed msys2 for performing the build. This was pretty straightforward:

@amomin
amomin / README.markdown
Last active November 1, 2015 16:47
Notes on an error in building a meanjs project for production

Building production on a mean.js stack application

By mean.js I mean specifically an application based on the meanjs framework hosted here.

For reference, the following posts helped me identify and fix my problem.

It works mostly like how you would expect. From a vanilla working development environment, the following should work:

@amomin
amomin / README.markdown
Last active July 11, 2024 14:39
Converting a folder into a git submodule
@amomin
amomin / README.markdown
Last active November 25, 2015 02:11
Slanted Rows

Example of slanted row layout.

Two examples are given - the first only works if the width is fixed, the second is responsive.