Skip to content

Instantly share code, notes, and snippets.

View hitesh83's full-sized avatar

Hitesh hitesh83

  • Pune, India
View GitHub Profile
@hitesh83
hitesh83 / odroid.sh
Created June 12, 2017 11:45
Odroid info
***set time zone
sudo dpkg-reconfigure tzdata
** update software
sudo apt update && sudo apt upgrade -y
sudo apt install linux-image-c2 -y
and change from <Yes> to <No> in the upcoming dialogue:
*** install mail utils
sudo apt-get install mailutils ssmtp -y && sudo apt-get install dnsutils -y && sudo apt-get install libpng12-dev -y && sudo apt-get install mutt
*** config smtp servers
@hitesh83
hitesh83 / rpi_blank_screen.txt
Created June 12, 2017 10:18
How to Disable the Blank Screen on Raspberry Pi (Raspbian)
1 – Disabling the blank screen once
You can disable the blank screen once with the following command line instructions:
$ sudo xset s off
$ sudo xset -dpms
$ sudo xset s noblank
xset s off disable the screen saver, xset -dpms disables the DPMS (Display Power Management Signaling) and xset s noblank tells to X server to not blank the video device.
2 – Disabling the blank screen forever
wget "https://api.dynu.com/nic/update?hostname=example.dynu.com&myip=198.144.117.32&myipv6=2604:4400:a:8a::f4
&username=someusername&password=somepassword"
@hitesh83
hitesh83 / setup instructions
Created June 8, 2017 10:29
PIL windows python
http://pillow.readthedocs.io/en/3.4.x/installation.html
from distutils.core import setup
import py2exe
setup(
options = {'py2exe': {'bundle_files': 1, 'compressed': True}},
windows = [{'script': "winbot2.py"}],
zipfile = None,
)
@hitesh83
hitesh83 / winbot.py
Created June 8, 2017 07:05
windows tele bot
import time
import random
import datetime
from PIL import ImageGrab
import telepot
from telepot.loop import MessageLoop
def handle(msg):
chat_id = msg['chat']['id']
command = msg['text']
@hitesh83
hitesh83 / bash.sh
Created June 5, 2017 10:16
re-spawn script
<script start>
#!/bin/sh
while true;
do
pgrep -f telebot.py || nohup python /home/pi/telebot.py >> telebot.out
done &
<script End>
To convert windows sh file name to unix file name -
@hitesh83
hitesh83 / telebot_full.txt
Last active August 20, 2018 08:28
Installing Telebot on RPi
sudo apt-get install python-pip -y
sudo pip install telepot
git clone https://github.com/AndrewFromMelbourne/raspi2png/
sudo cp -a raspi2png/raspi2png /usr/local/bin
sudo apt-get install imagemagick -y
sudo nano telebot.sh
<python script as below--start>
import time
import random
@hitesh83
hitesh83 / tele.sh
Created June 3, 2017 05:47
Delay stat of Python in sh
#!/bin/bash
/bin/sleep 100 && /usr/bin/python /home/pi/telebot.py
@hitesh83
hitesh83 / rasp2png.txt
Created May 31, 2017 08:39
RPI screen Capture
git clone https://github.com/AndrewFromMelbourne/raspi2png/
sudo cp -a raspi2png/raspi2png /usr/local/bin
raspi2png -p /home/pi/screenshot.png
Usage: raspi2png [-p pngname] [-v] [-w ] [-h ] [-t ] [-d ]
-p - name of png file to create (default is snapshot.png)
-v - verbose
-h - image height (default is screen height)
-w - image width (default is screen width)
-t - type of image captured