Skip to content

Instantly share code, notes, and snippets.

View Kuzyashin's full-sized avatar
😀
Some shit

Alexey Kuzyashin Kuzyashin

😀
Some shit
View GitHub Profile
@Kuzyashin
Kuzyashin / refreash_helm.sh
Created May 31, 2023 13:58 — forked from naotookuda/refreash_helm.sh
How to refresh "helm" cache ?
# !/bin/bash
# Remove all files in these directories.
rm -rf ~/.helm/cache/archive/*
rm -rf ~/.helm/repository/cache/*
# Refreash repository configurations
helm repo update
#That's all.
#If you "helm search" next time, you can find newest stable charts in repository.
@Kuzyashin
Kuzyashin / chatgpt.py
Created March 19, 2023 06:01
chatgpt.py
import sys
import requests
API_KEY = "YOUR_API_KEY"
ENDPOINT = "https://api.openai.com/v1/engines/davinci-codex/completions"
HEADERS = {
"Content-Type": "application/json",
"Authorization": f"Bearer {API_KEY}"
}
SESSION_ID = "your_session_id"
#!/bin/bash
export DEBIAN_FRONTEND="noninteractive"
export KUBERNETES_VERSION="1.24.10-00"
export DPKG_LOCK_TIMOUT="-1"
#############################################
# Update && upgrade && install docker.io #
#############################################
sudo apt-get update && sudo apt-get upgrade -y
@Kuzyashin
Kuzyashin / library.md
Created September 15, 2021 13:41 — forked from Rheola/library.md
Материалы по Go (golang)
@Kuzyashin
Kuzyashin / user-data.sh
Last active August 3, 2020 10:04
user-data.sh
#!/usr/bin/env bash
#
# Get the value of a tag for a running EC2 instance.
#
# This can be useful within bootstrapping scripts ("user-data").
#
# Note the EC3 instance needs to have an IAM role that lets it read tags. The policy
# JSON for this looks like:
#
# {
@Kuzyashin
Kuzyashin / brew-redis-macos.md
Created July 24, 2020 15:21
brew-redis-macos.md

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
class RealtyObjectAdmin(admin.ModelAdmin):
list_display = ['realty_complex',
'square', 'rent_available',
'floor', 'flat_number', 'rent_price_eur']
search_fields = ['realty_complex', ]
autocomplete_fields = ('realty_complex', )
fieldsets = (
(None, {
'fields': (('realty_complex', 'created_at', 'photo', ),
@Kuzyashin
Kuzyashin / template.html
Created June 30, 2019 13:29
template.html
{% if is_paginated %}
<ul class="pagination">
{% if page.has_previous %}
<li>
<span><a href="?page={{ page.previous_page_number }}">Previous</a></span>
</li>
{% endif %}
<li class="">
<span>Page {{ page.number }} of {{ page.paginator.num_pages }}.</span>
</li>
@Kuzyashin
Kuzyashin / django_pagination.py
Created June 30, 2019 13:24
django_pagination
class ImageListView(ListView):
model = Image
template_name = "main/image_list.html"
paginate_by = 10
def get_context_data(self, **kwargs):
context = super(ImageListView, self).get_context_data(**kwargs)
image_list = Image.objects.all()
paginator = Paginator(image_list, self.paginate_by)