A menu for the manly man

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMbtjUuceQaJ_JiqGW2aJ7bzET2TPRNs-7O888yvYKFxk8rgzPuhjVvS1eZPFQ7wU55UJIqYmKSoW2iC-CiucemUrlb_T_TTOMLPkEG-fOsKu9tO3hOlHeLWM8xvcFSVIgPSAfQSBchQTrmm6o7MCFkzT-90PlwsI9WVx_xL62ZqR9v5FAjclOFtsO/w400-h254/Elephant%20stew.png

 

Found on Gab (clickit to biggit):

I had to laugh at the instructions.

I’ve been present when an elephant that was destroying crops was shot near an African village.  The villagers swarmed the carcass, armed with machetes, axes and other edged instruments, and proceeded to have a gigantic meat-eating binge that lasted three days.  They dismembered that carcass from inside and out, literally:  some people crawled inside the belly cavity and cut their way out, while others stood on the ribs and cut their way in.  When an errant machete blade from one side or the other cut into someone on the other side of the skin, there were screams of outrage and anger;  but mostly they were too busy eating (yes, even raw meat!) to care.

At the end of three days, all that was left were the remains of the entrails, and the huge bones of the elephant skeleton.  Sixty-odd villagers had eaten until they bulged (literally):  their stomachs were so distended I was surprised they could still move.  Of course, in African heat, with no refrigeration available, the meat had already spoiled by the third day, but they ate and ate and ate so as to waste as little as possible of the precious nutrition deposited on their doorsteps by the Game Department.

Perhaps they should have tried this recipe . . .

Peter

Bayou Renaissance Man

Coiling Molten Steel Rod

https://theawesomer.com/photos/2022/03/molten_steel_coiling_t.jpg

Coiling Molten Steel Rod

Link

Redditor arcedup works in a steel mill and wanted to test out the video capabilities of their phone. While they were at it, they captured this wonderfully satisfying clip of molten hot steel being turned into a coiled rod. Is it wrong that we want to make the world’s largest Slinky with it?

The Awesomer

Argument: It is not an “arm” under the Second Amendment?

B.L.U.F. An analysis/opinion of the State’s attempt to move certain arms out from the protection of the Second Amendment.


This is a long running argument from the anti-gun rights people. The gist is always of the “this modern thing didn’t exist in 1791 so it isn’t covered by the second amendment.” These same people are saying this on phones, computers, The Internet, which the firmly believe are covered under the first Amendment, even though those things would not have been known at the time of the founding.

The question is legitimate, so lets take it to an extreme.

Are Nuclear Weapons Protected Arms Under the Second Amendment?

Hagar reported to me that she often times has discussions with anti-gun people and they will ask something like “Well, do you think people should be able to own nuclear weapons!?!?!?”

She reports that most of them are shocked when she replies in the affirmative “Yes, they should be able to legally own nuclear weapons.” There is more to our discussion, I’ll get to that later.

Before addressing the verbs “keep” and “bear,” we interpret their object: “Arms.” The 18th-century meaning is no different from the meaning today. The 1773 edition of Samuel Johnson’s dictionary defined “arms” as “[w]eapons of offence, or armour of defence.” 1 Dictionary of the English Language 106 (4th ed.) (reprinted 1978) (hereinafter Johnson). Timothy Cunningham’s important 1771 legal dictionary defined “arms” as “any thing that a man wears for his defence, or takes into his hands, or useth in wrath to cast at or strike another.” 1 A New and Complete Law Dictionary; see also N. Webster, American Dictionary of the English Language (1828) (reprinted 1989) (hereinafter Webster) (similar).

The term was applied, then as now, to weapons that were not specifically designed for military use and were not employed in a military capacity. For instance, Cunningham’s legal dictionary gave as an example of usage: “Servants and labourers shall use bows and arrows on Sundays, & c. and not bear other arms.” See also, e.g., An Act for the trial of Negroes, 1797 Del. Laws ch. XLIII, § 6, in 1 First Laws of the State of Delaware 102, 104 (J. Cushing ed.1981 (pt. 1)); see generally State v. Duke, 42 Tex. 455, 458 (1874) (citing decisions of state courts construing “arms”). Although one founding-era thesaurus limited “arms” (as opposed to “weapons”) to “instruments of offence generally made use of in war,” even that source stated that all firearms constituted “arms.” 1 J. Trusler, The Distinction Between Words Esteemed Synonymous in the English Language 37 (3d ed. 1794) (emphasis added).
District of Columbia v. Heller, 554 US 570 – Supreme Court 2008 P.2791

