Skip to content

Instantly share code, notes, and snippets.

View pratyushmittal's full-sized avatar

Pratyush Mittal pratyushmittal

View GitHub Profile
@jagira
jagira / securing_the_server.md
Created January 24, 2024 03:40
Server Security Basics

Securing the server

Securing a server is a continuous process as new vulnerabilities are discovered everyday. But you will be relatively safe if you take some basic security measures like locking root access, not allowing password authentication, setting up a basic firewall and log watching mechanism and enabling automatic updates.

1. Login as root and update package list and upgrade tools.

@gullyn
gullyn / flappy.html
Last active May 4, 2024 15:35
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
flags = [
'-Wall',
'-Wextra',
'-Werror',
'-fexceptions',
'-DNDEBUG',
'-DUSE_CLANG_COMPLETER',
'-pthread',
'-I/usr/include/gtk-3.0',
'-I/usr/include/at-spi2-atk/2.0',
@bettysteger
bettysteger / bookmarklet.js
Last active May 19, 2020 05:53
howto make an angular app with a JS bookmarklet
/**
* redirect javascript bookmarklet
*/
// javascript:location.href='http://example.com/?uri='+encodeURIComponent(location.href)
/**
* bookmarklet loaded on site
*/
(function(){
@dannguyen
dannguyen / ec2-centos-ruby-rvm-nginx-passenger.md
Last active November 27, 2023 15:43
Setting up Ruby 1.9.3 stable, RVM, nginx, passenger on Amazon Linux AMI (CentOS)

Ruby 1.9.3 stable, RVM, nginx, passenger on Amazon Linux AMI (CentOS, 03-2013)

This combines the instructions on a few different tutorials:

@mmohiudd
mmohiudd / CustomManager.py
Created October 17, 2012 03:13
MySQL INSERT … ON DUPLICATE KEY UPDATE with django 1.4 for bulk insert
import datetime
from pprint import pprint
from django.db import models, signals
from django.utils import timezone
import django.dispatch
@gudbergur
gudbergur / README.markdown
Created February 19, 2012 23:49
Bootstrap's Typeahead plugin extended (allowing for AJAX functionality) among other things

This is a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

For example, process typeahead list asynchronously and return objects

  # This example does an AJAX lookup and is in CoffeeScript
  $('.typeahead').typeahead(
    # source can be a function
    source: (typeahead, query) ->
 # this function receives the typeahead object and the query string