Skip to content

Instantly share code, notes, and snippets.

karan singh ksingh7

Block or report user

Report or block ksingh7

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pyspark-test.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ksingh7
ksingh7 / Commands.sh
Created Mar 8, 2019 — forked from nrollr/Commands.sh
Install PHP and NGINX on Amazon Linux AMI
View Commands.sh
## 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
View clitext.md
  • 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 Feb 5, 2019
Glances Monitoring Setup
View glances.md
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 Oct 17, 2019
Minimalistic Screenrc File
View .screenrc
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 Jan 20, 2018
Conky Rpi3 configuration
View conky_rpi3
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 Jan 20, 2018
Raspberry System Display Manger Conky
View conky_setup
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 Dec 27, 2016
QCT Lab RGW configuration 27 December
View ceph.conf
# 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
View gist:1919f65687c68c88af1fa9a7923e6ba9
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 Apr 16, 2016
enable root login from cloud-init
View enable-root-login-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
You can’t perform that action at this time.