Skip to content

Instantly share code, notes, and snippets.

View nawazm92's full-sized avatar
🎯
Focusing on productivity!

Nawaz nawazm92

🎯
Focusing on productivity!
View GitHub Profile
@nawazm92
nawazm92 / push_apns.php
Created October 10, 2017 06:38 — forked from SiriusDely/push_apns.php
Push Notification PHP Script - Apple iOS, Android C2DM, BlackBerry PPG
<?php
// Put your device token here (without spaces):
$deviceToken = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
// Put your private key's passphrase here:
$passphrase = 'xxxxxxx';
// Put your alert message here:
$message = 'A push notification has been sent!';

Setup LAMP, on AWS EC2 (Ubuntu 18.04)

First step connect to SSH,

ssh -i .pem ubuntu@<PUBLIC-DNS / IP>

Once you're in console you can start by following steps to setup lamp

sudo apt update

sudo apt install -y apache2

n1, n2 = 0, 1
count = 0
while count < 25:
print(n1)
nt = n1 + n2
n1 = n2
n2 = nt
count += 1
@nawazm92
nawazm92 / AWS-EC2-new-user.md
Last active December 18, 2019 12:44
Add new user accounts with SSH access to Amazon EC2 Linux (Ubuntu) instance
  1. Create a key pair for the new user account
  2. Connect with root into SSH
  3. Run following commands
  • $ sudo adduser deployer OR sudo adduser new_user --disabled-password (without password)
  • $ sudo su - new_user
  • $ mkdir .ssh
  • $ chmod 700 .ssh
  • $ touch .ssh/authorized_keys
  • $ chmod 600 .ssh/authorized_keys
#!/bin/bash
# This will remove Apache
sudo service apache2 stop
sudo apt-get purge apache2 apache2-utils apache2.2-bin
sudo apt remove apache2.*
sudo apt-get autoremove
whereis apache2
sudo rm -rf /etc/apache2