Archive for the Notes Category

2-Stroke Bike Engine Kit

| May 8th, 2018

Installing Your 2-Stroke Bike Engine Kit

Here we’ll instruct you on how to install a two-stroke bicycle engine kit on a bike. Now, before we even start, it’s important to know what you’re getting into and what you need to make sure installation goes as smooth as possible.

First things first- The Bike:

Even though the engine kit is made to be as universal as possible a few key features your bike should have will make installation a lot easier:

  • Your bike needs to be a standard male beach cruiser, road or hardtail mountain bike.
  • The tubes should be 25 to 28mm in diameter with an open “V” style frame
  • The frame should also have 9-11 inch of clearance between the bottom bracket and top bar.
  • These kits will fit most 26”x 1.75” wheel with a standard 12 or 14 gauge 36 count spoke
  • If you’re in these right specifications then you’re good to go!

 

Sprocket and Wheel Clamp Assembly:
install-2Most sprocket clamp assemblies comes with 9 bolts and nuts, two rubber grommets, and a single pair of metal plates (though some engine kits may have two). Most clamp assemblies come with 10mm bolts and studs, so you’ll need a socket wrench to complete this part of the installation.

If you’re using a coaster brake, first start by removing the coaster brake arm
(be careful not to accidentally disassemble the entire axle).

  • Cut a straight line in between two of the holes on one of grommets (not both)
  • Thread the grommet through the wheel around the hub (Note: Make sure the grommet holes are between the spokes, not blocking them)
  • Take the metal plates from your assembly and align them on top of the grommet inside of the wheel, then align the sprocket with the grommets to make sure the spokes and grommet holes are aligned
  • Starting from the inside of the wheel, send each bolt through the grommet and sprocket, and torque them down (Note: It will help to torque them in a star-shaped pattern)

Once you’re done tightening down the sprocket and clamp assembly, put the wheel on the bike and bolt it down with good tension on the bicycle chain.

Note: We highly recommend using caliper or disc brakes even if you have a coaster brake wheel. Because of the speeds you’ll be getting up to, you’ll want to be sure to have additional stopping power than a coaster brake.

Mounting the Engine:

Mounting the engine is actually a pretty easy procedure, but if your frame’s not as described above, there are a few things you’re going to need to install before mount the motor.
If you’re using a universal u-mount and/or vibration motor mounts to compensate for a larger downtube and/or seat tube, you’ll first need to remove the motor mount studs in your engine. Some riders use a stud extractor, but there’s an easy way to get those particular studs out: the two bolt method.

  • Thread a nut on to one of the studs, then thread another nut above the first
  • Tighten the nuts down as tight as possible between the two
  • Torque the bottom nut, and eventually you’ll be able to remove the studs.

To install the u-mount:

  • Remove your front motor mount and motor mount bracket
  • Place the mount plate on to the engine over the empty motor mount stud ports
  • Mount the two standing bolts in to the motor mount stud ports

To install vibration motor mounts:

  • Remove your motor mounts and motor mount brackets
  • Use the studs that came with the new mounts to fill in the motor mount stud ports
  • Slide the original motor mount back on to the studs, then the vibration motor mount on top of that

When those parts are installed, you can install the motor mount stud nuts. Once everything is ready to mount, then mount the engine on to your bike

Installing Your Clutch:

The parts of your clutch (for installation purposes) are your clutch cable, clutch lever, clutch spring, and the heat shield spring.

  • Take your stock handle bar grips off the handle bars, and slip on the clutch lever
  • Install the clutch cable in to the clutch lever (the beaded end should go in to the lever socket- just like installing a brake cable), then tighten it down
  • Slide the heat shield spring over the opposite end of the cable, and slide the wire though the clutch base screw
  • Slide the clutch spring over the wire, then slide the wire through the clutch arm on the engine (Note: loosen the clutch arm screw before sending the wire through the clutch arm)
  • Align the clutch arm so it’s flush with the engine (i.e. it points straight back), tighten the tension of the clutch cable so it stays, then tighten down the clutch arm screw

