Skip to content

Instantly share code, notes, and snippets.

@masbog
masbog / install_perl.txt
Created February 21, 2013 05:23
How To install PERL on iOS (Jailbroken device)
pre-require (install on cydia)
1. OpenSSH
2. OpenSSL
3. wget
if pre-require above all installed
1. SSH your device with root user (default root password is alpine)
- ssh root@(your_device_ip)
2. go to /var/root/
- cd /var/root/
ƗƗɑƗƗɑƗƗɑ
(Ơ̴̴̴̴̴̴͡.̮Ơ̴̴͡)
(⌣́_⌣̀)
ƪ(˘⌣˘)┐ ƪ(˘⌣˘)Ʃ ┌(˘⌣˘)Ʃ
<( ‾^‾)--O)'` .̮´)ː̖́
(>_<)○--(^o^)○
(˛•̃•̃)/\(•̃•̃¸)
(˘̩̩̩.˘̩ƪ)
ƪ(♥ε♥)ʃ
(˘⌣˘)ε˘`)
@masbog
masbog / autorreconnect-pptp.sh
Created August 6, 2014 16:45
autoreconnect-pptp
#!/bin/bash
#!/bin/sh
if ping -qnw1 -c1 your_ip_server_from_ppp0 2>&1 >/dev/null
then
echo "Link is up"
else
echo "Link is down, trying to reconnecting..."
pppd call pptp_config_name
fi
@masbog
masbog / ffmpeg_intall.sh
Last active May 30, 2018 00:16
Automation FFmpeg installation script ( https://trac.ffmpeg.org/wiki/CompilationGuide/Centos ) with all plugin and tested in Centos 7
#!/bin/bash
#!/bin/sh
rpm -Uvh http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm &&
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel freetype-devel speex-devel -y &&
mkdir ~/ffmpeg_sources &&
cd ~/ffmpeg_sources &&
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz &&
tar xzvf yasm-1.3.0.tar.gz &&
cd yasm-1.3.0 &&
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" &&
tmpElem_input_words = WebDriverWait(self.driver, 2).until(EC.presence_of_element_located((By.XPATH, '//div[@id="wordsbox"]')))
current_text = WebDriverWait(tmpElem_input_words, 2).until(EC.presence_of_element_located((By.XPATH, '//span[@class="currentword"]')))
inputan = WebDriverWait(self.driver, 5).until(EC.presence_of_element_located((By.XPATH, "//input[@autocomplete='off' and @autocapitalize='none' and @placeholder='type the words here']")))
ActionChains(self.driver).move_to_element(inputan).perform()
spans = tmpElem_input_words.find_elements_by_tag_name("span")
for span in spans:
print(current_text.text)
listresp = list(map(list, current_text.text))
listff =[]
#print (listresp)
@masbog
masbog / pgbackup.sh
Created February 11, 2015 04:05
postgre daily backup to file with shell script and can use in cronjobs
#!/bin/bash
PGHOST="8.0.6.13"
PGUSER="masbog"
PGDB="masdb"
PGVERSION="9.4"
FILENAME="/tmp/dbdump/$(date '+%A-%M-%m-%Y-%T.dump')"
STARTTIME="START AT $(date '+%A-%M-%m-%Y-%T')"
echo "removing old data rm -f /tmp/dbdump/*"
rm -f /tmp/dbdump/*
@masbog
masbog / AES.c
Created March 26, 2017 11:54 — forked from bricef/AES.c
A simple example of using AES encryption in Java and C.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* MCrypt API available online:
* http://linux.die.net/man/3/mcrypt
*/
#include <mcrypt.h>
@masbog
masbog / freebsd11-redmine.md
Last active August 27, 2017 18:33
Step by Step how to install redmine on freebsd11

List command # as root user*

# pkg install apache24 mysql56-server mysql56-client rubygem-passenger curl nano vim wget
# sysrc mysql_enable="YES"
# sysrc apache24_enable="YES
# cd /usr/local/www/
# curl -O http://www.redmine.org/releases/redmine-3.4.2.tar.gz
# tar xvf redmine-3.4.2.tar.gz 
# cd redmine-3.4.2
# service mysql-server onestart
@masbog
masbog / VMware-Player-12.5.2-4638234_Linux-4.9_patch.sh
Created March 10, 2017 07:23
fix too few arguments to function "get_user_pages_remote" on Fedora 25 kernel 4.9.13-200
#!/bin/bash
cp -n /usr/lib/vmware/modules/source/vmmon.tar /usr/lib/vmware/modules/source/vmmon.tar_bak
cp /usr/lib/vmware/modules/source/vmmon.tar .
tar xf vmmon.tar
patch -p0 << "EOF"
--- vmmon-only/linux/hostif.c
+++ vmmon-only/linux/hostif.c
@@ -1162,7 +1162,9 @@
int retval;
@masbog
masbog / supervisord-tomcat-8-wrapper.sh
Created March 28, 2017 03:15
Supervisord Tomcat 8 on Debian (compressed binary extract to /opt/)
#!/bin/bash
function shutdown()
{
date
echo "Shutting down Tomcat"
unset CATALINA_PID # Necessary in some cases
unset JAVA_OPTS # Necessary in some cases
$CATALINA_HOME/bin/catalina.sh stop