Skip to content

Instantly share code, notes, and snippets.

@vik-y
vik-y / wordpress_bluemix.txt
Created May 22, 2015 06:18
Deploying Wordpress Blog on Bluemix
Go to IBM Bluemix Catalog
Use the Wordpress Boiler plate.
Download the Start code and upload it on Bluemix using cf push <app name>
That's it. Wordpress deployed.
@vik-y
vik-y / phpmyadmin_bluemix.txt
Created May 22, 2015 06:06
Setting up phpmyadmin on bluemix
Step 1:
git clone https://github.com/vik-y/cf-ex-phpmyadmin
Step 2:
Create a Clear DB Service on IBM Bluemix
Step 3:
Create a PHP application on bluemix, we'll upload phpmyadmin code in this application
Step 4:
@vik-y
vik-y / ibm.jsp
Created May 19, 2015 07:23
IBM first assignment JSP
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
@vik-y
vik-y / IBMActivity.java
Created May 18, 2015 10:09
Normal API Call App
package com.example.bobo.sensorapp;
import android.content.Intent;
import android.os.AsyncTask;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@vik-y
vik-y / koding.txt
Created May 15, 2015 21:01
Transfer file using ssh from Koding VM
After you are done configuring SSH:
To log in:
First you have to make sure that your ssh-agent uses your public key. For that run
eval "$(ssh-agent -s)" in the terminal from which you want to SSH
After doing that
To get ssh access:
ssh username@kodingurl
@vik-y
vik-y / shell.py
Last active August 29, 2015 14:21
Run shell command and capture output using python
def run_terminal(command):
p = subprocess.Popen(command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
return out
@vik-y
vik-y / java_endsem.java
Created May 8, 2015 07:16
Java Exam minor things
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Scanner;
import java.io.*;
import javax.naming.ldap.SortControl;
@vik-y
vik-y / images.py
Created April 12, 2015 18:37
Download all images on a webpage
import requests
from BeautifulSoup import BeautifulSoup
r = requests.get('http://<url>')
while r.status_code!=200:
r = requests.get('http://<urL>')
soup = BeautifulSoup(r.text)
@vik-y
vik-y / ping.sh
Last active August 29, 2015 14:18
Shell Script to test internet connection at IIIT-B
#!/bin/bash
echo "" > result.txt
date >> result.txt
echo "Zense"
function test (){
date
echo " "
@vik-y
vik-y / android.java
Last active August 29, 2015 14:18
Android Working Http request Using threads
/*
* App crashes if you don't make a separate thread to send your http requests.
* This example uses a new thread to send http requests and hence won't crash the application.
*/
Random generator = new Random();
int i = generator.nextInt(6) + 1;
List<NameValuePair> pairs = new ArrayList<NameValuePair>();