Here we have the short of it [w]eapons of offence, or armour of defence.Id, citing Samuel Johnson’s dictionary of 1773

Are “nuclear weapons” weapons of offence? Yes, by the clear text of the Second Amendment supported by multiple sources at the time of the ratification of the Bill of Rights.

But nuclear weapons were not in existence at the time of the founding and the Founding Fathers could not have anticipated the horrific destructive power of such weapons. Again, Justice Scalia answers us.

Some have made the argument, bordering on the frivolous, that only those arms in existence in the 18th century are protected by the Second Amendment. We do not interpret constitutional rights that way. Just as the First Amendment protects modern forms of communications, e.g., Reno v. American Civil Liberties Union, 521 U.S. 844, 849, 117 S.Ct. 2329, 138 L.Ed.2d 874 (1997), and the Fourth Amendment applies to modern forms of search, e.g., Kyllo v. United States, 533 U.S. 27, 35-36, 121 S.Ct. 2038, 150 L.Ed.2d 94 (2001), the Second Amendment extends, prima facie, to all instruments that constitute bearable arms, even those that were not in existence at the time of the founding.
Id. At P 2791,2792

Under the instructions given by the Supreme Court in Heller it is clear that nuclear weapons are arms.

But the argument goes on that the arm must be “bearable” to be considered covered under the Second Amendment. We know from historical fact that this was not the understanding at the time of the founding. We know this because many civilians owned cannon and even warships. In fact the US Government was known to issue sanctions to warship owners to have them engage in combat on the high seas with the enemies of the United States.

Justice Scalia addresses this issue. He is addressing the question in Heller in regards to individual right vs. collective right so his analysis is not a direct answer for us.