With your clutch arm pulled in, you can pedal your bike like normal because the engine’s disengaged. Once you release the clutch lever, your engine will engage.

Chain Installation:
For easier installation of the chain, start by removing the clutch case cover (along with the clutch plate) and the drive sprocket case cover. Doing this will help the drive sprocket and clutch spin with ease. Then remove the master link from your chain

  • Measure the chain on the rear and front sprockets, then remove any unnecessary links (you’ll need a motorcycle chain breaker to remove links). Note: you’ll want to leave .5” of slack on the chain so that it doesn’t snap
  • Reinstall the master link
  • Reinstall the case covers and components
  • Install the pulley on your rear fork, and put the bottom portion of the chain on top of the plastic idle wheel
  • Align the chain so that the top and bottom portions of the chain run along a straight path. If the chain is not straight it can slip off the sprockets and damage your spokes (and even you, if you’re not careful)

 

Throttle Installation:
Start by dry fitting the throttle handle and kill switch on your handle bars, then mark where you’ll need to drill a ¼” hole in to the handle bar.

  • Thread the “L” bracket end of the throttle cable in to your kill switch housing
  • Slide the beaded end of the cable in to the cable port in the throttle grip
  • Insert the grip in to the kill switch housing, then slip the grip on to the handle bars
  • Line the pin from the top of the kill switch to the port you drilled, then screw the top and bottom portions of the kill switch together, forming your throttle and kill switch assembly

Carburetor Installation:

Start by going to the carburetor and removing the bottom end of the carburetor and remove the screw top, spring, plunger, jet needle (with c-clip attached), and the “e” washer.

  • Start by now inserting the jet needle in to the plunger, then the “e” clip above that
  • Stand the spring up in the plunger, then press down the screw top down on to the spring, which will compress the throttle components
  • Thread the end of the throttle cable through the screw top, and in to the plunger
  • Send the beaded end of the throttle cable in to the small port of the plunger (not the jet needle port), install, and let it go
  • Insert your new throttle assembly back in to your carburetor. Note: Do not force the plunger in to the carburetor. If it does not easily slide in, this is a sign that it’s not aligned within the carburetor. Slowly turn the cable until you feel the plunger easily drop down in to the carb
  • Screw the screw top back on
  • Loosen carburetor mounting clamps, slide the carburetor over the manifold, tighten it around the manifold, and align the carburetor so that the throttle cable is pointed up and the float bowl is level with the ground

Electrical Wiring

There are four components to your electric wiring: the magneto, the CDI, kill switch, and the spark plug. The spark plug, magneto, and now the kill switch are already installed, so all you need to install in the CDI. You can mount the CDI anywhere on your frame, as long as it’s close enough to the spark plug to connect to it.

Now that everything is ready to wire, let’s get down to it:

  • Connect the black wire from the CDI to the black wire from the magneto, and the green wire from the kill switch. These are your ground wires that will complete the circuit
  • Connect the blue wire from the CDI to the blue wire on the magneto, and the yellow/red wire from the kill switch

Note: kill switch wiring coloring will vary between engines and engine suppliers. These colors may not be your colors, but as long as you know which ground wires you have it’s only a process of elimination where your other wires are.

The Rest of Your Bike:

Now it’s time to install the rest of those components.

  • Install the muffler on to the front of the motor head (opposite of the carburetor)
  • Install the gas tank
    • Line the tank up with the top bar, align the gas tank brackets under that bar, and fasten the tank to the bike
    • Install the fuel valve in to the gas tank, connect the fuel line to the carburetor’s fuel jet, and connect the fuel line to the fuel valve
  • To install the chain guard, slide the guard’s front bolt port over the long screw behind your drive sprocket case cover, then fasten it with a nut. Then use a zip-tie to fasten the other end to the frame (Do not let this interfere with the chain)

