Tumgik
amythical · 7 years
Text
Openwrt XML::Parser not found error
apt-get update
Install expat-devel
if apt-get install expat-devel gives an error
search for the right file using apt-cache search expat
apt-get install libexpat-devel1
cpan
install XML::Parser
0 notes
amythical · 7 years
Text
mp4 to mov on mac/linux
ffmpeg -i input_file.mp4 -acodec copy -vcodec copy -f mov output_file.mov
1 note · View note
amythical · 7 years
Text
Configure zohomail (hosted email) for your domain
1.Create Zoho mail account
https://www.zoho.com/mail/
2.HTML verify domain as per instructions (download an html file, put it in specified directory on your site and let Zoho verify it)
3.Add MX record entries in DNS
Remove any other MX record entries
https://www.zoho.com/mail/help/adminconsole/godaddy.html#mx
Verify with https://mxtoolbox.com/
4. Add SPF entries in DNS 
https://www.zoho.com/campaigns/help/setup-spf-dkim.html#GoDaddy
5. Add DKIM entries in DNS
https://www.zoho.com/mail/help/adminconsole/dkim-configuration.html#alink1
Should take 30-60 mins for propagation
0 notes
amythical · 7 years
Text
Flite on raspi - Text to speech
Default Installation
https://learn.adafruit.com/speech-synthesis-on-the-raspberry-pi/speak-easier-flite
Install dependency to remake
sudo apt-get install libasound2-dev
Remake for external sounds
https://raspberrypi.stackexchange.com/questions/10384/speech-processing-on-the-raspberry-pi
0 notes
amythical · 7 years
Text
Accept facebooks lead gen tos
To run facebook lead ads on a facebook page, it asks to accept lean gen tos.
Here is the link to it https://www.facebook.com/ads/leadgen/tos
0 notes
amythical · 7 years
Text
MediatekSDK - Issues & Solutions
1.Error during make about ftp.kernel.org
   Check the file to be downloaded by ftp using make -j1 V=s
   Download that file using wget in the dl folder, example below
   wget http://kernel.org/pub/linux/utils/util-linux/v2.25/util-linux-2.25.2.tar.xz
2.Mosquitto needs libuuid
Install it using scripts/feeds/install libuuid
make again
On the device install libuuid first and then mosquitto
3.For interrupts use libmraa
In the package Makefile, in the define package/ sections add  
 DEPENDS:=+libmraa
