<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Waleed Gadelkareem</title><link>https://gadelkareem.com/</link><description>Recent content on Waleed Gadelkareem</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 27 Jul 2020 21:04:36 +0000</lastBuildDate><atom:link href="https://gadelkareem.com/index.xml" rel="self" type="application/rss+xml"/><item><title>Skeleton</title><link>https://gadelkareem.com/posts/skeleton/</link><pubDate>Mon, 27 Jul 2020 20:01:11 +0000</pubDate><guid>https://gadelkareem.com/posts/skeleton/</guid><description>&lt;p&gt;A complete Golang and Nuxt boilerplate for your project with backend API, frontend, tests and CI/CD pipelines.&lt;/p&gt;&#10;&lt;h2 id="features"&gt;Features&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Backend written in &lt;a href="https://golang.org/"&gt;Golang&lt;/a&gt; using &lt;a href="https://beego.me/"&gt;Beego framework&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;Frontend written in &lt;a href="https://nodejs.org/en/"&gt;NodeJS&lt;/a&gt; using &lt;a href="https://nuxtjs.org/"&gt;NUXT&lt;/a&gt; and &lt;a href="https://vuejs.org/"&gt;Vue.js&lt;/a&gt; frameworks.&lt;/li&gt;&#10;&lt;li&gt;Material design using &lt;a href="https://vuetifyjs.com/"&gt;Vuetify&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;JSON REST API based on &lt;a href="https://jsonapi.org/"&gt;jsonapi.org&lt;/a&gt; standard.&lt;/li&gt;&#10;&lt;li&gt;Fully featured user registration, login, password reminder, profile update, 2FA authentication, SMS based mobile confirmation, &amp;hellip; etc.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://jwt.io/"&gt;JSON Web Tokens (JWT)&lt;/a&gt; based authentication.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://gitlab.com/gadelkareem/skeleton/-/blob/master/src/backend/services/SocialAuthService.go"&gt;Social login&lt;/a&gt; using Facebook, LinkedIn, Google, Github.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Search_engine_optimization"&gt;SEO friendly&lt;/a&gt; thanks to &lt;a href="https://nuxtjs.org/guide/#static-generated-pre-rendering"&gt;the NUXT Static Generated (Pre Rendering)&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://gitlab.com/gadelkareem/skeleton/-/tree/master/src/backend/migrations/sql"&gt;SQL migration&lt;/a&gt; using &lt;a href="https://github.com/rubenv/sql-migrate"&gt;sql-migrate&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://gitlab.com/gadelkareem/skeleton/-/tree/master/src/backend/limiter"&gt;Rate limiter&lt;/a&gt; for API routes to easily set a rate limit per IP for one or more routes.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://gitlab.com/gadelkareem/skeleton/-/tree/master/src/backend/rbac"&gt;Role-based access control (RBAC)&lt;/a&gt; for API routes and permissions.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://gitlab.com/gadelkareem/skeleton/-/tree/master/src/backend/utils/paginator"&gt;Pagination&lt;/a&gt; implementation for API and frontend with caching.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://gitlab.com/gadelkareem/skeleton/-/blob/master/src/backend/services/AuthenticatorService.go"&gt;Multi-factor authentication&lt;/a&gt; using &lt;a href="https://github.com/pquerna/otp"&gt;One Time Passwords&lt;/a&gt; and mobile SMS code.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://gitlab.com/gadelkareem/skeleton/-/blob/master/src/backend/services/EmailService.go"&gt;Nice Email templates&lt;/a&gt; using &lt;a href="https://github.com/matcornic/hermes"&gt;Hermes&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://gitlab.com/gadelkareem/skeleton/-/tree/master/src/frontend/src/pages/dashboard"&gt;Fully featured admin dashboard&lt;/a&gt; based on &lt;a href="https://demos.creative-tim.com/vuetify-material-dashboard/?partner=116160&amp;amp;ref=vuetifyjs.com#/"&gt;Vuetify Material Dashboard&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://gitlab.com/gadelkareem/skeleton/-/pipelines"&gt;Complete CI/CD pipelines&lt;/a&gt; including tests using &lt;a href="https://gitlab.com/gadelkareem/skeleton/-/blob/master/.gitlab-ci.yml"&gt;GitLab .gitlab-ci.yml&lt;/a&gt; file.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="#deploy-to-heroku"&gt;Deploy to Heroku&lt;/a&gt; using few easy steps.&lt;/li&gt;&#10;&lt;li&gt;Automated development initialization using &lt;a href="https://gitlab.com/gadelkareem/skeleton/-/blob/master/docker-compose.yml"&gt;Docker compose&lt;/a&gt; and &lt;a href="https://gitlab.com/gadelkareem/skeleton/-/blob/master/init.sh"&gt;init file&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;Application Cache using &lt;a href="https://github.com/gadelkareem/cachita"&gt;Cachita&lt;/a&gt; with support for memory, Redis, database and file cache.&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="https://gitlab.com/gadelkareem/skeleton/-/blob/master/src/backend/di/Container.go"&gt;Dependency injection&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;Backend API integration and unit tests.&lt;/li&gt;&#10;&lt;li&gt;Frontend &lt;a href="https://github.com/facebook/jest"&gt;Jest&lt;/a&gt; tests.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="development"&gt;Development&lt;/h3&gt;&#10;&lt;p&gt;There are 2 methods to run Skeleton locally&lt;/p&gt;</description></item><item><title>Skeleton</title><link>https://gadelkareem.com/projects/skeleton/</link><pubDate>Mon, 27 Jul 2020 00:00:00 +0000</pubDate><guid>https://gadelkareem.com/projects/skeleton/</guid><description>&lt;p&gt;Skeleton is a complete Go and Nuxt boilerplate: backend API, frontend, tests and CI/CD pipelines, ready to start a product from.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Backend:&lt;/strong&gt; Go with the Beego framework, JSON REST API following the jsonapi.org standard, SQL migrations, rate limiting per IP, role-based access control and dependency injection.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Frontend:&lt;/strong&gt; Nuxt and Vue.js with Vuetify, statically generated for search engines, with an admin dashboard.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Accounts:&lt;/strong&gt; registration, login, password reset, JWT authentication, social login, two-factor authentication with one-time passwords and SMS, and subscription management with Stripe.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Delivery:&lt;/strong&gt; integration and unit tests for the API, Jest tests for the frontend, GitLab CI pipelines and a Docker Compose development setup.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Caching:&lt;/strong&gt; uses &lt;a href="https://github.com/gadelkareem/cachita"&gt;Cachita&lt;/a&gt;, my Go cache library for memory, Redis, SQL and file backends.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The project has 100+ stars and 48 forks on GitLab.&lt;/p&gt;</description></item><item><title>Infrastructure as code on Hetzner</title><link>https://gadelkareem.com/posts/infrastructure-as-code-on-hetzner/</link><pubDate>Sun, 27 Oct 2019 16:17:46 +0000</pubDate><guid>https://gadelkareem.com/posts/infrastructure-as-code-on-hetzner/</guid><description>&lt;p&gt;Provisions infrastructure for a Golang application on Hetzner cloud. The code packs a Golang, PostgreSQL, S3(minio) images using packer then launches the infrastructure using Terraform with helpers such as bash, hcloud and supfile. The main reason behind the setup is the make it as cost effective as possible to launch a small to medium project.&lt;/p&gt;&#10;&lt;h2 id="provision-infrastructure"&gt;Provision Infrastructure&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Make sure you have &lt;a href="https://github.com/hetznercloud/cli"&gt;hcloud&lt;/a&gt;, &lt;a href="https://github.com/pressly/sup"&gt;supfile&lt;/a&gt;, &lt;a href="https://www.packer.io/"&gt;packer&lt;/a&gt; and &lt;a href="https://www.terraform.io/"&gt;terraform&lt;/a&gt; installed locally.&lt;/li&gt;&#10;&lt;li&gt;Start a new project on Hetzner and get your API token.&lt;/li&gt;&#10;&lt;li&gt;Rename &lt;code&gt;vars.example.json&lt;/code&gt; to &lt;code&gt;vars.json&lt;/code&gt; and add your config/secrets.&lt;/li&gt;&#10;&lt;li&gt;Replace &lt;code&gt;ssh_authorized_keys&lt;/code&gt; in &lt;code&gt;cloud-init/base.yml&lt;/code&gt; with your public key.&lt;/li&gt;&#10;&lt;li&gt;Run &lt;code&gt;./infra.sh up&lt;/code&gt; to start the provisioning&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="destroy-infrastructure"&gt;Destroy Infrastructure&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Run &lt;code&gt;./infra.sh down&lt;/code&gt; to remove all images, volumes and instances.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="minio-gui"&gt;Minio GUI&lt;/h2&gt;&#10;&lt;p&gt;&lt;code&gt;https://s3-1.example.com/&lt;/code&gt; where example.com is your domain and notice we update Cloudflare DNS automatically while provisioning.&lt;/p&gt;</description></item><item><title>Infrastructure as code on Hetzner</title><link>https://gadelkareem.com/projects/infrastructure-as-code-on-hetzner/</link><pubDate>Sun, 27 Oct 2019 00:00:00 +0000</pubDate><guid>https://gadelkareem.com/projects/infrastructure-as-code-on-hetzner/</guid><description>&lt;p&gt;A repository that provisions the infrastructure for a Go application on Hetzner Cloud from nothing, and removes it again with one command.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;strong&gt;Images:&lt;/strong&gt; Packer builds images for the Go application, PostgreSQL and S3-compatible storage (MinIO).&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;strong&gt;Provisioning:&lt;/strong&gt; Terraform launches the servers, volumes and networking; cloud-init applies the base configuration.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;strong&gt;Glue:&lt;/strong&gt; a single &lt;code&gt;infra.sh&lt;/code&gt; script wraps Packer, Terraform, the &lt;code&gt;hcloud&lt;/code&gt; CLI and &lt;code&gt;sup&lt;/code&gt; for &lt;code&gt;up&lt;/code&gt; and &lt;code&gt;down&lt;/code&gt;.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;strong&gt;DNS:&lt;/strong&gt; Cloudflare records are updated automatically while provisioning.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Source: &lt;a href="https://github.com/gadelkareem/iac_hetzner"&gt;github.com/gadelkareem/iac_hetzner&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;Write-up: &lt;a href="https://gadelkareem.com/posts/infrastructure-as-code-on-hetzner/"&gt;Infrastructure as code on Hetzner&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>Complete Ansible, Vagrant and AWS infrastructure</title><link>https://gadelkareem.com/posts/complete-ansible-vagrant-and-aws-infrastructure/</link><pubDate>Mon, 10 Jun 2019 14:16:13 +0000</pubDate><guid>https://gadelkareem.com/posts/complete-ansible-vagrant-and-aws-infrastructure/</guid><description>&lt;p&gt;&lt;a href="https://github.com/gadelkareem/IaC_example"&gt;IaC example&lt;/a&gt; is a simple example of &lt;a href="https://en.wikipedia.org/wiki/Infrastructure_as_code"&gt;Infrastructure as code (IaC)&lt;/a&gt; to automate a development environment based on &lt;a href="https://www.vagrantup.com/"&gt;Vagrant&lt;/a&gt; and a staging, production environment on &lt;a href="https://aws.amazon.com/"&gt;AWS&lt;/a&gt;. The installation creates a basic &lt;a href="https://symfony.com/"&gt;Symfony&lt;/a&gt; application along with a &lt;a href="https://www.postgresql.org/"&gt;PostgreSQL&lt;/a&gt;, &lt;a href="https://lucene.apache.org/solr/"&gt;Solr&lt;/a&gt; and &lt;a href="https://redis.io/"&gt;Redis&lt;/a&gt; services. &lt;a href="https://www.ansible.com/"&gt;Ansible&lt;/a&gt; helps automate all the infrastructure tasks and the bash scripts act as a wrapper for the Ansible commands.&lt;/p&gt;&#10;&lt;h2 id="vagrant-provisioning"&gt;Vagrant provisioning&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Install Vagrant and clone this repo.&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;vagrant up&lt;/code&gt; to start installation&lt;/li&gt;&#10;&lt;li&gt;The installation will provision 2 boxes &lt;code&gt;myproject&lt;/code&gt; and &lt;code&gt;services&lt;/code&gt;, you can retry provisioning using &lt;code&gt;vagrant provision&lt;/code&gt; if it failed.&lt;/li&gt;&#10;&lt;li&gt;After provisioning the vagrant boxes you should access the symfony project on &lt;code&gt;192.168.33.31&lt;/code&gt; which is a basic symfony example project.&lt;/li&gt;&#10;&lt;li&gt;All &lt;code&gt;redis&lt;/code&gt;, &lt;code&gt;postgreSQL&lt;/code&gt; and &lt;code&gt;solr&lt;/code&gt; services are on the &lt;code&gt;services&lt;/code&gt; box.&lt;/li&gt;&#10;&lt;li&gt;Root is &lt;code&gt;/var/www/application&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;MyProject IP is &lt;code&gt;192.168.33.31&lt;/code&gt;.&lt;/li&gt;&#10;&lt;li&gt;Services IP is &lt;code&gt;192.168.33.32&lt;/code&gt;.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="aws-provisioning-aws-will-charge-you-for-launching-services"&gt;AWS provisioning (AWS will charge you for launching services)&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Login vagrant &lt;code&gt;vagrant ssh myproject&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Change the password and ssh key to yours and remove the prod_files from your repo &lt;code&gt;/var/www/application/prod_files&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Add the production password and ssh keys to vagrant&lt;code&gt;bash /var/www/application/prod_files/add_to_vagrant.sh&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Encrypt your AWS keys as shown on &lt;code&gt;provision/ansible/aws.sh:82&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;Go to &lt;code&gt;/var/www/application/provision/ansible&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;run &lt;code&gt;./aws-infrastructure.sh&lt;/code&gt; to start building the infrastructure on AWS.&lt;/li&gt;&#10;&lt;li&gt;Edit the deploy script &lt;code&gt;roles/deploy-application/files/myproject/deploy.sh&lt;/code&gt; to fit your requirements.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="solr-admin"&gt;Solr Admin&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="http://192.168.33.32:8983/"&gt;http://192.168.33.32:8983&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="pghero"&gt;pghero&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="http://192.168.33.32:3441/"&gt;http://192.168.33.32:3441/&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="mailhog"&gt;&lt;a href="https://github.com/mailhog/MailHog"&gt;MailHog&lt;/a&gt;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;a href="http://192.168.33.31:8025/"&gt;http://192.168.33.31:8025/&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Visit on &lt;a href="https://github.com/gadelkareem/IaC_example"&gt;Github&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Arab Renamer</title><link>https://gadelkareem.com/projects/arab-renamer/</link><pubDate>Fri, 13 Oct 2006 00:00:00 +0000</pubDate><guid>https://gadelkareem.com/projects/arab-renamer/</guid><description>&lt;p&gt;Arab Renamer is a small utility from my early years. It renames files that have Arabic names to the same names in Latin characters, by transliteration and not translation: &amp;lsquo;قرآن&amp;rsquo; becomes &amp;lsquo;Quran&amp;rsquo;. That made the files usable on systems and MP3 players that could not display Arabic at the time.&lt;/p&gt;&#10;&lt;p&gt;&lt;img src="https://gadelkareem.com/images/ar2_screen_shot.jpg" alt="Arab Renamer V2 screenshot"&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Uses the common chat conventions for letters with no Latin equivalent: 3 for ع, 7 for ح and &amp;rsquo; for ء.&lt;/li&gt;&#10;&lt;li&gt;Uses tashkeel (diacritics) when present to improve the conversion.&lt;/li&gt;&#10;&lt;li&gt;Can limit the length of file names while renaming.&lt;/li&gt;&#10;&lt;li&gt;Written in C/C++ with Borland C++: version 1 is a command line tool, version 2 adds a Win32 interface.&lt;/li&gt;&#10;&lt;li&gt;Licence: GNU General Public License (GPL).&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;People still ask whether it&amp;rsquo;s maintained.&lt;/p&gt;</description></item><item><title>About</title><link>https://gadelkareem.com/about/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://gadelkareem.com/about/</guid><description>&lt;p&gt;I am a site reliability and cloud infrastructure engineer based in Malta. I work as an independent contractor on remote engagements.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Experience:&lt;/strong&gt; 20+ years in IT, the last 10+ on production platforms in AWS, Azure and Google Cloud.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Focus:&lt;/strong&gt; infrastructure as code (Terraform, Ansible, Packer), CI/CD and GitOps, Kubernetes, observability, Zero Trust networking and cloud cost optimisation.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Code:&lt;/strong&gt; Go and Python for platform tooling and services; Bash and PowerShell for automation.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Languages:&lt;/strong&gt; Arabic (native) and English (fluent).&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Working model:&lt;/strong&gt; remote contracts, EU based, EU citizen.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Before moving into infrastructure I spent years as a backend developer and architect, which is why I still write and review application code alongside the platform work.&lt;/p&gt;</description></item><item><title>Contact</title><link>https://gadelkareem.com/contact/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://gadelkareem.com/contact/</guid><description>&lt;p&gt;For contract enquiries, email is the fastest route. I send my CV on request.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Email:&lt;/strong&gt; &lt;a class="eml" href="mailto:%61%64%6d%69%6e%40%67%61%64%65%6c%6b%61%72%65%65%6d%2e%63%6f%6d" data-u="admin" data-d="gadelkareem.com" aria-label="Send an email"&gt;&lt;/a&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/gadelkareem"&gt;linkedin.com/in/gadelkareem&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/gadelkareem"&gt;github.com/gadelkareem&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;GitLab:&lt;/strong&gt; &lt;a href="https://gitlab.com/gadelkareem"&gt;gitlab.com/gadelkareem&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;I am based in Malta (Central European Time) and work remotely.&lt;/p&gt;</description></item></channel></rss>