Skip to content

Instantly share code, notes, and snippets.

View guruputran's full-sized avatar
🎯
Focusing

Raj Kumar Guruputran guruputran

🎯
Focusing
View GitHub Profile
@guruputran
guruputran / Layout.js
Created May 15, 2023 02:43 — forked from ManotLuijiu/Layout.js
In case, you need to hide some component in react.js or next.js
import React from 'react';
import { useRouter } from 'next/router';
import Nav from './Nav';
import Header from './Header';
import Footer from './Footer';
const Layout = ({ children }) => {
const router = useRouter();
@guruputran
guruputran / nginx.conf
Created December 13, 2022 01:38
Nginx configuration to run php on a different port
server {
listen 8585;
server_name 10.47.7.107;
root /var/www/sengines;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ =404;
}
@guruputran
guruputran / python38.txtx
Created December 12, 2022 01:46
how-to-install-python-3-8-on-raspberry-pi-raspbian
https://installvirtual.com/how-to-install-python-3-8-on-raspberry-pi-raspbian/1. Update the Raspbian
Update the Raspbian before installing python.
sudo apt-get update
2. Prerequisites
Before installing Python 3.8 there are some dependencies that we need to install.
Use the following command to install the required dependencies.
sudo apt-get install -y build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev tar wget vim
3. Download Python
@guruputran
guruputran / elk72.sh
Last active October 17, 2022 10:02
ELK with version 7.2.0 (# credits to @kydouglas)
#ONE LINE
#sudo wget -Nnv 'https://gist.githubusercontent.com/kydouglas/1f68d69e856fd6d7dc223f8e1f5ae3b3/raw/f8c3b22b9d9c4 1093150b96c815776956b523d9d/elk.sh' && bash elk.sh && rm -f elk.sh
# credits to @kydouglas kydouglas/elk.sh
# Checking whether user has enough permission to run this script
sudo -n true
if [ $? -ne 0 ]
then
echo "This script requires user to have passwordless sudo access"
exit
fi
@guruputran
guruputran / Calendar.js
Created October 11, 2022 03:08
A date and time picker for ReactJS component
import { useState } from "react";
import ReactDatePicker from "react-datepicker";
import 'react-datepicker/dist/react-datepicker.css';
import {useForm } from 'react-hook-form'
import styles from "./Calendar.module.css";
import TimeRange from "react-time-range";
export default function Calendar() {
const [startDate, setStartDate] = useState(new Date());
const [times, setTimes] = useState({