Skip to content

Instantly share code, notes, and snippets.

@admiral0
admiral0 / naviperl.pl
Created January 18, 2012 22:22
Perl downloader for Nokia N9 firmware.
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Cookies;
use SOAP::Lite;
print "-----------------------------------\n";
print "- Nokia N9 Firmware Downloader -\n";
print "-----------------------------------\n";
print "Downloading product list...\n";
import json
import boto3
from datetime import datetime
ddb = boto3.client('dynamodb')
def lambda_handler(event, context):
today = datetime.utcnow().strftime('%d%m%Y')
try:
lulz = ddb.get_item(TableName='morti-di-stima', Key={'data': {'S': today}})['Item']['morti']['S']
--
-- Excavator
--
-- Under 1000 the turtle will try to consume all fuel it mines
fuel = 1000
y = tonumber(arg[1]) - 1
x = tonumber(arg[2]) - 1
@admiral0
admiral0 / discord.py
Created February 9, 2016 16:22
Discord bot
import ast
import random
import re
import sys
import discord
from PyQt5 import QtWidgets, Qt, QtCore
def calc_random(dice, dice_type):
@admiral0
admiral0 / Jenkinsfile
Created April 22, 2017 16:00
Jenkinsfile for building LEDE
pipeline {
agent any
stages {
stage("SCM Update"){
steps {
sh "git remote add lede git://git.lede-project.org/source.git || true"
sh "git fetch lede"
sh "git branch -D build"
sh "git checkout -b build"
@admiral0
admiral0 / .vimrc
Created November 29, 2013 15:21
WIP vim config
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
filetype plugin indent on " required!
@admiral0
admiral0 / gist:5998745
Last active December 19, 2015 18:29
My current vimrc. To setup: download this in your home and name it .vimrc ; execute "mkdir -p ~/.vim/bundle; git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle" ; open vim and write :BundleInstall<Enter>
" Vundle
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" Installed bundles
Bundle 'gmarik/vundle'
Bundle "MarcWeber/vim-addon-mw-utils"
Bundle "tomtom/tlib_vim"
@admiral0
admiral0 / hexxit
Last active December 18, 2015 14:48
{"name":"HEXXpre","user":"tekkitteam","friendly_name":"Hexxit","version":"0.1","url":null,"minecraft":"1.5.2","minecraft_md5":"6897c3287fb971c9f362eb3ab20f5ddd","background":"","logo":"https:\/\/technic.s3.amazonaws.com\/platform\/pack-logos\/94155.png","logo_md5":"c704aee4c0256940da780cdd12c61b1c","background_md5":"","mirror":true,"mirror_url":" the HEXXIT modlist: http:\/\/solder.awesonium.com\/index.php\/api\/","force_directory":false}
@admiral0
admiral0 / import.pl
Created May 9, 2013 11:20
import.pl for solder. Imports all mods and versions into the solder DB. License: MIT
#!/usr/bin/perl
use warnings;
use strict;
use DBI();
##EDIT HERE##
my $c_database = "database";
my $c_host = "localhost";
my $c_dbuser="dbuser";
@admiral0
admiral0 / lib32.pl
Created January 26, 2012 22:13
lib32 perl
use strict;
use warnings;
use DBI;
use SQLite::DB;
use LWP::Simple;
use Data::Dumper;
my $exit=0;
my $db=SQLite::DB->new("packages.sqlite");