Create a template service file at /etc/systemd/system/[email protected]. The template parameter will correspond to the name
of target host:
[Unit]
Description=Setup a secure tunnel to %I
After=network.targetCreate a template service file at /etc/systemd/system/[email protected]. The template parameter will correspond to the name
of target host:
[Unit]
Description=Setup a secure tunnel to %I
After=network.targetThere are two main modes to run the Let's Encrypt client (called Certbot):
Webroot is better because it doesn't need to replace Nginx (to bind to port 80).
In the following, we're setting up mydomain.com.
HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.
| // UIImage+Alpha.h | |
| // Created by Trevor Harmon on 9/20/09. | |
| // Free for personal or commercial use, with or without modification. | |
| // No warranty is expressed or implied. | |
| // Helper methods for adding an alpha layer to an image | |
| @interface UIImage (Alpha) | |
| - (BOOL)hasAlpha; | |
| - (UIImage *)imageWithAlpha; | |
| - (UIImage *)transparentBorderImage:(NSUInteger)borderSize; |
| #!/bin/bash | |
| cat $(find app/assets/stylesheets/ -type f) | | |
| grep -Eo '\.[a-z]+[a-z0-9_-]*' | sort | uniq | sed s/.// | | |
| while read CSS; do | |
| if ! grep -Erqi "([^(remove|has)]class[(:|=|[:space:]*=>[:space:]*)]*\s*[(\"|')]*[-a-z0-9[:space:]]*$CSS|\\.$CSS\b)" app/views/ vendor/assets/ app/assets/javascripts/; then | |
| echo $CSS >> unused.scss; | |
| fi | |
| done |
| #!/bin/bash | |
| #Alright, so this should automatically convert a given video into a gif called optimized_output.gif | |
| # See here for explanation: https://github.com/lelandbatey/configDebDev/blob/master/helpFiles.txt#L113 | |
| ffmpeg -i $1 out%04d.gif # Extracts each frame of the video as a single gif | |
| convert -delay 4 out*.gif anim.gif # Combines all the frames into one very nicely animated gif. | |
| convert -layers Optimize anim.gif optimized_output.gif # Optimizes the gif using imagemagick | |
| # vvvvv Cleans up the leftovers |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2
| def set_locale | |
| locale = params[:locale].to_s | |
| if !locale.blank? | |
| cookies[:preferred_lang] = { :value => locale, :expires => 10.years.from_now } | |
| session[:update_lang] = locale # remember preferred setting for this session | |
| else | |
| locale = cookies[:preferred_lang] | |
| end |
| #import <UIKit/UIKit.h> | |
| #import <ImageIO/ImageIO.h> | |
| #import <MobileCoreServices/MobileCoreServices.h> | |
| - (void)exportAnimatedGif | |
| { | |
| UIImage *shacho = [UIImage imageNamed:@"shacho.png"]; | |
| UIImage *bucho = [UIImage imageNamed:@"bucho.jpeg"]; | |
| NSString *path = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"animated.gif"]; |
| // Usage example: | |
| // input image: http://f.cl.ly/items/3v0S3w2B3N0p3e0I082d/Image%202011.07.22%2011:29:25%20PM.png | |
| // | |
| // UIImage *buttonImage = [UIImage ipMaskedImageNamed:@"UIButtonBarAction.png" color:[UIColor redColor]]; | |
| // .h | |
| @interface UIImage (IPImageUtils) | |
| + (UIImage *)ipMaskedImageNamed:(NSString *)name color:(UIColor *)color; | |
| @end |
| #import "CALayer_HitTestExtensions.h" | |
| #import <objc/runtime.h> | |
| static void *kHitMask; | |
| @implementation CALayer (CALayer_HitTestExtensions) | |
| - (NSUInteger)hitMask | |
| { |