Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

SMEHSAN ehsanatwork

🏠
Working from home
View GitHub Profile
@ehsanatwork
ehsanatwork / errormysql.txt
Created May 15, 2016
Error: Can't connect to local MySQL server through socket
View errormysql.txt
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
View permissiondenied.txt
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 ~]$
@ehsanatwork
ehsanatwork / serverseeor.txt
Last active May 15, 2016
Can't connect to local MySQL server through socket
View serverseeor.txt
[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]$
View bundleinstall.txt
[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
View .bashrc.txt
# ~/.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
@ehsanatwork
ehsanatwork / tableerror.txt
Created May 26, 2016
creating table shows errors in mysql
View tableerror.txt
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'
@ehsanatwork
ehsanatwork / log-heroku.text
Last active Jul 14, 2016
error in heroku.
View log-heroku.text
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 */*
@ehsanatwork
ehsanatwork / stock.py
Created Mar 28, 2017
loop is not ending
View stock.py
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. ")
View stock.py
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. ")
@ehsanatwork
ehsanatwork / content-gallery.php
Created May 10, 2017
Warning: Invalid argument supplied for foreach() in C:\wamp64\www\wordpress\wp-content\themes\twentytwenty\tpart\content-gallery.php on line 12
View content-gallery.php