CONGRATULATIONS- You just installed your bike engine kit! Before riding, we recommend using a ratio of 6 oz to 1 gallon to break your motor in, then 4-5oz to 1 gallon after the motor is broken in. However, engines may vary, so consult the manufacturer for their recommended oil ratios.

How to stop your PC from automatically restarting after installing updates

Important: Before proceeding note that this is a workaround not supported by Microsoft, and it can stop working at any time. You should use it at your own risk.

  1. Open Start.
  2. Search for Task Scheduler and click the result to open the tool.
  3. Right-click the Reboot task and select Disable.

Once you completed the steps, your device will no longer restart after downloading and installing new updates. However, new updates won’t apply, and future updates won’t install until you manually reboot your computer.

Additional steps (if needed)

In the case, Windows 10 automatically re-enables the Reboot task; you can stop this behavior by doing the following:

  1. Use the Windows key + R keyboard shortcut to open the Run command.
  2. Type the following path and click OK:

    %windir%System32TasksMicrosoftWindowsUpdateOrchestrator

  3. Select the Reboot file without an extension, right-click it, and select Rename.

  4. Rename the Reboot file to Reboot.old.
  5. Right-click inside the folder, select New, and click on Folder.

After you’ve completed the steps, Windows 10 will no longer be able to re-create the task to reboot your computer automatically.

If you want to revert the changes, go back to the UpdateOrchestrator folder and delete the Reboot folder and rename the Reboot.old file back to Reboot.

Then follow the Task Scheduler steps mentioned above but on Step 3 select Enable.

Note: We’re not saying that you should skip installing updates, as they’re important to keep your device secure and up to date. However, there are scenarios where you make want to take full control and decide exactly when to restart your computer to apply new updates, and this is when knowing how to stop automatic reboots comes in handy.

Google Cloud SSH Keys

| March 2nd, 2018
You can manage persistent SSH keys in one of two ways:
METHOD 1:  gcloud
1A.  You can use the gcloud command line tool to create a key pair for you.  Provided you’ve authenticated to gcloud as an IAM user with the compute instance admin role, it will create keys for you the first time you SSH into an instance in your project.  Here’s an example walkthrough:
gcloud auth list # Make sure you’re logged in as the correct IAM user.
 
# If not logged in as the right IAM user:
gcloud auth revoke –all
gcloud auth login [your-iam-user]
gcloud compute ssh [NAME-OF-RUNNING-INSTANCE]
1B.  If you’ve never connected via SSH using gcloud, it will create a private key and prompt you for an optional passphrase.  It creates a public key as well and uploads that to project metadata (ssh-keys).  If the instance to which you’re connecting has the “block project wide SSH keys” set, the public key is uploaded to the instance’s metadata (also ssh-keys, but visible in the Cloud Console for the particular instance).  The private key is kept locally on your computer, in your home directory.  These are the filesystem locations for your private and public keys:
~/.ssh/google_compute_engine # private key
~/.ssh/google_compute_engine.pub # public key
1C.  As you can see, the private key is stored in your home directory, on your computer.  If you share it, someone who knows your IAM user name can use it to SSH into the instance.  If you lose it, you can have gcloud recreate it by deleting the corresponding public key.  In general, deleting these keys will force them to be re-created and project/instance metadata for ssh-keys will be updated to hold the new public key.

METHOD 2:  Roll your own…

With the previous example, gcloud controls access to your instances by IAM user role.  Any compute instance admin can generate key pairs, with the public keys written to project/instance metadata, and picked up by the Linux Guest Environment (which includes the Google Accounts Daemon).

But you can also leverage project/instance metadata and the Accounts Daemon to distribute your own public keys.  This is useful if you have established systems for users to create their own key material, or if you have users who just need to SSH into some instances.  Here’s a walkthrough:

2A.  You or your users would generate SSH key pairs in the usual way, using ssh-keygen [1][2].  Your user keeps track of his/her private key.

2B.  Format the public key [3] so it matches one of these patterns:

ssh-rsa [KEY_VALUE] [USERNAME] # for keys that do not expire

