Raspbian Shutdown from web

sudo apt-get update && sudo apt-get install lighttpd php-cgi
sudo lighty-enable-mod fastcgi fastcgi-php
sudo service lighttpd force-reload
sudo visudo
# Add the following line below “pi ALL etc.” and exit the visudo editor:
www-data ALL = NOPASSWD: /sbin/shutdown
sudo nano /var/www/index.html

<html><a href="shutdown.php">Shutdown NOW</a></html>

sudo nano /var/www/shutdown.php

<?php system('sudo /sbin/shutdown -h now'); ?>

Source: https://www.raspberrypi.org/forums/viewtopic.php?t=58802

Toggle Matchbox Keyboard

I added a “launchbar” icon in the taskbar, to act as a toggle switch, so touching the icon started matchbox and touching it again closed matchbox. That seems to be what you’re looking for.

Looking at my notes this is what I did, and it should still work since matchbox-keyboard hasn’t been updated in a long time.

All the keyboard layouts provided in the install are located at /usr/share/matchbox-keyboard. You’ll see a list of .xml files, choose the one closest to what you need, the file names are somewhat descriptive. The .xml file you choose can also be edited to customize the characters, spacing, size, key location, etc. for the keyboard. If you copy that file of choice to your home directory that is the keyboard file it will use, you won’t have to specify a layout when starting matchbox-keyboard, and you can edit that user file and leave the original .xml files unchanged in case you need to back up or start over.

First create a .matchbox directory

mkdir ~/.matchbox

Then copy your .xml file of choice to that directory, in this example I used the US keyboard

cp /usr/share/matchbox-keyboard/keyboard-us.xml ~/.matchbox/keyboard.xml

After that all your .xml keyboard edits will be done in ~/.matchbox/keyboard.xml

nano ~/.matchbox/keyboard.xml

Now that you have a default keyboard file in place to make startup and editing easier you’ll need to create a bash script that will either toggle the keyboard on or off each time the script is run. I use a “scripts” directory to hold all my bash scripts, but you can put it wherever you like.

nano ~/toggle-matchbox.sh

#!/bin/bash
#This script toggles the virtual keyboard on or off
PID=`pidof matchbox-keyboard`
if [ ! -e $PID ]; then
killall matchbox-keyboard
else
matchbox-keyboard &
fi

Don’t forget to make it executable.

Now you’ll need to create a desktop file, this will add it to the menu, and allow you to add it to the launchbar so you can start/stop the keyboard with a single touch of the icon in the taskbar. Edit the path to your “toggle” shell script as needed.

sudo nano /usr/share/raspi-ui-overrides/applications/toggle-matchbox.desktop

[Desktop Entry]
Name=Toggle Matchbox Keyboard
Comment=Toggle Matchbox Keyboard
Exec=/home/pi/toggle-matchbox.sh
Type=Application
Icon=matchbox-keyboard.png
Categories=Panel;Utility;MB
X-MB-INPUT-MECHANSIM=True

Now you need to add it to the “Launchbar” for a one touch start/stop. You can use the Desktop GUI to add a button to the launchbar, but sometimes the Pi doesn’t update the menu in a timely manner after you’ve made changes, and you can’t add it to the launchbar until it shows up in the menu if you’re using the GUI. So I just went ahead and added the “toggle matchbox” button manually.

I did that by adding an entry to the launchbar plugin, so open the lxpanel file for editing

nano ~/.config/lxpanel-pi/LXDE/panels/panel

Scroll down the file till you see the section for the launchbar plugin. You can see I currently have 4 buttons in the launchbar

Plugin {
type=launchbar
Config {
Button {
id=/usr/share/raspi-ui-overrides/applications/pcmanfm.desktop
}
Button {
id=/usr/share/raspi-ui-overrides/applications/lxterminal.desktop
}
Button {
id=/usr/share/applications/iceweasel.desktop
}
Button {
id=/usr/share/raspi-ui-overrides/applications/galculator.desktop
}
}
}

