Skip to content

Instantly share code, notes, and snippets.

@itbj
itbj / _readme.md
Created May 8, 2017 — forked from maxivak/_readme.md
Vagrant with Ubuntu 16.04 in VirtualBox
View _readme.md

Setup Ubuntu 16.04 to be used with Vagrant and Virtualbox

Prepare Vagrant box with Ubuntu 16.04

We will use official box "ubuntu/xenial64" and modify it to work with Vagrant.

  • Vagrantfile
@MichalZalecki
MichalZalecki / Dockerfile
Last active Oct 22, 2020
Install oh-my-zsh in Docker
View Dockerfile
RUN ["apt-get", "update"]
RUN ["apt-get", "install", "-y", "zsh"]
RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true
# docker exec -it my-app-container /bin/zsh
@keithweaver
keithweaver / get-wifi.py
Last active Jun 28, 2020
Get Wifi information on Mac OSx using Python
View get-wifi.py
# I tried to use the pip install wifi but it really didn't work.
# So created this
import subprocess
process = subprocess.Popen(['/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport','-I'], stdout=subprocess.PIPE)
out, err = process.communicate()
process.wait()
print(out)
'''
@privateip
privateip / gist:d0fd3c6459c5e1a4c1f9dceeb018b109
Created Oct 2, 2016
playbook to backup network device running configuration to local file
View gist:d0fd3c6459c5e1a4c1f9dceeb018b109
---
- hosts: ios
connection: local
vars:
backup_root: /tmp/backups
cli:
host: "{{ inventory_hostname }}"
username: cisco
View how_to_install_zbarlight_on_windows.md
  1. install zbar on windows with include and library files

  2. make sure mingw installed and bin directory added to the path

  3. in PYTHONPATH\Lib\distutils, create a file distutils.cfg and add two lines:

    [build]

    compiler=mingw32

  4. get dll lib and include file from ftp://sourceware.org/pub/pthreads-win32/dll-latest copy files to PATH_MINGW32/[lib,bin,include] separately, just need file name like pthreadGC2 and remember to chang the name to libpthread

  5. change or add lines in setup.py:

@maxivak
maxivak / _readme.md
Last active Sep 14, 2020
Vagrant with Ubuntu 16.04 in VirtualBox
View _readme.md

Setup Ubuntu 16.04 to be used with Vagrant and Virtualbox

Prepare Vagrant box with Ubuntu 16.04

We will use official box "ubuntu/xenial64" and modify it to work with Vagrant.

  • Vagrantfile
View Python Socket 编程详细介绍.md

Python Socket 编程详细介绍

Python 提供了两个基本的 socket 模块:

  • Socket 它提供了标准的BSD Socket API。
  • SocketServer 它提供了服务器重心,可以简化网络服务器的开发。

下面讲解下 Socket模块功能。

Socket 类型

@yaegashi
yaegashi / playbook.yml
Created Oct 14, 2015
Ansible SSH connection using paramiko
View playbook.yml
---
- hosts: all
connection: paramiko
vars:
ansible_ssh_private_key_file: /path/to/private_key
ansible_ssh_pass: passphrase_for_private_key
tasks:
- debug:
msg: hello
@iest
iest / README.md
Last active Jul 9, 2020
Setting up environment variables with various shells
View README.md

What the hell are environment variables?

They're just variables you set on your system that various programs/processes can read. A fairly standard example in javascript circles would be setting your NODE_ENV variable to "production" or "development", altering how node code is executed on your system (for example showing more debug messaging when in development).

With most shells there's a way to set them for the current session, and a way to set them for all sessions. The following is meant to be a guide on how to set env vars in the various shells.

Bash (The default shell on OSX)

Setting for the session:

@twr14152
twr14152 / EEM Config-change-alert
Created Jun 17, 2015
EEM Cisco - config change Alert - with email and syslog capturing user name and config commands
View EEM Config-change-alert
archive
log config
logging enable
notify syslog contenttype plaintext
hidekeys
event manager applet Config_Change authorization bypass
event config
action 1.1 cli command "enable"
You can’t perform that action at this time.