This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo alias purge_cache=\"curl -X POST "https://api.cloudflare.com/client/v4/zones/YOUR_ZONE/purge_cache" -H "Authorization: Bearer YOUR_TOKEN" -H "Content-Type: application/json" --data "{"purge_everything":true}"\" >> ~/.zshrc && source | |
#then you can use purge_cache in your terminal to purge caches in cloudflare zone that you provided |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//you can go to Manage Jenkins > Script Console | |
import jenkins.model.Jenkins | |
import hudson.model.Job | |
MAX_BUILDS = 55 | |
Jenkins.instance.getAllItems(Job.class).each { job -> | |
println job.name | |
def recent = job.builds.limit(MAX_BUILDS) | |
for (build in job.builds) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as dotenv from 'dotenv'; | |
import winston from 'winston' | |
const logger = winston.createLogger({ | |
level: 'info', | |
format: winston.format.json(), | |
defaultMeta: { service: 'user-service' }, | |
transports: [ | |
new winston.transports.File({ filename: process.env.ERROR_LOGS, level: 'error' }), | |
new winston.transports.File({ filename: process.env.WARNING_LOGS, level: 'warning' }), | |
new winston.transports.File({ filename: process.env.INFO_LOGS, level: 'info' }), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
"sync" | |
"time" | |
) | |
func ping(w http.ResponseWriter, r *http.Request) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:latest | |
RUN apk --update add ca-certificates | |
RUN apk add git | |
RUN apk add bash | |
ENTRYPOINT ["tail", "-f", "/dev/null"] | |
#You can now run it via docker run -d IMAGE_ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:latest | |
COPY main.go main.go | |
RUN go get github.com/joho/godotenv | |
RUN go get github.com/lib/pq | |
RUN go get golang.org/x/oauth2/google | |
RUN go get google.golang.org/api/compute/v1 | |
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type f -not -path '*/\.*' -exec sed -i -e "s@<base href=\"\/\/www.mydomain.com.\"\/>@\/@" {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -B # enable brace expansion | |
for i in {1..38}; do | |
curl "https://www.dr.com.tr/sitemaps/product/product_${i}.xml" -o "product_${i}.xml" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: batch/v1beta1 | |
kind: CronJob | |
metadata: | |
name: xml-checker | |
spec: | |
schedule: "*/5 * * * *" | |
jobTemplate: | |
spec: | |
template: | |
spec: |