Skip to content

Instantly share code, notes, and snippets.

View cmcsun's full-sized avatar
🇺🇦

Christopher McFee cmcsun

🇺🇦
  • New York, NY
View GitHub Profile
View gist:628512dbf6af83ca0a1ed82605af93bd
global:
scrape_interval: 15s
evaluation_interval: 15s
external_labels:
monitor: 'docker-host-alpha'
rule_files:
- 'alert.rules'
- /core.rules
View gist:8b5427e8c022c0571ca8e0836f65b118

after install neovim nvim config file folder ~/.config/nvim

$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.config/nvim/bundle/Vundle.vim

set nocompatible              " be iMproved, required
filetype off                  " required
" set the runtime path to include Vundle and initialize

set rtp+=~/.vim/bundle/Vundle.vim

@cmcsun
cmcsun / vagrant-cheat-sheet.md
Created October 26, 2023 05:03 — forked from wpscholar/vagrant-cheat-sheet.md
Vagrant Cheat Sheet
View vagrant-cheat-sheet.md

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@cmcsun
cmcsun / multithread.py
Created July 30, 2018 23:07
multithread.py
View multithread.py
import threading, zipfile, time
class AsyncZip(threading.Thread):
def __init__(self, infile, outfile):
threading.Thread.__init__(self)
self.infile = infile
self.outfile = outfile
def run(self):
f = zipfile.ZipFile(self.outfile, 'w', zipfile.ZIP_DEFLATED)
View sol2.cpp
class Solution {
public:
bool containsDuplicate(vector<int>& nums) {
std::vector<int> sorted;
//bool containsDuplicated=false;
for (int i=0; i<nums.size(); i++)
{
sorted.push_back(nums[i]);
}
@cmcsun
cmcsun / unreal
Created April 9, 2017 03:18
unreal
View unreal
https://codetalk.io/posts/2015-11-18-setting-up-unrealircd-and-anope-on-ec2.html#sasl-support
https://www.unrealircd.org/download/4.0/4.0.10/src
https://www.unrealircd.org/docs/Installing_from_source
https://www.unrealircd.org/docs/Upgrading_from_3.2.x
https://www.unrealircd.org/docs/UnrealIRCd_files_and_directories
https://www.anope.org/faq.php?cat=1#4
http://www.techmansworld.com/2014/03/upgrading-from-anope-18-to-anope-20.html
@cmcsun
cmcsun / _verify-repair-permissions-disk.md
Created May 14, 2016 16:06 — forked from bzerangue/_verify-repair-permissions-disk.md
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)
View _verify-repair-permissions-disk.md

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

View gist:64018b4f9722694e3e248424446b3996
~/.task$ task rc.debug.tls=3 sync init
Please confirm that you wish to upload all your pending tasks to the Taskserver (yes/no) yes
c: INFO Server certificate will be verified.
c: 3 ASSERT: extensions.c:65
Syncing with li1107-241.members.linode.com:9001
Configuration override rc.debug.tls:3
Could not connect to li1107-241.members.linode.com 9001
Sync failed. Could not connect to the Taskserver.
View gist:89ef58b4a4af86e93cede9e4fa65a9ae
~/.task$ task diagnostics
task 2.5.1
Platform: Darwin
Compiler
Version: 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.29)
Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
Compliance: C++11
View gist:c967afb34d568b8f42ea9b17857390ee
CSDUJ[16:38]raina@rainacloud~$ taskd diagnostics --data /home/raina/taskdata/
taskd 1.1.0
Platform: Linux
Hostname: rainacloud
Compiler
Version: 4.9.3
Caps: +stdc +stdc_hosted +200809 +LP64 +c8 +i32 +l64 +vp64 +time_t64
Compliance: C++11