Skip to content

Instantly share code, notes, and snippets.

@m4rv4x
m4rv4x / react-app.md
Last active January 16, 2024 08:02
create react app

Make dir :

mkdir <react-app> && cd <react-app>

Init React Project :

npx create-react-app ./

Run dev :

@m4rv4x
m4rv4x / crypto-cli.md
Last active December 25, 2023 23:42
Fetch crypto charts from cli

You can use the cryptowatch command-line tool to fetch crypto prices and charts in the command line. Here's how you can install and use it:

  1. Install cryptowatch by running the following command:

    npm install -g cryptowatch-cli
    
  2. Once installed, you can use the cryptowatch command to fetch crypto prices and charts. For example, to fetch the price chart for Bitcoin (BTC) in USD, you can use the following command:

cryptowatch chart btcusd

@m4rv4x
m4rv4x / gist-cli.md
Last active December 25, 2023 23:42
Push a gist from cli

To push a GitHub Gist from the command line quickly, you can use the gist command-line tool. Here are the steps to do it:

  1. Install the gist command-line tool if you haven't already. You can install it using the following command:

    gem install gist
    

    Note: This assumes you have Ruby and RubyGems installed on your system.

@m4rv4x
m4rv4x / deploy-openvpn-as.md
Last active December 19, 2023 20:01
Run dockerized open-vpn access server the easy way

One Shot

Step 1 - Deploy Server

docker run -it --rm --cap-add=NET_ADMIN -p 1194:1194/udp -p 80:8080/tcp -e HOST_ADDR=$(curl -s https://api.ipify.org) --name dockovpn alekslitvinenk/openvpn

Step 2 - Connect Client

  • Follow Instructions
  • or
@m4rv4x
m4rv4x / deploy-mistral.md
Last active December 17, 2023 22:57
Deploy Mistral LLM using ollama

on Linux

Install ollama

curl https://ollama.ai/install.sh | sh

Run last Mixtral 8X7B on local machine :

ollama run mixtral:8x7b
Saving video as an MP3 file
To save the highest quality audio as an mp3 file you need to define --audio-format mp3 with -x which is extract audio
yt-dlp -f 'ba' -x --audio-format mp3 https://www.youtube.com/watch?v=dQw4w9WgXcQ -o '%(id)s.%(ext)s'
@m4rv4x
m4rv4x / github-quick-guide.md
Last active June 3, 2023 15:54
GitHub - Very quick memo

GitHub Quick Memo

Install / Login with GitHub CLI on Linux

wget https://github.com/cli/cli/releases/download/v2.29.0/gh_2.29.0_linux_amd64.deb
sudo dpkg -i gh_2.29.0_linux_amd64.deb
gh auth login

Create a new repo

@m4rv4x
m4rv4x / python-quick-guide.md
Last active June 3, 2023 15:54
Python3 quick guide

Quick deployment guide for a Python app:

Install Python: Install the latest version of Python on your server.

Install dependencies: Install any dependencies required by your app using pip.

Clone your app: Clone your app from your Git repository onto the server.

Set up a virtual environment for your Python app:

  1. Install virtualenv: First, you need to install virtualenv on your system. You can do this by running the following command: pip install virtualenv
  2. Create a virtual environment: Once virtualenv is installed, you can create a new virtual environment for your app by running the following command: virtualenv env This will create a new directory called env in your current directory, which will contain the virtual environment.
@m4rv4x
m4rv4x / nodejs-quick-guide.md
Last active June 3, 2023 15:54
NodeJS quick guide

Quick deployment guide for Node.js:

  1. Install Node.js on your server
  2. Create a new directory for your project
  3. Initialize a new Node.js project using npm init
  4. Install any necessary dependencies using npm install
  5. Write your Node.js code
  6. Test your code locally using node app.js
  7. Set up your server environment (e.g. AWS, DigitalOcean, etc.)
  8. Copy your project files to your server
@m4rv4x
m4rv4x / .zshrc
Last active May 5, 2023 16:04
Custom ZSH config
# Set up the prompt
setopt autocd # change directory just by typing its name
setopt correct # auto correct mistakes
setopt interactivecomments # allow comments in interactive mode
setopt magicequalsubst # enable filename expansion for arguments of the form ‘anything=esetopt nonomatch # hide error message if there is no match for the pattern
setopt notify # report the status of background jobs immediately
setopt numericglobsort # sort filenames numerically when it makes sense
setopt promptsubst # enable command substitution in prompt