Skip to content

Instantly share code, notes, and snippets.

View gangliao's full-sized avatar
🏠
Working from home

Gang Liao gangliao

🏠
Working from home
View GitHub Profile
#define POLYNOMIAL 0xD8 /* 11011 followed by 0's */
uint8_t crc_naive(uint8_t const message)
{
uint8_t remainder;
remainder = message;
for (uint8_t bit = 8; bit > 0; --bit)
{
/* If the uppermost bit is a 1... */
#!/bin/sh
set -xe
#0. clean
sudo rm -rf /etc/kubernetes/
sudo rm -rf ~/node_bin
export http_proxy=http://10.130.14.129:8080
export https_proxy=http://10.130.14.129:8080
@gangliao
gangliao / bitcoin.dockerfile
Last active July 4, 2018 12:51
Bitcoin Dockerfile
FROM ubuntu:16.04
MAINTAINER Gang Liao <gangliao@cs.umd.edu>
ARG UBUNTU_MIRROR
RUN /bin/bash -c 'if [[ -n ${UBUNTU_MIRROR} ]]; then sed -i 's#http://archive.ubuntu.com/ubuntu#${UBUNTU_MIRROR}#g' /etc/apt/sources.list; fi'
RUN apt-get update && apt-get install -y --no-install-recommends \
git python3-pip python3-dev openssh-server g++ pkg-config \
wget unzip unrar tar xz-utils bzip2 gzip coreutils \
curl sed grep vim librdmacm-dev libibverbs-dev libboost-all-dev \
@gangliao
gangliao / k8s-teamcity.yaml
Last active July 5, 2018 10:42
teamcity on kubernetes
---
apiVersion: v1
kind: Service
metadata:
name: teamcity-server-instance
spec:
ports:
- nodePort: 8111
port: 80
targetPort: 8111
cat output2 | grep cnc | awk '(print $9$10$11}' | uniq | wc -l
// Copyright (c) 2018 Gang Liao <gangliao@cs.umd.edu>. All Rights Reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
#!/bin/sh
set -x
sudo systemctl stop docker
sudo ip link delete docker0
sudo /usr/bin/cat > /usr/lib/systemd/system/docker.service << EOF
[Unit]
Description=Docker Application Container Engine
@gangliao
gangliao / move_twice.py
Created December 23, 2018 01:54
ai for robtics
#Given the list motions=[1,1] which means the robot
#moves right and then right again, compute the posterior
#distribution if the robot first senses red, then moves
#right one, then senses green, then moves right again,
#starting with a uniform prior distribution.
p=[0.2, 0.2, 0.2, 0.2, 0.2]
world=['green', 'red', 'red', 'green', 'green']
measurements = ['red', 'green']
motions = [1,1]
- protocol directory contains protocol files in ASCII format for training and development.
protocol/ASVspoof2017_train.trn.txt: contains a file list to be used to train human and spoofed speech detectors.
protocol/ASVspoof2017_dev.trl.txt : contains a development trial list to validate the spoofing detector.
The two file have the same format and the meaning of each column is listed as follows:
1st column: unique file ID
2nd column: speech type identifier: genuine means the trial is original speech; spoof means the file is created with replay attack.
3rd column: speaker ID
4th column: RedDots common phrase ID
Parameters: {'no_cuda': True, 'train': True, 'test_batch_size': 10, 'batch_size': 10, 'epochs': 41, 'seed': 1, 'lr': 0.0001, 'log_interval': 10, 'eval': True, 'cuda': False, 'momentum': 0.5, 'output_dir': 'model-output/5cnn-2fc-mfm-768x400'}
Conv1: (32, 1, 3, 3)
Conv2: (48, 16, 3, 3)
Conv3: (64, 24, 3, 3)
Fc1: (128, 1512)
Fc2: (2, 128)
Train Epoch: 1 [0/3016 (0%)] Loss: 0.679156
Train Epoch: 1 [100/3016 (3%)] Loss: 0.690277
Train Epoch: 1 [200/3016 (7%)] Loss: 0.671204