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')
@mufasa71
mufasa71 / archlinux_lxc_cannot_start.md
Last active August 14, 2017 08:39
archlinux in unprivileged lxc systemd cannot start

lxc/lxc#1678

lxc.init_cmd = /sbin/init systemd.legacy_systemd_cgroup_controller=yes

config:
  raw.lxc: lxc.init_cmd = /sbin/init systemd.legacy_systemd_cgroup_controller=yes
@mufasa71
mufasa71 / npm_shared_folders.md
Created July 1, 2017 13:34
npm shared folders
# if running inside VirtualBox on a shared folder
# you must enable symlinks on the shared folder
$ VBoxManage setextradata "<vm name>" VBoxInternal2/SharedFoldersEnableSymlinksCreate/<shared folder> 1

# verify with
$ VBoxManage getextradata "<vm name>" enumerate

npm install --no-bin-links

/usr/share/lxc/config/common.conf.d/01-extra-mounts.conf

lxc.hook.pre-start = /usr/local/bin/lxc-extra-mounts
lxc.hook.post-stop = /usr/local/bin/lxc-extra-mounts

/usr/local/bin/lxc-extra-mounts

#!/bin/bash

ACTION="${3}"
@mufasa71
mufasa71 / gist:b9da5ba9d0b1c7fae1459b13ed4b8370
Created May 23, 2017 17:36
How to enable HIPM+DIPM for Event ID 129 – storachi – Reset to device, DeviceRaidPort0, was issued.

Erik August 9, 2014 at 5:07 am

Actually, this is the incorrect setting for your issue! (That setting only affects purely PCI Express devices, such as Graphics Cards) It is actually the "AHCI Link Power Management – HIPM/DIPM" Power Options setting which is changed from HIPM (Balanced) to Active (High Performance). This setting, by default, is HIDDEN inside of the advanced power settings menu. In order to expose it (as well as transition time setting from "Partial" hard disk state to "Slumber" hard disk state; "AHCI Link Power Management – Adaptive"), you must go inside the registry to both:

  1. HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlPowerPowerSettings012ee47-9041-4b5d-9b77-535fba8b1442b2d69d7-a2a1-449c-9680-f91c70521c60 and change the "Attributes" key value from 1 (default; hidden) to 2 (exposed). [This will expose "AHCI Link Power Management – HIPM/DIPM" under Hard Disk power settings]
  2. HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlPowerPowerSettings012ee47-9041-4b5d-9b77-535fba8b1442dab60367-5
# 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)