LUG Name | URL |
---|---|
Arak | http://tiny.cc/arak |
Esfehan | http://tiny.cc/esfahan |
Ahvaz | http://tiny.cc/ahwaz |
Tehran | http://tiny.cc/teh |
Zanjan | http://tiny.cc/zanjan |
Shiraz | http://tiny.cc/shiraz |
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
#!/usr/bin/env ruby | |
# A simple chat app to demonstrate a pub/sub system using | |
# Redis and Server-Sent Event(SSE) | |
require 'sinatra' | |
require 'sinatra/streaming' | |
require 'redis' | |
require 'json' | |
set :port, 3000 | |
html = <<-EOT |
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
#!/usr/bin/env ruby | |
require 'uri' | |
require 'httparty' | |
# Download mp3 files from SoundCloud | |
# Usage: | |
# ./soundcloud.rb https://soundcloud.com/tara-tiba/paeez_tara-tiba | |
class SoundCloud | |
include HTTParty | |
base_uri 'https://soundcloud.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
#!/usr/bin/env ruby | |
# gem install mechanize | |
require 'mechanize' | |
abort "Usage:\n\tradiojavan.rb \"https://www.radiojavan.com/playlists/playlist/mp3/02596ef9986a\" output_txt" if ARGV.size < 2 | |
playlist_url = ARGV[0] | |
output_file = ARGV[1] | |
HOST = 'https://www.radiojavan.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
#!/usr/bin/env ruby | |
require 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'rest-client' | |
gem 'colorize' | |
end |
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
#!/bin/sh | |
# if you're using ZSH, change the shebang above to "#!/bin/zsh -i" | |
if [ ${#} -ne 2 ]; then | |
echo >&2 Usage: $(basename ${0}) old-version new-version | |
exit 1 | |
fi | |
home_path=$(cd ~; pwd -P) | |
old_version=${1} |
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
ruby '2.7.1' | |
gem 'rails', github: 'rails/rails' | |
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
# Action Text | |
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
gem 'okra', github: 'basecamp/okra' | |
# Drivers |
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
# frozen_string_literal: true | |
require 'socket' | |
class Client | |
def initialize | |
@socket = TCPSocket.new('localhost', 2000) | |
end | |
def next_line |
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
#!/bin/bash | |
echo "Generating an SSL private key to sign your certificate..." | |
openssl genrsa -des3 -out certificate.key 1024 | |
echo "Generating a Certificate Signing Request..." | |
openssl req -new -key certificate.key -out certificate.csr | |
echo "Removing passphrase from key (for nginx)..." | |
cp -v certificate.{key,org} | |
openssl rsa -in certificate.org -out certificate.key |
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
function nginx-enable --argument-names config_name -d "enable the given nginx config" | |
set nginx_conf_path "/etc/nginx" | |
set available_directory "servers-available" | |
set enabled_directory "servers-enabled" | |
if test ! -n "$config_name" | |
echo "No config is given." | |
return | |
end |
NewerOlder