zx is a set of handy commands to make some daily tasks easier.
- Check that Go is installed correctly
curl
orwget
should be installedgit
should be installed- Copying to the Clipboard requires
xclip
orxsel
command to be installed
zx is installed by running one of the following commands in your terminal.
sh -c "$(curl -fsSL https://raw.githubusercontent.com/martinusso/zx/master/install.sh)"
sh -c "$(wget -O- https://raw.githubusercontent.com/martinusso/zx/master/install.sh)"
As an alternative, you can first download the install script and run it afterwards:
wget https://raw.githubusercontent.com/martinusso/zx/master/install.sh
sh install.sh
Alternatively, you can "git clone" this repository to any directory and run install command.
git clone --depth 1 https://github.com/martinusso/zx.git
cd zx
make install
~ zx info
zx is a set of handy commands to make some daily tasks easier.
version: v0.3.0
Decode from Base64 or Encode to Base64.
Copies automatically the output to the clipboard.
Encode
~ zx base64 -e "zx is a set of handy commands to make some daily tasks easier"
enggaXMgYSBzZXQgb2YgaGFuZHkgY29tbWFuZHMgdG8gbWFrZSBzb21lIGRhaWx5IHRhc2tzIGVhc2llcg==
Decode
~ zx base64 enggaXMgYSBzZXQgb2YgaGFuZHkgY29tbWFuZHMgdG8gbWFrZSBzb21lIGRhaWx5IHRhc2tzIGVhc2llcg==
zx is a set of handy commands to make some daily tasks easier
base64
, b64
-d, --decode Decode from Base64
-e, --encode Encode to Base64
-h, --help help for base64
Generate a valid CNPJ or Validate if pass a CNPJ as args
Copies automatically the output to the clipboard.
~ zx cnpj
72114610000127
~ zx cnpj 72114610000127
72114610000127 ➜ valid
~ zx cnpj 72114610000121
72114610000121 ➜ invalid
-h, --help help for cnpj
Generate a valid CPF or Validate if pass a CPF as args.
Copies automatically the output to the clipboard.
~ zx cpf
08507460003
~ zx cpf 08507460003
08507460003 ➜ valid
~ zx cpf 08507460001
08507460001 ➜ invalid
-h, --help help for cpf
List of foreign currency rates.
Reference exchange rate: US dollar (USD).
BRL: ? (BRL 1 = USD ?), EUR: ? (EUR 1 = USD ?), GBP: ? (GBP 1 = USD ?)
~ zx exchange
BRL: 4.05 (USD 0.25), EUR: 0.90 (USD 1.12), GBP: 0.76 (USD 1.31)
-h, --help help for exchange
IP geolocation. It provides a simple IP to country, state and city mapping. Using db-ip.com/api.
Copies automatically the output to the clipboard.
~ zx ip 8.8.8.8
IP: 8.8.8.8
Continent: (SA) South America
Country: (BR) Brazil
City: Vitória (Espírito Santo)
-h, --help help for ip
Decode a JWT token.
This command doesn't validate the token, any well formed JWT can be decoded.
~ zx jwt eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Header:
{
"alg": "HS256",
"typ": "JWT"
}
Payload:
{
"iat": 1516239022,
"name": "John Doe",
"sub": "1234567890"
}
-h, --help help for jwt
Minify removes whitespace, strips comments, combines files, and optimizes/shortens a few common programming patterns.
Supported media types: css
, html
, js
, json
, svg
, xml
.
To confirm the input, press Ctrl+] ENTER
Copies automatically the output to the clipboard.
~ zx minify css
Type (or paste) here:
body {
overflow: hidden;
background-color: #000000;
background-image: url(images/bg.gif);
background-repeat: no-repeat;
}
^]
body{overflow:hidden;background-color:#000;background-image:url(images/bg.gif);background-repeat:no-repeat}
-h, --help help for minify
-t, --type string Supported media types: css, html, js, json, svg, xml
Generate a random password.
Copies automatically the output to the clipboard.
~ zx password
0n&r82i$
Specifying the size:
~ zx password 16
F@+pqBwkSH1907=2
~ zx password -l=16
Hk^vO4N]#tuI83le
zx password has the no|N
flag which allows you to remove character types in the password generation.
Password without lowercase letters:
~ zx password -Nl
F@+BSH1907=2
Password without uppercase letters:
~ zx password -Nu
@+pqwk1907=2
Password without numbers:
~ zx password -Nn
F@+pqBwkSH=
Password without symbols:
~ zx password -Ns
FpqBwkSH19072
And you can even combine several of them
~ zx password -Nsu
pqwk19072
-h, --help help for password
-l, --length int Password length
-N, --no string Password without [l]owercase, [u]ppercase, [n]umbers, [s]ymbols
Generate a random and unique salt and hash for passwords.
~ zx salt
Password: S[H3/7l1
Hash: efb283bcde5fe42c177558a563c0b998f179ba312777aa36218465ffe35ca3ba115f7e51cff736ca7a783b7d27be2ec072b80a2f6c817139ab2b32429a4fcd03
Salt: 6e034879d4c3e97def89875d23b7a173a438b1611269168d5fcb548cb7676b7b703e82887508bc1224732ef04373b45154760982bd90d7e40a4a5057dafd7c05
~ zx salt MyPassword
Password: MyPassword
Hash: c60bf872599be8327d40d2c29bf5abfec1c78da6870f9c6c83d8a1bb7069dd4fdfee535b5a24d658a1ff085830385a9242ff7f5a51ad9e60542e4b661f582783
Salt: 4c27d2a1ffc2fda6cb678e917679d39d7cfcaba1d9d207a0d8509c1c02946155071cdd2515aec0fe266e05d84ce1b2d13dd85ad8db0764b55e8e4024e90f2771
-h, --help help for salt
-p, --password string Password
Generate a random UUID.
Copies automatically the output to the clipboard.
~ zx uuid
d9ed16f4-f315-44e4-8e57-b00516d73420
-h, --help help for uuid
- Fork it
- Download your fork to your PC (git clone https://github.com/your_username/zx && cd zx)
- Create your feature branch (git checkout -b my-new-feature)
- Make changes and add them (git add .)
- Commit your changes (git commit -m 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new pull request
zx is released under the MIT license. See LICENSE