Skip to content

Instantly share code, notes, and snippets.

View kongchen's full-sized avatar
💭
zhetenging

Chen Kong kongchen

💭
zhetenging
View GitHub Profile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define :puppetmaster do |puppetmaster|
puppetmaster.vm.hostname = "puppetmaster"
puppetmaster.vm.network :private_network, ip: "192.168.33.50"
puppetmaster.vm.box = "base"

If you want to clone an svn repository with git-svn but don't want it to push all the existing branches, here's what you should do.

  • Clone with git-svn using the -T parameter to define your trunk path inside the svnrepo, at the same time instructing it to clone only the trunk:
  git svn clone -T trunk http://example.com/PROJECT
  • If instead of cloning trunk you just want to clone a certain branch, do the same thing but change the path given to -T:
  git svn clone -T branches/somefeature http://example.com/PROJECT
@kongchen
kongchen / gist:72c1ebf078e7af86b26de1b01d0a5dda
Created June 6, 2019 03:00 — forked from vdw/gist:09efee4f264bb2630345
Kill tcp connection with tcpkill on CentOS

Install tcpkill
yum -y install dsniff --enablerepo=epel

View connections
netstat -tnpa | grep ESTABLISHED.*sshd.

Block with ip tables
iptables -A INPUT -s IP-ADDRESS -j DROP

Kill connection

@kongchen
kongchen / gist:d462ff443ea6a5895740c6d3ec1aa3d0
Created February 12, 2022 15:01 — forked from tayvano/gist:6e2d456a9897f55025e25035478a3a50
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)