User Controls
Thanked Posts by Lanny
-
2017-07-16 at 9:17 PM UTC in Digital scales
Originally posted by mmQ I was just looking at the back of mine and it says 'NOT LEGAL FOR TRADE.'
Is that on every Digi? Why can't you trade it, it's your fucking property. Is it some technical bullshit about drugs?
I assume it means the manufacturer doesn't guarantee its accuracy for use in weighing things in a business transaction. Like the manufacturer doesn't want to be on the line if their scale fucks up weighing out gold dust or something. You can definitely trade the scale itself with someone. -
2017-08-31 at 7:13 AM UTC in Not Planning For Your FutureYee, the future looks bright for me.
And by "bright" I mean "heavily saturated in booze" -
2017-08-31 at 10:18 AM UTC in If Racial Equality is the Goal...Riddle Me This:
-
2017-08-31 at 5:08 AM UTC in I explain weeeell gonts!I can imagine you spending a whole date just doing that "WHEEEEL GONTS" thing in a high pitched voice while the whale of a ho you're out with rolls her eyes
-
2017-08-30 at 6:41 AM UTC in THE DEVIL IS CONSUMING THE SOUL OF MAN.not an SG thread
-
2017-06-07 at 4:20 AM UTC in Name the 3 NiS posters that youAldra has the most consistently entertaining responses.
Captain father fucker and mmq are both kind hit or miss but the hits are v. good. -
2017-08-28 at 3:40 AM UTC in The Retarded Thread: Click Here for AIDS
-
2017-08-27 at 2:16 AM UTC in Do computer files contain identifyable data?
Originally posted by -SpectraL In a .NET executable, the PE code section contains a stub that invokes the CLR virtual machine startup entry, _CorExeMain or _CorDllMain in mscoree.dll, much like it was in Visual Basic executables. The virtual machine then makes use of .NET metadata present, the root of which, IMAGE_COR20_HEADER (also called "CLR header") is pointed to by IMAGE_DIRECTORY_ENTRY_COMHEADER[5] entry in the PE header's data directory. IMAGE_COR20_HEADER strongly resembles PE's optional header, essentially playing its role for the CLR loader.
The CLR-related data, including the root structure itself, is typically contained in the common code section, .text. It is composed of a few directories: metadata, embedded resources, strong names and a few for native-code interoperability. Metadata directory is a set of tables that list all the distinct .NET entities in the assembly, including types, methods, fields, constants, events, as well as references between them and to other assemblies.
If you knew what half those words meant you'd realize how stupid copy pasting a section of an irrelevant wikipedia article that happened to contain the word "metadata" makes you look -
2017-08-27 at 9 PM UTC in How do i reformat a row from a CSV file to JSON?There's no general way to ask "does my string occurs in this dictionary" because it's not really obvious what "occurs in" would mean. It's like asking "what's the sum of this number and this sting", the operation isn't defined over those types. When you write `if 'foo' in my_dict:` what you're asking is "is 'foo' one of the keys in my_dict`. You probably want to search within a specific field in each row (like if someone types in "apache" there's not much point in looking at the CVE column since the string "apache" is never going to appear there). If you really want to search every field you'd have to do something like this instead:
query = raw_input("wut vuln m8?: ")
with open('cve_mitre.csv', 'rb') as infile:
csv_reader = csv.DictReader(infile)
rows = [row for row in csv_reader]
for row in rows:
for col_name in row:
if query in row[col_name]:
print json.dumps(row)
Note what gets sent to json.dumps doesn't need to be wrapped in this case since it (the vulnerability row) is already a dictionary. -
2017-08-27 at 4 AM UTC in Do computer files contain identifyable data?Also I have no idea what you think "proprietary information" means, but I know you're wrong about it.
-
2017-08-25 at 8:40 PM UTC in The Retarded Thread: Click Here for AIDSSpend years in solitude there, in deep meditation, trying to discover what strange confluence of psychological traumas induces you to tell lies no one believes for a moment consistently for years and years on end.
-
2017-08-25 at 7 AM UTC in The Retarded Thread: Click Here for AIDS
Originally posted by aldra
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| kids |
| mysql |
| pride |
| wordpress |
+--------------------+
6 rows in set (0.00 sec)
mysql> USE kids;
Database changed
mysql>
[lanny:~/anatomy]$ ls
elbow penis tities
[lanny:~/anatomy]$ touch penis
[lanny:~/anatomy]$ cat penis
meow, meow--- squirt
[lanny:~/anatomy]$ -
2017-08-25 at 11:24 PM UTC in How do i reformat a row from a CSV file to JSON?
Originally posted by Sophie So i ahve a big CSV file that is formatted like this.
CVE-1999-0026,Entry,"root privileges via buffer overflow in pset command on SGI IRIX systems.","CERT:CA-97.21.sgi_buffer_overflow | AUSCERT:AA-97.20.IRIX.pset.buffer.overflow.vul
I want to use Python's JSON module to make it look more like this:
CVE-1999-0026,
Entry,"root privileges via buffer overflow in pset command on SGI IRIX systems.",
"CERT:CA-97.21.sgi_buffer_overflow | AUSCERT:AA-97.20.IRIX.pset.buffer.overflow.vul
If i can do that without the JSON module that'd be ok too. As usual we are talking Python here.
The first thing you want to think about is the most natural way to represent these entries in JSON. Rather than representing them as a sequence it seems like key/values would make more sense. Usually CSV files come with row names at the top. Assuming that's the case you could do something like this:
import csv
import json
import StringIO
sample_csv = """cve_id,type,description,whatever
CVE-1999-0026,Entry,"root privileges via buffer overflow in pset command on SGI IRIX systems.","CERT:CA-97.21.sgi_buffer_overflow | AUSCERT:AA-97.20.IRIX.pset.buffer.overflow.vul"
CVE-1999-0027,Entry,"root privileges via buffer overflow in pset command on SGI IRIX systems.","CERT:CA-97.21.sgi_buffer_overflow | AUSCERT:AA-97.20.IRIX.pset.buffer.overflow.vul"
"""
if __name__ == '__main__':
pseudo_file = StringIO.StringIO(sample_csv)
csv_reader = csv.DictReader(pseudo_file)
rows = [row for row in csv_reader]
print json.dumps({'vulns': rows})
which produces this (after formatting):
{
"vulns": [
{
"whatever": "CERT:CA-97.21.sgi_buffer_overflow | AUSCERT:AA-97.20.IRIX.pset.buffer.overflow.vul",
"type": "Entry",
"description": "root privileges via buffer overflow in pset command on SGI IRIX systems.",
"cve_id": "CVE-1999-0026"
},
{
"whatever": "CERT:CA-97.21.sgi_buffer_overflow | AUSCERT:AA-97.20.IRIX.pset.buffer.overflow.vul",
"type": "Entry",
"description": "root privileges via buffer overflow in pset command on SGI IRIX systems.",
"cve_id": "CVE-1999-0027"
}
]
}
You can ignore the StringIO stuff, it's just a way to make a file-like object out of a string (csv.DictReader accepts a file-like object) but you'll have a real file.
Also worth pointing out that the `rows` list (a list of dictionaries built from the rows of the CSV file) gets wrapped in a dict before being passed to `json.dumps`. You don't _have_ to do this, json.dumps will accept a list, but strictly speaking plain arrays are not valid JSON, per the spec every piece of JSON must decode to exactly one object. That object can have keys which are arrays but the top level must be an object (map from keys to values, equivalent to python's "dictionary" type). -
2017-08-25 at 10:23 PM UTC in The Retarded Thread: Click Here for AIDSWhat -SpectraL taught me about bears:
Humans can realistically kill them with their bear (nyuck nyuck nyuck) hands. -
2017-08-06 at 11:22 PM UTC in Whats your favorite anime?
Originally posted by 霍比特人说中文不好 Can anybody recommend me something good which isn't fighting based? I haven't been able to get into Monster much because the story is meh. Watched Silver Spoon for a bit but it was entirely too cutesy and schooly for my taste.
Did watch On Top of Poppy Hill or Up On Poppy Hill or whatever its called and holy shit, its fucking fantastic. I really am in love with the busy traffic/street scenes in that movie. Maybe one of my favorite Miyazaki films.
The Girl Who Lept Through Time was pretty good, has that Ghibli kind of pseudo-plot with more modern animation. -
2017-08-21 at 6:48 PM UTC in The Retarded Thread: Click Here for AIDS
-
2017-08-12 at 5:03 AM UTC in Maybe 4 or 5 of you are not alts
-
2017-08-18 at 8:20 AM UTC in Money money moneyAlso yee, hit me up when you're in town on the way back through, we'll hit a bar or something if the timing works. Would feel bad letting a guy who traveled the vertical length of the US on $50 pay.
-
2017-08-16 at 4:59 PM UTC in What have you been playing lately?
Originally posted by Sophie Ya'll niggas seen zombie mode on Player Unknown Battlegrounds? Spoopy af.
Just looked it up. I think it's funny that day-z spawned h1-z1 spawned battlegrounds specifically to get away from the zombie thing and now we've come full circle.
Looks fun though, I'll give it a go. -
2017-08-16 at 5 PM UTC in I wonder if spiders are jealous of flysDoes the lion envy the gazel?