In the Makefile for the source add
LDFLAGS=-lmraa
0 notes
amythical · 7 years
Text
Cordova Ionic npm node android - Install & Upgrade
For Mac OS
Uninstall npm
sudo npm uninstall npm -g
rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm* ls -laF /usr/local/{lib/node{,/.npm},bin,share/man} | grep npm
find /usr/local/{lib/node,bin} -exec grep -l npm \{\} \; ;
Install npm
brew update
brew install npm
Install node
brew install node
Install cordova
npm install -g cordova@latest
Install specific ionic version
npm info ionic
npm install -g [email protected]
Update Android SDK
android
No need to download emulator images (System Images)
Update cordova-android
cordova platform ls
cordova platform update android
Cordova version 6.0.0 supports android-24 which is Android version 6.0
0 notes
amythical · 7 years
Text
Error: Please install Android target: "android-23".
ionic build android if it throws up Error: Please install Android target: "android-23".
Fixes -
1.Figure what version of the android Platform you have installed by running ‘android’ provided your PATH and ANDROID_HOME is set.Update to the latest available Platform SDK.
Check if you can see API 23 
If Yes then select it and update.
If No then rm -rf /Users/username/.gradle/
Run android again and you should see the latest versions available to update.
0 notes
amythical · 8 years
Text
Ssh automate with public keys
1.Gen key on local box 
ssh-keygen -t rsa -C "[email protected]"
2.On the server create a user 
adduser newuser
cd ~ mkdir .ssh chmod 700 .ssh touch .ssh/authorized_keys chmod 600 .ssh/authorized_keys vim .ssh/authorized_keys
Add contents of id_rsa.pub in this file and save it
3.Run ssh-agent on local box eval `ssh-agent -s` ssh-add ~/.ssh/id_rsa
4.On localbox execute
ssh user@servername
15 notes · View notes
amythical · 8 years
Text
Unlocking modems
http://www.it-slav.net/blogs/2010/05/02/unlock-huawei-modems/
0 notes
amythical · 8 years
Text
Install Discourse in a subfolder
Assuming discourse is installed and running on port 8080
We will have to make changes to discourse containers/app.yml as per 
http://learndiscourse.org/subfolder-support-with-docker/
in /var/discourse run sudo ./launcher rebuild app 
Make changes in nginx for proxy fwding
vim /etc/nginx/nginx.conf
location /forum/{        rewrite ^/forum(.*) /$1 break;        proxy_pass http://domain:8080;        }
sudo service nginx stop
sudo service nginx start
Access your site at http://domain
Access discourse at http://domain/forum/
0 notes
amythical · 8 years
Text
Discourse, nginx and wordpress on AWS Linux - no docker
2Install discourse from here
https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md
Change port in app.yml to 8080
Open port 8080 in AWS Console
Install nginx,mysql and php from http://codingsteps.com/install-php-fpm-nginx-mysql-on-ec2-with-amazon-linux-ami/
edit /etc/nginx/nginx.conf 
Change servername to your domain
In the server{} block add 
       rewrite ^/forum/(.*)$ http://domain:8080/$1 redirect;
Assumption is the yourdomain/forum will redirect to yourdomain:8080 which has discourse
http://domain should take you to nginx root
Install wordpress from here http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hosting-wordpress.html
0 notes
amythical · 8 years
Text
Docker remove ALL images
docker rmi -f $(docker images -aq)
PS - removes used and unused images - EXTREME MEASURE
0 notes
amythical · 8 years
Text
Clean unused docker volumes
For Docker 1.9 and up there's a native way:
List all orphaned volumes with
$ docker volume ls -qf dangling=true
Eliminate all of them with
$ docker volume rm $(docker volume ls -qf dangling=true)
0 notes
amythical · 8 years
Text
Docker nginx+ wordpress + discourse
Install docker and discourse from here 
https://serversforhackers.com/video/installing-discourse-with-docker
PS - While copying the yml file to the container keep web_only.yml as web.yml
Install nginx + wordpress 
https://github.com/eugeneware/docker-wordpress-nginx
Run the container in interactive mode as we have to do changes to nginx
Change 3000 with any port you wish (I did not have 80 available on external interface so changed it to 3000)
sudo docker run -p 3000:80 --name docker-wordpress-nginx -it -d eugeneware/docker-wordpress-nginx /bin/bash
sudo docker start instance123456
sudo docker attach instance123456
vim /etc/nginx/sites-enabled/default
Change server_name to your domain
Add the following for rewriting all urls starting with /forum/ to discourse running on external port 8080.Add inside server block in /etc/nginx/sites-enabled/default
rewrite ^/forum/(.*)$ http://yourdomain:8080/$1 redirect;
Restart nginx with nginx &
sudo service php5-fpm restart
Try http://yourdomain:3000 you should see wordpress and http://yourdomain:3000/forum/ you should see discourse
To quit docker without shutting down container in interactive mode use use the escape sequence Ctrl-p + Ctrl-q on Mac
0 notes
amythical · 8 years
Text
Apache startup enable disable
sudo update-rc.d apache2 disable sudo update-rc.d apache2 enable
0 notes
amythical · 8 years
Text
Bypass captive portal for Android
So you have created your Access Point on your device.
But when you try and connect to that WIFI on your mobile, you get an ugly popup - asking you if its OK to connect to this WIFI even though there is no internet.
If you are making an app, this throws your smooth app workflow off-track, causes one more confusing step to the customer, needs that you add an FAQ or instruct the customer why this is happening and distracts the consumer from your intended process.
How does this happen?
This is called ‘Captive Portal’.When a WIFI connects, android tries reaching out to connectivitycheck.gstatic.com for Marshmallow and clients3.google.com for Kitkat.
Android then calls a page generate_204 on these domains i.e it makes a call to connectivitycheck.gstatic.com/generate_204  for Marshmallow and clients3.google.com/generate_204 for Kitkat.
It expects a 204 HTTP response code in return instead of the usual 200 HTTP response code.
How I fixed it -
Step 1 - Resolve the domains locally
On my device I was running dnsmasq.Look at addn-hosts in the dnsmasq config file.In this directory pointed to by addn-hosts create a file called custom.
custom (contents below)
192.168.1.1 connectivitycheck.gstatic.com
192.168.1.1 clients3.google.com
restart dnsmasq.
Now connectivitycheck.gstatic.com & clients3.google.com resolve to your device’s webserver when connected by a client connected to your AP.
Step 2 - Server a 204 response
I was using uhttpd so did not have the url_rewrite option.What I managed to do is specified a php page as a 404 redirect in uhttpd conf.
       option error_page /204.php           
In the 404 php script, I returned a 204 header.Dirty hack but it works !!!
<?php
// .... log whatever you need to log, then reply:
header("HTTP/1.0 204 No Content");
?>
Now when connected to my AP, when the android device requests for connectivitycheck.gstatic.com/generate_204 it goes to a 404, which returns a 204 header and android is happy, it thinks its connected to the internet and the Captive Portal goes away automatically.
For Step 2 - if you have apache, do a url rewrite/htaccess mapping and redirect generate_204 to a page returning a 204 HTTP header.
Happy bypassing the Captive Portal for Android.
Bypassing IOS maybe later when I get to it. 
References 
http://android.stackexchange.com/questions/123129/how-does-wifi-in-android-detect-if-the-device-has-to-sign-in-or-not
https://en.wikipedia.org/wiki/Captive_portal
https://foxdogstudios.com/making-phones-believe-the-wifi-has-internet
0 notes