Skip to content

Instantly share code, notes, and snippets.

View sjmach's full-sized avatar
💭
I may be slow to respond.

Sundeep Joseph Machado sjmach

💭
I may be slow to respond.
View GitHub Profile
@sjmach
sjmach / sysctl.conf
Last active November 26, 2020 13:49
Ejabber Server Sysctl Connections
* Sysctl configuration,
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
@sjmach
sjmach / gist:95273479f7c757eae90c
Created November 16, 2015 14:14
Google Contributor Badge
<script src="https://www.gstatic.com/xads/publisher_badge/contributor_badge.js" data-width="88" data-height="31" data-theme="light" data-pub-name="Your Site Name" data-pub-id="ca-pub-00000000000"></script>
@sjmach
sjmach / gist:f0afb61449d18359f3cc
Created November 16, 2015 14:09
Google Contributor Code
<a href="https://www.google.com/contributor/welcome/?utm_source=publisher&utm_medium=banner&utm_campaign=pub-8834582001396641"><img src="https://storage.googleapis.com/houseads/Contributor_Ad_A1_300x250.png"></a>
@sjmach
sjmach / WhatsApp.java
Created March 29, 2015 10:02
Sample fiile to test whatsapp installation on android device via Appium
package com.sundeepmachado;
import java.io.File;
import java.net.URL;
import junit.framework.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
@sjmach
sjmach / managing-jenkins
Created December 15, 2014 10:40
Starting and stopping Jenkins service
# To stop Jenkins service
sudo service jenkins stop
# To start Jenkins service
sudo service jenkins start
# To restart jenkins service
@sjmach
sjmach / install-jenkins
Created December 15, 2014 10:34
Installing Jenkins on Ubuntu machine
wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
@sjmach
sjmach / Oracle-queries
Created April 14, 2014 09:06
Some useful SQL queries for Oracle database
-- SQL Query to find employees with top three salaries
select * from (
select * from employees order by salary desc)
wHERE rownum <= 3
--SQL query for top three distinct salaries
select * from (
select distinct(salary) from employees order by salary desc)
@sjmach
sjmach / offline-notifier.js
Last active December 20, 2015 12:49
How to display a dialog to a user when the internet is switched off in Phonegap.
// Wait for Cordova to load
document.addEventListener("deviceready", onDeviceReady, false);
// Cordova is ready
function onDeviceReady() {
document.addEventListener("offline", whenOffline, false);
return false;
}
@sjmach
sjmach / gist:5734965
Last active December 18, 2015 05:48
Automating Google Search - Selenium + TestNG
package com.machadosundeep;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.AfterMethod;
@sjmach
sjmach / Close Application Dialog box
Last active December 11, 2015 07:09
This code is to show the user a close Dialog box in Phonegap or Apache Cordova for android devices in Android. If the user clocks Yes then the application exits
function showConfirm() {
navigator.notification.confirm(
'Do you really want to exit?', // message
exitFromApp, // callback to invoke with index of button pressed
'Exit', // title
'Cancel,OK' // buttonLabels
);
}