Skip to content

Instantly share code, notes, and snippets.

View kongdd's full-sized avatar

Dongdong Kong kongdd

View GitHub Profile
@kongdd
kongdd / levmarq - Levenberg-Marquardt in plain C
Created February 12, 2022 07:24 — forked from rbabich/ levmarq - Levenberg-Marquardt in plain C
A simple implementation of the Levenberg-Marquardt algorithm in plain C
This file (with a leading space) exists so that the gist has a sensible name, rather than "LICENSE."
@kongdd
kongdd / install-tmux.sh
Last active October 23, 2021 01:18 — forked from pokev25/install-tmux.sh
add sudo
# Install tmux 2.8 on Centos
# install deps
sudo yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -LOk https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
tar -xf libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable
./configure --prefix=/usr/local
@kongdd
kongdd / .curlrc
Created January 11, 2021 02:02 — forked from asmega/.curlrc
default proxy for curl in .curlrc
proxy=http://username:password@host:port
@kongdd
kongdd / wsl2host.md
Last active March 25, 2020 05:42
wsl2 static ip best solution

A improved solution based that of @edwindijas:

Known that localhost (and 127.0.0.1) works in the lastest wsl2. Hence the only thing need to do is mapping 127.0.0.1:port to 0.0.0.0:port.

Make sure you can run powershell script

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

Execute the following PowerShell scripts in Administrator mode one time can solve the problem. Needn't autostart and execute every time when login.

@kongdd
kongdd / Debugging Mixed Python C++ code in Visual Studio Code
Created December 29, 2019 22:34 — forked from asroy/Debugging Mixed Python C++ code in Visual Studio Code
Debugging Mixed Python/C++ code in Visual Studio Code
I've tested it on Fedora 23 and Ubuntu 16.04. I'm using gcc-5.3.1, python-3.4, VS Code-1.14.0
You can debug mixed Python/C++ in the same GUI. It also works for MPI applications. You can switch between the debuggers and corresponding call stacks.
1. Packages needed
1) Visual Studio Code
2) Extensions for VS Code:
"Python" from Don Jayamanne (I'm using 0.6.7)
This allows VS Code act as the front end to debug python.
This gives VS Code ability to attach to a python script that uses module "ptvsd".
@kongdd
kongdd / cloudSettings
Last active October 27, 2021 02:08
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-10-27T02:08:39.819Z","extensionVersion":"v3.4.3"}
@kongdd
kongdd / cheat_sheet.txt
Created October 16, 2019 07:44
GDB cheat sheet
GDB commands by function - simple guide
---------------------------------------
More important commands have a (*) by them.
Startup
% gdb -help print startup help, show switches
*% gdb object normal debug
*% gdb object core core debug (must specify core file)
%% gdb object pid attach to running process
% gdb use file command to load object
@kongdd
kongdd / julia gdb session example
Created October 14, 2019 17:49 — forked from waTeim/julia gdb session example
A julia GDB session example
jeffw@dub1:~$ ps auxww | grep julia
jeffw 5646 1.5 11.3 8587092 85668 pts/0 S+ 19:53 0:03 julia-debug
jeffw 5886 0.0 0.1 9392 896 pts/1 S+ 19:57 0:00 grep --color=auto julia
jeffw@dub1:~$ gdb -p 5646
GNU gdb (GDB) 7.5-ubuntu
Copyright (C) 2012 Free Software Foundation, Inc.
@kongdd
kongdd / how_to_debug_rcpp.Rmd
Created August 19, 2019 06:27 — forked from alexg9010/how_to_debug_rcpp.Rmd
How to debug Rcpp code in a package
---
title: "How to debug Rcpp code in a package"
output: html_document
author: Alexander Gosdschan
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# git代理
```
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy http://127.0.0.1:1080
git config --global http.proxy socks5://127.0.0.1:1080
git config --global http.proxy socks5://127.0.0.1:1081
git config --global https.proxy socks5://127.0.0.1:1081
git config --global http.proxy http://127.0.0.1:8118