Giter VIP home page Giter VIP logo

tsukae's Introduction

๐Ÿ’ฌ Discord: _Zen_#8361 talk to me เผผ ใค โ—•_โ—• เผฝใค

tsukae's People

Contributors

5nord avatar irevenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tsukae's Issues

Problem with zsh

This line was creating problem for me.
Error message: panic: runtime error: index out of range [1] with length 1

changing
historySlice[i] = commandSlice[1] //writing command name after sudo
to
historySlice[i] = commandSlice[0] //writing command name after sudo
solved problem for me.

I don't have any programming language knowledge but i guess it's because of previous for loop, that remove timestamps.

Feature: Variable number of commands shown

Currently, it seems that only a handful of commands are shown. It would be useful to be able to set a variable number of commands, which are less useful for pie charts, but more useful for the list format.

Xonsh support

Hi!

It will be great to have xonsh shell support.

The history backend in xonsh is customisable but it has two default backends to choose: json and sqlite.

How to create and get the data for two backends:

pip install xonsh  # or install/docker ways: https://xon.sh/contents.html#installation

# Json
echo \$XONSH_HISTORY_BACKEND = \'json\' > /tmp/rc_json
xonsh --rc /tmp/rc_json
echo 1
echo 2
exit
cd ~/.local/share/xonsh/
cat xonsh-*.json | jq .data.cmds[].inp
# "echo 1\n"
# "echo 2\n"

# SQLite
echo \$XONSH_HISTORY_BACKEND = \'sqlite\' > /tmp/rc_sqlite
xonsh --rc /tmp/rc_sqlite
echo 1
echo 2
exit
pip install sqlite_web
sqlite_web ~/.local/share/xonsh/xonsh-history.sqlite
# http://127.0.0.1:8080/xonsh_history/query/
# SELECT * FROM "xonsh_history"

Thanks!

For community

โฌ‡๏ธ Please click the ๐Ÿ‘ reaction instead of leaving a +1 or ๐Ÿ‘ comment

binary releases

I would love to see a snap or .deb package of this for easy installation on my Ubuntu systems. ๐Ÿ˜„

Feature: Working directories instead of shell history (via z and zsh-z)

There are two command-line tools, z and zsh-z, which keep track of your most-used and recently-used command-line DIRECTORIES (they say "frecency" for a mixture of frequently and recently) as opposed to tsukae's current display of just the commands.

z: https://github.com/rupa/z
zsh-z:https://github.com/agkozak/zsh-z

The way you use the tool is to source a script that sets a hook that runs every time your prompt is displayed. You can then enter z foo where foo is a substring that is compared against your most 'frecently' used directories.

Unfortunately, z is a shell function, not a callable program. However, its data is stored in ~/.z, and looks like the details below. Note the path, its score, and the timestamp of access are all shown. This should be easy for tsukae to parse out, and offer a mode in addition to bash and zsh called z. You'd want to show the highest-scored N entries in tsukae.

Click to expand
$ head ~/.z
/Users/zachriggle/gdb-build|2.95589|1614576609
/Applications/IDA Pro 7.5|1.21395|1612766077
/Users/zachriggle/ctf-solutions|25.2152|1614161190
/Users/zachriggle/autoprogram|13.8645|1614141904
/Users/zachriggle/pwntools/.git|3.31034|1614112324
/Users/zachriggle/ctf-solutions/defcon/2020/finals/gameboooy|2.3126|1596929922
/Users/zachriggle/ctf-solutions/defcon|1.93996|1614161192
/usr/local/Cellar|2.40773|1613560248
/Users/zachriggle/sphinx|5.51275|1613553642
/Users/zachriggle/usercorn|2.23848|1612281791

Disclaimer: I would implement this myself, but I am barred from FOSS contributions by my employer.

Feature request: would like tsukae to ignore specified commands

I would like to be able to pass certain commands to be ignored when displaying the charts, i.e. the number of times I invoke git or ls or cd is not as important to me as other commands, but these are typically at the top of the charts, crowding them out. Maybe a command line option that takes one or more commands (or repeat the option) to be eliminated from the final list?

Documentation notes

Cool project! Thanks for sharing. I have some ideas to improve the readme - I hope these are helpful.

  1. I haven't used go, so it wasn't obvious to use go build. Might want to replace the suggested go run main.go with go build in the description (also assumes go is installed).
  2. The blacklist file wasn't automatically created for me. I just used mkdir ~/.config/tsukae and then touch blacklist.

Thanks!

Cannot select text displayed by Tsukae

I'm on macOS, using iTerm2, and it appears that I cannot select the text printed out by Tsukae, to e.g. copy paste the contents somewhere else.

When I try extra hard, iTerm2 shows me the following warning:

Screen Shot 2021-03-04 at 5 43 46 PM

Feature: Commands most used in <time period>

Currently, tsukae lists commands from the entire history file.

It would be useful to see which commands were most used in the last (day, week, month).

This won't work for bash, but zsh puts timestamps in its history file.

Fish support?

Haven't tried it, but the readme only states zsh and bash

Doesn't work on macOS

Not sure what the issue is, $HOME and $HISTFILE are all set correctly. The file is accessible and readable.

$ echo $HOME
/Users/heapcrash

$ echo $HISTFILE
/Users/heapcrash/.zhistory

$ tail -2 $HISTFILE
: 1614405148:0;echo $HISTFILE
: 1614405182:0;tail -2 $HISTFILE

$ go run main.go zsh
2021/02/27 00:52:12 Can't find or open /.zsh_history in: /Users/heapcrash
exit status 1

Feature: Configurable command blacklist

Tsukae is great and does right what it says on the tin. However, I don't necessarily care about my usage of e.g. cd or echo.

It would be nice if Tsukae had a configurable blacklist of commands to NOT show. Maybe have a list of commands to ignore in e.g. ~/.config/tsukae/blacklist.

Feature: Configurable colors, and 256-color or maybe even 24-bit color (to support colorblind-friendly palette)

Configurable Color Palette

I am red-green colorblind, so it makes it very hard to distinguish between some of the sections in the pie chart mode. So first, it would be nice to be able to configure which colors are used (ANSI "green" and "yellow" are indistinguishable to me). There are a few colors that aren't used (and even then there's the bold variants and background-color variants).

For example, here I cannot tell the difference between the gc and verify-fix slices in this picture:

Screen Shot 2021-03-04 at 1 17 23 PM

It would be nice to be able to specify the set of colors used by tsukae.

Stretch Goals

It would be even better if tsukae were to support 256 colors, or even 24-bit color, since most terminals support this now. It seems there is even a Go package to provide this support, with https://github.com/gdamore/tcell.

You can check if your terminal supports 24-bit color with the following command:

awk 'BEGIN{
    s="/\\/\\/\\/\\/\\"; s=s s s s s s s s;
    for (colnum = 0; colnum<77; colnum++) {
        r = 255-(colnum*255/76);
        g = (colnum*510/76);
        b = (colnum*255/76);
        if (g>255) g = 510-g;
        printf "\033[48;2;%d;%d;%dm", r,g,b;
        printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b;
        printf "%s\033[0m", substr(s,colnum+1,1);
    }
    printf "\n";
}'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.