Skip to content

Instantly share code, notes, and snippets.

View alexandr-san4ez's full-sized avatar
🧑‍💻

Alexandr K. alexandr-san4ez

🧑‍💻
View GitHub Profile
@iloveitaly
iloveitaly / copy-default-directory.bash
Created February 18, 2012 20:44
Some tools for managing polycom phones + asterisk systems
# this assumes you have a default directory defined
find /tftpboot/logs/ | ack 'logs/([^-]+)' --output '$1' | sed '/^$/d' | while read mac
do
cp -f "000000000000-directory.xml" "$mac-directory.xml"
done
@awidegreen
awidegreen / vim_cheatsheet.md
Last active June 17, 2024 03:41
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@gdvalle
gdvalle / putty-monokai.reg
Created December 2, 2012 05:24
Monokai style theme for PuTTY; colors copied from ST2's theme
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\monokai]
"Colour21"="255,255,255"
"Colour20"="245,222,179"
"Colour19"="200,240,240"
"Colour18"="0,217,217"
"Colour17"="179,146,239"
"Colour16"="174,129,255"
"Colour15"="122,204,218"
@mrchief
mrchief / LICENSE.md
Last active March 23, 2024 12:28
Add "Open with Sublime Text 2" to Windows Explorer Context Menu (including folders)

MIT License

Copyright (c) [year] [fullname]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@tedmiston
tedmiston / webcam-cv2.py
Last active May 4, 2023 11:56
Display the webcam in Python using OpenCV (cv2)
"""
Simply display the contents of the webcam with optional mirroring using OpenCV
via the new Pythonic cv2 interface. Press <esc> to quit.
"""
import cv2
def show_webcam(mirror=False):
cam = cv2.VideoCapture(0)
<?xml version="1.0"?>
<document type="freeswitch/xml">
<X-PRE-PROCESS cmd="set" data="local_address=$${local_ip_v4}"/>
<X-PRE-PROCESS cmd="set" data="sipnet_proxy=sipnet.ru"/>
<X-PRE-PROCESS cmd="set" data="sipnet_login=..."/>
<X-PRE-PROCESS cmd="set" data="sipnet_password=..."/>
<X-PRE-PROCESS cmd="set" data="sound_prefix=$${sounds_dir}/en/us/callie"/>
@mplewis
mplewis / safe_schedule.py
Last active April 23, 2024 01:12
An implementation of Scheduler that catches jobs that fail. For use with https://github.com/dbader/schedule
import logging
from traceback import format_exc
import datetime
from schedule import Scheduler
logger = logging.getLogger('schedule')
@ochinchina
ochinchina / install_boot2docker_2_hadrdisk.txt
Created September 26, 2014 01:57
install boot2docker to harddisk in the virtualbox
1, create a virtual machine from the virtualbox with VDI harddisk
2, add a virtual CDROM to the virtual machine and select boot2docker.iso ( the boot2docker.iso should be downloaded before)
3, start the virtual machine
4, write the boot2docker.iso image to the virtual harddisk using dd command
# dd if=/dev/cdrom of=/dev/sda
@zed
zed / url2filename.py
Last active September 3, 2022 04:42
Extract filename from an url
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import posixpath
try:
from urlparse import urlsplit
from urllib import unquote
except ImportError: # Python 3
from urllib.parse import urlsplit, unquote
@Shoozza
Shoozza / Cmder.bat
Last active May 10, 2017 10:31
Cmder.bat argument execution support
@ECHO OFF
REM Example: Cmder.bat vim hello_world.c
REM will run vim hello_world.c inside Cmder
REM Note Add following line at the end of init.bat (without REM)
REM @if not "%*" == "" %*
SET "CMDER_ROOT=%~dp0"
IF "%ConEmuDir%" == "" SET "ConEmuDir=%CMDER_ROOT%\vendor\conemu-maximus5"
START "" "%ConEmuDir%\ConEmu.exe" /Icon "%CMDER_ROOT%\icons\cmder.ico" /Title Cmder /LoadCfgFile "%CMDER_ROOT%\config\ConEmu.xml" /cmd cmd /k ""%ConEmuDir%\..\init.bat" %*" -new_console:d:%USERPROFILE%