recentpopularlog in
« earlier   later »
hashing - Is there a built-in checksum utility on Windows 7? - Super User
CertUtil is a pre-installed Windows utility that can be used to generate hash checksums:

<code>certUtil -hashfile pathToFileToCheck [HashAlgorithm]
HashAlgorithm choices: MD2 MD4 MD5 SHA1 SHA256 SHA384 SHA512</code>

So for example, the following generates an MD5 checksum for the file C:\TEMP\MyDataFile.img:

<code>CertUtil -hashfile C:\TEMP\MyDataFile.img MD5</code>

To get output similar to *Nix systems you can add some PowerShell magic:

<code style="language-powershell">$(CertUtil -hashfile C:\TEMP\MyDataFile.img MD5)[1] -replace " ",""</code>
windows  hashing  checksum  hash  md5  sha1  commandline  utility  software  solution 
april 2018
python - PyInstaller cannot find libpython2.7.so when making binary? - Stack Overflow | https://stackoverflow.com/
As @abarnert already said, the problem seems to be a static compilation of python. To solve this issue is needed to recompile python but adding the flag --enable-shared this time:
<code class="language-bash">
[root@machine ~]# ./configure --prefix=/usr/local --enable-shared
[root@machine ~]# make && make altinstall
</code>


May want to also do LDFLAGS="-Wl,-rpath /path/to/your/new/python/lib"
python  fromsource  errormessage  solution 
april 2018
configure - How to ignore local python when building python from source - Stack Overflow | https://stackoverflow.com/
I (think I) was able to avoid this problem by setting the runtime linker path to the Python 'lib' directory *before* compiling Python.
This looks to be a misfeature of the setup.py script always including /usr/local in the search path when make builds the target sharedmods.

You'll have to manually frob the setup.py, so do the...
<code class="language-python">./configure --enable-shared --prefix=/app/vendor/python-dev</code>

...first, then edit setup.py, find lines 442, 443, and 444 which should look like this...
<code class="language-python">
if not cross_compiling:
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')</code>


...and comment those out
python  fromsource  sharedlibrary  linker  errormessage  solution 
april 2018
Python Click command doesn't recognize options - Stack Overflow | https://stackoverflow.com/


The issue is that click.Option() expects the first argument to a list and is not like the decorator version @click.option().

<code class="language-python">params=[click.Option(['--force'], default=False)]</code>

Wrapping the command option in a list solved the problem.
python  click  errormessage  solution 
april 2018
MySQL Bugs: #5159: Views: Comments are not preserved | https://bugs.mysql.com/
This feature request is 18 years old now. People still express interest about this and other related feature requests. You may not consider it vital, but please don't understimate what Bruno Aquino Filardi Filho wrote: self documenting database is really important.
mysql  sql  views  documentation  comments  featurerequest  bug  watchthisspace 
april 2018
yourls_allow_duplicate_longurls where to set it to allow · Issue #2186 · YOURLS/YOURLS · GitHub | https://github.com/
File: user/config-sample.php:49

<code class="language-php">/** Allow multiple short URLs for a same long URL
** Set to true to have only one pair of shortURL/longURL (default YOURLS behavior)
** Set to false to allow multiple short URLs pointing to the same long URL (bit.ly behavior) */
define( 'YOURLS_UNIQUE_URLS', true );</code>

Set it to false in your config file.
php  yourls  configfile  configsetting  solution 
april 2018
Want to #DeleteFacebook? You Can Try - The New York Times
Where does Facebook really equal the internet?

Keep in mind that Facebook reaches well beyond the United States. As my colleague Sheera Frenkel noted on Twitter, deleting Facebook is a privilege. In some parts of the world, like Myanmar, Egypt and Indonesia, people rely on Facebook as a primary means to conduct business and stay in touch with friends and family. In Africa, Facebook has struck deals that offer basic services — centered on those provided by Facebook — to residents for free.
facebook  quitting  privacy  targetedadvertising  tracking  video 
april 2018
How to Delete Photo Albums from Your iPod Touch: 15 Steps | https://www.wikihow.com/
The second method of synchronizing with an empty folder worked, but it tricked me into unsyncing all the music that was on the iPod with the "other" iTunes library, deleting all the albums that were on it. Screwed by iTunes again.

Related (but probably unhelpful): https://discussions.apple.com/thread/7181726
ios  ios6  ipodtouch  ipod  photos  itunes  khaaaaaaan  synchronization  sync  annoyance  solution 
march 2018
How can I convert a python urandom to a string? - Stack Overflow | https://stackoverflow.com/

In python 3, the answer is

<code class="language-python">
from base64 import b64encode
from os import urandom

random_bytes = urandom(64)
token = b64encode(random_bytes).decode('utf-8')
</code>
python  python3  crypto  random  webdevel  solution 
march 2018
macos - How to use Mac OS X Keychain with SSH keys? - Super User | https://superuser.com/
This worked!
Add the pass phrase to each ssh key to keychain: (option -k loads plain private keys only, skips certificates)
<code class="language-bash">ssh-add -K [path/to/private SSH key]</code>
ssh  keychain  mac  osx  macos  annoyance  sierra  solution 
march 2018
python - How to count rows with SELECT COUNT(*) with SQLAlchemy? - Stack Overflow | https://stackoverflow.com/
I managed to render the following SELECT with SQLAlchemy on both layers.
<code class="language-sql">SELECT count(*) AS count_1
FROM "table"</code>

Usage from the SQL Expression layer
<code class="language-python">from sqlalchemy import select, func, Integer, Table, Column, MetaData

metadata = MetaData()