Add the new button entry to the launchbar plugin. I added mine to the top of the “button” list so it would show up next to the “Menu” button. If you want the toggle button to appear to the right add it at the bottom of the list, or even somewhere in the middle of the list.
This is what the file looked like after adding the button.

Plugin {
type=launchbar
Config {
Button {
id=/usr/share/raspi-ui-overrides/applications/toggle-matchbox.desktop
}
Button {
id=/usr/share/raspi-ui-overrides/applications/pcmanfm.desktop
}
Button {
id=/usr/share/raspi-ui-overrides/applications/lxterminal.desktop
}
Button {
id=/usr/share/applications/iceweasel.desktop
}
Button {
id=/usr/share/raspi-ui-overrides/applications/galculator.desktop
}
}
}

Now restart lxpanel and you should see the new “button” in the launchbar. Touch it to open the keyboard, touch it again to close.

lxpanelctl restart

As I said in the beginning I’m using notes and my memory for this since I’m not currently using matchbox-keyboard. But everything appears to be correct, and I usually keep good notes when adding things, so it should work fine. Maybe it will help you out in finding a solution.

Source: https://www.raspberrypi.org/forums/viewtopic.php?t=112515

Calibrate Waveshare 5″ Resistive Touchscreen

# install calibrator and evdev (allows multiple keyboards mice treated as separate device)
sudo apt install xinput-calibrator xserver-xorg-input-evdev

# make evdev higher number than libinput
sudo mv /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf

# list devices
xinput

# view calibration option
xinput --list-props <deviceid>

# calibrate
xinput_calibrator

# copy paste the result like below to /usr/share/X11/xorg.conf.d/99-calibration.conf:
Section "InputClass"
Identifier "calibration"
MatchProduct "BYZHYYZHY By ZH851"
Option "Calibration" "182 3859 277 3944"
Option "SwapAxes" "0"
EndSection

Source: https://www.waveshare.com/wiki/5inch_HDMI_LCD_(B)

Get Associated WiFi Clients OpenWRT

In order to see associated wifi clients, even if they don’t have a DHCP Client or have no ip, you have to ask the AP for associated wifi devices:

# Universal (Tested with OpenWRT 14.07 and 15.05.X)
iwinfo wlan0/wl0/ath0 assoclist

# Proprietary Broadcom (wl)
wl -i wl0 assoclist

# Proprietary Atheros (madwifi)
wlanconfig ath0 list sta

# MAC80211
iw dev wlan0 station dump

This way you will also see the connection speed. For me this is looking like this:

# iwinfo wlan0 assoclist
12:34:56:78:9A:BC -26 dBm / -95 dBm (SNR 69) 1930 ms ago
RX: 24.0 MBit/s, MCS 0, 20MHz 3359 Pkts.
TX: 130.0 MBit/s, MCS 14, 20MHz, short GI 1209 Pkts.

Source:  https://serverfault.com/a/776302

Cara Mengetahui Password Database iPos 4.0

Program ipos menggunakan database postgresql yang dibuka pada port 5444
Database tsb dapat diakses menggunakan username admin dan password yang berbeda-beda untuk setiap instalasi di PC

Untuk mengetahui password database ipos adalah sbb:

1. download process explorer
https://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

2. buka program ipos

3. masuk tab pengaturan

4. klik tombol backup database di toolbar

5. masukan nama file (klik browse), kasih nama apa aja, ga penting

6. buka program process explorer yang sudah di download di no 1

7. cari nama process ipos4.exe

8. atur jendela ipos dan process explorer bersebelahan, sehingga dapat melihat 2 aplikasi sekaligus

9. kembali ke program ipos dan klik proses (proses backup), sambil memperhatikan aplikasi process explorer

10. pada saat tombol proses di aplikasi ipos di klik, akan muncul process bernama pg_dump di aplikasi process explorer dalam waktu yang sangat singkat, kemudian akan hilang kembali, untuk itu anda perlu mendobel klik pada tulisan pg_dump cepat-cepat, jika anda tidak berhasil, bisa mengulangi kembali langkah no 9

