Skip to content

Instantly share code, notes, and snippets.

View MrityunjaiKumar's full-sized avatar
🎯
Focusing

Mrityunjai Kumar MrityunjaiKumar

🎯
Focusing
View GitHub Profile
@MrityunjaiKumar
MrityunjaiKumar / Software UART and String exchange (using statistical mode)
Last active March 7, 2017 00:47
Software UART and String exchange (using statistical mode)
############################## Master side (ESP)################################################
#define v_2 13 //GPIO13 // MOSI
#define v_3 12 //GPIO12 // MISO
#define v_4 14 //GPIO14 //SCK
#define v_5 16 //GPIO16
#define v_6 adc //ADC
#define v_7 reset //RESET
#define g_2 15 //GPIO15 //SS
#define g_3 2 //GPIO29 //TX1
apt-get remove virtualbox -y &&
apt-get autoremove -y &&
apt-get update -y; apt-get upgrade -y; apt-get dist-upgrade -y
mkdir virtualBox
cd virtualBox
#wget http://http.us.debian.org/debian/pool/main/libp/libpng/libpng12-0_1.2.50-2+deb8u3_amd64.deb &&
#wget http://http.us.debian.org/debian/pool/main/libv/libvpx/libvpx1_1.3.0-3_amd64.deb
apt-get install libssl1.1 libvpx4 libsdl-ttf2* libpng16* -y
#wget http://download.virtualbox.org/virtualbox/5.1.14/Oracle_VM_VirtualBox_Extension_Pack-5.1.14-112924.vbox-extpack
#wget http://download.virtualbox.org/virtualbox/5.1.4/VBoxGuestAdditions_5.1.4.iso
@MrityunjaiKumar
MrityunjaiKumar / opencv_bbb.sh
Created February 23, 2017 19:57
BeagleBone
echo "Installing OpenCV"
echo "Removing any pre-installed ffmpeg and x264"
sudo apt-get -qq remove ffmpeg x264 libx264-dev
echo "Installing Dependenices"
sudo apt-get install -y libopencv-dev pkg-config yasm libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils qt5-default libfaac-dev libjack-jackd2-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libva-dev libvdpau-dev libvorbis-dev libx11-dev libxfixes-dev libxvidcore-dev texi2html yasm zlib1g-dev libsdl1.2-dev libvpx-dev libgstreamer0.10-0 gstreamer0.10-tools gstreamer0.10-plugins-base libgstreamer-plugins-base0.10-dev gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad libgtk2.0-0 libgtk
Install avahi with the following commands on the Raspberry Pi:
sudo apt-get install avahi-daemon
Update boot startup for avahi-daemon
sudo insserv avahi-daemon
Apply the new configuration with:
sudo /etc/init.d/avahi-daemon restart
@MrityunjaiKumar
MrityunjaiKumar / ssl_apache.sh
Created December 17, 2016 18:04
ssl_apache.sh
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R,L]
</IfModule>
define('FORCE_SSL_ADMIN', true);
cd /var/log/apache2
tail access.log
grep -o 191.96.249.80 acceess.log | wc -l
cd /etc/apache2/sites-available/
sudo nano 000-default.conf #whatever the working config is for that website #by default its 000-default if not added/changed.
<Files xmlrpc.php>
order allow,deny
deny from 191.96.249.80
1) XML Tools #=> use the shortcut Ctrl+Alt+Shift+B (or menu -> Plugins -> XML Tools -> Pretty Print)
ssh -i file.pem ubuntu@elastic-ip
sudo apt-get update -y && sudo apt-get upgrade -y;
##installing LAMP
sudo apt-get install -y apache2 mysql-server php5-mysql php5 libapache2-mod-php5 php5-mcrypt phpmyadmin
#Test LAMP
echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
<?php phpinfo(); ?>
sudo apt-get install cups
sudo usermod -a -G lpadmin pi
http://www.openprinting.org/printer/samsung/samsung-ML-4500
http://www.openprinting.org/ppd-o-matic.php?driver=gdi&printer=samsung-ML-4500&show=0
< Location / >
# Restrict access to the server...
Order allow,deny
*Allow @local
sudo apt-get install libpng-dev libfreetype6-dev
pip install matplotlib