Skip to main content

Posts

Adding HTTPS for free with letsencrypt - Domain & Subdomain

Well why not httpsforfree? Well frankly the fact that they have access to my private keys freaks me out and letsencypt can have you up and running in seconds. Here are the steps 1. SSH into your VPS 2. Add the repo(if its not added already) add-apt-repository ppa:certbot/certbot 3. Install certbot $ apt-get update $ apt-get install python-certbot-nginx   4. Obtain certificate     $ sudo certbot --nginx -d example.com -d www.example.com     Follow the prompts and make sure you put your proper email!   (Optional) Setup a cron job to auto renew. I find the nano option easier and below I will show you my config.   $ crontab -e   Then 0 12 * * * /usr/bin/certbot renew --quiet     For subdomain i use   $ sudo certbot --nginx -d example.com -d  subdomain.example.com  

Artificial Neural Networks - Intro for beginners

The perceptron Single node perceptron Perceptrons form the basis for ANNs. Perceptron takes input and produces output as below: Input ➡️ Activation Function ➡️ Output Input If the weight is 0- input remains unaltered coming into the perceptron. Below is what happens to the input ∑ w i z i  ≽ t then y = 1. Else y = 0.  i t is the threshold which is set by the outgoing part. So the key to output is based on the weighted sum and the threshold. Activation function This is the processing part of the neuron and this determines output. So most commonly the ones used are the Sigmoid function and the hyperbolic tangent. QUESTION: Which activation function should I use? I am going to talk of three key activation functions a) Sigmoid The Sigmoid returns 0 or 1 and in code can be written as return 1.0/(1.0+Math.exp(-x) A Sigmoid is a mathematical curve having the characteristic S shape. DISADVANTAGE: Descending Gradient b) Tanh DISAD...

BAYESIAN NETWORKS in Machine Learning

So basically this topic is a mix of three theories namely: Graph Theory Probability Theory Bayes Theory 1. Graph Theory  Graph theory is a mathematical field for the study of Graphs. Graph = Nodes (or vertices) + Arcs (or lines, or edges!) So a node can be anything that you want, a company, profits or a band. The thing is- you can have many nodes- but they have to have some form of relation between them. Graphs can be directed and undirected as shown below. 2. Probability Theory Probability is a measure of the likelihood of something happening. And is always a value between 0 and 1. The more likely, the closer the value is to 1 and vs-versa. Probability = (Particular Event)➗(All Possible Events) An example is coin flip. The probability of getting heads is 0.50 - and this brings us to our next idea, conditional probability . Instead of one event at a time, what is the the probability of getting a heads twice? Which then becomes P(Heads|Heads) The ' | ' sim...

ANDROID: support libraries must use the exact same version specification

Here's a way you can tackle this annoying issue. Click on the Gradle side pane, select Tasks->android->androidDependencies. Running it will generate a list of the dependencies and the versions and a quick scroll should help you! Pic below should help

PRG, PRF, PRP in Cryptography - What are they?

So I have been reading up on my cryptography and I figured I should give out a brief lesson on these three amazing concepts What are they ? a) PRG (Pseudo Random Generator) You probably know the difference between stream and block cipher. One of the main differences between them is key size. Stream ciphers require the key to be of equal length of greater than the plaintext ,   whereas Block Ciphers take a key smaller than the PT and is then expanded. This is the PRG The PRG expands the seed Considerations: Stream Ciphers base on Perfect Secrecy whereas Block Ciphers base on Semantic Security b) PRF (Pseudo Random Function) Lets share a secret- imagine something- you want to authenticate yourself with me by proving that you know a secret that we both share. Here's a possible option i) Possible Option 1:  PRNGs We both seed a PRNG with the shared secret, I pick and then send you some random number i.  You   then have to prove that you know the s...

SQL Service Refusing to start? Here are a few things to try

1. Try put startup type to delayed and restart the machine 2. If error code is 2146893007 this means that SSL3.0 and/or TLS1.0 are currently disabled. They will need to be enabled via registry. They need to be set to 1. If you regedit you will see them in these paths HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL3.0\Server\Enabled HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL3.0\Server\Enabled 3. Go on Log Tab of the service and select log on as local account 4. Check the master files  First we need to find out the current location of the files. Once files are identified, either put them into the location where SQL wants or you will have to ALTER the database to point to the correct location and that will give you less headaches. If the issue lies with models or tempdb database you will need to start SQL Server using trace flag 3608 as explained ...

My Arduino journey

So I was starting off the Arduino and I did not know a thing about it! All I knew is that you could be Iron Man from this tiny thing. My skill was coding and none of the hardware stuff so I knew I had to learn. This post serves to document my journey into this Arduino world. What I know so far... Arduino is open source, the hardware AND software(Cool huh?) Arduino needs an IDE  You can connect it to your pi STEP ONE: Download the IDE from  this link. Depending on the OS. I'm on Ubuntu 16.04. I downloaded- did the ./install.sh and voila! done. What the challenge now was to navigate the board properly but after a bit of reading I learnt that pin 13 has an inbuilt resistor  and putting in the LED was now easy as cathode gets into the GND and  our friendly pin 13 has our back! Now my challenge became the permission error then I realised how to set permissions with this Linux code sudo chmod a+rw /dev/ttyACM0 And you ready to go! Seconds later- I h...