Skip to content

Instantly share code, notes, and snippets.

View saiprasad1996's full-sized avatar

Sai Prasad saiprasad1996

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=720, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Audio recording test</title>
</head>
<body>
import math
fc = 113.8275e3
c2 = 22e-6
fc= 90e3
gea = 60e-6
gcs=9
vout=5
vfb = 0.8
@saiprasad1996
saiprasad1996 / linuxservice.service
Created October 1, 2019 14:29
Linux systemd service template file
[Unit]
Description=Linux Demo service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=centos
ExecStart=/usr/bin/env php /path/to/server.php
@saiprasad1996
saiprasad1996 / sqlpython.py
Created September 28, 2018 12:24
Python connectivity with mysql
import pymysql
import pymysql.cursors
class Login:
def __init__(self,**kwargs):
self.username = kwargs['username']
self.password = kwargs['password']
self.connection = None
class Car:
type=None
fuelcapacity=None
mileage = None
seats = None
fuel = None
ignition = None
def start(self):
if self.fuel>1:
@saiprasad1996
saiprasad1996 / lamppstack.sh
Created November 18, 2017 09:31
Installing lampp stack on ubuntu server along with nodejs and pip
sudo apt-get update
sudo apt-get install apache2
sudo apt-get install mysql-server
sudo apt-get install curl
sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql
echo "Restarting Apache2 server"
sudo service apache2 restart
sudo systemctl status apache2
wget -v https://bootstrap.pypa.io/get-pip.py
sudo python3 get-pip.py
@saiprasad1996
saiprasad1996 / fileupload.php
Created November 12, 2017 18:34
PHP code for uploading file and description and inserting records into database
<?php
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
$text = $_POST["description"];
$uploadOk = 1;
$imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
// Check if image file is a actual image or fake image
if(isset($_POST["submit"])) {
$check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);

Keybase proof

I hereby claim:

  • I am saiprasad1996 on github.
  • I am saiprasad1996 (https://keybase.io/saiprasad1996) on keybase.
  • I have a public key whose fingerprint is 6014 A525 80B8 4F5F 0BC3 B294 478E 7CAE AA8E 6667

To claim this, I am signing this object:

@saiprasad1996
saiprasad1996 / AESCipher.py
Created July 21, 2017 12:49 — forked from mguezuraga/AESCipher.py
Encrypt & Decrypt using PyCrypto AES 256From http://stackoverflow.com/a/12525165/119849
#!/usr/bin/env python
import base64
from Crypto import Random
from Crypto.Cipher import AES
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s : s[0:-s[-1]]