11. jika anda berhasil akan muncul window baru dari aplikasi process explorer, pindah tab environment dan password postgresql bisa dilihat di kolom PGPASSWORD

Selamat mencoba!

– Sumber: hasil dari coba-coba

Using Control Script PTZ Zoneminder DCS-5020L

PTZ Controls can be used from within ZoneMinder using the control script linked below. Copy the script contents into a file alongside of the other ZM Control Scripts.
PATH: /usr/share/perl5/ZoneMinder/Control

D-Link DCS-5020L Control Script

PTZ Settings:

Main: Type: Remote, Protocol: DCS5020L, Name: DCS5020L, Can Wake, Can Sleep, Can Reset
Move: Can Move, Can Move Diagonally, Can Move Mapped, Can Move Relative
Pan: Can Pan, Min Pan Step 1, Max Pan Step 30
Tilt: Can Tilt, Min Tilt Step 1, Max Pan Step 30
Presets: Has Presets, Number: 24, Has Home Preset

Note: Wake turns IR on, Sleep turns IR off, Reset turns IR to auto.

Settings for Control Tab:

Controllable, Control Type: DCS5020L, Control address: user:pass@ipaddress

Notes:

  1. For PTZ control, the user/pass combination must be an administrator on the camera. A regular view-only user will not work.
  2. An unknown-quality H.264 stream available at http://user:pass@ip.of.camera/dgh264.raw . Haven’t worked out how to get it working in zoneminder yet.
  3. Audio is available from http://user:pass@ip.of.camera/dgaudio.cgi while the accompanying video is at http://user:pass@ip.of.camera/dgvideo.cgi
  4. The DCS-5020L script was based on the Trendnet TV-IP400W control script, available at http://www.sfpeter.com/2008/07/new-trendnet-tv-ip400w-controller-for-zoneminder-123x/ . “use ZoneMinder::Debug qw(:all);” was replaced with “use ZoneMinder::Logger qw(:all);” for zoneminder 1.25 compatibility.

Source:
– https://wiki.zoneminder.com/D-Link_DCS-5020L_Control_Script

Installing PEAR packages in XAMPP Windows

First open command prompt administrator because the script will try to write c:\windows\pear.ini

Next run this commands in xampp\php folder:
pear config-set doc_dir \xampp\php\docs\PEAR
pear config-set cfg_dir \xampp\php\cfg
pear config-set data_dir \xampp\php\data\PEAR
pear config-set test_dir \xampp\php\tests
pear config-set www_dir \xampp\php\www

Then you can install any packages using this command:
pear install <package-name>

example: pear install mail

Note: if you are using php 7.2, you might get error “PHP Fatal error: Cannot use result of built-in function in write context in \xampp\php\pear\Archive\Tar.php on line xxx”, read this to fix it: https://www.dotkernel.com/php-troubleshooting/fix-installing-pear-packages-with-php-7-2/

Source:
– http://stackoverflow.com/questions/62658/getting-pear-to-work-on-xampp-apache-mysql-stack-on-windows

Access denied to Administrative (Admin) shares in Windows 8, 8.1, 10

3 ways to fix:
1. Map Admin Shares with the built-in administrator account
2. LocalAccountTokenFilterPolicy – UAC remote restrictions

To get rid of the Access Denied message, follow this procedure:

  1. Launch the Registry editor by typing regedit.exe in the Start Screen.
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System.
  3. Create a new entry by right-clicking System and then selecting DWORD (32-bit) Value.
  4. Choose LocalAccountTokenFilterPolicy as name for the new entry.
  5. Set the value of LocalAccountTokenFilterPolicy to 1 by right-clicking the new entry.

3. Disable UAC Admin Approval mode

Note: Disabling UAC Admin Approval mode will also disable the Windows Store app.

  1. Launch Control Panel, type admin… in the search box, and then click Administrative Tools.
  2. Open the Local Security Policy application.
  3. Navigate to Local Policies > Security Options.
  4. Disable the policy User Account Control: Run all administrators in Admin Approval Mode.

source:
– https://4sysops.com/archives/access-denied-to-administrative-admin-shares-in-windows-8/