Skip to content

Instantly share code, notes, and snippets.

View ksingh7's full-sized avatar

karan singh ksingh7

View GitHub Profile
@ksingh7
ksingh7 / Commands.sh
Created March 8, 2019 00:35 — forked from nrollr/Commands.sh
Install PHP and NGINX on Amazon Linux AMI
## Install NGINX
$ sudo yum install nginx -y
## Install PHP and PHP-FPM
# for PHP version 7.1 use php71 and php71-fpm instead
$ sudo yum install php -y
$ sudo yum install php-fpm -y
## Configure NGINX (see below)
$ sudo nano /etc/nginx/conf.d/default.conf
@ksingh7
ksingh7 / clitext.md
Last active December 11, 2018 22:51
CLITXT :
  • Installation
wget https://clitxt.com/install.sh -O - | sh
echo "alias clitxt='curl -F \"upfile=@-\" https://clitxt.com'" >> ~/.bashrc
  • Logout and login back into the shell

Example :

@ksingh7
ksingh7 / glances.md
Last active February 5, 2019 10:15
Glances Monitoring Setup
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y glances python-bottle

## You can also open port 61208
systemctl stop firewalld ; systemctl disable firewalld
vim /usr/lib/systemd/system/glancesweb.service
@ksingh7
ksingh7 / .screenrc
Last active August 6, 2020 11:37
Minimalistic Screenrc File
startup_message off
vbell off
escape /
defscrollback 5000
# Enable mouse scrolling and scroll bar history scrolling
termcapinfo xterm* ti@:te@
#backtick 1 60 60 $HOME/.screenrc.acpi # .screenrc.acpi contains 1 line: acpi | awk -F ', ' '{print $2}'
@ksingh7
ksingh7 / conky_rpi3
Created January 20, 2018 17:47
Conky Rpi3 configuration
background yes
use_xft yes
xftfont 123:size=8
xftalpha 0.1
update_interval 0.5
total_run_times 0
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
@ksingh7
ksingh7 / conky_setup
Last active January 20, 2018 17:47
Raspberry System Display Manger Conky
sudo apt-get install conky -y
wget -O /home/pi/.conkyrc https://gist.githubusercontent.com/ksingh7/4704b659c6577c39b5141827c8af0d85/raw/67bc18cd587f0f0872256a9d72b99bfde2d49613/conky_rpi3
sudo vim /usr/bin/conky.sh
(ADD)
#!/bin/sh
(sleep 4s && conky) &
exit 0
sudo vim /etc/xdg/autostart/conky.desktop
@ksingh7
ksingh7 / ceph.conf
Created December 27, 2016 11:56
QCT Lab RGW configuration 27 December
# Please do not change this file directly since it is managed by Ansible and will be overwritten
[global]
#cephx cluster require signatures = True
#cephx require signatures = True
#mon clock drift warn backoff = 30
#mon osd min down reporters = 7
#mon osd report timeout = 900
#mon osd down out interval = 600
#mon osd allow primary affinity = True
def get_stats(self):
"""Retrieves stats from ceph mons"""
#ceph_cluster = "%s-%s" % (self.prefix, self.cluster)
ceph_cluster = 'ceph'
data = { ceph_cluster: { 'cluster': { 'slow_rq': 0 } } }
output = None
try:
output = subprocess.check_output('./slow-request.sh', shell=True)
@ksingh7
ksingh7 / enable-root-login-cloud-init
Created April 16, 2016 20:55
enable root login from cloud-init
$ sudo perl -i -pe 's/disable_root: 1/disable_root: 0/' /etc/cloud/cloud.cfg
$ sudo perl -i -pe 's/#PermitRootLogin .*/PermitRootLogin without-password/' /etc/ssh/sshd_config
$ sudo perl -i -pe 's/.*(ssh-rsa .*)/\1/' /root/.ssh/authorized_keys
$ sudo /etc/init.d/sshd reload # optional command
@ksingh7
ksingh7 / ceph_pool_migration.sh
Created March 11, 2016 15:26
Ceph pool migration
#!/bin/bash
src_pool_name=data
dest_pool_name=data_temp
crush_ruleset=1
pg_count=64
touch pool_migration.log
> pool_migration.log