Skip to content

Instantly share code, notes, and snippets.

@jingliu9
jingliu9 / rust-command-line-utilities.markdown
Created May 22, 2023 00:08 — forked from sts10/rust-command-line-utilities.markdown
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
# prune local branches that does not exist remotely
git fetch --prune && git branch -r | awk "{print \$1}" | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk "{print \$1}" | xargs git branch -d
sudo apt-get install cpufrequtils
cpufreq-info
# NOTE THE default max is 4000000 @bumble
TARGET_FREQ="2900000"
for x in /sys/devices/system/cpu/*/cpufreq/
do
# NOTE: This will report error, but while verifying via `cat`, it has its effect there.
@jingliu9
jingliu9 / tmux-cheatsheet.markdown
Created November 19, 2018 15:43 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jingliu9
jingliu9 / DemoDaemon.java
Created October 23, 2018 15:06 — forked from wolfg1969/DemoDaemon.java
run java program as a daemon with jsvc
package server;
import org.apache.commons.daemon.Daemon;
import org.apache.commons.daemon.DaemonContext;
import org.apache.commons.daemon.DaemonInitException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* User: guoyong
/* rdtsc.h
Iterface to the x86 cycle counter
Usage:
1) Include the header file
#include "rdtsc.h"
2) Set the machine frequency (for instace on a 3.2 GHz machine)
@jingliu9
jingliu9 / rdtsc_time.c
Created July 18, 2018 16:30
help mapping rdtsc result into time
/**
* https://aufather.wordpress.com/2010/09/08/high-performance-time-measuremen-in-linux/
**/
#include <stdint.h> /* for uint64_t */
#include <time.h> /* for struct timespec */
#include <stdio.h>
/* assembly code to read the TSC */
static inline uint64_t RDTSC()
{
@jingliu9
jingliu9 / linux_performance_60s.sh
Last active January 24, 2018 05:21
linux_performance_60s
#!/bin/bash
# from this page:https://medium.com/netflix-techblog/linux-performance-analysis-in-60-000-milliseconds-accc10403c55
#########################################################################################################
$ uptime
23:51:26 up 21:31, 1 user, load average: 30.02, 26.43, 19.02

test in localhost

hugo server --buildDrafts

new post

## new post
hugo new post/POST_NAME.md
#!/bin/sh
sudo apt-get update
apt-get -y install software-properties-common
# create floders
mkdir ~/downloads
mkdir ~/workspace
# cmake
sudo apt-get -y install cmake