Skip to content

Instantly share code, notes, and snippets.

View mufasa71's full-sized avatar

Shukhrat Mukimov mufasa71

View GitHub Profile
@mufasa71
mufasa71 / README.md
Created September 14, 2023 08:56 — forked from kfox/README.md
TCP echo server for Node.js

TCP echo server for Node.js

Usage

  1. Make sure you have a modern-ish version of Node.js installed.
  2. Type npx https://gist.github.com/kfox/1280c2f0ee8324067dba15300e0f2fd3
  3. Connect to it from a client, e.g. netcat or similar: nc localhost 9000
@mufasa71
mufasa71 / choosy
Created September 16, 2022 09:44 — forked from cesarolea/choosy
Open browser based off of certain rules (like choosy for macOS)
#!/bin/bash
URL=$1
DOMAIN=$(echo "$URL" | awk -F[/:] '{print $4}')
## Domain starts with
if [[ $DOMAIN =~ $(echo ^\($(paste -sd'|' /home/your-user/.config/url-start.txt)\)$) ]]; then
chromium-browser "$URL" & disown
elif [[ $DOMAIN =~ $(echo ^\($(paste -sd'|' /home/your-user/.config/url-is.txt)\)$) ]]; then
firefox "$URL" & disown
@mufasa71
mufasa71 / generateFlowModuleNameMappers.js
Created June 20, 2018 06:28 — forked from turadg/generateFlowModuleNameMappers.js
Helper to create .flowconfig module name mapper
#!/usr/bin/env node
/**
* Flowtype understands Node (or Haste) imports but not Webpack.
*
* Many codebases have webpack set up like:
* src/foo.js
* src/components/Bar.jsx
*
* And then import them like `require('foo')` or `require/components/Bar.jsx`
*
@mufasa71
mufasa71 / _readme.md
Created June 20, 2018 06:28 — forked from lambdahands/_readme.md
FlowType and CSS Modules

Huh?

So basically FlowType doesn't know about CSS Modules, a really handy way of dealing with the plagues of CSS in codebases (global variables and dependency wackiness mainly).

What WebPack allows us to do is "require" CSS files and use their class names:

import styles from "my_styles.css";
import React from "react";
@mufasa71
mufasa71 / flow-ignore.js
Created June 20, 2018 06:27 — forked from zerobias/flow-ignore.js
Make flow ignore all unrelated deps and work much faster
//@flow
const {
readdirSync,
outputFileSync,
pathExistsSync,
//$todo
readFileSync,
} = require('fs-extra')
# Maintainer: Aleksey Kamenskikh <aleksey.kamenskikh@gmail.com>
pkgname=mssql-server
pkgver=14.0.500.272
_prodver=${pkgver}-2
pkgrel=1
pkgdesc="Microsoft SQL Server for Linux"
arch=('x86_64')
url="https://www.microsoft.com/en-us/sql-server/sql-server-vnext-including-Linux"
license=('unknown')
depends=(python2-configparser numactl libopenssl-1.0-compat)
@mufasa71
mufasa71 / simple-gpg-enc.go
Created April 23, 2017 11:30 — forked from stuart-warren/simple-gpg-enc.go
golang gpg/openpgp encryption/decryption example
package main
import (
"bytes"
"code.google.com/p/go.crypto/openpgp"
"encoding/base64"
"io/ioutil"
"log"
"os"
)
@mufasa71
mufasa71 / simple_args_parsing.sh
Created March 28, 2017 09:29 — forked from jehiah/simple_args_parsing.sh
a simple way to parse shell script arguments
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
@mufasa71
mufasa71 / lxc.sh
Created March 26, 2017 09:01 — forked from reqshark/lxc.sh
set up linux containers with node.js
# update the host
apt-get update && apt-get upgrade -y # && apt-get dist-upgrade -y && apt-get autoremove --purge -y && apt-get autoclean -y
# https://www.stgraber.org/
# install linux containers
sudo apt-get install lxc
# list all containers and view their current status
sudo lxc-ls -f
@mufasa71
mufasa71 / gist:efc250342cda2bc90e0547766104d586
Created October 9, 2016 12:13 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt