>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found
/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
Profile your node app:
node --prof-process app.js
Visualize the data by opening chrome and going too:
chrome://tracing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WOrks in python 2.7 not sure if it works in python 3. | |
# Just straight up connect by any means possible. | |
from ftplib import FTP_TLS | |
def connect(): | |
ftp = FTP_TLS() | |
ftp.debugging = 2 | |
ftp.connect('localhost', 2121) | |
ftp.login('developer', 'password') |
Recently I've noticed a green dot next to my webcam staying on beyond my Google Hangout/Zoom meetings. This is obviously a problem so I've set out to find the solution.
Ends up it is pretty simple. All you need is lsof and grep.
To find out if your built-in webcam is being used:
lsof | grep Camera
https://cuteroot.com - Cards that grow into living plants.
https://sendacake.com - Exploding boxes with cake in them.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl -XPUT 'http://localhost:9200/twitter/' -d '{ | |
index : { | |
number_of_shards : 3 | |
number_of_replicas : 2 | |
} | |
}' |
How do you make a DIV or other HTML item full width of the screen? This overrides parent margins + paddings.
.full-width {
width: 100vw;
position: relative;
left: 50%;
right: 50%;
margin-left: -50vw;
Having an issue deep within django and realize we wanted a debugger. So we monkey patched the methods.
def fake_prep_for_like_query(self, x):
"""Prepares a value for use in a LIKE query."""
from django.utils.encoding import force_text
return force_text(x).replace("\\", "\\\\").replace("%", "\%").replace("_", "\_")
def fake_get_db_prep_lookup(self, lookup_type, value, connection,
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.forms.models import model_to_dict | |
class ModelChangesMixin(object): | |
""" | |
Mixin to tracks changes to your models. | |
""" | |
def __init__(self, *args, **kwargs): | |
super(ModelChangesMixin, self).__init__(*args, **kwargs) | |
self.__original = self._data |
NewerOlder