ssh-rsa [KEY_VALUE] google-ssh {“userName”:”[USERNAME]”,”expireOn”:”[EXPIRE_TIME]”} # for keys that you want to expire
2C.  Add the formatted public key to project or instance ssh-keys metadata [4].  This must be done by an IAM user with the compute instance admin role, but you can control the deployment of the key to just some instances, etc.  Again, this is a great way to leverage existing conventions in places where you may have users who just need to SSH into their instances.
MORE TO KEEP IN MIND
* SSH access requires that instances have public IP addresses unless you’ve connected to your VPC network via a VPN connection [5] or if you use another instance as a SSH bastion [6].
* SSH access can be blocked by firewall rules you define on your VPC network.
* In both cases, even where you add SSH keys yourself, you must have a working Linux Guest Environment.  This includes the Accounts Daemon, which is responsible for picking up the metadata.  Without that, defining SSH keys in instance metadata will have no effect on instances.  All instance images provided by Google have either the Google Linux Guest Environment or an equivalent (as is the case for CoreOS), so this is usually only a concern if you import images and need to install the Guest Environment manually.

Git Cheat Sheet

| December 29th, 2017

Git is the open source distributed version control system that facilitates GitHub activities on your laptop or
desktop. This cheat sheet summarizes commonly used Git command line instructions for quick reference.

MAKE CHANGES

Review edits and craft a commit transaction
[syntax type=”html|php|js|css”]$ git status[/syntax]
Lists all new or modified files to be committed
[syntax type=”html|php|js|css”]$ git add [file][/syntax]
Snapshots the file in preparation for versioning
[syntax type=”html|php|js|css”]$ git reset [file][/syntax]
Unstaged the file, but preserve its contents
[syntax type=”html|php|js|css”]$ git diff[/syntax]
Shows file differences not yet staged
[syntax type=”html|php|js|css”]$ git diff –staged[/syntax]
Shows file differences between staging and the last file version
[syntax type=”html|php|js|css”]$ git commit -m “[descriptive message]”[/syntax]
Records file snapshots permanently in version history

CONFIGURE TOOLING

Configure user information for all local repositories
[syntax type=”html|php|js|css”]$ git config –global user.name “[name]”[/syntax]
Sets the name you want atached to your commit transactions
[syntax type=”html|php|js|css”]$ git config –global user.email “[email address]”[/syntax]
Sets the email you want atached to your commit transactions
[syntax type=”html|php|js|css”]$ git config –global color.ui auto[/syntax]
Enables helpful colorization of command line output

CREATE REPOSITORIES

Start a new repository or obtain one from an existing URL
[syntax type=”html|php|js|css”]$ git init [project-name][/syntax]
Creates a new local repository with the specified name
[syntax type=”html|php|js|css”]$ git clone [url][/syntax]
Downloads a project and its entire version history

GROUP CHANGES

Name a series of commits and combine completed efforts
[syntax type=”html|php|js|css”]$ git branch[/syntax]
Lists all local branches in the current repository
[syntax type=”html|php|js|css”]$ git branch [branch-name][/syntax]
Creates a new branch
[syntax type=”html|php|js|css”]$ git checkout [branch-name][/syntax]
Switches to the specified branch and updates the working directory
[syntax type=”html|php|js|css”]$ git merge [branch][/syntax]
Combines the specified branch’s history into the current branch
[syntax type=”html|php|js|css”]$ git branch -d [branch-name][/syntax]
Deletes the specified branch

SYNCHRONIZE CHANGES

Register a repository bookmark and exchange version history
[syntax type=”html|php|js|css”]$ git fetch [bookmark][/syntax]
Downloads all history from the repository bookmark
[syntax type=”html|php|js|css”]$ git merge [bookmark]/[branch][/syntax]
Combines bookmark’s branch into current local branch
[syntax type=”html|php|js|css”]$ git push [alias] [branch][/syntax]
Uploads all local branch commits to GitHub
[syntax type=”html|php|js|css”]$ git pull[/syntax]
Downloads bookmark history and incorporate changes

