Skip to content

Instantly share code, notes, and snippets.

View AstmDesign's full-sized avatar
😀
Converting coffee to code

Astm AstmDesign

😀
Converting coffee to code
View GitHub Profile
@AstmDesign
AstmDesign / ubuntu_cleaner.sh
Created February 3, 2023 12:47 — forked from wyodeb/ubuntu_cleaner.sh
Autocleaning .deb based systems
#!/bin/bash
sudo aptitude update
sudo aptitude dist-upgrade
OLDCONF=$(dpkg -l|grep "^rc"|awk '{print $2}')
CURKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')
LINUXPKG="linux-(image|headers|ubuntu-modules|restricted-modules)"
METALINUXPKG="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)"
OLDKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)
BLUE="\033[1;33m"
RED="\033[0;31m"
@AstmDesign
AstmDesign / curl.md
Created December 7, 2022 20:42 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@AstmDesign
AstmDesign / test-doc-see-as-virus-by-clamav.txt
Created September 9, 2022 15:09 — forked from mikecastrodemaria/test-doc-see-as-virus-by-clamav.txt
A simple text file to be used as positive test for ClamAv virus scanner
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
@AstmDesign
AstmDesign / devise.ar.yml
Created November 23, 2020 06:56 — forked from Samidahlawi/devise.ar.yml
devise.ar.yml v4.7.1
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
en:
devise:
confirmations:
confirmed: "تم تأكيد حسابك الشخصي بنجاح."
send_instructions: "سوف تصلك رسالة خلال دقايق على بريدك الإلكتروني تتضمن الخطوات اللازمة لتأكيد حسابك."
send_paranoid_instructions: "إذا كان بريدك الإلكتروني موجود بالعفل اذا سوف تصلك رسالة خلال دقايق تتضمن خطوات اللازمة لتأكيد حسابك."
failure:
already_authenticated: "تم تسجيل دخولك مُسبقاً."
@AstmDesign
AstmDesign / rails http status codes
Created March 23, 2020 23:24 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@AstmDesign
AstmDesign / fix-libv8-mac.txt
Created February 14, 2020 07:44 — forked from fernandoaleman/fix-libv8-mac.txt
Fixing libv8 and therubyracer on Mac
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install
@AstmDesign
AstmDesign / bitbucket-pipelines.yml
Created December 9, 2019 12:40 — forked from jean182/bitbucket-pipelines.yml
Bitbucket Pipelines example
image: starefossen/ruby-node:2-5
pipelines:
branches:
master:
- step:
script:
- export HEROKU_APP_NAME=ci-conceptual
- chmod +x deploy-scripts/package_and_deploy.sh deploy-scripts/migrate.sh deploy-scripts/restart.sh
- deploy-scripts/package_and_deploy.sh
@AstmDesign
AstmDesign / Bitbucket Pipeline Rails.yml
Created December 9, 2019 11:38 — forked from isseu/Bitbucket Pipeline Rails.yml
To run rails with bitbucket pipeline CI
# This is a sample build configuration for Ruby.
# Check our guides at https://confluence.atlassian.com/x/VYk8Lw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: ruby:2.2.4
clone:
depth: 3
@AstmDesign
AstmDesign / main.yaml
Created September 17, 2019 07:20 — forked from ArturT/main.yaml
GitHub Actions - how to run parallel tests in RSpec for Ruby on Rails project. See article how to run RSpec on GitHub Actions for Ruby on Rails app using parallel jobs https://docs.knapsackpro.com/2019/how-to-run-rspec-on-github-actions-for-ruby-on-rails-app-using-parallel-jobs or sign up at https://knapsackpro.com/?utm_source=github&utm_medium=…
# .github/workflows/main.yaml
name: Main
on: [push]
jobs:
vm-job:
runs-on: ubuntu-latest
# If you need DB like PostgreSQL then define service below.
@AstmDesign
AstmDesign / easy_rails_deployment_with_capistrano.md
Created August 25, 2019 17:15
Easy Rails deployment with Capistrano

Goals of this tutorial:

  • deploy a new Rails app with capistrano
  • make it fast (total process takes less than 5 minutes)
  • make it simple (no unecessary config)
  • manual ssh to the server not required

Rails application stack:

  • nginx
  • unicorn
  • postgresql