Skip to content

Instantly share code, notes, and snippets.

View 3h5a9's full-sized avatar
🎯
Focusing

SM EHSAN 3h5a9

🎯
Focusing
View GitHub Profile
@3h5a9
3h5a9 / errormysql.txt
Created May 15, 2016 06:27
Error: Can't connect to local MySQL server through socket
smehsan@localhost ~]$ cd
[smehsan@localhost ~]$ rails new railsp -d mysql
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/javascripts/application.js
@3h5a9
3h5a9 / permissiondenied.txt
Last active May 15, 2016 07:03
permission denied
smehsan@localhost ~]$ mkdir /var/run/mysqld
mkdir: cannot create directory ‘/var/run/mysqld’: File exists
[smehsan@localhost ~]$ touch /var/run/mysqld/mysqld.sock
touch: cannot touch ‘/var/run/mysqld/mysqld.sock’: Permission denied
[smehsan@localhost ~]$
@3h5a9
3h5a9 / serverseeor.txt
Last active May 15, 2016 12:04
Can't connect to local MySQL server through socket
[smehsan@localhost one]$ rake db:create
#<Mysql2::Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13 "Permission denied")>
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "username"=>"root", "password"=>nil, "socket"=>"/var/run/mysqld/mysqld.sock", "database"=>"one_development"}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"}
(If you set the charset manually, make sure you have a matching collation)
#<Mysql2::Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13 "Permission denied")>
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "username"=>"root", "password"=>nil, "socket"=>"/var/run/mysqld/mysqld.sock", "database"=>"one_test"}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"}
(If you set the charset manually, make sure you have a matching collation)
[smehsan@localhost one]$
@3h5a9
3h5a9 / bundleinstall.txt
Created May 16, 2016 20:57
Bundle Install Error
[smehsan@localhost ~]$ cd Desktop
[smehsan@localhost Desktop]$ ls
App
[smehsan@localhost Desktop]$ cd App
[smehsan@localhost App]$
[smehsan@localhost App]$ rails new two
create
create README.rdoc
create Rakefile
create config.ru
@3h5a9
3h5a9 / .bashrc.txt
Created May 19, 2016 19:03
error line 168
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# We use preexec and precmd hook functions for Bash
# If you have anything that's using the Debug Trap or PROMPT_COMMAND
# change it to use preexec or precmd
# See also https://github.com/rcaloras/bash-preexec
# If not running interactively, don't do anything
case $- in
@3h5a9
3h5a9 / tableerror.txt
Created May 26, 2016 12:17
creating table shows errors in mysql
smehsan@smehsan:~/one$ rake db:migrate
== 20160526120711 CreateArticles: migrating ===================================
-- create_table(:articles)
rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Mysql2::Error: Table 'articles' already exists: CREATE TABLE `articles` (`id` int(11) auto_increment PRIMARY KEY, `title` varchar(255)) ENGINE=InnoDB
/home/smehsan/one/db/migrate/20160526120711_create_articles.rb:3:in `change'
ActiveRecord::StatementInvalid: Mysql2::Error: Table 'articles' already exists: CREATE TABLE `articles` (`id` int(11) auto_increment PRIMARY KEY, `title` varchar(255)) ENGINE=InnoDB
/home/smehsan/one/db/migrate/20160526120711_create_articles.rb:3:in `change'
@3h5a9
3h5a9 / log-heroku.text
Last active July 14, 2016 13:32
error in heroku.
2016-07-14T13:13:11.659258+00:00 app[web.1]: WHERE a.attrelid = '"articles"'::regclass
2016-07-14T13:13:11.653390+00:00 app[web.1]: Processing by ArticlesController#new as */*
2016-07-14T13:13:11.659258+00:00 app[web.1]: WHERE a.attrelid = '"articles"'::regclass
2016-07-14T13:13:11.659249+00:00 app[web.1]: ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR: relation "articles" does not exist
2016-07-14T13:13:11.659259+00:00 app[web.1]: ORDER BY a.attnum
2016-07-14T13:13:11.659261+00:00 app[web.1]:
2016-07-14T13:13:11.659262+00:00 app[web.1]:
2016-07-14T13:13:11.659254+00:00 app[web.1]: : SELECT a.attname, format_type(a.atttypid, a.atttypmod),
2016-07-14T13:13:11.653390+00:00 app[web.1]: Processing by ArticlesController#new as */*
@3h5a9
3h5a9 / stock.py
Created March 28, 2017 17:55
loop is not ending
stock = {'apple': 10, 'banana': 20, 'orange':0 }
alreadyAte = ['ehsan']
food = input('What food was eaten? ')
person = input('Who ate the food? ')
def menu():
print("Press 1: To add stock. ")
print("Press 2: To check stock. ")
print("Press 3: To enter purchase. ")
@3h5a9
3h5a9 / stock.py
Created March 28, 2017 18:06
unlimited loop
stock = {'apple': 10, 'banana': 20, 'orange':0 }
alreadyAte = ['ehsan']
food = input('What food was eaten? ')
person = input('Who ate the food? ')
def menu():
print("Press 1: To add stock. ")
print("Press 2: To check stock. ")
print("Press 3: To enter purchase. ")
@3h5a9
3h5a9 / content-gallery.php
Created May 10, 2017 05:08
Warning: Invalid argument supplied for foreach() in C:\wamp64\www\wordpress\wp-content\themes\twentytwenty\tpart\content-gallery.php on line 12