Skip to content

Instantly share code, notes, and snippets.

View ouaziz's full-sized avatar
💭
I may be slow to respond.

ouaziz mouhcine ouaziz

💭
I may be slow to respond.
View GitHub Profile
@ouaziz
ouaziz / Rails_ssl
Last active January 31, 2024 00:52
Rails ssl
# create file ssl.sh with ======>
#!/bin/sh
# See https://devcenter.heroku.com/articles/ssl-certificate-self for overview
ssl_dir='ssllocal'
mkdir -p $ssl_dir
openssl genrsa -des3 -passout pass:x -out $ssl_dir/server.pass.key 2048
1. Configure config/application.rb for Subdomain Handling:
# config/application.rb
module YourAppName
class Application < Rails::Application
config.middleware.use SubdomainMiddleware
# ... other configurations
end
end
# generated by chatgpt
# Configure your config/application.rb to handle subdomains:
# config/application.rb
module YourAppName
class Application < Rails::Application
config.middleware.use SubdomainMiddleware
# ... other configurations
end
end
@ouaziz
ouaziz / Configure Git to use a proxy
Last active January 31, 2024 00:45
Configure Git to use a proxy
git config --global http.proxy http://proxyUsername:proxyPassword@proxy.server.com:port
OR
git config --global http.proxy http://proxy.server.com:port
@ouaziz
ouaziz / install or update ruby and rails on centos.txt
Last active November 2, 2023 18:13
install or update ruby and rails on centos
#Remove old Ruby
$ yum remove ruby
# Install dependencies
$ yum groupinstall "Development Tools"
$ yum install zlib zlib-devel
$ yum install openssl-devel
$ wget http://pyyaml.org/download/libyaml/yaml-0.1.5.tar.gz
$ tar xzvf yaml-0.1.5.tar.gz
$ cd yaml-0.1.5
@ouaziz
ouaziz / components.reading-list.js
Last active January 29, 2018 16:09
Reading-list
import Ember from 'ember';
export default Ember.Component.extend({
value: "",
actions: {
onEnter(title) {
if (title) {
ActiveRecord::Base.connection.tables.each { |t| ActiveRecord::Base.connection.reset_pk_sequence!(t) }
puts "start..."
require 'tiny_tds'
client = TinyTds::Client.new username: 'sa', password: '123***s', host: '192.168.1.215', port: 1433, database: 'alyamama'
#results = client.execute("SELECT * FROM motif_controle")
#puts results.fields
#results.each do |row|
# puts row
#end
#puts "---------------"
results = client.execute("EXEC sp_test")
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember exemple'
});
@ouaziz
ouaziz / directory_size
Created May 22, 2015 23:14
directory size
def directory_size(path)
path << '/' unless path.end_with?('/')
raise RuntimeError, "#{path} is not a directory" unless File.directory?(path)
total_size = 0
Dir["#{path}**/*"].each do |f|
total_size += File.size(f) if File.file?(f) && File.size?(f)
end
# size in bytes