REFACTOR FILENAMES

Relocate and remove versioned files
[syntax type=”html|php|js|css”]$ git rm [file][/syntax]
Deletes the file from the working directory and stages the deletion
[syntax type=”html|php|js|css”]$ git rm –cached [file][/syntax]
Removes the file from version control but preserves the file locally
[syntax type=”html|php|js|css”]$ git mv [file-original] [file-renamed][/syntax]
Changes the file name and prepares it for commit

SAVE FRAGMENTS

Shelve and restore incomplete changes
[syntax type=”html|php|js|css”]$ git stash[/syntax]
Temporarily stores all modified tracked files
[syntax type=”html|php|js|css”]$ git stash list[/syntax]
Lists all stashed changesets
[syntax type=”html|php|js|css”]$ git stash pop[/syntax]
Restores the most recently stashed files
[syntax type=”html|php|js|css”]$ git stash drop[/syntax]
Discards the most recently stashed changeset

REDO COMMITS

Erase mistakes and craft replacement history
[syntax type=”html|php|js|css”]$ git reset [commit][/syntax]
Undoes all commits afer [commit], preserving changes locally
[syntax type=”html|php|js|css”]$ git reset –hard [commit][/syntax]
Discards all history and changes back to the specified commit

REVIEW HISTORY

Browse and inspect the evolution of project files
[syntax type=”html|php|js|css”]$ git log[/syntax]
Lists version history for the current branch
[syntax type=”html|php|js|css”]$ git log –follow [file][/syntax]
Lists version history for a file, including renames
[syntax type=”html|php|js|css”]$ git diff [first-branch]…[second-branch][/syntax]
Shows content differences between two branches
[syntax type=”html|php|js|css”]$ git show [commit][/syntax]
Outputs metadata and content changes of the specified commit

SUPPRESS TRACKING

Exclude temporary files and paths

[syntax type=”html|php|js|css”]$ git ls-files –other –ignored –exclude-standard[/syntax]

Lists all ignored files in this project
[syntax type=”html|php|js|css”]*.log
build/
temp-*[/syntax]
A text file named .gitignore suppresses accidental versioning of
files and paths matching the specified patterns

 

Case 1: Don’t care about local changes

  • Solution 1: Get the latest code and reset the code
    git fetch origin
    git reset --hard origin/[tag/branch/commit-id usually: master]
    
  • Solution 2: Delete the folder and clone again :D
    rm -rf [project_folder]
    git clone [remote_repo]
    

Case 2: Care about local changes

  • Solution 1: no conflicts with new-online version
    git fetch origin
    git status
    

    will report something like:

    Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
    

    Then get the latest version

    git pull
    
  • Solution 2: conflicts with new-online version
    git fetch origin
    git status
    

    will report something like:

    error: Your local changes to the following files would be overwritten by merge:
        file_name
    Please, commit your changes or stash them before you can merge.
    Aborting
    

    Commit your local changes

    git add .
    git commit -m ‘Commit msg’
    

    Try to get the changes (will fail)

    git pull
    

    will report something like:

    Pull is not possible because you have unmerged files.
    Please, fix them up in the work tree, and then use 'git add/rm <file>'
    as appropriate to mark resolution, or use 'git commit -a'.
    

    Open the conflict file and fix the conflict. Then:

    git add .
    git commit -m ‘Fix conflicts’
    git pull
    

    will report something like:

    Already up-to-date.
    

 

More info:

How do I use ‘git reset –hard HEAD’ to revert to a previous commit?

How can I get latest updates without committing my code(have conflicts)?
Interesting question. I've never tried this before but you may try it and report back ;) so:
- Make a patch with the changes: git diff > uncommitted-changes.patch
- Reset the branch
- pull the changes
- apply the patch

 

Protected: GCP Cheat Sheet

| December 27th, 2017

This content is password protected. To view it please enter your password below: