Skip to content

Instantly share code, notes, and snippets.

View ahsan's full-sized avatar
🎯
Focusing

Abdullah Ahsan ahsan

🎯
Focusing
View GitHub Profile
@ahsan
ahsan / dns-setup-dnsmasq.md
Last active November 2, 2023 22:41
Setup DNS server for a small home lab network

This guide is for setting up DNS server in a small lab network.

Server [Ubuntu 20.04]

  1. Configure netplan:
cat << EOF > /etc/netplan/dns_config.yml
network:
  version: 2
Action Shortcut
Find all references option+shift+F12

VIM Cheatsheet

Action Command
Cut (delete) word(s) d#w
d#e
Copy (yank) y
Paste p: after cursor
P: before cursor
Cursor Movement h: left
j: down
k: up
l: right
Goto line #G: go to line #
gg: start of file
G: end of file
Goto matching paranthesis %
Goto 0: beginning of line $: end of line
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.load.resource.drawable.GlideDrawable;
import com.bumptech.glide.request.animation.GlideAnimation;
import com.bumptech.glide.request.target.GlideDrawableImageViewTarget;
import com.squareup.okhttp.Call;
import com.squareup.okhttp.Callback;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:support-v4:24.0.0+'
compile 'com.squareup.okhttp3:okhttp:3.0.1'
private void getGiphy (String searchString) {
//URL Format: http://api.giphy.com/v1/gifs/search?q=cute+cat&api_key=dc6zaTOxFJmzC&limit=1&offset=0
//Random Search URL: http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=cute+funny+cat+kitten
String apiKey = "dc6zaTOxFJmzC"; //Giphy's Public API Key
String giphyUrl =
"http://api.giphy.com/v1/gifs/random" +
"?tag=" +
searchString +
"&api_key=" +