Create Backup & Write Image of SDCard

Create Backup
sudo dd if=/dev/sdXX of=~/sdcard.img
https://askubuntu.com/a/299090
 

Write Image to SDCard
sudo dd if=sdcard.img of=/dev/sdXX
https://askubuntu.com/a/119228

 

Advertisements

Belajar Selenium Python-Java Eclipse di Ubuntu

Selenium itu bisa untuk AutoFill Form Web

Caranya:

1. Copy dan rename: selenium.sh

#!/bin/bash# Following the guide found at this page # http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html

echo "\r\nUpdating system ...\r\n" 
sudo apt-get update

# Create folder to place selenium in 
# echo "\r\nCreating folder to place selenium in ...\r\n" 
sudo mkdir ~/selenium cd ~/selenium

# Get Selenium and install headless Java runtime # 
echo "\r\nInstalling Selenium and headless Java runtime ...\r\n" 
sudo wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar 
sudo apt-get install openjdk-7-jre-headless -y 

# Install Firefox # 
echo "\r\nInstalling Firefox ...\r\n" sudo apt-get install firefox -y 

# Install headless GUI for firefox. 'Xvfb is a display server that performs graphical operations in memory' # 
echo "\r\nInstalling XVFB (headless GUI for Firefox) ...\r\n" 
sudo apt-get install xvfb -y 

# Finally, starting up Selenium server #
echo "\r\nStarting up Selenium server ...\r\n"DISPLAY=:1 xvfb-run java -jar ~/selenium/selenium-server-standalone-2.53.1.jar

source: https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c

2. di terminal ketikkan:

chmod +x selenium.sh

./selenium.sh

3. lihat prosessnya sampai keluar Selenium server running

4. untuk start stop server selenium

java -jar ~/selenium/selenium-server-standalone-3.0.1.jar
http://localhost:4444/selenium-server/driver?cmd=getLogMessages
http://localhost:4444/wd/hub/status
http://localhost:4444/selenium-server/driver?cmd=shutDownSeleniumServer

5. untuk testing di chrome, utk firefox belum tahu caranya

sudo apt-get install chromium-chromedriver

ketik di editor dan beri nama misal python_test.py

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome("/usr/lib/chromium-browser/chromedriver")

#driver = webdriver.Firefox()
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.clear()
elem.send_keys("pycon")
elem.send_keys(Keys.RETURN)
assert "No results found." not in driver.page_source
driver.close()

silahkan tes di terminal

python python_test.py

6. Hasil pengujian:

selenium-server-standalone-2.53.1.jar SUPPORT => downgrade ke mozilla 45.0.2

link download mozilla deb: https://sourceforge.net/projects/ubuntuzilla/files/mozilla/apt/pool/main/f/firefox-mozilla-build/

selenium-server-standalone-3.0.1.jar TIDAK SUPPORT MINT 17

 

source:

http://selenium-python.readthedocs.io
Configure Eclipse with Selenium WebDriver

Autokey – Keyboard Shortcuts

Layout keyboard laptop Anda dirasa kurang nyaman?

Seperti tombol Home-End yg bertumpuk dengan panah kiri/kanan, page up/page down, sehingga harus tekan ‘fn’ tiap kali butuh? Padahal gimana klo butuhnya sering, seperti untuk ngetik / coding dll ?

Solusinya: install Autokey

Lalu setting semisal seperti contoh:

screenshot

Screenshot-1.png

Jika ingin autorun: buka menu Startup Applications, lalu setting semisal :

screenshot-2

Selamat berkreasi.. ^^

 

Sync Google Drive in Linux Mint -AND- Download Gmail Attachments & Emails to Google Drive

Berikut linknya :

Link Grive:
– install grive: https://mintguide.org/tools/11-install-grive-tools-14-in-ubuntu-and-linux-mint.html
– mount drive (brgkali diperlukan): https://community.linuxmint.com/tutorial/view/2051
– video setting grive: https://www.youtube.com/watch?v=HQ_z838UeoU
– How to Save your Gmail to Google Drive Automatically : http://www.labnol.org/internet/send-gmail-to-google-drive/21236/

 

Rotasi Layar di Linux Mint (& Ubuntu)

xrandr -q

Screen 0: minimum 320 x 200, current 1366 x 768, maximum 8192 x 8192
LVDS1 connected 1366×768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
1366×768 60.1*+
1360×768 59.8 60.0
1024×768 60.0
800×600 60.3 56.2
640×480 59.9
VGA2 disconnected (normal left inverted right x axis y axis)
HDMI2 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)

Cari port yang connected (LVDS1 bisa disesuaikan sesuai monitor Anda)

lalu, silahkan ketik di terminal mode yang diinginkan:

xrandr –output LVDS1 –rotate right
xrandr –output LVDS1 –rotate left
xrandr –output LVDS1 –rotate inverted
xrandr –output LVDS1 –rotate normal

Supaya script tsb dieksekusi tiap kali startup (autorun), maka:

Buka menu – preferences – startup applications :

klik new, ketik di kolom command, misal xrandr –output VGA-0 –rotate inverted

Source:

Rotating screen in Ubuntu and Linux Mint