Skip to content

Instantly share code, notes, and snippets.

View Nanodragon999's full-sized avatar
🏠
Searching for a remote work.

Norton Nanodragon999

🏠
Searching for a remote work.
  • France
View GitHub Profile
# gem install jphastings-dlc
require 'dlc'
s = DLC::Settings.new
s.name = "Your Name"
s.url = "http://yourdomain.com"
s.email = "[email protected]"
# Now you can make a dlc:
package = DLC::Package.new
package.name = "My package" # Suggested, but not required
#!/usr/bin/env python
#
# Copyright (c) 2010 Giorgos Keramidas.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
@bulljit
bulljit / removecompletedtorrents.sh
Created January 22, 2011 23:17
Transmission-Daemon: Remove Completed Torrents
#!/bin/sh
# script to check for complete torrents in transmission folder, then stop and move them
# either hard-code the MOVEDIR variable here…
MOVEDIR=/home/mjdescy/media # the folder to move completed downloads to
# …or set MOVEDIR using the first command-line argument
# MOVEDIR=%1
# use transmission-remote to get torrent list from transmission-remote list
# use sed to delete first / last line of output, and remove leading spaces
# use cut to get first field from each line
@parse
parse / shell.c
Created May 11, 2011 07:31
Simple shell in C
/* Compile with: g++ -Wall –Werror -o shell shell.c */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
@philipn
philipn / gist:1148693
Created August 16, 2011 08:59
GeoTIFFs -> One Big GeoTIFF
"""
Likely not useful to anyone else, but just putting it out there.
This script will take a directory of GeoTIFFs and merge them together without issues.
This script simply decompresses the files, runs nearblack to remove pseudo-black borders caused by compression, and then uses gdalwarp to stitch the files together.
The script is designed to use the minimal amount of disk space possible -- it cleans up each file after decompression and continually merges with a master image.
"""
import os
@millermedeiros
millermedeiros / wordcount.vim
Created November 10, 2011 22:30
wordcount.vim : fast word and char count for vim to be used on the status line
" ============================================================================
" File: wordcount.vim
" Maintainer: Miller Medeiros <http://blog.millermedeiros.com/>
" Description: Fast Word and Char count to be used on the statusline.
" based on Greg Sexton script: http://bit.ly/v3RfAv
" Last Change: 2011-11-10
" License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
@AndrewRadev
AndrewRadev / bookmarks.vim
Created November 16, 2011 20:02
Simple bookmark management in Vim
set viminfo+=!
if !exists('g:BOOKMARKS')
let g:BOOKMARKS = {}
endif
" Add the current [filename, cursor position] in g:BOOKMARKS under the given
" name
command! -nargs=1 Bookmark call s:Bookmark(<f-args>)
function! s:Bookmark(name)
@rjshade
rjshade / grab_all_pages.sh
Created January 27, 2012 23:46
wget with https and cookie login
#!/bin/bash
# first login and store the cookie
wget --post-data='name=USERNAME&pass=PASSWORD&op=Log%20in' --save-cookies=my-cookies.txt --keep-session-cookies "https://private.site.com" > /dev/null 2>&1
# now we can scrape the site (353 pages)
for i in {0..353}
do
echo "grabbing page $i..."
wget --cookies=on --keep-session-cookies --load-cookies=my-cookies.txt "https://private.site.com/people?page=$i" > /dev/null 2>&1
@kennedyj
kennedyj / hex2bin
Created January 30, 2012 23:31
Convert Hex to Bin in bash
#!/bin/bash
if [ ! -n $1 ]; then
echo "Must specify a value"
exit 1
fi
for var in "$@"
do
code=`echo $var | tr 'a-z' 'A-Z'`
@tig
tig / compress.c
Created February 13, 2012 02:40
COMPRESS - An LZW file compressor written in 1987
/*
compress.c (c) Charles E. Kindel, Jr., 1987
COMPRESS - An ASCII file compress program
Author: Charles E. Kindel, Jr. (tigger)
Started: June 14, 1987
Version: 2.0