Skip to content

Instantly share code, notes, and snippets.

@nezl
nezl / Dockerfile
Created April 16, 2019 05:47
pyflame dockerfile
FROM python:3.7
RUN apt-get update
RUN apt-get install -y autoconf automake autotools-dev g++ pkg-config python-dev python3-dev libtool make
COPY pyflame /pyflame
WORKDIR /pyflame
RUN ./autogen.sh && ./configure && make
#!/bin/sh
# stop running containers
for i in `docker container ls -q`; do
echo "stopping container $i"
docker container stop "$i";
done
for i in `docker container ls -aq`; do
echo "removing container $i"
@nezl
nezl / Dockerfile
Created February 9, 2019 11:16
xorg:cosmic
FROM ubuntu:18.10
RUN apt-get update && apt-get install -y \
alsa-utils \
libgl1-mesa-dri \
libgl1-mesa-glx \
xdg-utils \
libxtst6 libxrender1 libxi6 libfreetype6 \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
@nezl
nezl / pre-push
Created February 7, 2019 09:49
gist to not force push to master
#!/usr/bin/env ruby
# Read this blog to know more about this script.
#
# http://blog.bigbinary.com/2013/09/19/do-not-allow-force-pusht-to-master.html
class PrePushHandler
def handle
reject if pushing_to_master? && forced_push?
FROM ayushshanker/xorg:xenial
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git-core ncdu gcc silversearcher-ag nano && \
rm -rf /var/cache/apt/* && \
rm -rf /var/lib/apt/lists/*
@nezl
nezl / error msg
Last active October 1, 2015 05:23
video:webm@854x480
Traceback (most recent call last):
File "./run.py", line 53, in <module>
techtalk(i['pafy'])
File "./run.py", line 40, in techtalk
aria(audio)
File "./run.py", line 13, in aria
subprocess.call(args)
File "/usr/lib/python3.4/subprocess.py", line 537, in call
with Popen(*popenargs, **kwargs) as p:
@nezl
nezl / add a git repo to an existing folder.md
Last active December 27, 2025 12:46
configure git for github
  1. cd into the directory
  2. go to https://github.com/new and create a new repo. DO NOT check the initialize repo with README option.
  3. you will get a screen like
  4. run git init to create an empty git repo. (it is empty because we need to add files to the git repo, it doesnt account for the files in the same folder automatically)
  5. run git add --all to add all files & folders in the current folder to git repo. run git status to see files added to git staging area
  6. run git commit -m "short message about what changes happen in this commit" : note that a message is required by git.
  7. add a remote (github repo) to your local git repo using command git remote add origin git@github.com:user/repo.git
  8. send your local git repo to github using git push -u origin master: here origin is set to github by the prev command. master is the default branch.
  9. open github.com/user/repo in browser to view the git rep
debug2: load_server_config: filename /etc/ssh/sshd_config
debug2: load_server_config: done config len = 735
debug2: parse_server_config: config /etc/ssh/sshd_config len 735
debug3: /etc/ssh/sshd_config:5 setting Port 22
debug3: /etc/ssh/sshd_config:9 setting Protocol 2
debug3: /etc/ssh/sshd_config:11 setting HostKey /etc/ssh/ssh_host_rsa_key
debug3: /etc/ssh/sshd_config:12 setting HostKey /etc/ssh/ssh_host_dsa_key
debug3: /etc/ssh/sshd_config:13 setting HostKey /etc/ssh/ssh_host_ecdsa_key
debug3: /etc/ssh/sshd_config:14 setting HostKey /etc/ssh/ssh_host_ed25519_key
debug3: /etc/ssh/sshd_config:16 setting UsePrivilegeSeparation yes
debug2: load_server_config: filename /etc/ssh/sshd_config
debug2: load_server_config: done config len = 735
debug2: parse_server_config: config /etc/ssh/sshd_config len 735
debug3: /etc/ssh/sshd_config:5 setting Port 22
debug3: /etc/ssh/sshd_config:9 setting Protocol 2
debug3: /etc/ssh/sshd_config:11 setting HostKey /etc/ssh/ssh_host_rsa_key
debug3: /etc/ssh/sshd_config:12 setting HostKey /etc/ssh/ssh_host_dsa_key
debug3: /etc/ssh/sshd_config:13 setting HostKey /etc/ssh/ssh_host_ecdsa_key
debug3: /etc/ssh/sshd_config:14 setting HostKey /etc/ssh/ssh_host_ed25519_key
debug3: /etc/ssh/sshd_config:16 setting UsePrivilegeSeparation yes