This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.katkam; | |
import org.springframework.web.bind.annotation.*; | |
import org.springframework.web.servlet.ModelAndView; | |
import org.springframework.stereotype.Controller; | |
// import org.springframework.web.servlet.mvc.AbstractController; | |
// import org.springframework.validation.BindingResult; | |
// import javax.servlet.http.HttpServletRequest; | |
// import javax.servlet.http.HttpServletResponse; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
require 'zlib' | |
require 'yajl' | |
gz = open('http://data.githubarchive.org/2015-01-01-12.json.gz') #Date range 1-12 | |
js = Zlib::GzipReader.new(gz).read | |
Yajl::Parser.parse(js) do |event| | |
print event | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nitin; | |
import java.security.MessageDigest; | |
import org.apache.commons.codec.binary.Base64; | |
public class EamPwHasher { | |
public static String hashedPassword(String aUsername, String aPassword) throws Exception { | |
MessageDigest hasher = MessageDigest.getInstance("SHA-256"); | |
byte[] salt = (aUsername.toUpperCase()+"@#$ABCDEFGHIJKLMNOPQRSTUVWXYZ/(-").substring(0, 32).getBytes("UTF-8"); | |
hasher.update(salt); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run ssh-keygen. This creates the files ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub | |
Copy this file across to the host on which you want to login. | |
Run ssh-copy-id -i <filename> user@hostname | |
The user and hostname are on the destination system - copy this off the bash prompt | |
Putty uses a different format so use PuttyKeygen to load the private key and convert it to ppk format |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First open a terminal and enter sudo apt-get install xrdp. When that is installed enter sudo nano /etc/xrdp/startwm.sh in the terminal. Make sure the last line looks like this: | |
. /etc/X11/Xsession | |
Then go to your home folder, rightclick and select Show hidden. If there is no file named .xsession, create it. If there is a filed named like that, open it and make sure that it looks like this when your done: lxsession -e LXDE -s Lubuntu | |
Now type sudo service xrdp restart in the terminal to restart xrdp. Now it should work :) | |
answered Feb 1 '15 at 9:52 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#I'm Nitin the DevOps guy and these instructions are for whoever chooses to follow... | |
#Some NAS require sec=ntlm or sec=ntlmv2 as an option for it to mount | |
#Get catty with /proc/filesystem to check if cifs has been loaded after first use, them dmesg | tail to look for any other errors | |
#sudo mount -t cifs -o username=Administrator,password=Password123$ //192.168.1.53/e$ /mnt/53e/ | |
#Take a stab at auto-loading with the following in /etc/fstab and mount -a | |
#Add the sec option if needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout privkey -out cert | |
#req -x509 is to generate X509 certificate | |
#nodes is for no passphrase | |
#days is for validity to expiry | |
#newkey is for generating new key instead of using existing key | |
#Enable the SSL mod, enable the default-ssl site, modify the default-ssl.conf to set the SSLCertificateFile and SSLCertificateKeyFile | |
#Apache generates a warning telling us that it's a self-signed certificate; ignore the warning :-P |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http_port 86 accel defaultsite=www.computerworld.com no-vhost | |
cache_peer www.computerworld.com parent 80 0 no-query originserver name=myAccel | |
acl our_sites dstdomain www.computerworld.com | |
http_access allow our_sites | |
cache_peer_access myAccel allow our_sites | |
#cache_peer_access myAccel deny all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"C:\Program Files (x86)\WinSCP\WinSCP.exe" /console /command "open scp://root:[email protected]" "synchronize remote -filemask=>3D D:\Backup /volume1/Backup" exit | |
#Try one of these to accept the remote signature | |
#"C:\Program Files (x86)\WinSCP\WinSCP.exe" scp://root:[email protected] | |
#"C:\Program Files (x86)\WinSCP\WinSCP.exe" /command "open scp://root:[email protected]" |
NewerOlder