Skip to content

Instantly share code, notes, and snippets.

View koushik-ms's full-sized avatar
🦀
learning rust

koushik-ms

🦀
learning rust
View GitHub Profile
@koushik-ms
koushik-ms / borrow.rs
Created April 15, 2021 07:42
Shadowing and Borrowing in Rust
fn main() {
let mut name = "balloon";
{
let ref1 = &mut name;
*ref1 = "Column";
println!("{}", name);
let name = "JNum";
// Without let above, name takes back ownership and output of line 10 will change!
println!("{}", name);
}
@koushik-ms
koushik-ms / Runtime Color Control.md
Last active December 8, 2020 18:38
A proposal for solving issue #485 in AFLplusplus

Proposed solution for AFLplusplus#485

Currently all logging messages eventually resolve to the SAYF macro. The format-string lieral is constructed at compile-time with expanded color-codes or no color-codes based on USE_COLOR flag.

To achieve runtime control of color codes the idea is to use an env var (AFL_DECOLORIZE_CONSOLE_OUTPUT) to control output of color codes. When AFL was compiled with USE_COLOR, then it checks the presence and value of this variable and when it is set to 1, it strips the color-codes from the format strings.

Here's the outline of proposed solution:

include/debug.h:

@koushik-ms
koushik-ms / conda_config.yaml
Created July 4, 2020 08:46
Sample CONDA config yaml for deep-learning projects
channels:
- conda-forge
- pytorch
- fastai
dependencies:
- python=3.6
- numpy
- mkl
- jupyter
- pandas
#!/usr/bin/env python3
import json
with open('backup.js') as infile:
read_data = infile.read()
json_data = json.loads(read_data)
tab_groups = json.loads(json_data['windows'][0]['extData']['tabview-group'])