At the time of the founding, as now, to “bear” meant to “carry.” See Johnson 161; Webster; T. Sheridan, A Complete Dictionary of the English Language (1796); 2 Oxford English Dictionary 20 (2d ed.1989) (hereinafter Oxford). When used with “arms,” however, the term has a meaning that refers to carrying for a particular purpose—confrontation. In Muscarello v. United States, 524 U.S. 125, 118 S.Ct. 1911, 141 L.Ed.2d 111 (1998), in the course of analyzing the meaning of “carries a firearm” in a federal criminal statute, Justice GINSBURG wrote that “[s]urely a most familiar meaning is, as the Constitution’s Second Amendment . . . indicate[s]: `wear, bear, or carry . . . upon the person or in the clothing or in a pocket, for the purpose . . . of being armed and ready for offensive or defensive action in a case of conflict with another person.’” Id., at 143, 118 S.Ct. 1911 (dissenting opinion) (quoting Black’s Law Dictionary 214 (6th ed.1990)). We think that Justice GINSBURG accurately captured the natural meaning of “bear arms.” Although the phrase implies that the carrying of the weapon is for the purpose of “offensive or defensive action,” it in no way connotes participation in a structured military organization.
Id. at P. 2793

This leaves the question slightly open as to the question of size limitations on arms that are protected by the Second Amendment. We know that Heller clearly states that pistols and other handguns are. This has been extended to the sorts of long guns and shotguns that can be shouldered. It has been extended to weapons that are too heavy to shoulder but can be fired by one man from a bipod. I.e. a .50 cal semi-auto or bolt action rifle.

What about crew served weapons? Is a 60mm M224A1 mortar covered? How about the 81mm M252A1? How about the 120mm M120/M121, are they covered?

If those are covered are the M119 105mm Howitzer covered and the M777 155mm Howitzer? Or even the M110 Self-Propelled Howitzer. Those are huge. Are they covered?

The answer to all of that seems to be “yes”. The text of the Second Amendment does extend to “arms” that can not be carried by just one man but must instead have some other way of conveyance. It seems clear that a 16″ 3 Gun turret from a Wisconsin class Battleship would be covered arms.

From this, it seems clear that nuclear weapons are covered under the Second Amendment.

What laws are constitutional in regards to nuclear weapons?

According to the Constitution the answer is shall not be infringed According to the Supreme Court, there are acceptable regulations and limitations on the right to keep and bear arms.

To be clear, analogical reasoning under the Second Amendment is neither a regulatory straightjacket nor a regulatory blank check. On the one hand, courts should not “uphold every modern law that remotely resembles a historical analogue,” because doing so “risk[s] endorsing outliers that our ancestors would never have accepted.” Drummond v. Robinson, 9 F.4th 217, 226 (CA3 2021). On the other hand, analogical reasoning requires only that the government identify a well-established and representative historical analogue, not a historical twin. So even if a modern-day regulation is not a dead ringer for historical precursors, it still may be analogous enough to pass constitutional muster.
New York State Rifle & Pistol Assn, Inc. v. Bruen, 142 S. Ct. 2111 – Supreme Court 2022 P. 2133

…is neither a regulatory straightjacket nor a regulatory blank check… which leads to the question of when it the analogical reasoning within the limits? That is not relevant here.

Under Heller, when the Second Amendment’s plain text covers an individual’s conduct, the Constitution presumptively protects that conduct, and to justify a firearm regulation the government must demonstrate that the regulation is consistent with the Nation’s historical tradition of firearm regulation. Pp. 2125-2134.
Id. at P.2117.

This allows the state to raise the question of what laws are consistent with Nation’s historical tradition of firearm(arms) regulation.

So far the state has not been able to produce any law, in my opinion, from the correct time period that supports the banning of a class of weapon.

What they have been able to do is to find multiple laws regarding fire safety in regards to gunpowder. I submit that since the possibilities of a radiation mishap does exist and that does not infringe on your ability to keep and bear the nuclear weapon, that the state could have storage requirements that are for safety purposes.

Note, when I say “safety purposes” that doesn’t mean stuff like “It must be kept disassembled with its fissionable materials in a different county.” It means things like radiation sensors that are tested and monitored. Containers that are designed to low radiation leakage to a reasonable level and so forth.

In my opinion this type of safety law would fall within the text, history and tradition requirements of both Heller and Bruen.

Currently, the Supreme Court has put another limitation on what arms are covered within the scope of the Second Amendment.

None of the Court’s precedents forecloses the Court’s interpretation. Neither United States v. Cruikshank, 92 U.S. 542, 553, 23 L.Ed. 588, nor Presser v. Illinois, 116 U.S. 252, 264-265, 6 S.Ct. 580, 29 L.Ed. 615, refutes the individual-rights interpretation. United States v. Miller, 307 U.S. 174, 59 S.Ct. 816, 83 L.Ed. 1206, does not limit the right to keep and bear arms to militia purposes, but rather limits the type of weapon to which the right applies to those used by the militia, i.e., those in common use for lawful purposes. Pp. 2812 – 2816.
Heller
The rabbit hole called to me and I went to take a read of United States v. Cruikshank et al. If you think legal geek speak is bad today, it was harder still in 1876. 10 pages into the opinion I’m still not sure what the opinion was nor what the question asked was. It seems that I’ll have to do a deeper read into it at some point.

Chief Justice Waite ruled that neither the First nor Second Amendments limited the powers of the state government or individuals. Wikipedia

The right to keep and bear arms exists separately from the Constitution and is not solely based on the Second Amendment, which exists to prevent Congress from infringing the right.Justia

[T]hose in common use for lawful purposesHeller is the phrase that much of our current litigation is founded on. If an arm is in common use for lawful purposes then that arm is not “Unusual”.

This links back to …finds support in the historical tradition of prohibiting the carrying of dangerous and unusual weapons.Id. at P. 2786 is the other part of this.

What this means is that nuclear weapons fail “in common use for lawful purposes” so they are unusual weapons and they are also “dangerous” which means that laws from the founding that prohibited carrying “dangerous and unusual” weapons can be used to justify carry regulations in regards to nuclear weapons today.


More to come.

Gun Free Zone

The final trailer for ‘The Super Mario Bros. Movie’ looks more like a game than ever

http://img.youtube.com/vi/RjNcTBXTk4I/0.jpg

There was a time when movies based on video games tried to distance themselves from their source material. "This ain’t no game," bragged the poster for the 1993’s live-action Super Mario Bros. film. Times have changed: The final trailer for The Super Mario Bros. Movie by Illumination leans hard into its origins. This is absolutely a game, it says. See? Here’s a scene that looks like New Super Mario Bros. U Deluxe, and another one that looks just like Mario Kart 8 Deluxe.

If you were hoping to hear more of Chris Pratt’s Mario voice, you won’t find much new here — but the final trailer does give viewers a clear look at the tone the movie is going for. We watch Bowser list off an army of familiar video game enemies. We watch Mario and Donkey Kong use power mushrooms and fire flowers as they run through a training course that looks like a traditional Mario level. We see Mario and Peach race through a brightly rendered Rainbow Road. It looks familiar. It looks fun. And it looks like a game, but with better graphics.

That’s no surprise. According to directors Aaron Horvath and Michael Jelenic, Illumination has worked closely with Nintendo to make sure the film feels right. The directors also say that Illumination has improved its lighting and rendering technology to help push Super Mario Bros. Movie to the next level "beyond anything Illumination has ever done."

As for that Mario voice? You’ll finally be able to hear the full performance when the film hits theaters next month. The Super Mario Bros. Moviereleases on April 5, 2023.

This article originally appeared on Engadget at https://www.engadget.com/the-final-trailer-for-the-super-mario-bros-movie-looks-more-like-a-game-than-ever-231926362.html?src=rssEngadget

QR Code Generator in Laravel 10

https://harrk.dev/content/images/2023/03/QR-Code-Generator-in-Laravel-10-Tutorial.webp

In this post, we will look at generating QR codes within your Laravel applications.

First, we will need to require the simple-qrcode package that provides first-party support for Laravel. The package itself wraps the Bacon/BaconQrCode package which itself is a port of the ZXing library but for PHP.

If you wish – you may directly interact with the BaconQrCode package without using simple-qrcode. However, simple-qrcode provides a better developer experience when used with Laravel. Additionally, with out-of-the-box support for overlaying images on QR codes.

With the context blurb out of the way. Let’s dig in!

Step 1: Setting Up

Spin up a new Laravel 10 project (or step over this if you already have a project ready).

$ laravel new qrcodegenerator

Set up your database connection as per your own preference. Then install the simple-qrcode package via Composer.

$ composer require simplesoftwareio/simple-qrcode "~4"

Optional! If you want to create QR codes in .png format. You will need to install the imagick extension. In most cases, all you need to do is install via pecl with pecl install imagick. If that does not work for you, then Google is your friend here as it goes beyond the topic of this article.

Step 2: Creating The Controller

Now we need to wire up a controller and route before we can pull back a QR code in our browser.

Create a new QrCodeController.

$ php artisan make:controller QrCodeController

And then reference the controller in our routes/web.php file.

<?php

use App\Http\Controllers\QrCodeController;
use Illuminate\Support\Facades\Route;

Route::get('/', [QrCodeController::class, 'show']);

Opening up the URL in our browser gives us a blank page at this point. Also as I’m using Valet here, I only need to enter the foldername.test to view the project in my browser. Your setup may be different so you do you, whether that’s php artisan serve or something else.

A very empty page

Step 3: Generating QR Codes

At the very bare minimum, you can call the QrCode facade alongside generate with something to render. And you’ll get a QR code back.

In my QrCodeController I am creating a QR code with all the default settings with the following content “Hello, World!”.

<?php

namespace App\Http\Controllers;

use SimpleSoftwareIO\QrCode\Facades\QrCode;

class QrCodeController extends Controller
{
    public function show()
    {
        return QrCode::generate(
            'Hello, World!',
        );
    }
}

Refresh the page in the browser and…

A rendered QR code
wollah!

Step 4: Customising the Generated QR Code

Alright so how about something a little more interesting? A splash of colour? Let’s use a couple of methods that allow us to change the background colour, foreground colour, and margin.

public function show()
{
    return QrCode::size(200)
        ->backgroundColor(255, 255, 0)
        ->color(0, 0, 255)
        ->margin(1)
        ->generate(
            'Hello, World!',
        );
}

And here’s the result:

QR Code with colour

Let’s try something that makes our QR codes stand out. And I’m not talking about colours anymore.

We can actually modify the style and eye (the three corners) of the QR code. Try this out:

return QrCode::size(200)
        ->style('dot')
        ->eye('circle')
        ->color(0, 0, 255)
        ->margin(1)
        ->generate(
            'Hello, World!',
        );

Result:

QR Code with Style

Before closing this section. One more on colours: gradients.

$from = [255, 0, 0];
$to = [0, 0, 255];

return QrCode::size(200)
    ->style('dot')
    ->eye('circle')
    ->gradient($from[0], $from[1], $from[2], $to[0], $to[1], $to[2], 'diagonal')
    ->margin(1)
    ->generate(
        'Hello, World!',
    );

By specifying a from and to colour, alongside a type of gradient (vertical, horizontal, etc). You can create something really cool!

A QR Code with a gradient

Merging Images

To overlay an image in a QR code – we’ll need to change the way we do a few things.

To prepare for this I have dropped an image (twitter.jpg) in my storage/app folder. Then by calling ->merge($filepath), simple-qrcode will load that image and overlay it onto the QR code.

If you want to pull in the image data yourself, you can replace merge with mergeString. Eg: ->mergeString(Storage::get($path)).

Merging an image is only supported with png QR codes, so we need to specify the format on this, too.

public function show()
    {
        $data = QrCode::size(512)
            ->format('png')
            ->merge('/storage/app/twitter.jpg')
            ->errorCorrection('M')
            ->generate(
                'https://twitter.com/HarryKir',
            );

        return response($data)
            ->header('Content-type', 'image/png');
    }

Then the result of all this:

QR Code with Twitter Logo in Centre

You may have noticed the line in regards to errorCorrection. When we overlay an image, part of the QR code’s data becomes obscured.

By default, the errorCorrection is set to the lowest value (‘L’). If you attempt to scan your QR code like this, it’s likely that the QR code will not scan. To remedy this we adjust the errorCorrection level up a notch until our code is scannable.

The various levels are:

  • L: Low (7% correction)
  • M: Medium (15% correction)
  • Q: Quartile (25% correction)
  • H: High (30% correction)

The higher the correction level, the more “noisy” the QR code becomes. Preferably you want the lowest correction level alongside a scannable QR code for the sake of keeping up appearances.

Downloading Generated QR Codes

To return a download response, you can either store the QR code as a file and return the path with return response()->download($path); or stream the contents of the QR code without using the filesystem.

An example of using streamDownload to do this:

public function download()
{
    return response()->streamDownload(
        function () {
            echo QrCode::size(200)
                ->format('png')
                ->generate('https://harrk.dev');
        },
        'qr-code.png',
        [
            'Content-Type' => 'image/png',
        ]
    );
}

Generating QR Codes in Blade

Since we’ve been using a Facade all along, generating a QR code in Blade is as simple as repeating the above steps. Call the facade, customise as required, and call generate.

{!! QrCode::size(256)->generate('https://google.com') !!}

Or another approach, encode the data within an image tag manually. For example, if you need to change the image type for whatever reason.

<img src="data:image/png;base64, {!! base64_encode(QrCode::format('png')->size(256)->generate('https://google.com')) !!} ">

QR Code Data Types

Alright, so we’ve been using URLs in these examples. Mobile devices are clever enough to figure out how to handle these when scanned, but we can go a step further.

If you want to read the long version of this. Check out the ZXing’s Wiki page.

To summarise: simple-qrcode has a couple of helpers to specify the data the QR code will contain. You can replace the generate method with any of these.

Here are a few examples:

Email

Open a blank email addressed to “hello@example.com”.

QrCode::size(200)->email('hello@example.com');

Open an email with a predefined subject and body.

QrCode::size(200)->email('hello@example.com', 'Hello World', 'This is a test message.');

Phone Number

QrCode::size(200)->phoneNumber('555-555-5555');

SMS Text Message

Send an SMS text message to 555-555-5555 with a prewritten message, “Hi!”.

QrCode::size(200)->SMS('555-555-5555', 'Hi!');

Wi-Fi

Share Wi-Fi credentials for your visitors.

QrCode::size(200)->wiFi([
    'encryption' => 'WPA/WEP',
    'ssid' => 'SSID of the network',
    'password' => 'Password of the network',
    'hidden' => 'Whether the network is a hidden SSID or not.'
]);

Geolocation

Share a location by providing a latitude and longitude.

QrCode::size(200)->geo(51.378638, -0.100897);

Conclusion

To see more advance options for QR code customisation, refer to the documentation for simple-qrcode.

As for some real world examples of this package in action. I use simple-qrcode for generating QR codes for my QR code tracking SaaS.

QRMetric – Your Dynamic QR Code Buddy

Create Dynamic QR Codes that can be modified without requiring you to redistribute a new QR code. Can be changed any time, any place, anywhere.

Otherwise, if generating QR codes with Javascript is your thing. Consider checking out the node-qrcode library. I use this for generating QR codes on a static site, without any server involvement altogether.

Random QR Code Generator

RandomQR is a QR Code Generator for those times when you just need a random QR image and nothing more. Simple, easy, and fast.

Laravel News Links

Terraform your Laravel deployments

https://kbouzidi.com/img/containers/assets/terraform-your-laravel-deployments.jpeg/aede5dcfccc966770807a2c35c7ec2b5.jpeg

In this article we will use terraform to provision a lemp stack for a laravel application with all its configurations (database, php, nginx, firewall, ssl, etc).

PHP Stack Provisioning

Every PHP project you worked on has that phase when you need to deploy it to a desired environment that match the application requirement usually its a LEMP or a LAMP stack.

That may require you to install and configure all these applications on the server every time manually, which can be boring, time consuming and redundant.

Terraform-php-stack

Is a terraform project that i was working on to solve my PHP stack provisioning and configurations.

if you are dealing with that manually this will speed up your applications deployments. It can also help if you are migrating to a new server.

The good part is that you can also test it locally before deciding to run it on a production server.

I tried to make the project as user-friendly as possible, so you don’t need to know Terraform to use it.

However, I will still provide a step-by-step explanation:

  1. Installing Terraform

  2. Setup Target machine

  3. Configure terraform-php-stack

  4. Deployment

  5. Contribution

In fact terraform installation is very simple, i will only cover ubuntu/debian installation for other OS, you can check the official documentation (=>).

wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install terraform

You can use this terraform project against a fresh linux instance (vps) or a local virtual machine which is cool to test stuff before a real deployment.

For local testing i use vagrant & VirtualBox, you can use any other hypervisor.

This is my Vagrantfile :

Vagrant.configure("2") do |config|
 
  config.vm.box = "ubuntu/jammy64"
  config.vm.hostname = "kbouzidi"

  config.vm.provision "shell", inline: <<-SHELL
      apt update &&  hostname -I
     
  SHELL
 
  config.vm.network "private_network", type: "dhcp"

  config.vm.provider "virtualbox" do |vb|
   
  end
   
end

COPY SSH KEY

You need to copy your public ssh key to your target server.

ssh-copy-id user@targetIP

🚨 if you skip this probably you will be lost into a desert 🏜️

Well only if you will use vagrant with its own private key.

In this part, I will walk you through how I used this for a Laravel 10 project, and don’t worry, you don’t need to know Terraform at all.

First, you need to clone the project

git clone git@github.com:Safemood/terraform-php-stack.git

To start, you need to copy the example files to create your own configurations.

cd terraform-php-stack
cp terraform.tfvars.example terraform.tfvars

As you can see, this is the folder structure :

├── main.tf
├── modules
│   ├── install_dependencies
│   │   ├── configure.sh
│   │   ├── main.tf
│   │   └── variables.tf
│   ├── install_node
│   │   ├── main.tf
│   │   └── variables.tf
│   ├── install_mysql
│   │   ├── create_db.sh
│   │   ├── main.tf
│   │   └── variables.tf
│   ├── install_nginx
│   │   ├── default.tftpl
│   │   ├── main.tf
│   │   └── variables.tf
│   ├── install_php
│   │   ├── main.tf
│   │   ├── php.ini
│   │   ├── setup.sh
│   │   └── variables.tf
│   └── setup_app
│       ├── main.tf
│		├── .env.tftpl
│       └── variables.tf
├── terraform.tfvars.example

What is important in here :

  • main.tf where we can set all the required modules.

  • modules folder where the supported modules exist.

  • terraform.tfvars where we can set our environment variables && configurations.

  • .env.tftpl the template .env file for your php project.

We will configure the whole deployment only from terraform.tfvars

ssh_host            = "target ip"
ssh_user            = "ssh user"
ssh_key             = "private_key path"
php_version         = "8.2"
webmaster_email     = "example@test.com"
mysql_root_password = "crazySecurePassword"
git_repo            = "git@github.com:laravel/laravel"
db_connexion        = "mysql"
db_host             = "localhost"
db_port             = "3306"
db_name             = "kbouzidi"
db_user             = "safemood"
db_password         = "terraform"
domain_name         = "kbouzidi.com"
app_env             = "production"
app_debug           = false
scheme              = "http"  // 'https' will auto assign ssl certificates to your domain
stack_modules       = ["dependencies", "node", "nginx", "php", "app", "mysql"] // dependencies","mysql", "nginx", "php","app" , "node"
system_dependencies = "git tmux vim zip unzip htop fail2ban"
installation_steps = [
  # Set Folder Permissions
  "sudo chgrp -R www-data storage bootstrap/cache",
  "sudo chmod -R ug+rwx storage bootstrap/cache",
  # Installation
  "composer install --optimize-autoloader --no-dev",
  "php artisan key:generate --force",
  "php artisan storage:link --force",
  "php artisan migrate --seed --force",
  "sudo php artisan optimize:clear",
  "npm install && npm run build",
  "php artisan optimize"
]

What you need to know :

stack_modules is an array of the modules that you wanna install :

  • dependencies : to install required system dependencies and make other necessary configurations.

  • php : to install php on the system with the required version “php_version“.

  • node : to install nodejs & npm on the system with the required version “node_version“.

  • nginx : to install nginx and setup an nginx web server.

  • mysql : to install and setup a mysql server and a dadicated database to your project with the required permissions.

  • app : to setup and install our application.

Some other important notes:

  • scheme : https will auto assign ssl certificates to your domain using certbot.

  • git_repo : when its a private repo, you will need to add a deploy key to your project (link).

🚨 for private github repo make sure to use deploy keys so the token has access only to the related project only.

Deployment is the simplest part; just access the ‘terraform-php-stack’ folder and hit :

terraform init // only the first time
terraform apply 
// or if you know what your doing 💥
terraform apply --auto-approve

You can see how the deployment process works in action.

As you have seen, the whole LEMP stack took only 4 minutes!

You can destroy this infrastructure with :

terraform destroy 

I created this with Laravel ❤️ in mind and i really love to expand it to be helpful for all major PHP framework and stacks, so contributions are very welcome 🤗🥰.

Just keep in mind these main points :

  • The ability to use the project without being a terraform expert.

  • Simplify the process of deploying and managing infrastructure for PHP developers using Terraform.

  • Make PHP developers happier 😁.

What i have in mind for this project:

  • Add Symfony support .

  • Add a fully docker version to provision the whole stack with containers.

  • Add support for major cloud providers (aws, google cloud, azure) to make PHP stack provisioning easier on these platforms.

I hope the information I provided was helpful. If you have any questions or need further clarification, don’t hesitate to reach out to me. I’m always open to feedback, so please feel free to share any thoughts or suggestions you may have.

You can find me on LinkedIn || Twitter || Github!

Feel free to drop by and say hello – I’m always up for meeting new people and expanding my network!😊

Laravel News Links

The Creators of Disney’s Kiff Share Their Inspirations for the New Animated Series

https://i.kinja-img.com/gawker-media/image/upload/c_fill,f_auto,fl_progressive,g_center,h_675,pg_1,q_80,w_1200/291569868a92322d62f32999bfb7f4ed.jpg

A new buddy comedy is coming to the Disney Channel and Disney+. Inspired by animated favorites like The Simpsons and DuckTales, Kiff is a new generation’s slice-of-life series in which—surrounded by friends and family in an eccentric community—two friends find adventures just around the corner.

io9 recently sat down with Kiff creators Nic Smal and Lucy Heavens to chat about the show. It centers on a spunky squirrel protagonist and her laid-back bunny bestie Barry, and takes inspiration from the people and places Smal and Heavens encountered when they were growing up.


Best Friends Forever! | Kiff | NEW Series! | Kiff a NEW @disneychannel Cartoon

Sabina Graves, io9: I’m excited to chat with you all about Kiff. I’ve watched a few of the episodes. I think it’s so bonkers and silly. I loved it. Can you tell me a bit about the inspiration for the show, and how you all collaborated on this concept?

Heavens: Thank you! We really just wanted to do a project that we would be filled with joy to make and that we wanted to watch. We had this the sort of kernel of what Kiff was in terms of her character and her personality, and we kind of spun it out from there—we just leaned on all of our favorite people and places, and it’s a very relatable show. And yeah, it was just all things that made us laugh.

Smal: We made it to the studio and we sort of clicked on similar kind of tastes in comedy and we had fun chatting about it. And I drew Kiff, which at the time was just like a big light bulb. And we both sat there and just were like: “heheheheheh.” Just the world started showing itself to us from there. It just all spun out from Kiff.

G/O Media may get a commission

io9: That’s awesome. I love how Kiff has this really big sense of go-getter adventurer attitude, and a lot of times her imagination plays out scenarios and how she thinks it should go. It’s really cool to show audiences that things aren’t always going to go as you imagine them. What was important to you in showing your audience how to navigate life when things don’t go as planned?

Heavens: I think maybe if anything, the show is like “life doesn’t go the way that you think it will.” And it’s a kind of “know thyself” show, where you look at your behavior and what motivated you and you understand yourself a bit better.

Smal: Yeah, and even if things don’t kind of turn out or pan out exactly how you imagined it, whatever kind of twists and turns happen—if you got someone you know by your side that you care for deeply and cares for you and is nonjudgmental, just the pure friendship and support, then anything’s possible. And that’s all that really matters. You know?

io9: For sure. I think anyone could use a Barry [Kiff’s bunny bestie]. I love the the family episode where Kiff gets to be an honorary member of Barry’s family, because there’s always that funny dynamic of how your family acts one way when it’s just family, and then when guests are over, it’s kind of different…

Smal: And that that feeling going over to someone’s house for the first time for a sleepover and feeling a bit like there is a difference. What’s normal to one family might be completely, wildly, not normal to another, but it’s like, “Hey, it’s all good.”

io9: It’s like such a fun dynamic to see Kiff meld into. I also had a really good time with the road trip—it kind of gave me Fury Road, Mad Max vibes. There’s certainly pop culture touchstones that stand out, like the Kill Bill noise.

Heavens: We do love and pay homage to all things popular culture.

io9: What your first fandoms in animation, and how did they inform your career path?

Heavens: It was The Simpsons—ain’t it just the way as a millennial?

Smal: We didn’t know each other at that age, but we both were recording The Simpsons on VHS, creating our own collections.

Heavens: “Do not tape over.”

Smal: Cartoons were just something that I always felt there was a connection there, and always comedy. The afternoons just spent watching back-to-back whatever was coming on. I think animation really comes and finds you. Shows like SpongeBob SquarePants and DuckTales.

Heavens: And Animaniacs.

io9: I mean, yeah.

Heavens: We both just ate it all up. But probably in terms of sensibility, [and] in terms of what informed our sense of humor, it is probably mostly The Simpsons.

io9: The world-building of the different people in Kiff’s life definitely has that [Simpsons] feel, like they each have a sense of their own inner life. When it came to creating that, were the voices for these characters on the page, or did you open it up to some of the voice talent to really make it their own as well?

Heavens: It’s a kind of endless feedback loop, where we started with the voice on the page, and then we were getting it back, and then you write more for that voice, and then there are elements that you really enjoy—and on it goes. That’s been a very happy part of the process.


Kiff premieres Friday, March 10, on the Disney Channel (8:00 p.m. EST/PST), and will drop on on Disney+ streaming right after.


Want more io9 news? Check out when to expect the latest Marvel, Star Wars, and Star Trek releases, what’s next for the DC Universe on film and TV, and everything you need to know about the future of Doctor Who.

Gizmodo