Skip to content

Instantly share code, notes, and snippets.

@rbw
rbw / pscan.php
Last active Feb 23, 2021
Non-blocking port scanner in PHP
View pscan.php
<?php
// Optional mappings
$port_service = array(
20 => "ftp-data",
21 => "ftp",
22 => "ssh",
23 => "telnet",
24 => "priv-mail",
25 => "smtp",
View snow_task_messages.js
var TaskMessages = Class.create();
TaskMessages.prototype = {
initialize: function(sysId) {
this.sysId = sysId;
this.exclude = [
'calendar_stc', 'sys_class_name', 'calendar_duration', 'sys_domain,location',
'business_duration', 'reassignment_count', 'upon_reject',
];
this._generateHistory();
},
@rbw
rbw / _GOMP_barrier
Created Sep 24, 2018
_GOMP_barrier issue
View _GOMP_barrier
$ CC=/usr/local/bin/gcc-8 python3 setup.py build_ext --inplace && python3 -m nanopy
running build_ext
building 'nanopy.work' extension
creating build
creating build/temp.macosx-10.6-intel-3.6
creating build/temp.macosx-10.6-intel-3.6/nanopy
gcc-8 -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c nanopy/work.c -o build/temp.macosx-10.6-intel-3.6/nanopy/work.o -fopenmp
gcc-8: warning: x86_64 conflicts with i386 (arch flags ignored)
nanopy/work.c: In function 'generate':
@rbw
rbw / nanopy_clang.txt
Last active Sep 24, 2018
Nanopy clang compile error
View nanopy_clang.txt
[/tmp/nanopy]$ CC=/usr/bin/clang python3 setup.py build_ext --enable-gpu --inplace
running build_ext
building 'nanopy.work' extension
/usr/bin/clang -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DHAVE_CL_CL_H=1 -I/usr/include/python3.6m -c nanopy/work.c -o build/temp.linux-x86_64-3.6/nanopy/work.o
clang: warning: argument unused during compilation: '-specs=/usr/share/dpkg/no-pie-compile.specs' [-Wunused-command-line-argument]
nanopy/work.c:15:31: warning: missing terminating '"' character [-Winvalid-pp-token]
const char *opencl_program = R"%%%(
^
nanopy/work.c:15:30: error: use of undeclared identifier 'R'
@rbw
rbw / part_of_day.py
Created Aug 19, 2018
Get part of day (morning, afternoon, evening, night) in Python
View part_of_day.py
#!/usr/bin/env python
from sys import stdout
def get_part_of_day(hour):
return (
"morning" if 5 <= hour <= 11
else
"afternoon" if 12 <= hour <= 17