Skip to content

Instantly share code, notes, and snippets.

@seanchenxi
seanchenxi / resize-vagrantbox-disk
Created February 10, 2020 00:16
Resize Vagrantbox disk
fdisk /dev/sda
#delete default partition
#recreate default partition
#use linux vm type partition
n
p
3
t
8e
w
update npm
npm install npm -g
update js env
npm install -g grunt-cli bower
@seanchenxi
seanchenxi / gist:22730c7899576967154b
Created February 25, 2016 11:24
Gource & FFMPEG for GIT
gource \
-1280x720 \
--stop-at-end \
--key \
--disable-progress \
--seconds-per-day 0.12 \
--file-idle-time 2.6 \
--elasticity 0.006 \
--max-user-speed 560 \
--bloom-multiplier 0.70 \
@seanchenxi
seanchenxi / sshd-config
Created February 22, 2016 16:00
java ssh algorithm negotiation fail
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
@seanchenxi
seanchenxi / jetty-web.xml
Created February 17, 2016 14:28
Example for jetty-web.xml config with db2 datasource
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/</Set>
<New id="mysql" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg>java:comp/env/jdbc/mySQL</Arg>
<Arg>
<New class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
<!--<Set name="Url">jdbc:mysql://10.5.3.180:3306/categs01?useUnicode=true&amp;characterEncoding=UTF-8&amp;zeroDateTimeBehavior=convertToNull</Set>-->
@seanchenxi
seanchenxi / Node.js File Looper
Created December 20, 2015 23:58 — forked from adamwdraper/Node.js File Looper
Loop through all files in a given directory with node.js
var fs = require('fs');
var walkPath = './';
var walk = function (dir, done) {
fs.readdir(dir, function (error, list) {
if (error) {
return done(error);
}
@seanchenxi
seanchenxi / server.xml
Last active November 16, 2015 18:57
Websphere developer runtime, usr/servers/$LOCAL_SERVER_NAME$/server.xml, to activate jdbc
<?xml version="1.0" encoding="UTF-8"?>
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>jsp-2.2</feature>
<feature>localConnector-1.0</feature>
<feature>jdbc-4.0</feature>
<feature>servlet-3.0</feature>
</featureManager>
<dataSource id="ecatDataSource1" jndiName="jdbc/rftGWTMYSQL01" type="javax.sql.DataSource">
@seanchenxi
seanchenxi / .htaccess
Last active August 29, 2015 14:15 — forked from mshuffett/.htaccess
# Apache .htaccess
# angularjs pushstate (history) support:
# See http://www.josscrowcroft.com/2012/code/htaccess-for-html5-history-pushstate-url-routing/
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteRule (.*) index.html [L]
using Microsoft.Phone.Controls;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.IsolatedStorage;
using System.Linq;
using System.Text;
using System.Windows;
@seanchenxi
seanchenxi / idea64.exe.vmoptions
Created March 2, 2014 14:49
for Intellij 13 64bit
-Xms128m
-Xmx768m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=96m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Duser.country=GB
-Duser.language=en
-Dfile.encoding=UTF-8