Skip to content

Instantly share code, notes, and snippets.

View kylelix7's full-sized avatar
💭
forward is forward

Kyle Li kylelix7

💭
forward is forward
View GitHub Profile
@kylelix7
kylelix7 / gist:25b68afd065b3652d71e46696ca1a6f8
Created November 15, 2016 22:53 — 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

@kylelix7
kylelix7 / tcpdump, nc
Created April 19, 2017 21:31
tcpdump, nc checking packets
on server: tcpdump -c 100 -i any udp and port 33001
on client: nc -u <IP> 33001
https://chartio.com/resources/tutorials/how-to-write-to-a-csv-file-using-oracle-sql-plus/
How to Write to a CSV File Using Oracle SQL*Plus
DATA TUTORIAL
laptop with example chartio dashboard
Working with Redshift, BigQuery, MySQL, MongoDB, Postgres, IBM DB2, Oracle?
Easily connect your databases and create powerful visualizations and interactive dashboards in minutes.
@kylelix7
kylelix7 / setup.sh
Created November 4, 2019 02:35
setup Angular on mac
# install node.js if you haven't done it
brew install node
# install angular cli
npm install -g @angular/cli
@kylelix7
kylelix7 / scarfold.sh
Last active November 4, 2019 04:53
scarfold a new angular app with angular cli
ng new stock-app
# ? Would you like to add Angular routing? No
# ? Which stylesheet format would you like to use? CSS
cd stock-app
npm install --save bootstrap@4 @ng-bootstrap/ng-bootstrap @swimlane/ngx-charts
#npm WARN @swimlane/[email protected] requires a peer of @angular/[email protected] || 8.x but none is installed. You must install peer dependencies yourself.
#
#+ @ng-bootstrap/[email protected]
@kylelix7
kylelix7 / NgxChartsModule.ts
Created November 4, 2019 04:07
NgxChartsModule
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
@NgModule({
declarations: [
@kylelix7
kylelix7 / chart.component.ts
Last active November 4, 2019 06:28
chart.component.ts
import { Component } from '@angular/core';
import { StockDataService } from '../stock-data.service';
import { HistoricalData } from '../models';
import { Observable} from 'rxjs';
@Component({
selector: 'app-chart',
templateUrl: './chart.component.html',
styleUrls: ['./chart.component.css']
})
@kylelix7
kylelix7 / chart.component.html
Created November 4, 2019 05:17
chart.component.html
<ngx-charts-line-chart
[scheme]="colorScheme"
[results]="single"
[gradient]="gradient"
[xAxis]="showXAxis"
[yAxis]="showYAxis"
[legend]="showLegend"
[showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel"
[xAxisLabel]="xAxisLabel"
@kylelix7
kylelix7 / models.ts
Created November 4, 2019 05:20
models.ts
export interface NameValPair {
'name': string,
'value': number
};
export interface HistoricalData {
'name': string,
'series': NameValPair[]
}
@kylelix7
kylelix7 / stock-data.service.ts
Last active November 4, 2019 06:26
stock-data.service.ts
import { Injectable } from '@angular/core';
import { HistoricalData } from './models';
import { Subject } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class StockDataService {
public historicalData: Subject<HistoricalData[]> = new Subject();
constructor() {