Skip to content

Instantly share code, notes, and snippets.

@zhensongren
zhensongren / ask_llama
Created September 10, 2023 13:59
A full-stack application for asking questions again internal documents
https://github.com/run-llama/sec-insights/issues/9
https://www.secinsights.ai/conversation/fa6614b9-ccac-4b01-a94b-779a404e6141
Sure, here's the questionnaire in English:
Do you encounter situations in your daily work that require handling a large amount of data?
a. Yes, I frequently deal with large volumes of data.
b. Sometimes, I handle some data.
c. Rarely, I am not heavily involved in data processing.
d. No, I don't work with data.
How familiar are you with AI (Artificial Intelligence) and data science?
a. Completely unfamiliar, I would like to start from the basics.
@zhensongren
zhensongren / uninstall_python3.MD
Last active October 13, 2024 19:58
How to uninstall python3 from Ubuntu

To list all python versions in default locations

ls /usr/bin/python*

To remove just python3 package

sudo apt-get remove python3.5

plus it's dependent packages

sudo apt-get remove --auto-remove python3.5

plus configuration and/or data files of python3

sudo apt-get purge python3.5

@zhensongren
zhensongren / screen.MD
Created February 27, 2020 22:05
run the process without stop after exit terminal

run the process without stop after exit terminal

  1. install GNU screen: apt-get update apt-get upgrade apt-get install screen

  2. type "screen". this will open up a new screen - kind of similar in look & feel to what "clear" would result in.

  3. run the process (e.g.: ./init-dev.sh to fire up a ChicagoBoss erlang server)

  4. type: Ctrl + A, and then Ctrl + D. This will detach your screen session but leave your processes running!

@zhensongren
zhensongren / my_sql_on_GCP.md
Last active May 23, 2024 00:02
Setup on MySQL on Google Cloud Compute Engine

Create two instances for MySQL—a client and a server instance.

To set your Cloud Platform project in this session use “gcloud config set project [PROJECT_ID]”

gcloud config set project mysql-remote-access-267116

Create the client and server VM instances.

client:

gcloud compute instances create my-client --zone us-central1-f --image-project ubuntu-os-cloud --image-family ubuntu-1804-lts --scopes https://www.googleapis.com/auth/cloud-platform

Server:

gcloud compute instances create my-server --zone us-central1-f --image-project ubuntu-os-cloud --image-family ubuntu-1804-lts --scopes https://www.googleapis.com/auth/cloud-platform

@zhensongren
zhensongren / install_mysql_in_wsl.md
Last active March 11, 2024 16:59
Set up MySQL on local machine (Windows Subsystem for Linux, WSL2)

Upgrade the Repositories

sudo apt update sudo apt upgrade

Install MySQL 5.7

sudo apt install mysql-server

Secure MySQL Installation

sudo apt install mysql-server #To do the high security provide all answers to yes

//CareerCup 1.2 Reverse a string by StringBuilder.
class StringReverse {
public static void main(String args[]) {
System.out.println("before: " + args[0]);
String s = new StringBuilder(args[0]).reverse().toString();
System.out.println("after: " + s);
}
}
@zhensongren
zhensongren / UniqueChar.java
Created April 3, 2015 19:48
CareerCup 1.1
//test if a string is consist of a sequence of all unique characters
public class UniqueChar {
public static boolean isUnique(String x) {
if (x.length() > 256)
return false;
boolean[] b = new boolean[256];
for(int i=0; i<x.length(); i++) {