Change GH-pages URL without sub directories for Portfolio - url

Hey currently my Portfolio is being hosted at https://etiotan.github.io/portfolio/app/ through githubpages
I would instead like it to be hosted from this URL
https://etiotan.github.io
I know there is a way to do but I just cant figure it out!

You need to have your repository named after username.github.io so in your case etiotan.github.io. Check this link for more information.
You'll also need either :
to move your app content (html/css/js) to the root of your repo on your gh-pages branch
So your gh-pages will look like :
├── css/
├── js/
├── minjs/
├── pug/
├── sass/
├── favicon.ico
├── index.pug
└── index.html
or create a new index.html at the root of your repo on your gh-pages branch which will redirect to your app/index.html

Related

terraform validate error: The argument "region" is required, but was not set

I wrote a custom RDS module for my development team to consume for deploying RDS instances. I am using BitBucket for source control and I am trying to integrate a BitBucket pipeline to run terraform validate on my .tf files to validate syntax before making it consumable to the devs.terraform init runs fine but when I run terraform validate I get the following error: Error: Missing required argument. The argument "region" is required, but was not set. After looking at the documentation, I am confused why this command would check for a declared provider if it is not actually deploying anything? I am admittedly new to writing modules. Perhaps this isn't the right command for what I want to accomplish?
Terraform version: v0.12.7
AWS Provider version: 2.24
bitbucket-pipelines.yml:
image: hashicorp/terraform:full
pipelines:
branches:
master:
- step:
script:
- terraform version
- terraform init
- terraform validate
Module tree:
├── CHANGELOG.md
├── README.md
├── bitbucket-pipelines.yml
├── main.tf
├── modules
│   ├── db_instance
│   │   ├── README.md
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   └── variables.tf
│   ├── db_option_group
│   │   ├── README.md
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   └── variables.tf
│   ├── db_parameter_group
│   │   ├── README.md
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   └── variables.tf
│   └── db_subnet_group
│   ├── README.md
│   ├── main.tf
│   ├── outputs.tf
│   └── variables.tf
├── outputs.tf
└── variables.tf
The situation you've hit here is the bug described in Terraform issue #21408, where validation is checking that the provider configuration is complete even though you're intending to write a module that will inherit a provider.
There are two main workarounds for this at the time of writing. The easiest one-shot workaround is to set the environment variable AWS_DEFAULT_REGION to any valid AWS region then it should be used as a value for region and allow validation to pass.
To make that reproducible, you can use a test configuration which can serve a test bed for the module when you are developing it alone, outside the context of a particular caller. To do this, make a directory tests/simple (or really anything you like; the name doesn't matter) and put in it a test.tf file containing something like this:
provider "aws" {
region = "us-east-1"
}
module "under_test" {
source = "../.."
# Any arguments the module requires
}
You can then switch into that test directory and use the normal Terraform workflow to validate the whole configuration together:
cd tests/simple
terraform init
terraform validate
A nice benefit of this general idea of test configurations is that you can potentially also use them for end-to-end testing by running terraform plan or terraform apply with a suitable set of environment variables set, and you can have multiple test configurations to test different permutations of options and make sure they all pass validation and, if you do end-to-end testing, that they all work.
Even once that Terraform issue is fixed, test configurations will remain a nice technique for ensuring that your module works as a child module, separately from whether it's valid in isolation.
I have run into the same problem even though I have provided region to my provider configuration.
After some digging I have come across this thread from terraform's discussion board. The problem it seems is that for some undocumented reason, terraform expects AWS_DEFAULT_REGION environment variable to be set to a region value (eg. "us-west-1"). Setting it to a valid region has solved this problem for me.
You can find more information about setting environment variables for Terraform here.
Hope it helps your problem.
One or more of your TF resources has no region configured. To handle this without the AWS_DEFAULT_REGION env variable or if you have multiple regions, you can use provider aliases in your resources to specify your region. For example:
provider "aws" {
region = "us-east-1"
alias = "us"
}
...
resource "aws_cloudwatch_log_metric_filter" "hk_DBrecoverymode-UAT" {
provider = aws.us
...
}

iOS - Header File notation error for Keeping Directory Structure in frameworks

Problem Background :
I have made my own library in C++ with its respective .h and .cc files. They are organized in a small directory structure as shown :
.trillBPP
├── BPSK
│   ├── finddata.cc
│   ├── finddata.h
│   ├── trigger.cc
│   └── trigger.h
├── config.h
├── config_msvc.h
├── miscfunc.cc
├── miscfunc.h
└── vector
├── binary.cpp
├── binary.h
├── mat1.cpp
├── mat1.h
├── misc.cpp
├── misc.h
├── sort.h
├── vec.cpp
└── vec.h
The header files in C++ are included simply with a call like - #include <trillBPP/vector/vec.h> or #include <trillBPP/config.h> depending on the ,file name and directory.
Problem Statement :
I'm porting this C++ code and I'm trying to create a framework in Xcode but as it turns out, Xcode flattens the directory structure and gives an error for the header file calls, the error that it gives says trillBPP/vector/vec.h file not found.
This is how the project looks like :
I've tried adding the files as Folder References instead of groups, but then it won't even recognize the header-files as header files! In Header Search Paths in Build Settings, I've also added -I and /, with no success. I came across the answer Keeping directory structure when creating frameworks in xcode , but that didn't help out because of less details for me since I'm an Xcode newbie.
So, 1. Without changing the header file call how can I tell Xcode to keep the directory structure in the final framework, 2. and also keep the header file calls the same?

Keep uploads directory under public while deploying new revisions using capistrano

I have a Rails app and using Apache2 + Passenger + Capistrano on production server:
.
├── current -> releases/20150527234152
| ├── app
| ├── db
| ├── lib
| ├── ...
| └── public
| ├── assets
| └── uploads
| ├── 01.jpg
| ├── 02.jpg
| ├── 03.jpg
| └── ...
├── releases
| ├── 20150527212555
| ├── 20150527230415
| └── 20150527234152
├── repo
└── shared
I am not tracking the public/uploads directory (Where images are being uploaded by users). So whenever I do cap production deploy, the current links to the new version which won't have the uploads directory anymore. I am using carrierwave gem for image upload.
The only solution I can think of is to have capistrano run a script after deploying that moves the directory from older to latest revision.
Or
Have the uploads directory outside of the app. (If so, what's the best/safest location for it?)
I want to know which solution is better, or if there is a better option.
Cheers
The method you are looking for is called linked_dirs.
It accepts an Array of directories and will create a symlink to the directories specified across each successive deployment works well for directories that should persist even when other code is updated as is your case for uploads.
When you deploy what it does is it runs deploy:check:linked_dirs to confirm that the path exists and/or creates it. Then it runs deploy:symlink:linked_dirs which creates a symlink to this directory.
You can find it in the Official Documentation. The Rake Tasks can be Found Here

Why does `pub install` keep creating `packages` link in all the subdirs of `web`?

I have a web dir, which contains some css and js files:
├── bootstrap-wysiwyg
│   ├── index.html
│   ├── packages -> ../../packages
│   └── republish.sh
├── css
│   ├── bootstrap-combined.no-icons.min.css
│   ├── packages -> ../../packages
│   ├── prettify.css
│   └── screen.css
├── images
│   └── packages -> ../../packages
├── js
│   ├── bootstrap.min.js
│   ├── packages -> ../../packages
│   ├── prettify.js
│   └── prettify.js.1
├── lib
│   ├── font-awesome-3.2.1
│ └── packages -> ../../packages
└── packages -> ../packages
You can see there are one packages link in each subdir of the web dir. I deleted them once, but it will appear when I run pub install.
I can't understand why pub will create them for me, and is there any way to disable it? I don't want them because when I run build command in my IDEA Dart-plugin, it will reports errors since it can't handle them correctly.
When Dart sees an import like:
import 'package:foo/foo.dart';
It translates it to:
import '<url of your entrypoint>/packages/foo/foo.dart';
So, say your app's entrypoint is in:
myapp/web/app/main.dart
If it has a "package:" import, like above, it will remap it to:
import 'myapp/web/app/packages/foo/foo.dart';
That means that for Dart to be able to find foo.dart, there needs to be a packages directory inside app that contains foo/foo.dart. Part of pub's job is to set that up for you.
This is definitely not the nicest part of working with Dart and pub. Spewing symlinks everywhere is gross, but it deals with the limitations that the language places on us. Over time, we're hoping to move away from having to create these symlinks.
More details on this here.

How to generate the ActionScript 3 source code of an OpenLaszlo LZX SWF runtime app

When developing OpenLaszlo applications, it's sometimes useful to generate the ActionScript 3 source code of an application written in lzx, e.g. when you want to compile OpenLaszlo into an Adobe AIR application.
What is the simplest way to generate the ActionScript 3 source code into a predefined folder?
The lzc command line tool which can be found in the $LPS_HOME/WEB-INF/lps/server/bin/ has on option for that:
--lzxonly
for as3 runtime, emit intermediate as files,
but don't call backend as3 compiler
By default the OpenLaszlo compiler will generate the ActionScript 3 code into the system specific Java temp folder, but the $JAVA_OPTS environment variable can be used to change that folder.
Here's an example of how the command can be used in combination with $JAVA_OPTS on Linux:
a) Create a simple LZX file, e.g.
<canvas>
<button text="Hello world" />
</canvas>
and save it as test.lzx.
b) Set the $JAVA_OPTS variable
The following syntax is for Linux or OS X:
export JAVA_OPTS="-Djava.io.tmpdir=./tmp -DXmx1024M"
c) Compile the LZX into ActionScript 3
> lzc --lzxonly test.lzx --runtime=swf10
Compiling: test.lzx to test.swf10.swf
The tmp folder will contain the generated ActionScript 3 files
tmp
├── lzccache
└── lzswf9
└── build
└── test
├── app.swf
├── build.sh
├── LzApplication.as
├── $lzc$class_basebutton.as
├── $lzc$class_basecomponent.as
├── $lzc$class_basefocusview.as
├── $lzc$class_button.as
├── $lzc$class__componentmanager.as
├── $lzc$class_focusoverlay.as
├── $lzc$class__m2u.as
├── $lzc$class__m2v.as
├── $lzc$class__m2w.as
├── $lzc$class__m2x.as
├── $lzc$class__m2y.as
├── $lzc$class__m2z.as
├── $lzc$class__m30.as
├── $lzc$class__m31.as
├── $lzc$class__mm.as
├── $lzc$class__mn.as
├── $lzc$class__mo.as
├── $lzc$class__mp.as
├── $lzc$class_statictext.as
├── $lzc$class_style.as
├── $lzc$class_swatchview.as
├── LZC_COMPILER_OPTIONS
├── LzPreloader.as
└── LzSpriteApplication.as
The folder structure follows the following scheme:
{JAVA_TEMP_FOLDER}/lzswf9/build/{LZX_FILENAME_WITHOUT_ENDING}, therefore in our case
tmp/lzswf9/build/test/
The main applicaton file is LzSpriteApplication.as, and you can look into the build.sh file to get an idea how the Flex SDK's mxmlc command is used to compile the generated source code.

Resources