Friday, September 14, 2018

xw0rks.tk (xw0rks.orgfree.com)

My webpage is evolving for many years. I lost track and forgot when did I really started with it.
It was my test field. Anything new I learned I've implemented in this page, so it might look a bit overpopulated with different effects.

Anyway this is how it looks like at the moment I'm writing this post.


I will just put GoogleDrive links to CSS and JS code that I use for this page. You can use any of it and modify it by your needs. Good luck.

CSS file

MODAL folder contains both CSS and JS files in seperate folders:

modal/css/jquery.fancybox

modal/js/jquery.fancybox.js

modal/js/jquery.fancybox-media.js

modal/js/jquery-1.9.0.min.js

Friday, February 16, 2018

Raspberry Pi - input system command with button

Input button to execute #linux system command on Raspberry Pi
with #python. In this case it's #poweroff or #reboot command to safely turn off or restart your #RPi in case you don't have display and have no time to #ssh. But you can use any system command you want.
Connecting:
Pin 1 (3.3v) > 1 kOhm resistor > Pin 11 (GPIO 17) > Button > Ground
Here is #code, name it as you want with ".py" extension (for example button.py) and later run it with #admin privileges ("sudo python button.py")

import RPi.GPIO as gpioimport os

#set up pin 17 as an input

gpio.setmode(gpio.BCM) 
gpio.setup(17, gpio.IN)

while True:  input_value = gpio.input(17) 
   if input_value == False: 
     os.system("sudo poweroof") #or "sudo reboot" 
  while input_value == False: 
   input_value = gpio.input(17) 
Support me on xw0rks.tk