Skip to content

Instantly share code, notes, and snippets.

@misraX
misraX / cpu-frequency-control.sh
Last active August 11, 2017 12:08
Kernel cpu frequency control to lower the power consumtion and fans noise without the need to set up the frequency limits using BIOS settings.
#!/bin/bash
# Created By: misraX
# Github: github.com/misrax
# License: MIT
# CopyWrite: 2017
# A very basic shell script.
# Tested in archlinux
# kernel: 4.11.9-1-ARCH, cpupower: 4.12-1, bash: 4.4.12
# To control the frequency of my Lynnfield Core i5 760 CPU. In a very hot weather :D
replace all home/user --> vim way: home\/user\/
to --> vim way: /
var/www/example.com/public_html --> vim way: var\/ww\/example.com\/public_html\/
all --> vim way: /g
will be:
:%s/home\/user\//var\/www\/example.com\/public_html\//g
@misraX
misraX / pip-freezeWrapper.sh
Last active March 5, 2025 15:46
Bash Script To Install Python Packages and Generate requirements.txt Inside Python Virtualenv.
#!/bin/bash
#
# Created By: misraX
# Github: github.com/misrax
# License: MIT
# CopyWrite: 2017
# Bash script to install and generate pip requirements.txt from inside a virtualenv.
# By using pip freeze to creat a list of all the virtualenviroment pip packeges.
# It's just a simple way of creating the pip requirements.txt for a development use.
# usage pip-install package1 package2 package3 .. package(n)... etc
@misraX
misraX / docker-install-debian.sh
Last active August 11, 2017 12:06
Installing docker in Debian amd64 using the official method
#!/bin/bash
# installing dependencies
apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
# Adding docker keys to apt-keys
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
# Verifying the docker figerprint
apt-key fingerprint 0EBFCD88
@misraX
misraX / channels.conf
Last active July 31, 2017 22:27
VDR channels.conf for Hotbird 13E0 July-2017
I24 News English;RRsat:10815:hC56M2O0S0:S13E:27500:2001=27:3001=eng@4:0:0:17301:318:11500:0
I24 News Arabic;RRsat:10815:hC56M2O0S0:S13E:27500:2002=27:3002=ara@4:0:0:17302:318:11500:0
NetViet;MX1:10815:hC56M2O0S0:S13E:27500:2006=2:3006=und@4:0:0:17306:318:11500:0
Vozrojdenie.tv;RRsat:10815:hC56M2O0S0:S13E:27500:2008=2:3008@4:0:0:17308:318:11500:0
Ukraine 24;RRsat:10815:hC56M2O0S0:S13E:27500:2009=2:3009@4:0:0:17309:318:11500:0
BVN;RRsat:10815:hC56M2O0S0:S13E:27500:2011=2:3011=dut@4:0:0:17311:318:11500:0
CNL;RRsat:10815:hC56M2O0S0:S13E:27500:2012=2:3012@4:0:0:17312:318:11500:0
Fashion;RRsat:10815:hC56M2O0S0:S13E:27500:2015=2:3015@4:0:0:17315:318:11500:0
Music Box Russia;RRsat:10815:hC56M2O0S0:S13E:27500:2016=2:3016@4:0:0:17316:318:11500:0
TBN Russia;RR Media:10815:hC56M2O0S0:S13E:27500:2017=2:3017@4:0:0:17317:318:11500:0
#/bin/bash
# Created By: misraX
# Github: github.com/misrax
# License: MIT
# For the purpose of testing and individual usage
# The purpose of using it is to solve the dependancies problem and the manual installion of every needed package.
# The script consider that you are already in the desired build directory just feed the array with the desired package or packages
# And let it automat the automat :D,
# NOTICE: Some packages may fail if it depends on another package.
@misraX
misraX / backuptonts.sh
Last active September 26, 2017 17:06
Backing up && syncing files from Linux Filesystem ex.(ext4) to Windows Filesystem (ntfs)
#!/bin/bash
username=name
PATH_TO_EXCLUDED_FILE=/home/$username/exlude.txt
BACKUP_PATH=/mnt/VOLUME/FOLDER
pacman -Qqe > $HOME/pkglist.txt
rsync -rltDvu --modify-window=1 --progress --delete --delete-excluded --exclude-from=$PATH_TO_EXCLUDED_FILE /home /$BACKUP_PATH
# Restoring pacman
@misraX
misraX / macOS Installing Vim From Source.md
Last active April 2, 2020 01:19
macOS Installing Vim From Source With Python3, Python2 and Ruby Support.

README file guides to install latest vim with python2, python3 and ruby using official source installers:

These methods have been tested in macOS sierra 10.12.6 and will likely not fail in most macOS new releases.

Tested with:

  • xcode-select version 2347.
  • Python 3.6.2.
  • Python 2.7.14.
  • VIM - Vi IMproved 8.0.
@misraX
misraX / pg_change_db_owner.sh
Created January 24, 2018 19:35 — forked from jirutka/pg_change_db_owner.sh
Some convenient scripts to manage ownerships and privileges in PostgreSQL.
#!/bin/sh
#
# The MIT License
#
# Copyright 2014-2017 Jakub Jirutka <[email protected]>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// setting.json
{
"window.zoomLevel": 1,
"workbench.colorTheme": "quietLight-plus-theme",
"workbench.iconTheme": "material-icon-theme",
"emmet.syntaxProfiles": {
"javascript": "jsx",
"xml": {
"attr_quotes": "single"
}