Skip to content

Instantly share code, notes, and snippets.

Nikita Abdullin 0xABD

  • Planet Earth
Block or report user

Report or block 0xABD

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@0xABD
0xABD / python_bat_test.bat
Created Aug 28, 2015
Make *.BAT files with python code in Windows
View python_bat_test.bat
@echo off & python -x %~f0 %* & goto :eof
# 1) goto :eof makes CMD jump to the end of file after the 1st line
# 2) -x makes python (must be in the %PATH%) to skip the first line of the script
# 3) %~f0 is the fully qualified file name of the script
import sys
print("Hello! " + sys.argv[0])
@0xABD
0xABD / paul.py
Created Jun 12, 2014
A tribute to Paul the octopus 2014
View paul.py
#!/usr/bin/env python
import random
class paul:
scores2010 = [
(170, '1:0'),
(110, '2:1'),
(70, '1:1'),
(70, '0:0'),
(60, '2:0'),
@0xABD
0xABD / paul.html
Created Jun 12, 2014
A tribute to Paul the octopus 2014
View paul.html
<html>
<head><title>OW Paul 2014</title></head>
<body>
<p>... and he uttered his oracle:</p>
<p style="font-size:50px">
<script>
var scores2010 = [
[170, "1:0"],
[110, "2:1"],
[70, "1:1"],
View conv2vmx-ovf.py
#!/usr/bin/env python
#
# usage:
# conv2vmx-ovf.py some-vm.ovf
#
# ref: http://www.cnblogs.com/eshizhan/p/3332020.html
#
import sys
fn = sys.argv[1]
@0xABD
0xABD / setup.py
Created Apr 14, 2015
py2exe config single exe file without library.zip
View setup.py
# py2exe config single exe file without library.zip
from distutils.core import setup
import py2exe
setup(
console = ['mytest1.py'],
zipfile = None,
options = {'py2exe' : {
'ascii' : True,
'bundle_files' : 1,
View keybase.md

Keybase proof

I hereby claim:

  • I am 0xABD on github.
  • I am nabdullin (https://keybase.io/nabdullin) on keybase.
  • I have a public key whose fingerprint is FF62 278E 5176 8E90 DABE 8EF6 E89C 49B2 2A20 0E13

To claim this, I am signing this object:

@0xABD
0xABD / timestamp.c
Created Sep 7, 2015
print local timestamp as YYYYMMDDHHMISS
View timestamp.c
#include <stdio.h>
#include <time.h>
/*
@ECHO OFF
for /f %%a in ('timestamp.exe') do (set ts=%%a)
echo %ts%
*/
int main(int argc, char **argv)
@0xABD
0xABD / ifndef.py
Created Jan 10, 2012
c c++ include header #ifndef guard
View ifndef.py
import string, sys, os
tt = string.maketrans(string.punctuation,'_'*len(string.punctuation))
for fname in sys.argv[1:]:
hname = os.path.split(fname)[-1].upper().translate(tt)
head_str = '#ifndef ' + hname + '\n#define ' + hname+'\n'
tail_str = '\n#endif //' + hname + '\n'
dt = file(fname).read()
@0xABD
0xABD / fetch_symbols.bat
Created Jan 10, 2012
windows: download debug symbols for all system dll's from c:\windows\system32\
View fetch_symbols.bat
symchk /r c:\windows\system32 /s symsrv*symsrv.dll*c:\symbols*http://msdl.microsoft.com/download/symbols
@0xABD
0xABD / yesno.bat
Created Jan 10, 2012
windows: bat file with python yes/no one-liner
View yesno.bat
@python -u -c "import random,sys;sys.stdout.write(random.choice(['Yes','No']))"
You can’t perform that action at this time.