table = Table("table", metadata,
Column('primary_key', Integer),
Column('other_column', Integer) # just to illustrate
)

print select([func.count()]).select_from(table)
</code>

Usage from the ORM layer

You just subclass Query (you have probably anyway) and provide a specialized count() method, like this one.
<code class="language-python">from sqlalchemy import func

class BaseQuery(Query):
def count_star(self):
count_query = (self.statement.with_only_columns([func.count()])
.order_by(None))
return self.session.execute(count_query).scalar()
</code>

Please note that order_by(None) resets the ordering of the query, which is irrelevant to the counting.

Using this method you can have a count(*) on any ORM Query, that will honor all the filter andjoin conditions already specified.


tags: sql sqlalchemy dba orm syntax solution .lemmi .cchmc
march 2018
The Linux Command Line by William E. Shotts, Jr. | http://linuxcommand.org/
tags: unix linux commandline shellscripting bash ebook book newbie
march 2018
python - SQL Alchemy ResultProxy.rowcount should not be zero - Stack Overflow | https://stackoverflow.com/
Looks like I might be relying on some undocumented behavior here, and might just want to do a "SELECT COUNT (*)" instead:
resultproxy.rowcount is ultimately a proxy for the DBAPI attribute cursor.rowcount. Most DBAPIs do not provide the "count of rows" for a SELECT query via this attribute; its primary purpose is to provide the number of rows matched by an UPDATE or DELETE statement.


tags: sql sqlalchemy database dba syntax maybesolution .lemmi .cchmc
march 2018
python - Multiple context objects in CLI (Click) - Stack Overflow | https://stackoverflow.com/
Slightly different way - use custom class for obj:

<code class="language-python">class Config(object):

def __init__(self, config):
# do something with config here ...
self.a = 'example_A'
self.b = 'example_B'

# in your def cli()
ctx.obj = Config(config)
# in your commands you can works with your prepared data like this:
print(ctx.obj.a)
print(ctx.obj.b)</code>


tags: python flask click contextobject webdevel solution .lemmi .cchmc
march 2018
python - SELECT * in sqlalchemy? - Stack Overflow | https://stackoverflow.com/
The following selection works for me in the core expression language (returning a RowProxy object):

<code class="language-python">foo_col = sqlalchemy.sql.column('foo')
s = sqlalchemy.sql.select(['*']).where(foo_col == 1)</code>


tags: sqlalchemy sql dba python webdevel maybesolution .lemmi .cchmc
march 2018
python - method of iterating over sqlalchemy model's defined columns? - Stack Overflow | https://stackoverflow.com/
From here you can simply call JobStatus.__table__.columns._data.keys() which gives you a nice, clean list.

Also:
<code class="language-python">
from sqlalchemy import inspect
inspect(JobStatus).columns.keys()
</code>
sqlalchemy  sql  dba  introspection  solution 
march 2018
GrayKey iPhone unlocker poses serious security concerns - Malwarebytes Labs | Malwarebytes Labs | https://blog.malwarebytes.com/
From the comments:
This response from reddit user u/compounding is the best I have seen

"The rising wait times and the phone erase function are built into the
operating system. The operating system asks the Secure Enclave to do an
unlock function, and when it returns an incorrect result the operating
system won’t accept another attempt for a given time, and once 10
attempts are reached, sends a message to the Secure Enclave to purge its
keys.

Based on the article, they have broken the chain of trust and are
able to load their own operating system which can interact with the
Secure Enclave directly and therefore doesn’t need to worry about those
limits. It also looks like they haven’t penetrated the Secure Enclave
itself, so the deliberate 80 ms minimum guess time within the Enclave
itself is still intact (it takes them ~240 ms per guess based on the
numbers they provide), which is good news - not everything is broken,
just the weakest passwords (4-6 digit numeric)

This is basically what Apple admitted they could build for
the FBI, but refused to comply and won in court saying they didn’t have
to make this for them. This company either got ahold of Apple’s
authentication keys to sign their “operating system” so the phone thinks
it is legit and coming from Apple, or more likely they found a bug in
the secure boot chain which lets them load and run their unsigned
system.

Even with this breach, the Secure Enclave will still limit attempts
to between 4-12 guesses per second at most, so even using 6 lowercase
letters as a password would bump the cracking time from ~3 days (with
numbers only) up to ~9 months, and having numbers and lowercase letters
together would be something like 5 years (assuming they aren’t
predictable enough to guess them for other reasons)."


tags: iphone security cracking lawenforcement
march 2018
Haunted By Data | http://idlewords.com/
tags: bigdata surveillance privacy siliconvalley technooptimism
march 2018
White Writer Calls Black Panther ‘Hollywood’s Worst Nightmare,’ Blames It for White People’s Problems | https://www.theroot.com/
When I read Mendelson’s piece, I immediately said what I thought he was thinking as he wrote this: “Oh, my God. The black people are ruining everything.”


tags: hollywood film
march 2018
Paths of Hate - Platige Shorts | http://www.platigeshorts.com/
Nenow directed three animated shorts, and each one was a very important step for the artist. “The Aim” (2005), created while Nenow was still in film school, was the first of his movies to receive an award. “The Great Escape” (2006) was screened at major international film festivals. “Paths of Hate” (2010) was short-listed for an Academy Award nomination, received a Special Distinction at the Annecy International Animated Film Festival, was honored at Comic-Con, the world’s largest comic and video game festival and received the Best of Show award at the 2011 SIGGRAPH festival.

tags: animation cgi video
march 2018
« earlier      later »
per page:    204080120160

Copy this bookmark:





to read